From 57da7016c4d05832a56e8ed77f70229c3dcaed8b Mon Sep 17 00:00:00 2001 From: Ritvik Kapila Date: Thu, 19 Dec 2024 12:57:57 -0800 Subject: [PATCH] chore(rust): release 0.2.0 --- AwsEncryptionSDK/runtimes/rust/Cargo.toml | 2 +- .../runtimes/rust/start_release.sh | 2 +- mpl | 2 +- releases/rust/esdk/Cargo.toml | 15 +- releases/rust/esdk/README.md | 62 +- .../client_supplier_example.rs | 8 +- .../regional_role_client_supplier.rs | 6 +- .../required_encryption_context_example.rs | 4 +- .../signing_only_example.rs | 8 +- .../signing_suite_only_cmm.rs | 24 +- .../aws_kms_discovery_keyring_example.rs | 6 +- ...aws_kms_discovery_multi_keyring_example.rs | 6 +- .../aws_kms_hierarchical_keyring_example.rs | 10 +- .../create_branch_key_id.rs | 8 +- .../example_branch_key_id_supplier.rs | 8 +- .../keyring/aws_kms_hierarchical/mod.rs | 1 + ...he_across_hierarchical_keyrings_example.rs | 16 +- .../version_branch_key_id_example.rs | 68 + .../keyring/aws_kms_keyring_example.rs | 4 +- .../aws_kms_mrk_discovery_keyring_example.rs | 6 +- ...kms_mrk_discovery_multi_keyring_example.rs | 6 +- .../keyring/aws_kms_mrk_keyring_example.rs | 4 +- .../aws_kms_mrk_multi_keyring_example.rs | 4 +- .../keyring/aws_kms_multi_keyring_example.rs | 4 +- .../keyring/aws_kms_rsa_keyring_example.rs | 6 +- .../ephemeral_raw_ecdh_keyring_example.rs | 8 +- .../kms_ecdh_discovery_keyring_example.rs | 10 +- .../keyring/ecdh/kms_ecdh_keyring_example.rs | 8 +- ..._key_discovery_raw_ecdh_keyring_example.rs | 10 +- .../keyring/ecdh/raw_ecdh_keyring_example.rs | 8 +- .../examples/keyring/multi_keyring_example.rs | 6 +- .../keyring/raw_aes_keyring_example.rs | 6 +- .../keyring/raw_rsa_keyring_example.rs | 6 +- .../limit_encrypted_data_keys_example.rs | 8 +- releases/rust/esdk/examples/main.rs | 2 + .../examples/set_commitment_policy_example.rs | 6 +- .../set_encryption_algorithm_suite_example.rs | 8 +- releases/rust/esdk/src/aes_gcm.rs | 4 +- releases/rust/esdk/src/client.rs | 6 +- releases/rust/esdk/src/dafny_libraries.rs | 49 +- .../src/deps/aws_cryptography_keyStore.rs | 1 + .../deps/aws_cryptography_keyStore/client.rs | 6 +- .../operation/create_key.rs | 3 +- .../operation/create_key_store.rs | 3 +- .../operation/get_active_branch_key.rs | 8 +- .../operation/get_beacon_key.rs | 8 +- .../operation/get_branch_key_version.rs | 14 +- .../operation/get_key_store_info.rs | 3 +- .../operation/version_key.rs | 8 +- .../deps/aws_cryptography_keyStore/types.rs | 1 + .../aws_cryptography_keyStore/validation.rs | 861 ++++ .../aws_cryptography_materialProviders.rs | 1 + .../client.rs | 6 +- .../create_aws_kms_discovery_keyring.rs | 8 +- .../create_aws_kms_discovery_multi_keyring.rs | 8 +- .../operation/create_aws_kms_ecdh_keyring.rs | 20 +- .../create_aws_kms_hierarchical_keyring.rs | 20 +- .../operation/create_aws_kms_keyring.rs | 14 +- .../create_aws_kms_mrk_discovery_keyring.rs | 14 +- ...ate_aws_kms_mrk_discovery_multi_keyring.rs | 8 +- .../operation/create_aws_kms_mrk_keyring.rs | 14 +- .../create_aws_kms_mrk_multi_keyring.rs | 3 +- .../operation/create_aws_kms_multi_keyring.rs | 3 +- .../operation/create_aws_kms_rsa_keyring.rs | 14 +- .../create_cryptographic_materials_cache.rs | 8 +- .../create_default_client_supplier.rs | 3 +- ...default_cryptographic_materials_manager.rs | 8 +- .../operation/create_multi_keyring.rs | 8 +- .../operation/create_raw_aes_keyring.rs | 26 +- .../operation/create_raw_ecdh_keyring.rs | 14 +- .../operation/create_raw_rsa_keyring.rs | 20 +- .../create_required_encryption_context_cmm.rs | 8 +- .../operation/decrypt_materials.rs | 26 +- ...ption_materials_with_plaintext_data_key.rs | 20 +- .../operation/delete_cache_entry.rs | 8 +- ...yption_materials_has_plaintext_data_key.rs | 26 +- .../operation/get_algorithm_suite_info.rs | 8 +- .../operation/get_branch_key_id.rs | 8 +- .../operation/get_cache_entry.rs | 8 +- .../operation/get_client.rs | 8 +- .../operation/get_encryption_materials.rs | 14 +- .../initialize_decryption_materials.rs | 20 +- .../initialize_encryption_materials.rs | 20 +- .../operation/on_decrypt.rs | 14 +- .../operation/on_encrypt.rs | 8 +- .../operation/put_cache_entry.rs | 50 +- .../operation/update_usage_metadata.rs | 20 +- .../operation/valid_algorithm_suite_info.rs | 56 +- .../valid_decryption_materials_transition.rs | 14 +- .../valid_encryption_materials_transition.rs | 14 +- .../validate_commitment_policy_on_decrypt.rs | 14 +- .../validate_commitment_policy_on_encrypt.rs | 14 +- .../types.rs | 1 + .../validation.rs | 4537 +++++++++++++++++ .../src/deps/aws_cryptography_primitives.rs | 1 + .../aws_cryptography_primitives/client.rs | 6 +- .../operation/aes_decrypt.rs | 38 +- .../operation/aes_encrypt.rs | 32 +- .../operation/aes_kdf_counter_mode.rs | 20 +- .../operation/compress_public_key.rs | 14 +- .../operation/decompress_public_key.rs | 14 +- .../operation/derive_shared_secret.rs | 20 +- .../operation/digest.rs | 14 +- .../operation/ecdsa_sign.rs | 20 +- .../operation/ecdsa_verify.rs | 26 +- .../operation/generate_ecc_key_pair.rs | 8 +- .../operation/generate_ecdsa_signature_key.rs | 8 +- .../operation/generate_random_bytes.rs | 14 +- .../operation/generate_rsa_key_pair.rs | 14 +- .../get_public_key_from_private_key.rs | 14 +- .../operation/get_rsa_key_modulus_length.rs | 8 +- .../operation/h_mac.rs | 20 +- .../operation/hkdf.rs | 32 +- .../operation/hkdf_expand.rs | 32 +- .../operation/hkdf_extract.rs | 14 +- .../operation/kdf_counter_mode.rs | 26 +- .../operation/parse_public_key.rs | 8 +- .../operation/rsa_decrypt.rs | 20 +- .../operation/rsa_encrypt.rs | 20 +- .../operation/validate_public_key.rs | 14 +- .../deps/aws_cryptography_primitives/types.rs | 1 + .../aws_cryptography_primitives/validation.rs | 2486 +++++++++ releases/rust/esdk/src/ecdh.rs | 29 +- .../esdk/src/implementation_from_dafny.rs | 287 +- releases/rust/esdk/src/lib.rs | 85 +- releases/rust/esdk/src/operation/decrypt.rs | 8 +- releases/rust/esdk/src/operation/encrypt.rs | 14 +- releases/rust/esdk/src/rsa.rs | 2 +- releases/rust/esdk/src/storm_tracker.rs | 4 +- releases/rust/esdk/src/time.rs | 8 + releases/rust/esdk/src/types.rs | 1 + releases/rust/esdk/src/validation.rs | 374 ++ 132 files changed, 9066 insertions(+), 1177 deletions(-) create mode 100644 releases/rust/esdk/examples/keyring/aws_kms_hierarchical/version_branch_key_id_example.rs create mode 100644 releases/rust/esdk/src/deps/aws_cryptography_keyStore/validation.rs create mode 100644 releases/rust/esdk/src/deps/aws_cryptography_materialProviders/validation.rs create mode 100644 releases/rust/esdk/src/deps/aws_cryptography_primitives/validation.rs create mode 100644 releases/rust/esdk/src/validation.rs diff --git a/AwsEncryptionSDK/runtimes/rust/Cargo.toml b/AwsEncryptionSDK/runtimes/rust/Cargo.toml index f27355efb..2fd45898f 100644 --- a/AwsEncryptionSDK/runtimes/rust/Cargo.toml +++ b/AwsEncryptionSDK/runtimes/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-esdk" -version = "0.1.0" +version = "0.2.0" edition = "2021" rust-version = "1.81.0" keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"] diff --git a/AwsEncryptionSDK/runtimes/rust/start_release.sh b/AwsEncryptionSDK/runtimes/rust/start_release.sh index 07cb77691..45e1af826 100755 --- a/AwsEncryptionSDK/runtimes/rust/start_release.sh +++ b/AwsEncryptionSDK/runtimes/rust/start_release.sh @@ -22,7 +22,7 @@ perl -pe "s/^version = .*$/version = \"$1\"/" < Cargo.toml > new_Cargo.toml mv new_Cargo.toml Cargo.toml # Remove all files and directories in src except for specified files -find src -depth 1 | egrep -v '(lib.rs)' | xargs rm -rf +find src -depth 1 | egrep -v '(lib.rs|README.md)' | xargs rm -rf # Change to the parent directory and run make polymorph and transpile commands cd ../.. diff --git a/mpl b/mpl index 23650a9c6..59979192a 160000 --- a/mpl +++ b/mpl @@ -1 +1 @@ -Subproject commit 23650a9c6e1c897455e2d59d15b7d7a2c5a07cdd +Subproject commit 59979192a51ef5b1864ac36d57925d55eb562fa2 diff --git a/releases/rust/esdk/Cargo.toml b/releases/rust/esdk/Cargo.toml index 7581e0849..2fd45898f 100644 --- a/releases/rust/esdk/Cargo.toml +++ b/releases/rust/esdk/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "aws-esdk" -version = "0.1.0" +version = "0.2.0" edition = "2021" -rust-version = "1.80.0" +rust-version = "1.81.0" keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"] license = "ISC AND (Apache-2.0 OR ISC)" description = "aws-esdk is a library for implementing client side encryption." @@ -16,14 +16,15 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -aws-config = "1.5.10" -aws-lc-rs = "1.11.1" -aws-lc-sys = "0.23.1" +aws-config = "1.5.11" +aws-lc-rs = "1.12.0" +aws-lc-sys = "0.24.0" aws-sdk-dynamodb = "1.55.0" aws-sdk-kms = "1.51.0" aws-smithy-runtime-api = {version = "1.7.3", features = ["client"] } -aws-smithy-types = "1.2.9" -chrono = "0.4.38" +aws-smithy-types = "1.2.10" +chrono = "0.4.39" +cpu-time = "1.0.0" dafny-runtime = "0.1.1" dashmap = "6.1.0" pem = "3.0.4" diff --git a/releases/rust/esdk/README.md b/releases/rust/esdk/README.md index c48ae96c6..b3436b54e 100644 --- a/releases/rust/esdk/README.md +++ b/releases/rust/esdk/README.md @@ -1,63 +1,25 @@ # AWS Encryption SDK for Rust -AWS Encryption SDK for Rust +[![build status](https://github.com/aws/aws-encryption-sdk-dafny/actions/workflows/daily_ci.yml/badge.svg?branch=mainline)](https://github.com/aws/aws-encryption-sdk-dafny/actions/workflows/daily_ci.yml) +[![crates.io](https://img.shields.io/crates/v/aws-esdk.svg)](https://crates.io/crates/aws-esdk) +[![docs](https://docs.rs/aws-esdk/badge.svg)](https://docs.rs/aws-esdk) +[![rustc](https://img.shields.io/badge/rust-1.81%2B-orange.svg)](https://img.shields.io/badge/rust-1.81%2B-orange.svg) -## Using the AWS Encryption SDK for Rust +This is the official [AWS Encryption SDK for Rust](https://crates.io/crates/aws-esdk). -The AWS Encryption SDK is available on [Crates.io](https://www.crates.io/). +## [CHANGELOG](https://github.com/aws/aws-encryption-sdk-dafny/blob/mainline/AwsEncryptionSDK/runtimes/rust/CHANGELOG.md) -For more details about the design and architecture of the AWS Encryption SDK, see the [AWS Encryption SDK Developer Guide](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html). - -## Building the AWS Encryption SDK for Rust - -To build, the AWS Encryption SDK requires the most up to date version of [Dafny](https://github.com/dafny-lang/dafny) on your PATH. - -You will also need to ensure that you fetch all submodules using either `git clone --recursive ...` when cloning the repository or `git submodule update --init` on an existing clone. - -To setup your project to use the AWS Encryption SDK in Rust, run: - -``` -cd AwsEncryptionSDK -# Polymorph smithy to Rust -make polymorph_rust -# Transpile Dafny to Rust -make transpile_rust -``` - -### (Optional) Set up the AWS Encryption SDK to work with AWS KMS - -If you set up the AWS Encryption SDK to use the AWS KMS Keyring, -the AWS Encryption SDK will make calls to AWS KMS on your behalf, -using the appropriate AWS SDK. +## Overview -However, you must first set up AWS credentials for use with the AWS SDK. +The AWS Encryption SDK enables secure client-side encryption. It uses cryptography best practices to protect your data and protect the encryption keys that protect your data. Each data object is protected with a unique data encryption key, and the data encryption key is protected with a key encryption key called a wrapping key. The encryption method returns a single, portable [encrypted message](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/message-format.html) that contains the encrypted data and the encrypted data key, so you don't need to keep track of the data encryption keys for your data. You can use KMS keys in [AWS Key Management Service](https://aws.amazon.com/kms/) (AWS KMS) as wrapping keys. The AWS Encryption SDK also provides APIs to define and use encryption keys from other key providers. -## Testing the AWS Encryption SDK for Rust - -### Configure AWS credentials - -To run the test suite you must first set up AWS credentials for use with the AWS SDK. -This is required in order to run the integration tests, which use a KMS Keyring against a publicly accessible KMS CMK. - -### Run the tests - -Run the test suite with: - -``` -cd AwsEncryptionSDK -make test_rust -``` - -Run tests on examples, to ensure they are up to date: +For more details about the design and architecture of the AWS Encryption SDK, see the [AWS Encryption SDK Developer Guide](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html). -``` -cd AwsEncryptionSDK/runtimes/rust/ -cargo test --examples -``` +## Examples for AWS Encryption SDK in Rust -Please look at the Examples on how to use the Encryption SDK in Rust [here](examples). +Please look at the Examples on how to use the Encryption SDK in Rust [here](https://github.com/aws/aws-encryption-sdk-dafny/tree/mainline/releases/rust/esdk/examples). -Please note that tests and test vectors require internet access and valid AWS credentials, since calls to KMS are made as part of the test workflow. +Please note that some examples MAY require internet access and valid AWS credentials, since calls to KMS are made. ## License diff --git a/releases/rust/esdk/examples/client_supplier/client_supplier_example.rs b/releases/rust/esdk/examples/client_supplier/client_supplier_example.rs index 79a4a1177..c09bcc229 100644 --- a/releases/rust/esdk/examples/client_supplier/client_supplier_example.rs +++ b/releases/rust/esdk/examples/client_supplier/client_supplier_example.rs @@ -18,10 +18,10 @@ use super::regional_role_client_supplier::RegionalRoleClientSupplier; use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::types::error::Error::AwsCryptographicMaterialProvidersException; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::DiscoveryFilter; +use aws_esdk::material_providers::types::error::Error::AwsCryptographicMaterialProvidersException; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::DiscoveryFilter; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_keyring( diff --git a/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs b/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs index 0a6b31a1a..195dd8bb5 100644 --- a/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs +++ b/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use aws_config::Region; -use aws_esdk::aws_cryptography_materialProviders::types::ClientSupplier; -use aws_esdk::aws_cryptography_materialProviders::operation::get_client::GetClientInput; -use aws_esdk::aws_cryptography_materialProviders::types::error::Error; +use aws_esdk::material_providers::types::ClientSupplier; +use aws_esdk::material_providers::operation::get_client::GetClientInput; +use aws_esdk::material_providers::types::error::Error; use aws_esdk::com_amazonaws_kms::client::Client as kms_client; use super::regional_role_client_supplier_config; diff --git a/releases/rust/esdk/examples/cryptographic_materials_manager/required_encryption_context/required_encryption_context_example.rs b/releases/rust/esdk/examples/cryptographic_materials_manager/required_encryption_context/required_encryption_context_example.rs index 55e38e76c..bb03bdcbc 100644 --- a/releases/rust/esdk/examples/cryptographic_materials_manager/required_encryption_context/required_encryption_context_example.rs +++ b/releases/rust/esdk/examples/cryptographic_materials_manager/required_encryption_context/required_encryption_context_example.rs @@ -10,8 +10,8 @@ On decrypt, the client MUST supply the key/value pair(s) that were not stored to use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use aws_esdk::types::error::Error::AwsCryptographicMaterialProvidersError; use std::collections::HashMap; use std::vec::Vec; diff --git a/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_only_example.rs b/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_only_example.rs index ea883137a..e8e599eb9 100644 --- a/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_only_example.rs +++ b/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_only_example.rs @@ -10,10 +10,10 @@ use super::signing_suite_only_cmm::SigningSuiteOnlyCMM; use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; use aws_esdk::types::error::Error::AwsCryptographicMaterialProvidersError; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef; -use aws_esdk::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef; +use aws_esdk::material_providers::types::EsdkAlgorithmSuiteId; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_cmm( diff --git a/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_suite_only_cmm.rs b/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_suite_only_cmm.rs index 0e1ba8354..cd1481157 100644 --- a/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_suite_only_cmm.rs +++ b/releases/rust/esdk/examples/cryptographic_materials_manager/restrict_algorithm_suite/signing_suite_only_cmm.rs @@ -1,18 +1,18 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -use aws_esdk::aws_cryptography_materialProviders::operation::get_encryption_materials::GetEncryptionMaterialsInput; -use aws_esdk::aws_cryptography_materialProviders::operation::get_encryption_materials::GetEncryptionMaterialsOutput; -use aws_esdk::aws_cryptography_materialProviders::operation::decrypt_materials::DecryptMaterialsInput; -use aws_esdk::aws_cryptography_materialProviders::operation::decrypt_materials::DecryptMaterialsOutput; -use aws_esdk::aws_cryptography_materialProviders::types::error::Error; -use aws_esdk::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManager; -use aws_esdk::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef; -use aws_esdk::aws_cryptography_materialProviders::types::keyring::KeyringRef; -use aws_esdk::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId; -use aws_esdk::aws_cryptography_materialProviders::types::AlgorithmSuiteId; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::operation::get_encryption_materials::GetEncryptionMaterialsInput; +use aws_esdk::material_providers::operation::get_encryption_materials::GetEncryptionMaterialsOutput; +use aws_esdk::material_providers::operation::decrypt_materials::DecryptMaterialsInput; +use aws_esdk::material_providers::operation::decrypt_materials::DecryptMaterialsOutput; +use aws_esdk::material_providers::types::error::Error; +use aws_esdk::material_providers::types::cryptographic_materials_manager::CryptographicMaterialsManager; +use aws_esdk::material_providers::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef; +use aws_esdk::material_providers::types::keyring::KeyringRef; +use aws_esdk::material_providers::types::EsdkAlgorithmSuiteId; +use aws_esdk::material_providers::types::AlgorithmSuiteId; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::vec::Vec; /* diff --git a/releases/rust/esdk/examples/keyring/aws_kms_discovery_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_discovery_keyring_example.rs index 7bc096e0b..c38479ca4 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_discovery_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_discovery_keyring_example.rs @@ -38,9 +38,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::DiscoveryFilter; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::DiscoveryFilter; use aws_esdk::types::error::Error::AwsCryptographicMaterialProvidersError; use std::collections::HashMap; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_discovery_multi_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_discovery_multi_keyring_example.rs index 0773503b1..743ad60bf 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_discovery_multi_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_discovery_multi_keyring_example.rs @@ -35,9 +35,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::DiscoveryFilter; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::DiscoveryFilter; use std::collections::HashMap; use std::vec::Vec; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/aws_kms_hierarchical_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/aws_kms_hierarchical_keyring_example.rs index 9aee84897..f0132f6c8 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/aws_kms_hierarchical_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/aws_kms_hierarchical_keyring_example.rs @@ -42,11 +42,11 @@ use super::example_branch_key_id_supplier::ExampleBranchKeyIdSupplier; use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; use aws_esdk::types::error::Error::AwsCryptographicMaterialProvidersError; -use aws_esdk::aws_cryptography_keyStore::types::KmsConfiguration; -use aws_esdk::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig; -use aws_esdk::aws_cryptography_keyStore::client as keystore_client; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::key_store::types::KmsConfiguration; +use aws_esdk::key_store::types::key_store_config::KeyStoreConfig; +use aws_esdk::key_store::client as keystore_client; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_keyring( diff --git a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/create_branch_key_id.rs b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/create_branch_key_id.rs index b4fb6a525..bd8bce26b 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/create_branch_key_id.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/create_branch_key_id.rs @@ -1,9 +1,9 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -use aws_esdk::aws_cryptography_keyStore::client as keystore_client; -use aws_esdk::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig; -use aws_esdk::aws_cryptography_keyStore::types::KmsConfiguration; +use aws_esdk::key_store::client as keystore_client; +use aws_esdk::key_store::types::key_store_config::KeyStoreConfig; +use aws_esdk::key_store::types::KmsConfiguration; /* The Hierarchical Keyring Example relies on the existence @@ -11,7 +11,7 @@ use aws_esdk::aws_cryptography_keyStore::types::KmsConfiguration; branch key material. This example demonstrates configuring a KeyStore and then - using a helper method to create a branch key. + uses a helper method to create a branch key. */ pub async fn create_branch_key_id( key_store_table_name: &str, diff --git a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/example_branch_key_id_supplier.rs b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/example_branch_key_id_supplier.rs index 00255941d..fb7ec8ccb 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/example_branch_key_id_supplier.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/example_branch_key_id_supplier.rs @@ -1,10 +1,10 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -use aws_esdk::aws_cryptography_materialProviders::operation::get_branch_key_id::GetBranchKeyIdInput; -use aws_esdk::aws_cryptography_materialProviders::operation::get_branch_key_id::GetBranchKeyIdOutput; -use aws_esdk::aws_cryptography_materialProviders::types::error::Error; -use aws_esdk::aws_cryptography_materialProviders::types::branch_key_id_supplier::BranchKeyIdSupplier; +use aws_esdk::material_providers::operation::get_branch_key_id::GetBranchKeyIdInput; +use aws_esdk::material_providers::operation::get_branch_key_id::GetBranchKeyIdOutput; +use aws_esdk::material_providers::types::error::Error; +use aws_esdk::material_providers::types::branch_key_id_supplier::BranchKeyIdSupplier; use std::collections::HashMap; /* diff --git a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/mod.rs b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/mod.rs index 77beff84b..0bd2ec8d5 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/mod.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/mod.rs @@ -3,5 +3,6 @@ pub mod aws_kms_hierarchical_keyring_example; pub mod create_branch_key_id; +pub mod version_branch_key_id_example; pub mod example_branch_key_id_supplier; pub mod shared_cache_across_hierarchical_keyrings_example; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/shared_cache_across_hierarchical_keyrings_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/shared_cache_across_hierarchical_keyrings_example.rs index caf21b3c7..78dee31ad 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/shared_cache_across_hierarchical_keyrings_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/shared_cache_across_hierarchical_keyrings_example.rs @@ -65,14 +65,14 @@ use super::create_branch_key_id::create_branch_key_id; use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::types::CacheType; -use aws_esdk::aws_cryptography_materialProviders::types::DefaultCache; -use aws_esdk::aws_cryptography_materialProviders::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef; -use aws_esdk::aws_cryptography_keyStore::types::KmsConfiguration; -use aws_esdk::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig; -use aws_esdk::aws_cryptography_keyStore::client as keystore_client; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::CacheType; +use aws_esdk::material_providers::types::DefaultCache; +use aws_esdk::material_providers::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::key_store::types::KmsConfiguration; +use aws_esdk::key_store::types::key_store_config::KeyStoreConfig; +use aws_esdk::key_store::client as keystore_client; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_keyring( diff --git a/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/version_branch_key_id_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/version_branch_key_id_example.rs new file mode 100644 index 000000000..fedfd61bd --- /dev/null +++ b/releases/rust/esdk/examples/keyring/aws_kms_hierarchical/version_branch_key_id_example.rs @@ -0,0 +1,68 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +use aws_esdk::key_store::client as keystore_client; +use aws_esdk::key_store::types::key_store_config::KeyStoreConfig; +use aws_esdk::key_store::types::KmsConfiguration; + +/* + This example demonstrates configuring a KeyStore and then + uses a helper method to version a branch key. +*/ +pub async fn version_branch_key_id( + key_store_table_name: &str, + logical_key_store_name: &str, + kms_key_arn: &str, + branch_key_id: &str +) -> Result<(), crate::BoxError> { + // Create a Key Store + // The KMS Configuration you use in the KeyStore MUST have the right access to the resources in the KeyStore. + let sdk_config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await; + let key_store_config = KeyStoreConfig::builder() + .kms_client(aws_sdk_kms::Client::new(&sdk_config)) + .ddb_client(aws_sdk_dynamodb::Client::new(&sdk_config)) + .ddb_table_name(key_store_table_name) + .logical_key_store_name(logical_key_store_name) + .kms_configuration(KmsConfiguration::KmsKeyArn(kms_key_arn.to_string())) + .build()?; + + let keystore = keystore_client::Client::from_conf(key_store_config)?; + + // To version a branch key you MUST have access to kms:ReEncrypt* and kms:GenerateDataKeyWithoutPlaintext + keystore.version_key() + .branch_key_identifier(branch_key_id) + .send() + .await?; + + println!("Version Branch Key Example Completed Successfully"); + + Ok(()) +} + +// Function to test version_branch_key_id in main.rs in examples directory +pub async fn create_and_version_branch_key_id() -> Result<(), crate::BoxError2> { + use crate::example_utils::utils; + use super::create_branch_key_id::create_branch_key_id; + + let branch_key_id: String = create_branch_key_id( + utils::TEST_KEY_STORE_NAME, + utils::TEST_LOGICAL_KEY_STORE_NAME, + utils::TEST_KEY_STORE_KMS_KEY_ID + ).await?; + + version_branch_key_id( + utils::TEST_KEY_STORE_NAME, + utils::TEST_LOGICAL_KEY_STORE_NAME, + utils::TEST_KEY_STORE_KMS_KEY_ID, + &branch_key_id + ).await?; + + Ok(()) +} + +#[tokio::test(flavor = "multi_thread")] +pub async fn test_version_branch_key_id() -> Result<(), crate::BoxError2> { + // Test function for Version Branch Key example + create_and_version_branch_key_id().await?; + Ok(()) +} diff --git a/releases/rust/esdk/examples/keyring/aws_kms_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_keyring_example.rs index c4977af17..f5a4090ee 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_keyring_example.rs @@ -23,8 +23,8 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_keyring( diff --git a/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_keyring_example.rs index 8686e2e4f..0d8877c5c 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_keyring_example.rs @@ -40,9 +40,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::DiscoveryFilter; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::DiscoveryFilter; use std::collections::HashMap; use aws_config::Region; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_multi_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_multi_keyring_example.rs index 3dad49de4..635b60ede 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_multi_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_mrk_discovery_multi_keyring_example.rs @@ -42,9 +42,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::DiscoveryFilter; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::DiscoveryFilter; use std::collections::HashMap; use aws_config::Region; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_mrk_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_mrk_keyring_example.rs index ba0898f4e..96c05eb50 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_mrk_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_mrk_keyring_example.rs @@ -27,8 +27,8 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; use aws_config::Region; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_mrk_multi_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_mrk_multi_keyring_example.rs index 4ed152199..070c997a8 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_mrk_multi_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_mrk_multi_keyring_example.rs @@ -33,8 +33,8 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; use aws_config::Region; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_multi_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_multi_keyring_example.rs index edc9ffa05..cdff88810 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_multi_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_multi_keyring_example.rs @@ -43,8 +43,8 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; use aws_config::Region; diff --git a/releases/rust/esdk/examples/keyring/aws_kms_rsa_keyring_example.rs b/releases/rust/esdk/examples/keyring/aws_kms_rsa_keyring_example.rs index 71324d367..ab26df65d 100644 --- a/releases/rust/esdk/examples/keyring/aws_kms_rsa_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/aws_kms_rsa_keyring_example.rs @@ -20,9 +20,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::EsdkAlgorithmSuiteId; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_keyring( diff --git a/releases/rust/esdk/examples/keyring/ecdh/ephemeral_raw_ecdh_keyring_example.rs b/releases/rust/esdk/examples/keyring/ecdh/ephemeral_raw_ecdh_keyring_example.rs index 925dcc367..b8ce06cf3 100644 --- a/releases/rust/esdk/examples/keyring/ecdh/ephemeral_raw_ecdh_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/ecdh/ephemeral_raw_ecdh_keyring_example.rs @@ -40,10 +40,10 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-ecdh-k use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations; -use aws_esdk::aws_cryptography_materialProviders::types::EphemeralPrivateKeyToStaticPublicKeyInput; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::RawEcdhStaticConfigurations; +use aws_esdk::material_providers::types::EphemeralPrivateKeyToStaticPublicKeyInput; use aws_esdk::aws_cryptography_primitives::types::EcdhCurveSpec; use std::collections::HashMap; use std::path::Path; diff --git a/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_discovery_keyring_example.rs b/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_discovery_keyring_example.rs index 4b0ecb436..3e684f4d0 100644 --- a/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_discovery_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_discovery_keyring_example.rs @@ -29,11 +29,11 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-kms-ecdh-k use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::KmsEcdhStaticConfigurations; -use aws_esdk::aws_cryptography_materialProviders::types::KmsPrivateKeyToStaticPublicKeyInput; -use aws_esdk::aws_cryptography_materialProviders::types::KmsPublicKeyDiscoveryInput; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::KmsEcdhStaticConfigurations; +use aws_esdk::material_providers::types::KmsPrivateKeyToStaticPublicKeyInput; +use aws_esdk::material_providers::types::KmsPublicKeyDiscoveryInput; use aws_esdk::aws_cryptography_primitives::types::EcdhCurveSpec; use aws_smithy_types::Blob; use std::collections::HashMap; diff --git a/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_keyring_example.rs b/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_keyring_example.rs index c5dd7f48a..a069a8a97 100644 --- a/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/ecdh/kms_ecdh_keyring_example.rs @@ -43,10 +43,10 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-kms-ecdh-k use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::KmsEcdhStaticConfigurations; -use aws_esdk::aws_cryptography_materialProviders::types::KmsPrivateKeyToStaticPublicKeyInput; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::KmsEcdhStaticConfigurations; +use aws_esdk::material_providers::types::KmsPrivateKeyToStaticPublicKeyInput; use aws_esdk::aws_cryptography_primitives::types::EcdhCurveSpec; use std::collections::HashMap; use std::path::Path; diff --git a/releases/rust/esdk/examples/keyring/ecdh/public_key_discovery_raw_ecdh_keyring_example.rs b/releases/rust/esdk/examples/keyring/ecdh/public_key_discovery_raw_ecdh_keyring_example.rs index 8de9b2194..dc29efce6 100644 --- a/releases/rust/esdk/examples/keyring/ecdh/public_key_discovery_raw_ecdh_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/ecdh/public_key_discovery_raw_ecdh_keyring_example.rs @@ -46,11 +46,11 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-ecdh-k use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations; -use aws_esdk::aws_cryptography_materialProviders::types::PublicKeyDiscoveryInput; -use aws_esdk::aws_cryptography_materialProviders::types::EphemeralPrivateKeyToStaticPublicKeyInput; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::RawEcdhStaticConfigurations; +use aws_esdk::material_providers::types::PublicKeyDiscoveryInput; +use aws_esdk::material_providers::types::EphemeralPrivateKeyToStaticPublicKeyInput; use aws_esdk::aws_cryptography_primitives::types::EcdhCurveSpec; use aws_smithy_types::Blob; use std::collections::HashMap; diff --git a/releases/rust/esdk/examples/keyring/ecdh/raw_ecdh_keyring_example.rs b/releases/rust/esdk/examples/keyring/ecdh/raw_ecdh_keyring_example.rs index 3f7796ec0..ffd7b2a52 100644 --- a/releases/rust/esdk/examples/keyring/ecdh/raw_ecdh_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/ecdh/raw_ecdh_keyring_example.rs @@ -49,10 +49,10 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-ecdh-k use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations; -use aws_esdk::aws_cryptography_materialProviders::types::RawPrivateKeyToStaticPublicKeyInput; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::RawEcdhStaticConfigurations; +use aws_esdk::material_providers::types::RawPrivateKeyToStaticPublicKeyInput; use aws_esdk::aws_cryptography_primitives::types::EcdhCurveSpec; use std::collections::HashMap; use std::fs::File; diff --git a/releases/rust/esdk/examples/keyring/multi_keyring_example.rs b/releases/rust/esdk/examples/keyring/multi_keyring_example.rs index 8f70f994f..6ef963300 100644 --- a/releases/rust/esdk/examples/keyring/multi_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/multi_keyring_example.rs @@ -43,9 +43,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::AesWrappingAlg; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::AesWrappingAlg; use std::collections::HashMap; use rand::RngCore; diff --git a/releases/rust/esdk/examples/keyring/raw_aes_keyring_example.rs b/releases/rust/esdk/examples/keyring/raw_aes_keyring_example.rs index c6d500fbb..9c682f2a8 100644 --- a/releases/rust/esdk/examples/keyring/raw_aes_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/raw_aes_keyring_example.rs @@ -25,9 +25,9 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-aes-ke use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::AesWrappingAlg; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::AesWrappingAlg; use std::collections::HashMap; use rand::RngCore; diff --git a/releases/rust/esdk/examples/keyring/raw_rsa_keyring_example.rs b/releases/rust/esdk/examples/keyring/raw_rsa_keyring_example.rs index 04a2e5548..a6d003c3f 100644 --- a/releases/rust/esdk/examples/keyring/raw_rsa_keyring_example.rs +++ b/releases/rust/esdk/examples/keyring/raw_rsa_keyring_example.rs @@ -49,9 +49,9 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-rsa-ke use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::PaddingScheme; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::PaddingScheme; use std::collections::HashMap; use std::fs::File; use std::io::Read; diff --git a/releases/rust/esdk/examples/limit_encrypted_data_keys_example.rs b/releases/rust/esdk/examples/limit_encrypted_data_keys_example.rs index 3ccda194a..868056e70 100644 --- a/releases/rust/esdk/examples/limit_encrypted_data_keys_example.rs +++ b/releases/rust/esdk/examples/limit_encrypted_data_keys_example.rs @@ -18,10 +18,10 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-aes-ke use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::keyring::KeyringRef; -use aws_esdk::aws_cryptography_materialProviders::types::AesWrappingAlg; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::keyring::KeyringRef; +use aws_esdk::material_providers::types::AesWrappingAlg; use aws_esdk::types::error::Error::AwsEncryptionSdkException; use std::collections::HashMap; use rand::RngCore; diff --git a/releases/rust/esdk/examples/main.rs b/releases/rust/esdk/examples/main.rs index feb80c5f4..662171548 100644 --- a/releases/rust/esdk/examples/main.rs +++ b/releases/rust/esdk/examples/main.rs @@ -188,6 +188,8 @@ pub async fn main() -> Result<(), BoxError2> { utils::TEST_KEY_STORE_KMS_KEY_ID ).await?; + keyring::aws_kms_hierarchical::version_branch_key_id_example::create_and_version_branch_key_id().await?; + keyring::aws_kms_hierarchical::shared_cache_across_hierarchical_keyrings_example::encrypt_and_decrypt_with_keyring( utils::TEST_EXAMPLE_DATA, utils::TEST_KEY_STORE_NAME, diff --git a/releases/rust/esdk/examples/set_commitment_policy_example.rs b/releases/rust/esdk/examples/set_commitment_policy_example.rs index d0cc05524..3cd8186e4 100644 --- a/releases/rust/esdk/examples/set_commitment_policy_example.rs +++ b/releases/rust/esdk/examples/set_commitment_policy_example.rs @@ -26,9 +26,9 @@ https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::EsdkCommitmentPolicy::ForbidEncryptAllowDecrypt; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::EsdkCommitmentPolicy::ForbidEncryptAllowDecrypt; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; use std::collections::HashMap; pub async fn encrypt_and_decrypt_with_keyring( diff --git a/releases/rust/esdk/examples/set_encryption_algorithm_suite_example.rs b/releases/rust/esdk/examples/set_encryption_algorithm_suite_example.rs index c62cfb464..7953be61a 100644 --- a/releases/rust/esdk/examples/set_encryption_algorithm_suite_example.rs +++ b/releases/rust/esdk/examples/set_encryption_algorithm_suite_example.rs @@ -41,10 +41,10 @@ https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/use-raw-aes-ke use aws_esdk::client as esdk_client; use aws_esdk::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -use aws_esdk::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId::AlgAes256GcmHkdfSha512CommitKey; -use aws_esdk::aws_cryptography_materialProviders::client as mpl_client; -use aws_esdk::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; -use aws_esdk::aws_cryptography_materialProviders::types::AesWrappingAlg; +use aws_esdk::material_providers::types::EsdkAlgorithmSuiteId::AlgAes256GcmHkdfSha512CommitKey; +use aws_esdk::material_providers::client as mpl_client; +use aws_esdk::material_providers::types::material_providers_config::MaterialProvidersConfig; +use aws_esdk::material_providers::types::AesWrappingAlg; use std::collections::HashMap; use rand::RngCore; diff --git a/releases/rust/esdk/src/aes_gcm.rs b/releases/rust/esdk/src/aes_gcm.rs index 21bf9230f..8867c539d 100644 --- a/releases/rust/esdk/src/aes_gcm.rs +++ b/releases/rust/esdk/src/aes_gcm.rs @@ -52,11 +52,13 @@ impl AES_GCM { )) } else if *self.keyLength() == 32i32 { Ok(&aws_lc_rs::aead::AES_256_GCM) + } else if *self.keyLength() == 24i32 { + Ok(&aws_lc_rs::aead::AES_192_GCM) } else if *self.keyLength() == 16i32 { Ok(&aws_lc_rs::aead::AES_128_GCM) } else { Err(format!( - "Key length of {} not supported in Rust. Key length must be 16 or 32.", + "Key length of {} not supported in Rust. Key length must be 16, 24 or 32.", self.keyLength() )) } diff --git a/releases/rust/esdk/src/client.rs b/releases/rust/esdk/src/client.rs index c7b90345b..0f1bb15ca 100644 --- a/releases/rust/esdk/src/client.rs +++ b/releases/rust/esdk/src/client.rs @@ -13,11 +13,13 @@ impl Client { /// Creates a new client from the service [`Config`](crate::Config). #[track_caller] pub fn from_conf( - conf: crate::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig, + input: crate::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig, ) -> Result { + crate::validation::validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig(&input) + .map_err(crate::types::error::Error::wrap_validation_err)?; let inner = crate::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK( - &crate::conversions::aws_encryption_sdk_config::_aws_encryption_sdk_config::to_dafny(conf), + &crate::conversions::aws_encryption_sdk_config::_aws_encryption_sdk_config::to_dafny(input), ); if matches!( inner.as_ref(), diff --git a/releases/rust/esdk/src/dafny_libraries.rs b/releases/rust/esdk/src/dafny_libraries.rs index a5e7f437f..4afd94ac5 100644 --- a/releases/rust/esdk/src/dafny_libraries.rs +++ b/releases/rust/esdk/src/dafny_libraries.rs @@ -4,6 +4,7 @@ #![deny(warnings, unconditional_panic)] #![deny(nonstandard_style)] #![deny(clippy::all)] +#![allow(dead_code)] #[allow(non_snake_case)] pub mod DafnyLibraries { @@ -83,7 +84,13 @@ pub mod DafnyLibraries { use std::io::Write; use std::path::Path; - pub fn INTERNAL_ReadBytesFromFile( + // Attempts to read all bytes from the file at {@code path}, and returns a tuple of the following values: + // isError : true iff an exception was thrown during path string conversion or when reading the file + // bytesRead : the sequence of bytes read from the file, or an empty sequence if {@code isError} is true + // errorMsg : the error message of the thrown exception if {@code isError} is true, or an empty equence otherwise + // We return these values individually because Result is not defined in the runtime but + // instead in library code. It is the responsibility of library code to construct an equivalent Result value. + pub(crate) fn INTERNAL_ReadBytesFromFile( file: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ) -> ( bool, @@ -122,28 +129,62 @@ pub mod DafnyLibraries { } } + // Get the current dirctory for use in error messages fn curr_dir() -> String { let path = std::env::current_dir(); match path { Ok(path) => format!("{}", path.display()), - Err(_) => "unknown".to_string(), + Err(_) => "Error while getting the path of current directory".to_string(), } } - pub fn INTERNAL_WriteBytesToFile( + // Attempts to append bytes to the file at path, creating nonexistent parent + // See SendBytesToFile for details + pub(crate) fn INTERNAL_AppendBytesToFile( path: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, bytes: &::dafny_runtime::Sequence, ) -> ( bool, ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) { + SendBytesToFile(path, bytes, true) + } + + // Attempts to write bytes to the file at path, creating nonexistent parent + // See SendBytesToFile for details + pub(crate) fn INTERNAL_WriteBytesToFile( + path: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + bytes: &::dafny_runtime::Sequence, + ) -> ( + bool, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + ) { + SendBytesToFile(path, bytes, false) + } + + // Attempts to write bytes to the file at path, creating nonexistent parent + // directories as necessary, and returns a tuple of the following values: + // isError : true iff an exception was thrown during path string conversion or when writing to the file + // errorMsg : the error message of the thrown exception if {@code isError} is true, or an empty sequence otherwise + // We return these values individually because {@code Result} is not defined in the runtime but + // instead in library code. It is the responsibility of library code to construct an equivalent Result value. + // if append is false, the file is truncated, otherwise we append to the existing file. + fn SendBytesToFile( + path: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, + bytes: &::dafny_runtime::Sequence, + append: bool, + ) -> ( + bool, + ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, ) { let file_name = dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(path); let path = Path::new(&file_name); let maybe_file = std::fs::OpenOptions::new() + .append(append) .write(true) .create(true) - .truncate(true) + .truncate(!append) .open(path); let mut file = match maybe_file { Err(why) => { diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore.rs index e118e5215..e3614bb67 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore.rs @@ -8,4 +8,5 @@ pub mod error; /// All operations that this crate can perform. pub mod operation; pub mod conversions; +pub mod validation; pub mod deps; diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/client.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/client.rs index 5dfefe95f..31fc09ea6 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/client.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/client.rs @@ -13,11 +13,13 @@ impl Client { /// Creates a new client from the service [`Config`](crate::Config). #[track_caller] pub fn from_conf( - conf: crate::deps::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig, + input: crate::deps::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig, ) -> Result { + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner = crate::software::amazon::cryptography::keystore::internaldafny::_default::KeyStore( - &crate::deps::aws_cryptography_keyStore::conversions::key_store_config::_key_store_config::to_dafny(conf), + &crate::deps::aws_cryptography_keyStore::conversions::key_store_config::_key_store_config::to_dafny(input), ); if matches!( inner.as_ref(), diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key.rs index 7534e597c..7fd1886b1 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key.rs @@ -18,7 +18,8 @@ impl CreateKey { crate::deps::aws_cryptography_keyStore::operation::create_key::CreateKeyOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_for_KeyStore_CreateKey(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_keyStore::conversions::create_key::_create_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key_store.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key_store.rs index 53149e557..876d7abd7 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key_store.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/create_key_store.rs @@ -18,7 +18,8 @@ impl CreateKeyStore { crate::deps::aws_cryptography_keyStore::operation::create_key_store::CreateKeyStoreOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreInput_for_KeyStore_CreateKeyStore(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_keyStore::conversions::create_key_store::_create_key_store_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateKeyStore(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_active_branch_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_active_branch_key.rs index 6eef1ad6d..48327c275 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_active_branch_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_active_branch_key.rs @@ -18,12 +18,8 @@ impl GetActiveBranchKey { crate::deps::aws_cryptography_keyStore::operation::get_active_branch_key::GetActiveBranchKeyOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - if input.branch_key_identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "branch_key_identifier", - "branch_key_identifier was not specified but it is required when building GetActiveBranchKeyInput", - )).map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyInput_for_KeyStore_GetActiveBranchKey(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_keyStore::conversions::get_active_branch_key::_get_active_branch_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetActiveBranchKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_beacon_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_beacon_key.rs index 9ff33667a..2ecfe1736 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_beacon_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_beacon_key.rs @@ -18,12 +18,8 @@ impl GetBeaconKey { crate::deps::aws_cryptography_keyStore::operation::get_beacon_key::GetBeaconKeyOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - if input.branch_key_identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "branch_key_identifier", - "branch_key_identifier was not specified but it is required when building GetBeaconKeyInput", - )).map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyInput_for_KeyStore_GetBeaconKey(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_keyStore::conversions::get_beacon_key::_get_beacon_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetBeaconKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_branch_key_version.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_branch_key_version.rs index 580394eb1..1d3aba8ac 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_branch_key_version.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_branch_key_version.rs @@ -18,18 +18,8 @@ impl GetBranchKeyVersion { crate::deps::aws_cryptography_keyStore::operation::get_branch_key_version::GetBranchKeyVersionOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - if input.branch_key_identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "branch_key_identifier", - "branch_key_identifier was not specified but it is required when building GetBranchKeyVersionInput", - )).map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err); -} -if input.branch_key_version.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "branch_key_version", - "branch_key_version was not specified but it is required when building GetBranchKeyVersionInput", - )).map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_for_KeyStore_GetBranchKeyVersion(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_keyStore::conversions::get_branch_key_version::_get_branch_key_version_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetBranchKeyVersion(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_key_store_info.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_key_store_info.rs index 1dcb871ca..72abebb3a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_key_store_info.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/get_key_store_info.rs @@ -18,7 +18,8 @@ impl GetKeyStoreInfo { crate::deps::aws_cryptography_keyStore::operation::get_key_store_info::GetKeyStoreInfoOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - + crate::deps::aws_cryptography_keyStore::validation::validate_smithy_Papi_HUnit_for_KeyStore_GetKeyStoreInfo(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = (); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetKeyStoreInfo(); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/version_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/version_key.rs index 3673ebd82..057f4fb87 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/version_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/operation/version_key.rs @@ -18,12 +18,8 @@ impl VersionKey { crate::deps::aws_cryptography_keyStore::operation::version_key::VersionKeyOutput, crate::deps::aws_cryptography_keyStore::types::error::Error, > { - if input.branch_key_identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "branch_key_identifier", - "branch_key_identifier was not specified but it is required when building VersionKeyInput", - )).map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_keyStore::validation::validate_aws_Pcryptography_PkeyStore_HVersionKeyInput_for_KeyStore_VersionKey(&input) + .map_err(crate::deps::aws_cryptography_keyStore::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_keyStore::conversions::version_key::_version_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).VersionKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/types.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/types.rs index dba654686..ec5a4cbf8 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/types.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/types.rs @@ -3,6 +3,7 @@ // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. /// Types for the `KeyStoreConfig` pub mod key_store_config; +pub use crate::deps::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig; pub mod builders; diff --git a/releases/rust/esdk/src/deps/aws_cryptography_keyStore/validation.rs b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/validation.rs new file mode 100644 index 000000000..96a4c7230 --- /dev/null +++ b/releases/rust/esdk/src/deps/aws_cryptography_keyStore/validation.rs @@ -0,0 +1,861 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials(input: &crate::deps::aws_cryptography_keyStore::types::BeaconKeyMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKeyIdentifier(&input.beacon_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKey(&input.beacon_key)?; +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DhmacKeys(&input.hmac_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "beacon_key_identifier", + "beacon_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DhmacKeys(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HHmacKeyMap(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials(input: &crate::deps::aws_cryptography_keyStore::types::BranchKeyMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyIdentifier(&input.branch_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyVersion(&input.branch_key_version)?; +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKey(&input.branch_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key", + "branch_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyVersion(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_version", + "branch_key_version is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyInput(input: &crate::deps::aws_cryptography_keyStore::types::CreateKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_DencryptionContext(&input.encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_for_KeyStore_CreateKey(input: &crate::deps::aws_cryptography_keyStore::operation::create_key::CreateKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_DencryptionContext(&input.encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyOutput(input: &crate::deps::aws_cryptography_keyStore::types::CreateKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HCreateKeyOutput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyOutput_for_KeyStore_CreateKey(input: &crate::deps::aws_cryptography_keyStore::operation::create_key::CreateKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HCreateKeyOutput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyOutput_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreInput(input: &crate::deps::aws_cryptography_keyStore::types::CreateKeyStoreInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreInput_for_KeyStore_CreateKeyStore(input: &crate::deps::aws_cryptography_keyStore::operation::create_key_store::CreateKeyStoreInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreOutput(input: &crate::deps::aws_cryptography_keyStore::types::CreateKeyStoreOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreOutput_DtableArn(&input.table_arn)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreOutput_for_KeyStore_CreateKeyStore(input: &crate::deps::aws_cryptography_keyStore::operation::create_key_store::CreateKeyStoreOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreOutput_DtableArn(&input.table_arn)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HCreateKeyStoreOutput_DtableArn(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "table_arn", + "table_arn is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=1024).contains(&input.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add)) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "table_arn", + "table_arn failed to satisfy constraint: Member must have length between 1 and 1024, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HDdbClientReference(input: &crate::deps::com_amazonaws_dynamodb::client::Client) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HDiscovery(input: &crate::deps::aws_cryptography_keyStore::types::Discovery) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input: &::std::collections::HashMap<::std::string::String, ::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for (inner_key, inner_val) in input.iter() { + validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dkey(inner_key)?; + validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dvalue(inner_val)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dkey(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dvalue(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyInput(input: &crate::deps::aws_cryptography_keyStore::types::GetActiveBranchKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyInput_for_KeyStore_GetActiveBranchKey(input: &crate::deps::aws_cryptography_keyStore::operation::get_active_branch_key::GetActiveBranchKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyInput_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyOutput(input: &crate::deps::aws_cryptography_keyStore::types::GetActiveBranchKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyOutput_DbranchKeyMaterials(&input.branch_key_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyOutput_for_KeyStore_GetActiveBranchKey(input: &crate::deps::aws_cryptography_keyStore::operation::get_active_branch_key::GetActiveBranchKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyOutput_DbranchKeyMaterials(&input.branch_key_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetActiveBranchKeyOutput_DbranchKeyMaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_materials", + "branch_key_materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyInput(input: &crate::deps::aws_cryptography_keyStore::types::GetBeaconKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyInput_for_KeyStore_GetBeaconKey(input: &crate::deps::aws_cryptography_keyStore::operation::get_beacon_key::GetBeaconKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyInput_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyOutput(input: &crate::deps::aws_cryptography_keyStore::types::GetBeaconKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyOutput_DbeaconKeyMaterials(&input.beacon_key_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyOutput_for_KeyStore_GetBeaconKey(input: &crate::deps::aws_cryptography_keyStore::operation::get_beacon_key::GetBeaconKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyOutput_DbeaconKeyMaterials(&input.beacon_key_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBeaconKeyOutput_DbeaconKeyMaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "beacon_key_materials", + "beacon_key_materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput(input: &crate::deps::aws_cryptography_keyStore::types::GetBranchKeyVersionInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_DbranchKeyVersion(&input.branch_key_version)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_for_KeyStore_GetBranchKeyVersion(input: &crate::deps::aws_cryptography_keyStore::operation::get_branch_key_version::GetBranchKeyVersionInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_DbranchKeyVersion(&input.branch_key_version)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionInput_DbranchKeyVersion(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_version", + "branch_key_version is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionOutput(input: &crate::deps::aws_cryptography_keyStore::types::GetBranchKeyVersionOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionOutput_DbranchKeyMaterials(&input.branch_key_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionOutput_for_KeyStore_GetBranchKeyVersion(input: &crate::deps::aws_cryptography_keyStore::operation::get_branch_key_version::GetBranchKeyVersionOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionOutput_DbranchKeyMaterials(&input.branch_key_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetBranchKeyVersionOutput_DbranchKeyMaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_materials", + "branch_key_materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput(input: &crate::deps::aws_cryptography_keyStore::types::GetKeyStoreInfoOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkeyStoreId(&input.key_store_id)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkeyStoreName(&input.key_store_name)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DlogicalKeyStoreName(&input.logical_key_store_name)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DgrantTokens(&input.grant_tokens)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkmsConfiguration(&input.kms_configuration)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_for_KeyStore_GetKeyStoreInfo(input: &crate::deps::aws_cryptography_keyStore::operation::get_key_store_info::GetKeyStoreInfoOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkeyStoreId(&input.key_store_id)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkeyStoreName(&input.key_store_name)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DlogicalKeyStoreName(&input.logical_key_store_name)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DgrantTokens(&input.grant_tokens)?; +validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkmsConfiguration(&input.kms_configuration)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "grant_tokens", + "grant_tokens is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkeyStoreId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_store_id", + "key_store_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkeyStoreName(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_store_name", + "key_store_name is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(3..=255).contains(&input.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add)) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "key_store_name", + "key_store_name failed to satisfy constraint: Member must have length between 3 and 255, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DkmsConfiguration(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_configuration", + "kms_configuration is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HKMSConfiguration(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGetKeyStoreInfoOutput_DlogicalKeyStoreName(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "logical_key_store_name", + "logical_key_store_name is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGrantTokenList(input: &::std::vec::Vec<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PkeyStore_HGrantTokenList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HGrantTokenList_Dmember(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HHmacKeyMap(input: &::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for (inner_key, inner_val) in input.iter() { + validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dkey(inner_key)?; + validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dvalue(inner_val)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dkey(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dvalue(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig(input: &crate::deps::aws_cryptography_keyStore::types::key_store_config::KeyStoreConfig) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DddbTableName(&input.ddb_table_name)?; +validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DkmsConfiguration(&input.kms_configuration)?; +validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DlogicalKeyStoreName(&input.logical_key_store_name)?; +validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_Did(&input.id)?; +validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DgrantTokens(&input.grant_tokens)?; +validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DddbClient(&input.ddb_client)?; +validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DkmsClient(&input.kms_client)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DddbClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HDdbClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DddbTableName(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ddb_table_name", + "ddb_table_name is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(3..=255).contains(&input.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add)) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "ddb_table_name", + "ddb_table_name failed to satisfy constraint: Member must have length between 3 and 255, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_Did(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DkmsConfiguration(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_configuration", + "kms_configuration is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HKMSConfiguration(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKeyStoreConfig_DlogicalKeyStoreName(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "logical_key_store_name", + "logical_key_store_name is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKmsClientReference(input: &crate::deps::com_amazonaws_kms::client::Client) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKMSConfiguration(input: &crate::deps::aws_cryptography_keyStore::types::KmsConfiguration) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_keyStore::types::KmsConfiguration::KmsKeyArn(ref inner) = &input { + validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_DkmsKeyArn(inner)?; +} +if let crate::deps::aws_cryptography_keyStore::types::KmsConfiguration::KmsMrKeyArn(ref inner) = &input { + validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_DkmsMRKeyArn(inner)?; +} +if let crate::deps::aws_cryptography_keyStore::types::KmsConfiguration::Discovery(ref inner) = &input { + validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_Ddiscovery(inner)?; +} +if let crate::deps::aws_cryptography_keyStore::types::KmsConfiguration::MrDiscovery(ref inner) = &input { + validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_DmrDiscovery(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_Ddiscovery(input: &crate::deps::aws_cryptography_keyStore::types::Discovery) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HDiscovery(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_DkmsKeyArn(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if !(1..=2048).contains(&input.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add)) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "kms_key_arn", + "kms_key_arn failed to satisfy constraint: Member must have length between 1 and 2048, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_DkmsMRKeyArn(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if !(1..=2048).contains(&input.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add)) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "kms_mr_key_arn", + "kms_mr_key_arn failed to satisfy constraint: Member must have length between 1 and 2048, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HKMSConfiguration_DmrDiscovery(input: &crate::deps::aws_cryptography_keyStore::types::MrDiscovery) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HMRDiscovery(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HMRDiscovery(input: &crate::deps::aws_cryptography_keyStore::types::MrDiscovery) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HMRDiscovery_Dregion(&input.region)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HMRDiscovery_Dregion(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "region", + "region is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=32).contains(&input.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add)) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "region", + "region failed to satisfy constraint: Member must have length between 1 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HVersionKeyInput(input: &crate::deps::aws_cryptography_keyStore::types::VersionKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HVersionKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HVersionKeyInput_for_KeyStore_VersionKey(input: &crate::deps::aws_cryptography_keyStore::operation::version_key::VersionKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HVersionKeyInput_DbranchKeyIdentifier(&input.branch_key_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HVersionKeyInput_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HVersionKeyOutput(input: &crate::deps::aws_cryptography_keyStore::types::VersionKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HVersionKeyOutput_for_KeyStore_VersionKey(input: &crate::deps::aws_cryptography_keyStore::operation::version_key::VersionKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_smithy_Papi_HUnit(input: &()) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_smithy_Papi_HUnit_for_KeyStore_GetKeyStoreInfo(input: &crate::deps::aws_cryptography_keyStore::operation::get_key_store_info::Unit) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders.rs index e118e5215..e3614bb67 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders.rs @@ -8,4 +8,5 @@ pub mod error; /// All operations that this crate can perform. pub mod operation; pub mod conversions; +pub mod validation; pub mod deps; diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/client.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/client.rs index 4d1510900..7c44301a8 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/client.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/client.rs @@ -13,11 +13,13 @@ impl Client { /// Creates a new client from the service [`Config`](crate::Config). #[track_caller] pub fn from_conf( - conf: crate::deps::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig, + input: crate::deps::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig, ) -> Result { + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HMaterialProvidersConfig(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner = crate::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders( - &crate::deps::aws_cryptography_materialProviders::conversions::material_providers_config::_material_providers_config::to_dafny(conf), + &crate::deps::aws_cryptography_materialProviders::conversions::material_providers_config::_material_providers_config::to_dafny(input), ); if matches!( inner.as_ref(), diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_keyring.rs index 01e6e418b..5b070bd90 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_keyring.rs @@ -18,12 +18,8 @@ impl CreateAwsKmsDiscoveryKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.kms_client.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_client", - "kms_client was not specified but it is required when building CreateAwsKmsDiscoveryKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsDiscoveryKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_discovery_keyring::_create_aws_kms_discovery_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsDiscoveryKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_multi_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_multi_keyring.rs index 0695a53f8..8dd313e81 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_multi_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_discovery_multi_keyring.rs @@ -18,12 +18,8 @@ impl CreateAwsKmsDiscoveryMultiKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.regions.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "regions", - "regions was not specified but it is required when building CreateAwsKmsDiscoveryMultiKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsDiscoveryMultiKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_discovery_multi_keyring::_create_aws_kms_discovery_multi_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsDiscoveryMultiKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_ecdh_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_ecdh_keyring.rs index aa9da5528..88c3d6990 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_ecdh_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_ecdh_keyring.rs @@ -18,24 +18,8 @@ impl CreateAwsKmsEcdhKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.key_agreement_scheme.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_agreement_scheme", - "key_agreement_scheme was not specified but it is required when building CreateAwsKmsEcdhKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.curve_spec.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "curve_spec", - "curve_spec was not specified but it is required when building CreateAwsKmsEcdhKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.kms_client.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_client", - "kms_client was not specified but it is required when building CreateAwsKmsEcdhKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsEcdhKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_ecdh_keyring::_create_aws_kms_ecdh_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsEcdhKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_hierarchical_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_hierarchical_keyring.rs index 1b73da6c1..c1bb6595a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_hierarchical_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_hierarchical_keyring.rs @@ -18,24 +18,8 @@ impl CreateAwsKmsHierarchicalKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.key_store.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_store", - "key_store was not specified but it is required when building CreateAwsKmsHierarchicalKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.ttl_seconds.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ttl_seconds", - "ttl_seconds was not specified but it is required when building CreateAwsKmsHierarchicalKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if matches!(input.ttl_seconds, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "ttl_seconds", - "ttl_seconds failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsHierarchicalKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_hierarchical_keyring::_create_aws_kms_hierarchical_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsHierarchicalKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_keyring.rs index 9e558d210..1b8d86734 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_keyring.rs @@ -18,18 +18,8 @@ impl CreateAwsKmsKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.kms_key_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_key_id", - "kms_key_id was not specified but it is required when building CreateAwsKmsKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.kms_client.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_client", - "kms_client was not specified but it is required when building CreateAwsKmsKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_keyring::_create_aws_kms_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_keyring.rs index 8a85f4f85..1e90b2795 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_keyring.rs @@ -18,18 +18,8 @@ impl CreateAwsKmsMrkDiscoveryKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.kms_client.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_client", - "kms_client was not specified but it is required when building CreateAwsKmsMrkDiscoveryKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.region.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "region", - "region was not specified but it is required when building CreateAwsKmsMrkDiscoveryKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkDiscoveryKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_mrk_discovery_keyring::_create_aws_kms_mrk_discovery_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsMrkDiscoveryKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_multi_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_multi_keyring.rs index 7d3f579ac..461e7fb17 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_multi_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_discovery_multi_keyring.rs @@ -18,12 +18,8 @@ impl CreateAwsKmsMrkDiscoveryMultiKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.regions.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "regions", - "regions was not specified but it is required when building CreateAwsKmsMrkDiscoveryMultiKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkDiscoveryMultiKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_mrk_discovery_multi_keyring::_create_aws_kms_mrk_discovery_multi_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsMrkDiscoveryMultiKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_keyring.rs index 4a760427b..d70d4df62 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_keyring.rs @@ -18,18 +18,8 @@ impl CreateAwsKmsMrkKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.kms_key_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_key_id", - "kms_key_id was not specified but it is required when building CreateAwsKmsMrkKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.kms_client.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_client", - "kms_client was not specified but it is required when building CreateAwsKmsMrkKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_mrk_keyring::_create_aws_kms_mrk_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsMrkKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_multi_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_multi_keyring.rs index 7fbb3d031..bd4aa9941 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_multi_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_mrk_multi_keyring.rs @@ -18,7 +18,8 @@ impl CreateAwsKmsMrkMultiKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkMultiKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_mrk_multi_keyring::_create_aws_kms_mrk_multi_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsMrkMultiKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_multi_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_multi_keyring.rs index 1c64df8da..d0f16e149 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_multi_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_multi_keyring.rs @@ -18,7 +18,8 @@ impl CreateAwsKmsMultiKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMultiKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_multi_keyring::_create_aws_kms_multi_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsMultiKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_rsa_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_rsa_keyring.rs index 5abb7251c..da350e9f7 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_rsa_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_aws_kms_rsa_keyring.rs @@ -18,18 +18,8 @@ impl CreateAwsKmsRsaKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.kms_key_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kms_key_id", - "kms_key_id was not specified but it is required when building CreateAwsKmsRsaKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encryption_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_algorithm", - "encryption_algorithm was not specified but it is required when building CreateAwsKmsRsaKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsRsaKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_aws_kms_rsa_keyring::_create_aws_kms_rsa_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateAwsKmsRsaKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_cryptographic_materials_cache.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_cryptographic_materials_cache.rs index 55e35e487..eb2646e8e 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_cryptographic_materials_cache.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_cryptographic_materials_cache.rs @@ -18,12 +18,8 @@ impl CreateCryptographicMaterialsCache { crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.cache.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "cache", - "cache was not specified but it is required when building CreateCryptographicMaterialsCacheInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheInput_for_AwsCryptographicMaterialProviders_CreateCryptographicMaterialsCache(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_cryptographic_materials_cache::_create_cryptographic_materials_cache_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateCryptographicMaterialsCache(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_client_supplier.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_client_supplier.rs index 2d81f7447..334d05b32 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_client_supplier.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_client_supplier.rs @@ -18,7 +18,8 @@ impl CreateDefaultClientSupplier { crate::deps::aws_cryptography_materialProviders::types::client_supplier::ClientSupplierRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierInput_for_AwsCryptographicMaterialProviders_CreateDefaultClientSupplier(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_default_client_supplier::_create_default_client_supplier_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateDefaultClientSupplier(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager.rs index 9f72087bc..e1533da52 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager.rs @@ -18,12 +18,8 @@ impl CreateDefaultCryptographicMaterialsManager { crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.keyring.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "keyring", - "keyring was not specified but it is required when building CreateDefaultCryptographicMaterialsManagerInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultCryptographicMaterialsManagerInput_for_AwsCryptographicMaterialProviders_CreateDefaultCryptographicMaterialsManager(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_default_cryptographic_materials_manager::_create_default_cryptographic_materials_manager_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateDefaultCryptographicMaterialsManager(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_multi_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_multi_keyring.rs index 31e7d2b8b..9da312aaf 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_multi_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_multi_keyring.rs @@ -18,12 +18,8 @@ impl CreateMultiKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.child_keyrings.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "child_keyrings", - "child_keyrings was not specified but it is required when building CreateMultiKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateMultiKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_multi_keyring::_create_multi_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateMultiKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_aes_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_aes_keyring.rs index 8a6a3efff..9d63e526a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_aes_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_aes_keyring.rs @@ -18,30 +18,8 @@ impl CreateRawAesKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.key_namespace.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_namespace", - "key_namespace was not specified but it is required when building CreateRawAesKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.key_name.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_name", - "key_name was not specified but it is required when building CreateRawAesKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.wrapping_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "wrapping_key", - "wrapping_key was not specified but it is required when building CreateRawAesKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.wrapping_alg.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "wrapping_alg", - "wrapping_alg was not specified but it is required when building CreateRawAesKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_for_AwsCryptographicMaterialProviders_CreateRawAesKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_raw_aes_keyring::_create_raw_aes_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateRawAesKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_ecdh_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_ecdh_keyring.rs index 91b9f6bdd..d80ead84c 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_ecdh_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_ecdh_keyring.rs @@ -18,18 +18,8 @@ impl CreateRawEcdhKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.key_agreement_scheme.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_agreement_scheme", - "key_agreement_scheme was not specified but it is required when building CreateRawEcdhKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.curve_spec.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "curve_spec", - "curve_spec was not specified but it is required when building CreateRawEcdhKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_for_AwsCryptographicMaterialProviders_CreateRawEcdhKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_raw_ecdh_keyring::_create_raw_ecdh_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateRawEcdhKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_rsa_keyring.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_rsa_keyring.rs index 4c8f617b8..f584a2071 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_rsa_keyring.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_raw_rsa_keyring.rs @@ -18,24 +18,8 @@ impl CreateRawRsaKeyring { crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.key_namespace.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_namespace", - "key_namespace was not specified but it is required when building CreateRawRsaKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.key_name.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key_name", - "key_name was not specified but it is required when building CreateRawRsaKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.padding_scheme.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "padding_scheme", - "padding_scheme was not specified but it is required when building CreateRawRsaKeyringInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_for_AwsCryptographicMaterialProviders_CreateRawRsaKeyring(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_raw_rsa_keyring::_create_raw_rsa_keyring_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateRawRsaKeyring(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm.rs index 4aea3629f..d541c1c37 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm.rs @@ -18,12 +18,8 @@ impl CreateRequiredEncryptionContextCmm { crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.required_encryption_context_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "required_encryption_context_keys", - "required_encryption_context_keys was not specified but it is required when building CreateRequiredEncryptionContextCmmInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_for_AwsCryptographicMaterialProviders_CreateRequiredEncryptionContextCMM(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::create_required_encryption_context_cmm::_create_required_encryption_context_cmm_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CreateRequiredEncryptionContextCMM(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decrypt_materials.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decrypt_materials.rs index 7f29f63a4..180c92175 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decrypt_materials.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decrypt_materials.rs @@ -18,30 +18,8 @@ impl DecryptMaterials { crate::deps::aws_cryptography_materialProviders::operation::decrypt_materials::DecryptMaterialsOutput, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm_suite_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm_suite_id", - "algorithm_suite_id was not specified but it is required when building DecryptMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.commitment_policy.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "commitment_policy", - "commitment_policy was not specified but it is required when building DecryptMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encrypted_data_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encrypted_data_keys", - "encrypted_data_keys was not specified but it is required when building DecryptMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building DecryptMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_for_CryptographicMaterialsManager_DecryptMaterials(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; cryptographic_materials_manager.inner.borrow_mut().decrypt_materials(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decryption_materials_with_plaintext_data_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decryption_materials_with_plaintext_data_key.rs index e940a8106..250fb887a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decryption_materials_with_plaintext_data_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/decryption_materials_with_plaintext_data_key.rs @@ -18,24 +18,8 @@ impl DecryptionMaterialsWithPlaintextDataKey { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm_suite.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm_suite", - "algorithm_suite was not specified but it is required when building DecryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building DecryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.required_encryption_context_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "required_encryption_context_keys", - "required_encryption_context_keys was not specified but it is required when building DecryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_for_AwsCryptographicMaterialProviders_DecryptionMaterialsWithPlaintextDataKey(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::decryption_materials_with_plaintext_data_key::_decryption_materials_with_plaintext_data_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).DecryptionMaterialsWithPlaintextDataKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/delete_cache_entry.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/delete_cache_entry.rs index 8ab002d54..d4712e577 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/delete_cache_entry.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/delete_cache_entry.rs @@ -18,12 +18,8 @@ impl DeleteCacheEntry { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "identifier", - "identifier was not specified but it is required when building DeleteCacheEntryInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HDeleteCacheEntryInput_for_CryptographicMaterialsCache_DeleteCacheEntry(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; cryptographic_materials_cache.inner.borrow_mut().delete_cache_entry(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/encryption_materials_has_plaintext_data_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/encryption_materials_has_plaintext_data_key.rs index 7da02cb35..b96c67006 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/encryption_materials_has_plaintext_data_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/encryption_materials_has_plaintext_data_key.rs @@ -18,30 +18,8 @@ impl EncryptionMaterialsHasPlaintextDataKey { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm_suite.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm_suite", - "algorithm_suite was not specified but it is required when building EncryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building EncryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encrypted_data_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encrypted_data_keys", - "encrypted_data_keys was not specified but it is required when building EncryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.required_encryption_context_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "required_encryption_context_keys", - "required_encryption_context_keys was not specified but it is required when building EncryptionMaterials", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_for_AwsCryptographicMaterialProviders_EncryptionMaterialsHasPlaintextDataKey(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::encryption_materials_has_plaintext_data_key::_encryption_materials_has_plaintext_data_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).EncryptionMaterialsHasPlaintextDataKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_algorithm_suite_info.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_algorithm_suite_info.rs index 0817eb446..8e0629d9b 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_algorithm_suite_info.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_algorithm_suite_info.rs @@ -18,12 +18,8 @@ impl GetAlgorithmSuiteInfo { crate::deps::aws_cryptography_materialProviders::operation::get_algorithm_suite_info::AlgorithmSuiteInfo, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.binary_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "binary_id", - "binary_id was not specified but it is required when building GetAlgorithmSuiteInfoInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HGetAlgorithmSuiteInfoInput_for_AwsCryptographicMaterialProviders_GetAlgorithmSuiteInfo(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::standard_library_conversions::blob_to_dafny(&input.binary_id.unwrap()); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetAlgorithmSuiteInfo(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_branch_key_id.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_branch_key_id.rs index cda085422..d8c375c6d 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_branch_key_id.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_branch_key_id.rs @@ -18,12 +18,8 @@ impl GetBranchKeyId { crate::deps::aws_cryptography_materialProviders::operation::get_branch_key_id::GetBranchKeyIdOutput, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building GetBranchKeyIdInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdInput_for_BranchKeyIdSupplier_GetBranchKeyId(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; branch_key_id_supplier.inner.borrow_mut().get_branch_key_id(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_cache_entry.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_cache_entry.rs index af2899554..b20b3b848 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_cache_entry.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_cache_entry.rs @@ -18,12 +18,8 @@ impl GetCacheEntry { crate::deps::aws_cryptography_materialProviders::operation::get_cache_entry::GetCacheEntryOutput, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "identifier", - "identifier was not specified but it is required when building GetCacheEntryInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_for_CryptographicMaterialsCache_GetCacheEntry(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; cryptographic_materials_cache.inner.borrow_mut().get_cache_entry(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_client.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_client.rs index 6b552f7f4..507757c65 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_client.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_client.rs @@ -18,12 +18,8 @@ impl GetClient { crate::deps::com_amazonaws_kms::client::Client, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.region.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "region", - "region was not specified but it is required when building GetClientInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HGetClientInput_for_ClientSupplier_GetClient(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; client_supplier.inner.borrow_mut().get_client(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_encryption_materials.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_encryption_materials.rs index a437352a6..0bb78b48b 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_encryption_materials.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/get_encryption_materials.rs @@ -18,18 +18,8 @@ impl GetEncryptionMaterials { crate::deps::aws_cryptography_materialProviders::operation::get_encryption_materials::GetEncryptionMaterialsOutput, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building GetEncryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.commitment_policy.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "commitment_policy", - "commitment_policy was not specified but it is required when building GetEncryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_for_CryptographicMaterialsManager_GetEncryptionMaterials(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; cryptographic_materials_manager.inner.borrow_mut().get_encryption_materials(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_decryption_materials.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_decryption_materials.rs index ce56dad8a..da98d1283 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_decryption_materials.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_decryption_materials.rs @@ -18,24 +18,8 @@ impl InitializeDecryptionMaterials { crate::deps::aws_cryptography_materialProviders::operation::initialize_decryption_materials::DecryptionMaterials, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm_suite_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm_suite_id", - "algorithm_suite_id was not specified but it is required when building InitializeDecryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building InitializeDecryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.required_encryption_context_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "required_encryption_context_keys", - "required_encryption_context_keys was not specified but it is required when building InitializeDecryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_for_AwsCryptographicMaterialProviders_InitializeDecryptionMaterials(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::initialize_decryption_materials::_initialize_decryption_materials_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).InitializeDecryptionMaterials(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_encryption_materials.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_encryption_materials.rs index bbccb29e6..705c857d7 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_encryption_materials.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/initialize_encryption_materials.rs @@ -18,24 +18,8 @@ impl InitializeEncryptionMaterials { crate::deps::aws_cryptography_materialProviders::operation::initialize_encryption_materials::EncryptionMaterials, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm_suite_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm_suite_id", - "algorithm_suite_id was not specified but it is required when building InitializeEncryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encryption_context.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encryption_context", - "encryption_context was not specified but it is required when building InitializeEncryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.required_encryption_context_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "required_encryption_context_keys", - "required_encryption_context_keys was not specified but it is required when building InitializeEncryptionMaterialsInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_for_AwsCryptographicMaterialProviders_InitializeEncryptionMaterials(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::initialize_encryption_materials::_initialize_encryption_materials_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).InitializeEncryptionMaterials(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_decrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_decrypt.rs index d6c9ef2a6..3b8aae79b 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_decrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_decrypt.rs @@ -18,18 +18,8 @@ impl OnDecrypt { crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::OnDecryptOutput, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.materials.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "materials", - "materials was not specified but it is required when building OnDecryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encrypted_data_keys.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encrypted_data_keys", - "encrypted_data_keys was not specified but it is required when building OnDecryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_for_Keyring_OnDecrypt(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; keyring.inner.borrow_mut().on_decrypt(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_encrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_encrypt.rs index b37df09c0..1fc3ca3d1 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_encrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/on_encrypt.rs @@ -18,12 +18,8 @@ impl OnEncrypt { crate::deps::aws_cryptography_materialProviders::operation::on_encrypt::OnEncryptOutput, crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.materials.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "materials", - "materials was not specified but it is required when building OnEncryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HOnEncryptInput_for_Keyring_OnEncrypt(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; keyring.inner.borrow_mut().on_encrypt(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/put_cache_entry.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/put_cache_entry.rs index c498f6ff9..5fd0c7884 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/put_cache_entry.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/put_cache_entry.rs @@ -18,54 +18,8 @@ impl PutCacheEntry { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "identifier", - "identifier was not specified but it is required when building PutCacheEntryInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.materials.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "materials", - "materials was not specified but it is required when building PutCacheEntryInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.creation_time.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "creation_time", - "creation_time was not specified but it is required when building PutCacheEntryInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if matches!(input.creation_time, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "creation_time", - "creation_time failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.expiry_time.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "expiry_time", - "expiry_time was not specified but it is required when building PutCacheEntryInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if matches!(input.expiry_time, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "expiry_time", - "expiry_time failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if matches!(input.messages_used, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "messages_used", - "messages_used failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if matches!(input.bytes_used, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "bytes_used", - "bytes_used failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_for_CryptographicMaterialsCache_PutCacheEntry(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; cryptographic_materials_cache.inner.borrow_mut().put_cache_entry(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/update_usage_metadata.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/update_usage_metadata.rs index f68be1150..1c1d2a9d2 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/update_usage_metadata.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/update_usage_metadata.rs @@ -18,24 +18,8 @@ impl UpdateUsageMetadata { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.identifier.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "identifier", - "identifier was not specified but it is required when building UpdateUsageMetadataInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.bytes_used.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "bytes_used", - "bytes_used was not specified but it is required when building UpdateUsageMetadataInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if matches!(input.bytes_used, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "bytes_used", - "bytes_used failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_for_CryptographicMaterialsCache_UpdateUsageMetadata(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; cryptographic_materials_cache.inner.borrow_mut().update_usage_metadata(input) } } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_algorithm_suite_info.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_algorithm_suite_info.rs index 2e5c12e0b..340afc10a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_algorithm_suite_info.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_algorithm_suite_info.rs @@ -18,60 +18,8 @@ impl ValidAlgorithmSuiteInfo { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "id", - "id was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.binary_id.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "binary_id", - "binary_id was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.message_version.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "message_version", - "message_version was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.encrypt.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "encrypt", - "encrypt was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.kdf.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "kdf", - "kdf was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.commitment.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "commitment", - "commitment was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.signature.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "signature", - "signature was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.symmetric_signature.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "symmetric_signature", - "symmetric_signature was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.edk_wrapping.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "edk_wrapping", - "edk_wrapping was not specified but it is required when building AlgorithmSuiteInfo", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_for_AwsCryptographicMaterialProviders_ValidAlgorithmSuiteInfo(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::valid_algorithm_suite_info::_valid_algorithm_suite_info_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ValidAlgorithmSuiteInfo(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_decryption_materials_transition.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_decryption_materials_transition.rs index da9636ef9..8e538e1c5 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_decryption_materials_transition.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_decryption_materials_transition.rs @@ -18,18 +18,8 @@ impl ValidDecryptionMaterialsTransition { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.start.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "start", - "start was not specified but it is required when building ValidDecryptionMaterialsTransitionInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.stop.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "stop", - "stop was not specified but it is required when building ValidDecryptionMaterialsTransitionInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_for_AwsCryptographicMaterialProviders_ValidDecryptionMaterialsTransition(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::valid_decryption_materials_transition::_valid_decryption_materials_transition_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ValidDecryptionMaterialsTransition(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_encryption_materials_transition.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_encryption_materials_transition.rs index f78743cd2..ef480966a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_encryption_materials_transition.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/valid_encryption_materials_transition.rs @@ -18,18 +18,8 @@ impl ValidEncryptionMaterialsTransition { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.start.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "start", - "start was not specified but it is required when building ValidEncryptionMaterialsTransitionInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.stop.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "stop", - "stop was not specified but it is required when building ValidEncryptionMaterialsTransitionInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_for_AwsCryptographicMaterialProviders_ValidEncryptionMaterialsTransition(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::valid_encryption_materials_transition::_valid_encryption_materials_transition_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ValidEncryptionMaterialsTransition(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_decrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_decrypt.rs index 581c27351..e1214fc9f 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_decrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_decrypt.rs @@ -18,18 +18,8 @@ impl ValidateCommitmentPolicyOnDecrypt { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm", - "algorithm was not specified but it is required when building ValidateCommitmentPolicyOnDecryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.commitment_policy.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "commitment_policy", - "commitment_policy was not specified but it is required when building ValidateCommitmentPolicyOnDecryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_for_AwsCryptographicMaterialProviders_ValidateCommitmentPolicyOnDecrypt(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::validate_commitment_policy_on_decrypt::_validate_commitment_policy_on_decrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ValidateCommitmentPolicyOnDecrypt(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_encrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_encrypt.rs index 8ec0fe938..f96d93c81 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_encrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/validate_commitment_policy_on_encrypt.rs @@ -18,18 +18,8 @@ impl ValidateCommitmentPolicyOnEncrypt { (), crate::deps::aws_cryptography_materialProviders::types::error::Error, > { - if input.algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "algorithm", - "algorithm was not specified but it is required when building ValidateCommitmentPolicyOnEncryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} -if input.commitment_policy.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "commitment_policy", - "commitment_policy was not specified but it is required when building ValidateCommitmentPolicyOnEncryptInput", - )).map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_materialProviders::validation::validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_for_AwsCryptographicMaterialProviders_ValidateCommitmentPolicyOnEncrypt(&input) + .map_err(crate::deps::aws_cryptography_materialProviders::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_materialProviders::conversions::validate_commitment_policy_on_encrypt::_validate_commitment_policy_on_encrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ValidateCommitmentPolicyOnEncrypt(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types.rs index 7b1a18979..682c72231 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types.rs @@ -3,6 +3,7 @@ // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. /// Types for the `MaterialProvidersConfig` pub mod material_providers_config; +pub use crate::deps::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig; pub mod builders; diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/validation.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/validation.rs new file mode 100644 index 000000000..4283dc575 --- /dev/null +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/validation.rs @@ -0,0 +1,4537 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials(input: &crate::deps::aws_cryptography_keyStore::types::BeaconKeyMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKeyIdentifier(&input.beacon_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKey(&input.beacon_key)?; +validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DhmacKeys(&input.hmac_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DbeaconKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "beacon_key_identifier", + "beacon_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials_DhmacKeys(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HHmacKeyMap(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials(input: &crate::deps::aws_cryptography_keyStore::types::BranchKeyMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyIdentifier(&input.branch_key_identifier)?; +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyVersion(&input.branch_key_version)?; +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKey(&input.branch_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key", + "branch_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_identifier", + "branch_key_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DbranchKeyVersion(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_version", + "branch_key_version is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HEncryptionContext(input: &::std::collections::HashMap<::std::string::String, ::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for (inner_key, inner_val) in input.iter() { + validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dkey(inner_key)?; + validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dvalue(inner_val)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dkey(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HEncryptionContext_Dvalue(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HHmacKeyMap(input: &::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for (inner_key, inner_val) in input.iter() { + validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dkey(inner_key)?; + validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dvalue(inner_val)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dkey(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PkeyStore_HHmacKeyMap_Dvalue(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAccountIdList(input: &::std::vec::Vec<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HAccountIdList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAccountIdList_Dmember(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input: &crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteId) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteId::Esdk(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId_DESDK(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteId::Dbe(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId_DDBE(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId_DDBE(input: &crate::deps::aws_cryptography_materialProviders::types::DbeAlgorithmSuiteId) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId_DESDK(input: &crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo(input: &crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteInfo) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Did(&input.id)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DbinaryId(&input.binary_id)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DmessageVersion(&input.message_version)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dencrypt(&input.encrypt)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dkdf(&input.kdf)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dcommitment(&input.commitment)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dsignature(&input.signature)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DsymmetricSignature(&input.symmetric_signature)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DedkWrapping(&input.edk_wrapping)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_for_AwsCryptographicMaterialProviders_ValidAlgorithmSuiteInfo(input: &crate::deps::aws_cryptography_materialProviders::operation::valid_algorithm_suite_info::AlgorithmSuiteInfo) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Did(&input.id)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DbinaryId(&input.binary_id)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DmessageVersion(&input.message_version)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dencrypt(&input.encrypt)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dkdf(&input.kdf)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dcommitment(&input.commitment)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dsignature(&input.signature)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DsymmetricSignature(&input.symmetric_signature)?; +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DedkWrapping(&input.edk_wrapping)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DbinaryId(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "binary_id", + "binary_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dcommitment(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "commitment", + "commitment is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DedkWrapping(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "edk_wrapping", + "edk_wrapping is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEdkWrappingAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dencrypt(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encrypt", + "encrypt is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncrypt(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Did(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "id", + "id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dkdf(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kdf", + "kdf is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DmessageVersion(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "message_version", + "message_version is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_Dsignature(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature", + "signature is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HSignatureAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo_DsymmetricSignature(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "symmetric_signature", + "symmetric_signature is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HSymmetricSignatureAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HBranchKeyIdSupplierReference(input: &crate::deps::aws_cryptography_materialProviders::types::branch_key_id_supplier::BranchKeyIdSupplierRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType(input: &crate::deps::aws_cryptography_materialProviders::types::CacheType) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::CacheType::Default(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCacheType_DDefault(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::CacheType::No(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCacheType_DNo(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::CacheType::SingleThreaded(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCacheType_DSingleThreaded(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::CacheType::MultiThreaded(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCacheType_DMultiThreaded(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::CacheType::StormTracking(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCacheType_DStormTracking(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::CacheType::Shared(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCacheType_DShared(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType_DDefault(input: &crate::deps::aws_cryptography_materialProviders::types::DefaultCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDefaultCache(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType_DMultiThreaded(input: &crate::deps::aws_cryptography_materialProviders::types::MultiThreadedCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HMultiThreadedCache(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType_DNo(input: &crate::deps::aws_cryptography_materialProviders::types::NoCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HNoCache(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType_DShared(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsCacheReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType_DSingleThreaded(input: &crate::deps::aws_cryptography_materialProviders::types::SingleThreadedCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HSingleThreadedCache(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCacheType_DStormTracking(input: &crate::deps::aws_cryptography_materialProviders::types::StormTrackingCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HClientSupplierReference(input: &crate::deps::aws_cryptography_materialProviders::types::client_supplier::ClientSupplierRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy(input: &crate::deps::aws_cryptography_materialProviders::types::CommitmentPolicy) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::CommitmentPolicy::Esdk(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy_DESDK(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::CommitmentPolicy::Dbe(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy_DDBE(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy_DDBE(input: &crate::deps::aws_cryptography_materialProviders::types::DbeCommitmentPolicy) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy_DESDK(input: &crate::deps::aws_cryptography_materialProviders::types::EsdkCommitmentPolicy) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsDiscoveryKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsDiscoveryKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_discovery_keyring::CreateAwsKmsDiscoveryKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DdiscoveryFilter(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryKeyringInput_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_client", + "kms_client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsDiscoveryMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_Dregions(&input.regions)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsDiscoveryMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_discovery_multi_keyring::CreateAwsKmsDiscoveryMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_Dregions(&input.regions)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DclientSupplier(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HClientSupplierReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DdiscoveryFilter(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsDiscoveryMultiKeyringInput_Dregions(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "regions", + "regions is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HRegionList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsEcdhKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DKeyAgreementScheme(&input.key_agreement_scheme)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DcurveSpec(&input.curve_spec)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsEcdhKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_ecdh_keyring::CreateAwsKmsEcdhKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DKeyAgreementScheme(&input.key_agreement_scheme)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DcurveSpec(&input.curve_spec)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DcurveSpec(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "curve_spec", + "curve_spec is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DKeyAgreementScheme(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_agreement_scheme", + "key_agreement_scheme is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsEcdhStaticConfigurations(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsEcdhKeyringInput_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_client", + "kms_client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsHierarchicalKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DbranchKeyId(&input.branch_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DbranchKeyIdSupplier(&input.branch_key_id_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DkeyStore(&input.key_store)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DttlSeconds(&input.ttl_seconds)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_Dcache(&input.cache)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DpartitionId(&input.partition_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsHierarchicalKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_hierarchical_keyring::CreateAwsKmsHierarchicalKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DbranchKeyId(&input.branch_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DbranchKeyIdSupplier(&input.branch_key_id_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DkeyStore(&input.key_store)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DttlSeconds(&input.ttl_seconds)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_Dcache(&input.cache)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DpartitionId(&input.partition_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DbranchKeyId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DbranchKeyIdSupplier(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HBranchKeyIdSupplierReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_Dcache(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCacheType(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DkeyStore(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_store", + "key_store is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyStoreReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DpartitionId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsHierarchicalKeyringInput_DttlSeconds(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ttl_seconds", + "ttl_seconds is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "ttl_seconds", + "ttl_seconds failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DkmsKeyId(&input.kms_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_keyring::CreateAwsKmsKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DkmsKeyId(&input.kms_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_client", + "kms_client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsKeyringInput_DkmsKeyId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_key_id", + "kms_key_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsMrkDiscoveryKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DgrantTokens(&input.grant_tokens)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_Dregion(&input.region)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkDiscoveryKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_mrk_discovery_keyring::CreateAwsKmsMrkDiscoveryKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DgrantTokens(&input.grant_tokens)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_Dregion(&input.region)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DdiscoveryFilter(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_client", + "kms_client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryKeyringInput_Dregion(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "region", + "region is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsMrkDiscoveryMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_Dregions(&input.regions)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkDiscoveryMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_mrk_discovery_multi_keyring::CreateAwsKmsMrkDiscoveryMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_Dregions(&input.regions)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DdiscoveryFilter(&input.discovery_filter)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DclientSupplier(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HClientSupplierReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DdiscoveryFilter(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkDiscoveryMultiKeyringInput_Dregions(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "regions", + "regions is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HRegionList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsMrkKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DkmsKeyId(&input.kms_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_mrk_keyring::CreateAwsKmsMrkKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DkmsKeyId(&input.kms_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_client", + "kms_client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkKeyringInput_DkmsKeyId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_key_id", + "kms_key_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsMrkMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_Dgenerator(&input.generator)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DkmsKeyIds(&input.kms_key_ids)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_mrk_multi_keyring::CreateAwsKmsMrkMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_Dgenerator(&input.generator)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DkmsKeyIds(&input.kms_key_ids)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DclientSupplier(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HClientSupplierReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_Dgenerator(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMrkMultiKeyringInput_DkmsKeyIds(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsKeyIdList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_Dgenerator(&input.generator)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DkmsKeyIds(&input.kms_key_ids)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_multi_keyring::CreateAwsKmsMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_Dgenerator(&input.generator)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DkmsKeyIds(&input.kms_key_ids)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DclientSupplier(&input.client_supplier)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DclientSupplier(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HClientSupplierReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_Dgenerator(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsMultiKeyringInput_DkmsKeyIds(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsKeyIdList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateAwsKmsRsaKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DkmsKeyId(&input.kms_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DencryptionAlgorithm(&input.encryption_algorithm)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_for_AwsCryptographicMaterialProviders_CreateAwsKmsRsaKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_aws_kms_rsa_keyring::CreateAwsKmsRsaKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DkmsKeyId(&input.kms_key_id)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DencryptionAlgorithm(&input.encryption_algorithm)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DkmsClient(&input.kms_client)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DgrantTokens(&input.grant_tokens)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DencryptionAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_algorithm", + "encryption_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DgrantTokens(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DkmsClient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DkmsKeyId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "kms_key_id", + "kms_key_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateAwsKmsRsaKeyringInput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateCryptographicMaterialsCacheInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheInput_Dcache(&input.cache)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheInput_for_AwsCryptographicMaterialProviders_CreateCryptographicMaterialsCache(input: &crate::deps::aws_cryptography_materialProviders::operation::create_cryptographic_materials_cache::CreateCryptographicMaterialsCacheInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheInput_Dcache(&input.cache)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheInput_Dcache(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "cache", + "cache is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCacheType(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheOutput(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheOutput_DmaterialsCache(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheOutput_for_AwsCryptographicMaterialProviders_CreateCryptographicMaterialsCache(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheOutput_DmaterialsCache(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsCacheOutput_DmaterialsCache(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials_cache", + "materials_cache is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsCacheReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsManagerOutput(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsManagerOutput_DmaterialsManager(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsManagerOutput_for_AwsCryptographicMaterialProviders_CreateDefaultCryptographicMaterialsManager(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsManagerOutput_DmaterialsManager(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateCryptographicMaterialsManagerOutput_DmaterialsManager(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials_manager", + "materials_manager is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateDefaultClientSupplierInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierInput_for_AwsCryptographicMaterialProviders_CreateDefaultClientSupplier(input: &crate::deps::aws_cryptography_materialProviders::operation::create_default_client_supplier::CreateDefaultClientSupplierInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierOutput(input: &crate::deps::aws_cryptography_materialProviders::types::client_supplier::ClientSupplierRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierOutput_Dclient(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierOutput_for_AwsCryptographicMaterialProviders_CreateDefaultClientSupplier(input: &crate::deps::aws_cryptography_materialProviders::types::client_supplier::ClientSupplierRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierOutput_Dclient(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultClientSupplierOutput_Dclient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "client", + "client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HClientSupplierReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultCryptographicMaterialsManagerInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateDefaultCryptographicMaterialsManagerInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultCryptographicMaterialsManagerInput_Dkeyring(&input.keyring)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultCryptographicMaterialsManagerInput_for_AwsCryptographicMaterialProviders_CreateDefaultCryptographicMaterialsManager(input: &crate::deps::aws_cryptography_materialProviders::operation::create_default_cryptographic_materials_manager::CreateDefaultCryptographicMaterialsManagerInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultCryptographicMaterialsManagerInput_Dkeyring(&input.keyring)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateDefaultCryptographicMaterialsManagerInput_Dkeyring(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "keyring", + "keyring is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsHierarchicalKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateRawAesKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkDiscoveryKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateRawRsaKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateRawEcdhKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsDiscoveryMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMrkDiscoveryMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsDiscoveryKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsRsaKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_for_AwsCryptographicMaterialProviders_CreateAwsKmsEcdhKeyring(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateKeyringOutput_Dkeyring(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "keyring", + "keyring is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_Dgenerator(&input.generator)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_DchildKeyrings(&input.child_keyrings)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_for_AwsCryptographicMaterialProviders_CreateMultiKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_multi_keyring::CreateMultiKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_Dgenerator(&input.generator)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_DchildKeyrings(&input.child_keyrings)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_DchildKeyrings(input: &::std::option::Option<::std::vec::Vec>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "child_keyrings", + "child_keyrings is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateMultiKeyringInput_Dgenerator(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateRawAesKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DkeyNamespace(&input.key_namespace)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DkeyName(&input.key_name)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DwrappingKey(&input.wrapping_key)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DwrappingAlg(&input.wrapping_alg)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_for_AwsCryptographicMaterialProviders_CreateRawAesKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_raw_aes_keyring::CreateRawAesKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DkeyNamespace(&input.key_namespace)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DkeyName(&input.key_name)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DwrappingKey(&input.wrapping_key)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DwrappingAlg(&input.wrapping_alg)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DkeyName(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_name", + "key_name is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DkeyNamespace(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_namespace", + "key_namespace is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DwrappingAlg(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "wrapping_alg", + "wrapping_alg is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawAesKeyringInput_DwrappingKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "wrapping_key", + "wrapping_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateRawEcdhKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_DKeyAgreementScheme(&input.key_agreement_scheme)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_DcurveSpec(&input.curve_spec)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_for_AwsCryptographicMaterialProviders_CreateRawEcdhKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_raw_ecdh_keyring::CreateRawEcdhKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_DKeyAgreementScheme(&input.key_agreement_scheme)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_DcurveSpec(&input.curve_spec)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_DcurveSpec(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "curve_spec", + "curve_spec is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawEcdhKeyringInput_DKeyAgreementScheme(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_agreement_scheme", + "key_agreement_scheme is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateRawRsaKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DkeyNamespace(&input.key_namespace)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DkeyName(&input.key_name)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DpaddingScheme(&input.padding_scheme)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DprivateKey(&input.private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_for_AwsCryptographicMaterialProviders_CreateRawRsaKeyring(input: &crate::deps::aws_cryptography_materialProviders::operation::create_raw_rsa_keyring::CreateRawRsaKeyringInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DkeyNamespace(&input.key_namespace)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DkeyName(&input.key_name)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DpaddingScheme(&input.padding_scheme)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DprivateKey(&input.private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DkeyName(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_name", + "key_name is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DkeyNamespace(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_namespace", + "key_namespace is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DpaddingScheme(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "padding_scheme", + "padding_scheme is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DprivateKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRawRsaKeyringInput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput(input: &crate::deps::aws_cryptography_materialProviders::types::CreateRequiredEncryptionContextCmmInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_DunderlyingCMM(&input.underlying_cmm)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_Dkeyring(&input.keyring)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_for_AwsCryptographicMaterialProviders_CreateRequiredEncryptionContextCMM(input: &crate::deps::aws_cryptography_materialProviders::operation::create_required_encryption_context_cmm::CreateRequiredEncryptionContextCmmInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_DunderlyingCMM(&input.underlying_cmm)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_Dkeyring(&input.keyring)?; +validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_Dkeyring(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_DrequiredEncryptionContextKeys(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "required_encryption_context_keys", + "required_encryption_context_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMInput_DunderlyingCMM(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMOutput(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMOutput_DmaterialsManager(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMOutput_for_AwsCryptographicMaterialProviders_CreateRequiredEncryptionContextCMM(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMOutput_DmaterialsManager(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCreateRequiredEncryptionContextCMMOutput_DmaterialsManager(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials_manager", + "materials_manager is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsCacheReference(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_cache::CryptographicMaterialsCacheRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input: &crate::deps::aws_cryptography_materialProviders::types::DecryptionMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DalgorithmSuite(&input.algorithm_suite)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DplaintextDataKey(&input.plaintext_data_key)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DverificationKey(&input.verification_key)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DsymmetricSigningKey(&input.symmetric_signing_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_for_AwsCryptographicMaterialProviders_DecryptionMaterialsWithPlaintextDataKey(input: &crate::deps::aws_cryptography_materialProviders::operation::decryption_materials_with_plaintext_data_key::DecryptionMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DalgorithmSuite(&input.algorithm_suite)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DplaintextDataKey(&input.plaintext_data_key)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DverificationKey(&input.verification_key)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DsymmetricSigningKey(&input.symmetric_signing_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DalgorithmSuite(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite", + "algorithm_suite is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DplaintextDataKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DrequiredEncryptionContextKeys(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "required_encryption_context_keys", + "required_encryption_context_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DsymmetricSigningKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials_DverificationKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput(input: &crate::deps::aws_cryptography_materialProviders::types::DecryptMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DcommitmentPolicy(&input.commitment_policy)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DencryptedDataKeys(&input.encrypted_data_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DreproducedEncryptionContext(&input.reproduced_encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_for_CryptographicMaterialsManager_DecryptMaterials(input: &crate::deps::aws_cryptography_materialProviders::operation::decrypt_materials::DecryptMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DcommitmentPolicy(&input.commitment_policy)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DencryptedDataKeys(&input.encrypted_data_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DreproducedEncryptionContext(&input.reproduced_encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite_id", + "algorithm_suite_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DcommitmentPolicy(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "commitment_policy", + "commitment_policy is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DencryptedDataKeys(input: &::std::option::Option<::std::vec::Vec>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encrypted_data_keys", + "encrypted_data_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKeyList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsInput_DreproducedEncryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsOutput(input: &crate::deps::aws_cryptography_materialProviders::types::DecryptMaterialsOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsOutput_DdecryptionMaterials(&input.decryption_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsOutput_for_CryptographicMaterialsManager_DecryptMaterials(input: &crate::deps::aws_cryptography_materialProviders::operation::decrypt_materials::DecryptMaterialsOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsOutput_DdecryptionMaterials(&input.decryption_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDecryptMaterialsOutput_DdecryptionMaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "decryption_materials", + "decryption_materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDefaultCache(input: &crate::deps::aws_cryptography_materialProviders::types::DefaultCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDefaultCache_DentryCapacity(&input.entry_capacity)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDefaultCache_DentryCapacity(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "entry_capacity", + "entry_capacity is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_capacity", + "entry_capacity failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDeleteCacheEntryInput(input: &crate::deps::aws_cryptography_materialProviders::types::DeleteCacheEntryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDeleteCacheEntryInput_Didentifier(&input.identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDeleteCacheEntryInput_for_CryptographicMaterialsCache_DeleteCacheEntry(input: &crate::deps::aws_cryptography_materialProviders::operation::delete_cache_entry::DeleteCacheEntryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDeleteCacheEntryInput_Didentifier(&input.identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDeleteCacheEntryInput_Didentifier(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "identifier", + "identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm(input: &crate::deps::aws_cryptography_materialProviders::types::DerivationAlgorithm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::DerivationAlgorithm::Hkdf(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm_DHKDF(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::DerivationAlgorithm::Identity(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm_DIDENTITY(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::DerivationAlgorithm::None(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm_DNone(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm_DHKDF(input: &crate::deps::aws_cryptography_materialProviders::types::Hkdf) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HHKDF(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm_DIDENTITY(input: &crate::deps::aws_cryptography_materialProviders::types::Identity) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HIDENTITY(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm_DNone(input: &crate::deps::aws_cryptography_materialProviders::types::None) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HNone(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDIRECT__KEY__WRAPPING(input: &crate::deps::aws_cryptography_materialProviders::types::DirectKeyWrapping) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter(input: &crate::deps::aws_cryptography_materialProviders::types::DiscoveryFilter) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter_DaccountIds(&input.account_ids)?; +validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter_Dpartition(&input.partition)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter_DaccountIds(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "account_ids", + "account_ids is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAccountIdList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HDiscoveryFilter_Dpartition(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "partition", + "partition is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HECDSA(input: &crate::deps::aws_cryptography_materialProviders::types::Ecdsa) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HECDSA_Dcurve(&input.curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HECDSA_Dcurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "curve", + "curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEdkWrappingAlgorithm(input: &crate::deps::aws_cryptography_materialProviders::types::EdkWrappingAlgorithm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::EdkWrappingAlgorithm::DirectKeyWrapping(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HEdkWrappingAlgorithm_DDIRECT__KEY__WRAPPING(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::EdkWrappingAlgorithm::IntermediateKeyWrapping(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HEdkWrappingAlgorithm_DIntermediateKeyWrapping(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEdkWrappingAlgorithm_DDIRECT__KEY__WRAPPING(input: &crate::deps::aws_cryptography_materialProviders::types::DirectKeyWrapping) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDIRECT__KEY__WRAPPING(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEdkWrappingAlgorithm_DIntermediateKeyWrapping(input: &crate::deps::aws_cryptography_materialProviders::types::IntermediateKeyWrapping) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncrypt(input: &crate::deps::aws_cryptography_materialProviders::types::Encrypt) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::Encrypt::AesGcm(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HEncrypt_DAES__GCM(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncrypt_DAES__GCM(input: &crate::deps::aws_cryptography_primitives::types::AesGcm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAES__GCM(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey(input: &crate::deps::aws_cryptography_materialProviders::types::EncryptedDataKey) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey_DkeyProviderId(&input.key_provider_id)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey_DkeyProviderInfo(&input.key_provider_info)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey_Dciphertext(&input.ciphertext)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey_Dciphertext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ciphertext", + "ciphertext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey_DkeyProviderId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_provider_id", + "key_provider_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey_DkeyProviderInfo(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_provider_info", + "key_provider_info is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKeyList(input: &::std::vec::Vec) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKeyList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKeyList_Dmember(input: &crate::deps::aws_cryptography_materialProviders::types::EncryptedDataKey) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input: &::std::collections::HashMap<::std::string::String, ::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for (inner_key, inner_val) in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dkey(inner_key)?; + validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dvalue(inner_val)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dkey(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dvalue(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input: &::std::vec::Vec<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys_Dmember(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input: &crate::deps::aws_cryptography_materialProviders::types::EncryptionMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DalgorithmSuite(&input.algorithm_suite)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DencryptedDataKeys(&input.encrypted_data_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DplaintextDataKey(&input.plaintext_data_key)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DsigningKey(&input.signing_key)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DsymmetricSigningKeys(&input.symmetric_signing_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_for_AwsCryptographicMaterialProviders_EncryptionMaterialsHasPlaintextDataKey(input: &crate::deps::aws_cryptography_materialProviders::operation::encryption_materials_has_plaintext_data_key::EncryptionMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DalgorithmSuite(&input.algorithm_suite)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DencryptedDataKeys(&input.encrypted_data_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DplaintextDataKey(&input.plaintext_data_key)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DsigningKey(&input.signing_key)?; +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DsymmetricSigningKeys(&input.symmetric_signing_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DalgorithmSuite(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite", + "algorithm_suite is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteInfo(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DencryptedDataKeys(input: &::std::option::Option<::std::vec::Vec>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encrypted_data_keys", + "encrypted_data_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKeyList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DplaintextDataKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DrequiredEncryptionContextKeys(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "required_encryption_context_keys", + "required_encryption_context_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DsigningKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials_DsymmetricSigningKeys(input: &::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HSymmetricSigningKeyList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEphemeralPrivateKeyToStaticPublicKeyInput(input: &crate::deps::aws_cryptography_materialProviders::types::EphemeralPrivateKeyToStaticPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEphemeralPrivateKeyToStaticPublicKeyInput_DrecipientPublicKey(&input.recipient_public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEphemeralPrivateKeyToStaticPublicKeyInput_DrecipientPublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recipient_public_key", + "recipient_public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetAlgorithmSuiteInfoInput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetAlgorithmSuiteInfoInput_DbinaryId(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetAlgorithmSuiteInfoInput_for_AwsCryptographicMaterialProviders_GetAlgorithmSuiteInfo(input: &crate::deps::aws_cryptography_materialProviders::operation::get_algorithm_suite_info::GetAlgorithmSuiteInfoInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetAlgorithmSuiteInfoInput_DbinaryId(&input.binary_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetAlgorithmSuiteInfoInput_DbinaryId(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "binary_id", + "binary_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdInput(input: &crate::deps::aws_cryptography_materialProviders::types::GetBranchKeyIdInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdInput_DencryptionContext(&input.encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdInput_for_BranchKeyIdSupplier_GetBranchKeyId(input: &crate::deps::aws_cryptography_materialProviders::operation::get_branch_key_id::GetBranchKeyIdInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdInput_DencryptionContext(&input.encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdOutput(input: &crate::deps::aws_cryptography_materialProviders::types::GetBranchKeyIdOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdOutput_DbranchKeyId(&input.branch_key_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdOutput_for_BranchKeyIdSupplier_GetBranchKeyId(input: &crate::deps::aws_cryptography_materialProviders::operation::get_branch_key_id::GetBranchKeyIdOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdOutput_DbranchKeyId(&input.branch_key_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetBranchKeyIdOutput_DbranchKeyId(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "branch_key_id", + "branch_key_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput(input: &crate::deps::aws_cryptography_materialProviders::types::GetCacheEntryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_Didentifier(&input.identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_for_CryptographicMaterialsCache_GetCacheEntry(input: &crate::deps::aws_cryptography_materialProviders::operation::get_cache_entry::GetCacheEntryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_Didentifier(&input.identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_DbytesUsed(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryInput_Didentifier(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "identifier", + "identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput(input: &crate::deps::aws_cryptography_materialProviders::types::GetCacheEntryOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_Dmaterials(&input.materials)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DcreationTime(&input.creation_time)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DexpiryTime(&input.expiry_time)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DmessagesUsed(&input.messages_used)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_for_CryptographicMaterialsCache_GetCacheEntry(input: &crate::deps::aws_cryptography_materialProviders::operation::get_cache_entry::GetCacheEntryOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_Dmaterials(&input.materials)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DcreationTime(&input.creation_time)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DexpiryTime(&input.expiry_time)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DmessagesUsed(&input.messages_used)?; +validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DbytesUsed(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "bytes_used", + "bytes_used is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "bytes_used", + "bytes_used failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DcreationTime(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "creation_time", + "creation_time is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "creation_time", + "creation_time failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DexpiryTime(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "expiry_time", + "expiry_time is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "expiry_time", + "expiry_time failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_Dmaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials", + "materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetCacheEntryOutput_DmessagesUsed(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "messages_used", + "messages_used is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "messages_used", + "messages_used failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetClientInput(input: &crate::deps::aws_cryptography_materialProviders::types::GetClientInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetClientInput_Dregion(&input.region)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetClientInput_for_ClientSupplier_GetClient(input: &crate::deps::aws_cryptography_materialProviders::operation::get_client::GetClientInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetClientInput_Dregion(&input.region)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetClientInput_Dregion(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "region", + "region is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetClientOutput(input: &crate::deps::com_amazonaws_kms::client::Client) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetClientOutput_Dclient(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetClientOutput_for_ClientSupplier_GetClient(input: &crate::deps::com_amazonaws_kms::client::Client) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetClientOutput_Dclient(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetClientOutput_Dclient(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "client", + "client is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput(input: &crate::deps::aws_cryptography_materialProviders::types::GetEncryptionMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DcommitmentPolicy(&input.commitment_policy)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DmaxPlaintextLength(&input.max_plaintext_length)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_for_CryptographicMaterialsManager_GetEncryptionMaterials(input: &crate::deps::aws_cryptography_materialProviders::operation::get_encryption_materials::GetEncryptionMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DcommitmentPolicy(&input.commitment_policy)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DmaxPlaintextLength(&input.max_plaintext_length)?; +validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DcommitmentPolicy(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "commitment_policy", + "commitment_policy is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DmaxPlaintextLength(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsInput_DrequiredEncryptionContextKeys(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsOutput(input: &crate::deps::aws_cryptography_materialProviders::types::GetEncryptionMaterialsOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsOutput_DencryptionMaterials(&input.encryption_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsOutput_for_CryptographicMaterialsManager_GetEncryptionMaterials(input: &crate::deps::aws_cryptography_materialProviders::operation::get_encryption_materials::GetEncryptionMaterialsOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsOutput_DencryptionMaterials(&input.encryption_materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGetEncryptionMaterialsOutput_DencryptionMaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_materials", + "encryption_materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList(input: &::std::vec::Vec<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HGrantTokenList_Dmember(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HHKDF(input: &crate::deps::aws_cryptography_materialProviders::types::Hkdf) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HHKDF_Dhmac(&input.hmac)?; +validate_aws_Pcryptography_PmaterialProviders_HHKDF_DsaltLength(&input.salt_length)?; +validate_aws_Pcryptography_PmaterialProviders_HHKDF_DinputKeyLength(&input.input_key_length)?; +validate_aws_Pcryptography_PmaterialProviders_HHKDF_DoutputKeyLength(&input.output_key_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HHKDF_Dhmac(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "hmac", + "hmac is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HHKDF_DinputKeyLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "input_key_length", + "input_key_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=32).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "input_key_length", + "input_key_length failed to satisfy constraint: Member must be between 1 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HHKDF_DoutputKeyLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "output_key_length", + "output_key_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=32).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "output_key_length", + "output_key_length failed to satisfy constraint: Member must be between 1 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HHKDF_DsaltLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "salt_length", + "salt_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "salt_length", + "salt_length failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HIDENTITY(input: &crate::deps::aws_cryptography_materialProviders::types::Identity) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput(input: &crate::deps::aws_cryptography_materialProviders::types::InitializeDecryptionMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_for_AwsCryptographicMaterialProviders_InitializeDecryptionMaterials(input: &crate::deps::aws_cryptography_materialProviders::operation::initialize_decryption_materials::InitializeDecryptionMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite_id", + "algorithm_suite_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeDecryptionMaterialsInput_DrequiredEncryptionContextKeys(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "required_encryption_context_keys", + "required_encryption_context_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput(input: &crate::deps::aws_cryptography_materialProviders::types::InitializeEncryptionMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DsigningKey(&input.signing_key)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DverificationKey(&input.verification_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_for_AwsCryptographicMaterialProviders_InitializeEncryptionMaterials(input: &crate::deps::aws_cryptography_materialProviders::operation::initialize_encryption_materials::InitializeEncryptionMaterialsInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DrequiredEncryptionContextKeys(&input.required_encryption_context_keys)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DsigningKey(&input.signing_key)?; +validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DverificationKey(&input.verification_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite_id", + "algorithm_suite_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DrequiredEncryptionContextKeys(input: &::std::option::Option<::std::vec::Vec<::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "required_encryption_context_keys", + "required_encryption_context_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContextKeys(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DsigningKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HInitializeEncryptionMaterialsInput_DverificationKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping(input: &crate::deps::aws_cryptography_materialProviders::types::IntermediateKeyWrapping) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping_DkeyEncryptionKeyKdf(&input.key_encryption_key_kdf)?; +validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping_DmacKeyKdf(&input.mac_key_kdf)?; +validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping_DpdkEncryptAlgorithm(&input.pdk_encrypt_algorithm)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping_DkeyEncryptionKeyKdf(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_encryption_key_kdf", + "key_encryption_key_kdf is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping_DmacKeyKdf(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "mac_key_kdf", + "mac_key_kdf is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDerivationAlgorithm(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HIntermediateKeyWrapping_DpdkEncryptAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "pdk_encrypt_algorithm", + "pdk_encrypt_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncrypt(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKeyringList(input: &::std::vec::Vec) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HKeyringList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKeyringList_Dmember(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKeyStoreReference(input: &crate::deps::aws_cryptography_keyStore::client::Client) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsClientReference(input: &crate::deps::com_amazonaws_kms::client::Client) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsEcdhStaticConfigurations(input: &crate::deps::aws_cryptography_materialProviders::types::KmsEcdhStaticConfigurations) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HKmsEcdhStaticConfigurations_DKmsPublicKeyDiscovery(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::KmsEcdhStaticConfigurations::KmsPrivateKeyToStaticPublicKey(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HKmsEcdhStaticConfigurations_DKmsPrivateKeyToStaticPublicKey(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsEcdhStaticConfigurations_DKmsPrivateKeyToStaticPublicKey(input: &crate::deps::aws_cryptography_materialProviders::types::KmsPrivateKeyToStaticPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsEcdhStaticConfigurations_DKmsPublicKeyDiscovery(input: &crate::deps::aws_cryptography_materialProviders::types::KmsPublicKeyDiscoveryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HKmsPublicKeyDiscoveryInput(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsKeyIdList(input: &::std::vec::Vec<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HKmsKeyIdList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsKeyIdList_Dmember(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput(input: &crate::deps::aws_cryptography_materialProviders::types::KmsPrivateKeyToStaticPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput_DsenderKmsIdentifier(&input.sender_kms_identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput_DsenderPublicKey(&input.sender_public_key)?; +validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput_DrecipientPublicKey(&input.recipient_public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput_DrecipientPublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recipient_public_key", + "recipient_public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput_DsenderKmsIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "sender_kms_identifier", + "sender_kms_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsPrivateKeyToStaticPublicKeyInput_DsenderPublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsPublicKeyDiscoveryInput(input: &crate::deps::aws_cryptography_materialProviders::types::KmsPublicKeyDiscoveryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HKmsPublicKeyDiscoveryInput_DrecipientKmsIdentifier(&input.recipient_kms_identifier)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKmsPublicKeyDiscoveryInput_DrecipientKmsIdentifier(input: &::std::option::Option<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recipient_kms_identifier", + "recipient_kms_identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMaterialProvidersConfig(input: &crate::deps::aws_cryptography_materialProviders::types::material_providers_config::MaterialProvidersConfig) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMaterials(input: &crate::deps::aws_cryptography_materialProviders::types::Materials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::Materials::Encryption(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HMaterials_DEncryption(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::Materials::Decryption(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HMaterials_DDecryption(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::Materials::BranchKey(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HMaterials_DBranchKey(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::Materials::BeaconKey(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HMaterials_DBeaconKey(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMaterials_DBeaconKey(input: &crate::deps::aws_cryptography_keyStore::types::BeaconKeyMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HBeaconKeyMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMaterials_DBranchKey(input: &crate::deps::aws_cryptography_keyStore::types::BranchKeyMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PkeyStore_HBranchKeyMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMaterials_DDecryption(input: &crate::deps::aws_cryptography_materialProviders::types::DecryptionMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMaterials_DEncryption(input: &crate::deps::aws_cryptography_materialProviders::types::EncryptionMaterials) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMultiThreadedCache(input: &crate::deps::aws_cryptography_materialProviders::types::MultiThreadedCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HMultiThreadedCache_DentryCapacity(&input.entry_capacity)?; +validate_aws_Pcryptography_PmaterialProviders_HMultiThreadedCache_DentryPruningTailSize(&input.entry_pruning_tail_size)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMultiThreadedCache_DentryCapacity(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "entry_capacity", + "entry_capacity is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_capacity", + "entry_capacity failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HMultiThreadedCache_DentryPruningTailSize(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_pruning_tail_size", + "entry_pruning_tail_size failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HNoCache(input: &crate::deps::aws_cryptography_materialProviders::types::NoCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HNone(input: &crate::deps::aws_cryptography_materialProviders::types::None) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput(input: &crate::deps::aws_cryptography_materialProviders::types::OnDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_Dmaterials(&input.materials)?; +validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_DencryptedDataKeys(&input.encrypted_data_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_for_Keyring_OnDecrypt(input: &crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::OnDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_Dmaterials(&input.materials)?; +validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_DencryptedDataKeys(&input.encrypted_data_keys)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_DencryptedDataKeys(input: &::std::option::Option<::std::vec::Vec>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encrypted_data_keys", + "encrypted_data_keys is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptedDataKeyList(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptInput_Dmaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials", + "materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptOutput(input: &crate::deps::aws_cryptography_materialProviders::types::OnDecryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnDecryptOutput_Dmaterials(&input.materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptOutput_for_Keyring_OnDecrypt(input: &crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::OnDecryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnDecryptOutput_Dmaterials(&input.materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnDecryptOutput_Dmaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials", + "materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnEncryptInput(input: &crate::deps::aws_cryptography_materialProviders::types::OnEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnEncryptInput_Dmaterials(&input.materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnEncryptInput_for_Keyring_OnEncrypt(input: &crate::deps::aws_cryptography_materialProviders::operation::on_encrypt::OnEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnEncryptInput_Dmaterials(&input.materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnEncryptInput_Dmaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials", + "materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnEncryptOutput(input: &crate::deps::aws_cryptography_materialProviders::types::OnEncryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnEncryptOutput_Dmaterials(&input.materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnEncryptOutput_for_Keyring_OnEncrypt(input: &crate::deps::aws_cryptography_materialProviders::operation::on_encrypt::OnEncryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HOnEncryptOutput_Dmaterials(&input.materials)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HOnEncryptOutput_Dmaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials", + "materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPublicKeyDiscoveryInput(input: &crate::deps::aws_cryptography_materialProviders::types::PublicKeyDiscoveryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HPublicKeyDiscoveryInput_DrecipientStaticPrivateKey(&input.recipient_static_private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPublicKeyDiscoveryInput_DrecipientStaticPrivateKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recipient_static_private_key", + "recipient_static_private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput(input: &crate::deps::aws_cryptography_materialProviders::types::PutCacheEntryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_Didentifier(&input.identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_Dmaterials(&input.materials)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DcreationTime(&input.creation_time)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DexpiryTime(&input.expiry_time)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DmessagesUsed(&input.messages_used)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_for_CryptographicMaterialsCache_PutCacheEntry(input: &crate::deps::aws_cryptography_materialProviders::operation::put_cache_entry::PutCacheEntryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_Didentifier(&input.identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_Dmaterials(&input.materials)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DcreationTime(&input.creation_time)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DexpiryTime(&input.expiry_time)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DmessagesUsed(&input.messages_used)?; +validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DbytesUsed(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "bytes_used", + "bytes_used failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DcreationTime(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "creation_time", + "creation_time is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "creation_time", + "creation_time failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DexpiryTime(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "expiry_time", + "expiry_time is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "expiry_time", + "expiry_time failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_Didentifier(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "identifier", + "identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_Dmaterials(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "materials", + "materials is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HPutCacheEntryInput_DmessagesUsed(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "messages_used", + "messages_used failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations(input: &crate::deps::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations::PublicKeyDiscovery(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations_DPublicKeyDiscovery(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations_DRawPrivateKeyToStaticPublicKey(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations_DEphemeralPrivateKeyToStaticPublicKey(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations_DEphemeralPrivateKeyToStaticPublicKey(input: &crate::deps::aws_cryptography_materialProviders::types::EphemeralPrivateKeyToStaticPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HEphemeralPrivateKeyToStaticPublicKeyInput(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations_DPublicKeyDiscovery(input: &crate::deps::aws_cryptography_materialProviders::types::PublicKeyDiscoveryInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HPublicKeyDiscoveryInput(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawEcdhStaticConfigurations_DRawPrivateKeyToStaticPublicKey(input: &crate::deps::aws_cryptography_materialProviders::types::RawPrivateKeyToStaticPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HRawPrivateKeyToStaticPublicKeyInput(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawPrivateKeyToStaticPublicKeyInput(input: &crate::deps::aws_cryptography_materialProviders::types::RawPrivateKeyToStaticPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HRawPrivateKeyToStaticPublicKeyInput_DsenderStaticPrivateKey(&input.sender_static_private_key)?; +validate_aws_Pcryptography_PmaterialProviders_HRawPrivateKeyToStaticPublicKeyInput_DrecipientPublicKey(&input.recipient_public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawPrivateKeyToStaticPublicKeyInput_DrecipientPublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recipient_public_key", + "recipient_public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRawPrivateKeyToStaticPublicKeyInput_DsenderStaticPrivateKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "sender_static_private_key", + "sender_static_private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRegionList(input: &::std::vec::Vec<::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HRegionList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HRegionList_Dmember(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSignatureAlgorithm(input: &crate::deps::aws_cryptography_materialProviders::types::SignatureAlgorithm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::SignatureAlgorithm::Ecdsa(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HSignatureAlgorithm_DECDSA(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::SignatureAlgorithm::None(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HSignatureAlgorithm_DNone(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSignatureAlgorithm_DECDSA(input: &crate::deps::aws_cryptography_materialProviders::types::Ecdsa) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HECDSA(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSignatureAlgorithm_DNone(input: &crate::deps::aws_cryptography_materialProviders::types::None) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HNone(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSingleThreadedCache(input: &crate::deps::aws_cryptography_materialProviders::types::SingleThreadedCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HSingleThreadedCache_DentryCapacity(&input.entry_capacity)?; +validate_aws_Pcryptography_PmaterialProviders_HSingleThreadedCache_DentryPruningTailSize(&input.entry_pruning_tail_size)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSingleThreadedCache_DentryCapacity(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "entry_capacity", + "entry_capacity is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_capacity", + "entry_capacity failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSingleThreadedCache_DentryPruningTailSize(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_pruning_tail_size", + "entry_pruning_tail_size failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache(input: &crate::deps::aws_cryptography_materialProviders::types::StormTrackingCache) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DentryCapacity(&input.entry_capacity)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DentryPruningTailSize(&input.entry_pruning_tail_size)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DgracePeriod(&input.grace_period)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DgraceInterval(&input.grace_interval)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DfanOut(&input.fan_out)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DinFlightTTL(&input.in_flight_ttl)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DsleepMilli(&input.sleep_milli)?; +validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DtimeUnits(&input.time_units)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DentryCapacity(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "entry_capacity", + "entry_capacity is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_capacity", + "entry_capacity failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DentryPruningTailSize(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "entry_pruning_tail_size", + "entry_pruning_tail_size failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DfanOut(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "fan_out", + "fan_out is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "fan_out", + "fan_out failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DgraceInterval(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "grace_interval", + "grace_interval is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "grace_interval", + "grace_interval failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DgracePeriod(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "grace_period", + "grace_period is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "grace_period", + "grace_period failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DinFlightTTL(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "in_flight_ttl", + "in_flight_ttl is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "in_flight_ttl", + "in_flight_ttl failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DsleepMilli(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "sleep_milli", + "sleep_milli is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "sleep_milli", + "sleep_milli failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HStormTrackingCache_DtimeUnits(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSymmetricSignatureAlgorithm(input: &crate::deps::aws_cryptography_materialProviders::types::SymmetricSignatureAlgorithm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if let crate::deps::aws_cryptography_materialProviders::types::SymmetricSignatureAlgorithm::Hmac(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HSymmetricSignatureAlgorithm_DHMAC(inner)?; +} +if let crate::deps::aws_cryptography_materialProviders::types::SymmetricSignatureAlgorithm::None(ref inner) = &input { + validate_aws_Pcryptography_PmaterialProviders_HSymmetricSignatureAlgorithm_DNone(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSymmetricSignatureAlgorithm_DHMAC(input: &crate::deps::aws_cryptography_primitives::types::DigestAlgorithm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSymmetricSignatureAlgorithm_DNone(input: &crate::deps::aws_cryptography_materialProviders::types::None) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HNone(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSymmetricSigningKeyList(input: &::std::vec::Vec<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for inner in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HSymmetricSigningKeyList_Dmember(inner)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HSymmetricSigningKeyList_Dmember(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput(input: &crate::deps::aws_cryptography_materialProviders::types::UpdateUsageMetadataInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_Didentifier(&input.identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_for_CryptographicMaterialsCache_UpdateUsageMetadata(input: &crate::deps::aws_cryptography_materialProviders::operation::update_usage_metadata::UpdateUsageMetadataInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_Didentifier(&input.identifier)?; +validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_DbytesUsed(&input.bytes_used)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_DbytesUsed(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "bytes_used", + "bytes_used is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "bytes_used", + "bytes_used failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HUpdateUsageMetadataInput_Didentifier(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "identifier", + "identifier is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput(input: &crate::deps::aws_cryptography_materialProviders::types::ValidateCommitmentPolicyOnDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_Dalgorithm(&input.algorithm)?; +validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_DcommitmentPolicy(&input.commitment_policy)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_for_AwsCryptographicMaterialProviders_ValidateCommitmentPolicyOnDecrypt(input: &crate::deps::aws_cryptography_materialProviders::operation::validate_commitment_policy_on_decrypt::ValidateCommitmentPolicyOnDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_Dalgorithm(&input.algorithm)?; +validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_DcommitmentPolicy(&input.commitment_policy)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_Dalgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm", + "algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnDecryptInput_DcommitmentPolicy(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "commitment_policy", + "commitment_policy is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput(input: &crate::deps::aws_cryptography_materialProviders::types::ValidateCommitmentPolicyOnEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_Dalgorithm(&input.algorithm)?; +validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_DcommitmentPolicy(&input.commitment_policy)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_for_AwsCryptographicMaterialProviders_ValidateCommitmentPolicyOnEncrypt(input: &crate::deps::aws_cryptography_materialProviders::operation::validate_commitment_policy_on_encrypt::ValidateCommitmentPolicyOnEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_Dalgorithm(&input.algorithm)?; +validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_DcommitmentPolicy(&input.commitment_policy)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_Dalgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm", + "algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HAlgorithmSuiteId(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidateCommitmentPolicyOnEncryptInput_DcommitmentPolicy(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "commitment_policy", + "commitment_policy is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCommitmentPolicy(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput(input: &crate::deps::aws_cryptography_materialProviders::types::ValidDecryptionMaterialsTransitionInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_Dstart(&input.start)?; +validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_Dstop(&input.stop)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_for_AwsCryptographicMaterialProviders_ValidDecryptionMaterialsTransition(input: &crate::deps::aws_cryptography_materialProviders::operation::valid_decryption_materials_transition::ValidDecryptionMaterialsTransitionInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_Dstart(&input.start)?; +validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_Dstop(&input.stop)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_Dstart(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "start", + "start is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidDecryptionMaterialsTransitionInput_Dstop(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "stop", + "stop is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HDecryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput(input: &crate::deps::aws_cryptography_materialProviders::types::ValidEncryptionMaterialsTransitionInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_Dstart(&input.start)?; +validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_Dstop(&input.stop)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_for_AwsCryptographicMaterialProviders_ValidEncryptionMaterialsTransition(input: &crate::deps::aws_cryptography_materialProviders::operation::valid_encryption_materials_transition::ValidEncryptionMaterialsTransitionInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_Dstart(&input.start)?; +validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_Dstop(&input.stop)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_Dstart(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "start", + "start is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HValidEncryptionMaterialsTransitionInput_Dstop(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "stop", + "stop is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionMaterials(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM(input: &crate::deps::aws_cryptography_primitives::types::AesGcm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAES__GCM_DkeyLength(&input.key_length)?; +validate_aws_Pcryptography_Pprimitives_HAES__GCM_DtagLength(&input.tag_length)?; +validate_aws_Pcryptography_Pprimitives_HAES__GCM_DivLength(&input.iv_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM_DivLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "iv_length", + "iv_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..=255).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "iv_length", + "iv_length failed to satisfy constraint: Member must be between 0 and 255, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM_DkeyLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_length", + "key_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=32).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "key_length", + "key_length failed to satisfy constraint: Member must be between 1 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM_DtagLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "tag_length", + "tag_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..=32).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "tag_length", + "tag_length failed to satisfy constraint: Member must be between 0 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_smithy_Papi_HUnit(input: &()) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_smithy_Papi_HUnit_for_KeyStore_GetKeyStoreInfo(input: &crate::deps::aws_cryptography_keyStore::operation::get_key_store_info::Unit) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives.rs index e118e5215..e3614bb67 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives.rs @@ -8,4 +8,5 @@ pub mod error; /// All operations that this crate can perform. pub mod operation; pub mod conversions; +pub mod validation; pub mod deps; diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/client.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/client.rs index ef0e6631e..dd322ebb2 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/client.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/client.rs @@ -13,11 +13,13 @@ impl Client { /// Creates a new client from the service [`Config`](crate::Config). #[track_caller] pub fn from_conf( - conf: crate::deps::aws_cryptography_primitives::types::crypto_config::CryptoConfig, + input: crate::deps::aws_cryptography_primitives::types::crypto_config::CryptoConfig, ) -> Result { + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HCryptoConfig(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner = crate::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives( - &crate::deps::aws_cryptography_primitives::conversions::crypto_config::_crypto_config::to_dafny(conf), + &crate::deps::aws_cryptography_primitives::conversions::crypto_config::_crypto_config::to_dafny(input), ); if matches!( inner.as_ref(), diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_decrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_decrypt.rs index 61bc4abb6..b37fce66f 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_decrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_decrypt.rs @@ -18,42 +18,8 @@ impl AesDecrypt { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.enc_alg.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "enc_alg", - "enc_alg was not specified but it is required when building AesDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key", - "key was not specified but it is required when building AesDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.cipher_txt.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "cipher_txt", - "cipher_txt was not specified but it is required when building AesDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.auth_tag.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "auth_tag", - "auth_tag was not specified but it is required when building AesDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.iv.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "iv", - "iv was not specified but it is required when building AesDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.aad.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "aad", - "aad was not specified but it is required when building AesDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_for_AwsCryptographicPrimitives_AESDecrypt(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::aes_decrypt::_aes_decrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).AESDecrypt(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_encrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_encrypt.rs index 116608779..a76195cfd 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_encrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_encrypt.rs @@ -18,36 +18,8 @@ impl AesEncrypt { crate::deps::aws_cryptography_primitives::operation::aes_encrypt::AesEncryptOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.enc_alg.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "enc_alg", - "enc_alg was not specified but it is required when building AesEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.iv.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "iv", - "iv was not specified but it is required when building AesEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key", - "key was not specified but it is required when building AesEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.msg.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "msg", - "msg was not specified but it is required when building AesEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.aad.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "aad", - "aad was not specified but it is required when building AesEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_for_AwsCryptographicPrimitives_AESEncrypt(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::aes_encrypt::_aes_encrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).AESEncrypt(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_kdf_counter_mode.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_kdf_counter_mode.rs index 701ef36c4..ba6f253bc 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_kdf_counter_mode.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/aes_kdf_counter_mode.rs @@ -18,24 +18,8 @@ impl AesKdfCounterMode { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.ikm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ikm", - "ikm was not specified but it is required when building AesKdfCtrInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.expected_length.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "expected_length", - "expected_length was not specified but it is required when building AesKdfCtrInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if matches!(input.expected_length, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "expected_length", - "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_for_AwsCryptographicPrimitives_AesKdfCounterMode(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::aes_kdf_counter_mode::_aes_kdf_counter_mode_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).AesKdfCounterMode(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/compress_public_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/compress_public_key.rs index c53de31cd..2eaee37db 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/compress_public_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/compress_public_key.rs @@ -18,18 +18,8 @@ impl CompressPublicKey { crate::deps::aws_cryptography_primitives::operation::compress_public_key::CompressPublicKeyOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "public_key", - "public_key was not specified but it is required when building CompressPublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.ecc_curve.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ecc_curve", - "ecc_curve was not specified but it is required when building CompressPublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_for_AwsCryptographicPrimitives_CompressPublicKey(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::compress_public_key::_compress_public_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).CompressPublicKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/decompress_public_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/decompress_public_key.rs index 5250af0a1..aae37a25a 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/decompress_public_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/decompress_public_key.rs @@ -18,18 +18,8 @@ impl DecompressPublicKey { crate::deps::aws_cryptography_primitives::operation::decompress_public_key::DecompressPublicKeyOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.compressed_public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "compressed_public_key", - "compressed_public_key was not specified but it is required when building DecompressPublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.ecc_curve.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ecc_curve", - "ecc_curve was not specified but it is required when building DecompressPublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_for_AwsCryptographicPrimitives_DecompressPublicKey(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::decompress_public_key::_decompress_public_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).DecompressPublicKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/derive_shared_secret.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/derive_shared_secret.rs index f28d5c639..cb1e883a3 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/derive_shared_secret.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/derive_shared_secret.rs @@ -18,24 +18,8 @@ impl DeriveSharedSecret { crate::deps::aws_cryptography_primitives::operation::derive_shared_secret::DeriveSharedSecretOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.ecc_curve.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ecc_curve", - "ecc_curve was not specified but it is required when building DeriveSharedSecretInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.private_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "private_key", - "private_key was not specified but it is required when building DeriveSharedSecretInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "public_key", - "public_key was not specified but it is required when building DeriveSharedSecretInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_for_AwsCryptographicPrimitives_DeriveSharedSecret(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::derive_shared_secret::_derive_shared_secret_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).DeriveSharedSecret(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/digest.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/digest.rs index 2c88644a6..a5ccc1de7 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/digest.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/digest.rs @@ -18,18 +18,8 @@ impl Digest { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.digest_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "digest_algorithm", - "digest_algorithm was not specified but it is required when building DigestInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.message.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "message", - "message was not specified but it is required when building DigestInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HDigestInput_for_AwsCryptographicPrimitives_Digest(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::digest::_digest_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).Digest(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_sign.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_sign.rs index 764285cd4..7b77b80b2 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_sign.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_sign.rs @@ -18,24 +18,8 @@ impl EcdsaSign { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.signature_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "signature_algorithm", - "signature_algorithm was not specified but it is required when building EcdsaSignInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.signing_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "signing_key", - "signing_key was not specified but it is required when building EcdsaSignInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.message.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "message", - "message was not specified but it is required when building EcdsaSignInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HECDSASignInput_for_AwsCryptographicPrimitives_ECDSASign(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::ecdsa_sign::_ecdsa_sign_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ECDSASign(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_verify.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_verify.rs index cb477c2bb..381a45a39 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_verify.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/ecdsa_verify.rs @@ -18,30 +18,8 @@ impl EcdsaVerify { ::std::primitive::bool, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.signature_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "signature_algorithm", - "signature_algorithm was not specified but it is required when building EcdsaVerifyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.verification_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "verification_key", - "verification_key was not specified but it is required when building EcdsaVerifyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.message.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "message", - "message was not specified but it is required when building EcdsaVerifyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.signature.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "signature", - "signature was not specified but it is required when building EcdsaVerifyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_for_AwsCryptographicPrimitives_ECDSAVerify(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::ecdsa_verify::_ecdsa_verify_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ECDSAVerify(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecc_key_pair.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecc_key_pair.rs index 60e52161d..ff66dcc75 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecc_key_pair.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecc_key_pair.rs @@ -18,12 +18,8 @@ impl GenerateEccKeyPair { crate::deps::aws_cryptography_primitives::operation::generate_ecc_key_pair::GenerateEccKeyPairOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.ecc_curve.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ecc_curve", - "ecc_curve was not specified but it is required when building GenerateEccKeyPairInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairInput_for_AwsCryptographicPrimitives_GenerateECCKeyPair(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::generate_ecc_key_pair::_generate_ecc_key_pair_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GenerateECCKeyPair(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecdsa_signature_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecdsa_signature_key.rs index 7d3cebb2d..ff551006b 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecdsa_signature_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_ecdsa_signature_key.rs @@ -18,12 +18,8 @@ impl GenerateEcdsaSignatureKey { crate::deps::aws_cryptography_primitives::operation::generate_ecdsa_signature_key::GenerateEcdsaSignatureKeyOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.signature_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "signature_algorithm", - "signature_algorithm was not specified but it is required when building GenerateEcdsaSignatureKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyInput_for_AwsCryptographicPrimitives_GenerateECDSASignatureKey(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::generate_ecdsa_signature_key::_generate_ecdsa_signature_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GenerateECDSASignatureKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_random_bytes.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_random_bytes.rs index 056a246e0..cc5a61a67 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_random_bytes.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_random_bytes.rs @@ -18,18 +18,8 @@ impl GenerateRandomBytes { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.length.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "length", - "length was not specified but it is required when building GenerateRandomBytesInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if matches!(input.length, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "length", - "length failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesInput_for_AwsCryptographicPrimitives_GenerateRandomBytes(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::generate_random_bytes::_generate_random_bytes_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GenerateRandomBytes(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_rsa_key_pair.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_rsa_key_pair.rs index a36347a7c..76002db09 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_rsa_key_pair.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/generate_rsa_key_pair.rs @@ -18,18 +18,8 @@ impl GenerateRsaKeyPair { crate::deps::aws_cryptography_primitives::operation::generate_rsa_key_pair::GenerateRsaKeyPairOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.length_bits.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "length_bits", - "length_bits was not specified but it is required when building GenerateRsaKeyPairInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if matches!(input.length_bits, Some(x) if !(81..=4096).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "length_bits", - "length_bits failed to satisfy constraint: Member must be between 81 and 4096, inclusive", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairInput_for_AwsCryptographicPrimitives_GenerateRSAKeyPair(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::generate_rsa_key_pair::_generate_rsa_key_pair_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GenerateRSAKeyPair(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_public_key_from_private_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_public_key_from_private_key.rs index 43244b450..f568135af 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_public_key_from_private_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_public_key_from_private_key.rs @@ -18,18 +18,8 @@ impl GetPublicKeyFromPrivateKey { crate::deps::aws_cryptography_primitives::operation::get_public_key_from_private_key::GetPublicKeyFromPrivateKeyOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.ecc_curve.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ecc_curve", - "ecc_curve was not specified but it is required when building GetPublicKeyFromPrivateKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.private_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "private_key", - "private_key was not specified but it is required when building GetPublicKeyFromPrivateKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_for_AwsCryptographicPrimitives_GetPublicKeyFromPrivateKey(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::get_public_key_from_private_key::_get_public_key_from_private_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetPublicKeyFromPrivateKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_rsa_key_modulus_length.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_rsa_key_modulus_length.rs index 5f6fad61e..ff9863d8c 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_rsa_key_modulus_length.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/get_rsa_key_modulus_length.rs @@ -18,12 +18,8 @@ impl GetRsaKeyModulusLength { crate::deps::aws_cryptography_primitives::operation::get_rsa_key_modulus_length::GetRsaKeyModulusLengthOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "public_key", - "public_key was not specified but it is required when building GetRsaKeyModulusLengthInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthInput_for_AwsCryptographicPrimitives_GetRSAKeyModulusLength(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::get_rsa_key_modulus_length::_get_rsa_key_modulus_length_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).GetRSAKeyModulusLength(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/h_mac.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/h_mac.rs index e7f02530d..4fba8fdae 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/h_mac.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/h_mac.rs @@ -18,24 +18,8 @@ impl HMac { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.digest_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "digest_algorithm", - "digest_algorithm was not specified but it is required when building HMacInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "key", - "key was not specified but it is required when building HMacInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.message.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "message", - "message was not specified but it is required when building HMacInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HHMacInput_for_AwsCryptographicPrimitives_HMac(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::h_mac::_h_mac_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).HMac(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf.rs index e6239e24a..1a96a6419 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf.rs @@ -18,36 +18,8 @@ impl Hkdf { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.digest_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "digest_algorithm", - "digest_algorithm was not specified but it is required when building HkdfInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.ikm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ikm", - "ikm was not specified but it is required when building HkdfInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.info.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "info", - "info was not specified but it is required when building HkdfInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.expected_length.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "expected_length", - "expected_length was not specified but it is required when building HkdfInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if matches!(input.expected_length, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "expected_length", - "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HHkdfInput_for_AwsCryptographicPrimitives_Hkdf(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::hkdf::_hkdf_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).Hkdf(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_expand.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_expand.rs index 20ca1bef9..89b84ab26 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_expand.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_expand.rs @@ -18,36 +18,8 @@ impl HkdfExpand { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.digest_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "digest_algorithm", - "digest_algorithm was not specified but it is required when building HkdfExpandInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.prk.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "prk", - "prk was not specified but it is required when building HkdfExpandInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.info.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "info", - "info was not specified but it is required when building HkdfExpandInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.expected_length.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "expected_length", - "expected_length was not specified but it is required when building HkdfExpandInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if matches!(input.expected_length, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "expected_length", - "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_for_AwsCryptographicPrimitives_HkdfExpand(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::hkdf_expand::_hkdf_expand_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).HkdfExpand(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_extract.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_extract.rs index 65b9a7d29..ec2a02d2e 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_extract.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/hkdf_extract.rs @@ -18,18 +18,8 @@ impl HkdfExtract { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.digest_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "digest_algorithm", - "digest_algorithm was not specified but it is required when building HkdfExtractInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.ikm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ikm", - "ikm was not specified but it is required when building HkdfExtractInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_for_AwsCryptographicPrimitives_HkdfExtract(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::hkdf_extract::_hkdf_extract_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).HkdfExtract(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/kdf_counter_mode.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/kdf_counter_mode.rs index 467b3162e..d8da94989 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/kdf_counter_mode.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/kdf_counter_mode.rs @@ -18,30 +18,8 @@ impl KdfCounterMode { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.digest_algorithm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "digest_algorithm", - "digest_algorithm was not specified but it is required when building KdfCtrInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.ikm.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ikm", - "ikm was not specified but it is required when building KdfCtrInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.expected_length.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "expected_length", - "expected_length was not specified but it is required when building KdfCtrInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if matches!(input.expected_length, Some(x) if !(0..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "expected_length", - "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_for_AwsCryptographicPrimitives_KdfCounterMode(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::kdf_counter_mode::_kdf_counter_mode_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).KdfCounterMode(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/parse_public_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/parse_public_key.rs index f22f60519..d47addd48 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/parse_public_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/parse_public_key.rs @@ -18,12 +18,8 @@ impl ParsePublicKey { crate::deps::aws_cryptography_primitives::operation::parse_public_key::ParsePublicKeyOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "public_key", - "public_key was not specified but it is required when building ParsePublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HParsePublicKeyInput_for_AwsCryptographicPrimitives_ParsePublicKey(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::parse_public_key::_parse_public_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ParsePublicKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_decrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_decrypt.rs index 2a3a2606c..36b745e79 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_decrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_decrypt.rs @@ -18,24 +18,8 @@ impl RsaDecrypt { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.padding.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "padding", - "padding was not specified but it is required when building RsaDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.private_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "private_key", - "private_key was not specified but it is required when building RsaDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.cipher_text.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "cipher_text", - "cipher_text was not specified but it is required when building RsaDecryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_for_AwsCryptographicPrimitives_RSADecrypt(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::rsa_decrypt::_rsa_decrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).RSADecrypt(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_encrypt.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_encrypt.rs index d9dafa601..fc489c74d 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_encrypt.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/rsa_encrypt.rs @@ -18,24 +18,8 @@ impl RsaEncrypt { ::aws_smithy_types::Blob, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.padding.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "padding", - "padding was not specified but it is required when building RsaEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "public_key", - "public_key was not specified but it is required when building RsaEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.plaintext.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "plaintext", - "plaintext was not specified but it is required when building RsaEncryptInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_for_AwsCryptographicPrimitives_RSAEncrypt(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::rsa_encrypt::_rsa_encrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).RSAEncrypt(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/validate_public_key.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/validate_public_key.rs index b4bfc5bbd..215f41201 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/validate_public_key.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/operation/validate_public_key.rs @@ -18,18 +18,8 @@ impl ValidatePublicKey { crate::deps::aws_cryptography_primitives::operation::validate_public_key::ValidatePublicKeyOutput, crate::deps::aws_cryptography_primitives::types::error::Error, > { - if input.ecc_curve.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ecc_curve", - "ecc_curve was not specified but it is required when building ValidatePublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} -if input.public_key.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "public_key", - "public_key was not specified but it is required when building ValidatePublicKeyInput", - )).map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err); -} + crate::deps::aws_cryptography_primitives::validation::validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_for_AwsCryptographicPrimitives_ValidatePublicKey(&input) + .map_err(crate::deps::aws_cryptography_primitives::types::error::Error::wrap_validation_err)?; let inner_input = crate::deps::aws_cryptography_primitives::conversions::validate_public_key::_validate_public_key_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).ValidatePublicKey(&inner_input); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/types.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/types.rs index 7638d7aba..0291fd6af 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_primitives/types.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/types.rs @@ -3,6 +3,7 @@ // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. /// Types for the `CryptoConfig` pub mod crypto_config; +pub use crate::deps::aws_cryptography_primitives::types::crypto_config::CryptoConfig; pub mod builders; diff --git a/releases/rust/esdk/src/deps/aws_cryptography_primitives/validation.rs b/releases/rust/esdk/src/deps/aws_cryptography_primitives/validation.rs new file mode 100644 index 000000000..5acefaa3b --- /dev/null +++ b/releases/rust/esdk/src/deps/aws_cryptography_primitives/validation.rs @@ -0,0 +1,2486 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM(input: &crate::deps::aws_cryptography_primitives::types::AesGcm) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAES__GCM_DkeyLength(&input.key_length)?; +validate_aws_Pcryptography_Pprimitives_HAES__GCM_DtagLength(&input.tag_length)?; +validate_aws_Pcryptography_Pprimitives_HAES__GCM_DivLength(&input.iv_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM_DivLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "iv_length", + "iv_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..=255).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "iv_length", + "iv_length failed to satisfy constraint: Member must be between 0 and 255, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM_DkeyLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key_length", + "key_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=32).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "key_length", + "key_length failed to satisfy constraint: Member must be between 1 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAES__GCM_DtagLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "tag_length", + "tag_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..=32).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "tag_length", + "tag_length failed to satisfy constraint: Member must be between 0 and 32, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput(input: &crate::deps::aws_cryptography_primitives::types::AesDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DencAlg(&input.enc_alg)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Dkey(&input.key)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DcipherTxt(&input.cipher_txt)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DauthTag(&input.auth_tag)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Div(&input.iv)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Daad(&input.aad)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_for_AwsCryptographicPrimitives_AESDecrypt(input: &crate::deps::aws_cryptography_primitives::operation::aes_decrypt::AesDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DencAlg(&input.enc_alg)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Dkey(&input.key)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DcipherTxt(&input.cipher_txt)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DauthTag(&input.auth_tag)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Div(&input.iv)?; +validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Daad(&input.aad)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Daad(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "aad", + "aad is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DauthTag(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "auth_tag", + "auth_tag is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DcipherTxt(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "cipher_txt", + "cipher_txt is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_DencAlg(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "enc_alg", + "enc_alg is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HAES__GCM(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Div(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "iv", + "iv is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptInput_Dkey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key", + "key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESDecryptOutput_Dplaintext(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptOutput_for_AwsCryptographicPrimitives_AESDecrypt(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESDecryptOutput_Dplaintext(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESDecryptOutput_Dplaintext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "plaintext", + "plaintext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput(input: &crate::deps::aws_cryptography_primitives::types::AesEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_DencAlg(&input.enc_alg)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Div(&input.iv)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Dkey(&input.key)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Dmsg(&input.msg)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Daad(&input.aad)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_for_AwsCryptographicPrimitives_AESEncrypt(input: &crate::deps::aws_cryptography_primitives::operation::aes_encrypt::AesEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_DencAlg(&input.enc_alg)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Div(&input.iv)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Dkey(&input.key)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Dmsg(&input.msg)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Daad(&input.aad)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Daad(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "aad", + "aad is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_DencAlg(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "enc_alg", + "enc_alg is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HAES__GCM(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Div(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "iv", + "iv is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Dkey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key", + "key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptInput_Dmsg(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "msg", + "msg is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput(input: &crate::deps::aws_cryptography_primitives::types::AesEncryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_DcipherText(&input.cipher_text)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_DauthTag(&input.auth_tag)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_for_AwsCryptographicPrimitives_AESEncrypt(input: &crate::deps::aws_cryptography_primitives::operation::aes_encrypt::AesEncryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_DcipherText(&input.cipher_text)?; +validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_DauthTag(&input.auth_tag)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_DauthTag(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "auth_tag", + "auth_tag is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAESEncryptOutput_DcipherText(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "cipher_text", + "cipher_text is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput(input: &crate::deps::aws_cryptography_primitives::types::AesKdfCtrInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_Dikm(&input.ikm)?; +validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_DexpectedLength(&input.expected_length)?; +validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_Dnonce(&input.nonce)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_for_AwsCryptographicPrimitives_AesKdfCounterMode(input: &crate::deps::aws_cryptography_primitives::operation::aes_kdf_counter_mode::AesKdfCtrInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_Dikm(&input.ikm)?; +validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_DexpectedLength(&input.expected_length)?; +validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_Dnonce(&input.nonce)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_DexpectedLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "expected_length", + "expected_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "expected_length", + "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_Dikm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ikm", + "ikm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrInput_Dnonce(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAesKdfCtrOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrOutput_for_AwsCryptographicPrimitives_AesKdfCounterMode(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HAesKdfCtrOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HAesKdfCtrOutput_Dokm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "okm", + "okm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput(input: &crate::deps::aws_cryptography_primitives::types::CompressPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_DeccCurve(&input.ecc_curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_for_AwsCryptographicPrimitives_CompressPublicKey(input: &crate::deps::aws_cryptography_primitives::operation::compress_public_key::CompressPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_DeccCurve(&input.ecc_curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyInput_DpublicKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPublicKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyOutput(input: &crate::deps::aws_cryptography_primitives::types::CompressPublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyOutput_DcompressedPublicKey(&input.compressed_public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyOutput_for_AwsCryptographicPrimitives_CompressPublicKey(input: &crate::deps::aws_cryptography_primitives::operation::compress_public_key::CompressPublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyOutput_DcompressedPublicKey(&input.compressed_public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCompressPublicKeyOutput_DcompressedPublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "compressed_public_key", + "compressed_public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HCryptoConfig(input: &crate::deps::aws_cryptography_primitives::types::crypto_config::CryptoConfig) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput(input: &crate::deps::aws_cryptography_primitives::types::DecompressPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_DcompressedPublicKey(&input.compressed_public_key)?; +validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_DeccCurve(&input.ecc_curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_for_AwsCryptographicPrimitives_DecompressPublicKey(input: &crate::deps::aws_cryptography_primitives::operation::decompress_public_key::DecompressPublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_DcompressedPublicKey(&input.compressed_public_key)?; +validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_DeccCurve(&input.ecc_curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_DcompressedPublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "compressed_public_key", + "compressed_public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyInput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyOutput(input: &crate::deps::aws_cryptography_primitives::types::DecompressPublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyOutput_for_AwsCryptographicPrimitives_DecompressPublicKey(input: &crate::deps::aws_cryptography_primitives::operation::decompress_public_key::DecompressPublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDecompressPublicKeyOutput_DpublicKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPublicKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput(input: &crate::deps::aws_cryptography_primitives::types::DeriveSharedSecretInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_for_AwsCryptographicPrimitives_DeriveSharedSecret(input: &crate::deps::aws_cryptography_primitives::operation::derive_shared_secret::DeriveSharedSecretInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DprivateKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "private_key", + "private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPrivateKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretInput_DpublicKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPublicKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretOutput(input: &crate::deps::aws_cryptography_primitives::types::DeriveSharedSecretOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretOutput_DsharedSecret(&input.shared_secret)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretOutput_for_AwsCryptographicPrimitives_DeriveSharedSecret(input: &crate::deps::aws_cryptography_primitives::operation::derive_shared_secret::DeriveSharedSecretOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretOutput_DsharedSecret(&input.shared_secret)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDeriveSharedSecretOutput_DsharedSecret(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "shared_secret", + "shared_secret is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestInput(input: &crate::deps::aws_cryptography_primitives::types::DigestInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDigestInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HDigestInput_Dmessage(&input.message)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestInput_for_AwsCryptographicPrimitives_Digest(input: &crate::deps::aws_cryptography_primitives::operation::digest::DigestInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDigestInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HDigestInput_Dmessage(&input.message)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestInput_DdigestAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest_algorithm", + "digest_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestInput_Dmessage(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDigestOutput_Ddigest(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestOutput_for_AwsCryptographicPrimitives_Digest(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HDigestOutput_Ddigest(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HDigestOutput_Ddigest(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest", + "digest is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECCPrivateKey(input: &crate::deps::aws_cryptography_primitives::types::EccPrivateKey) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECCPrivateKey_Dpem(&input.pem)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECCPrivateKey_Dpem(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "pem", + "pem is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECCPublicKey(input: &crate::deps::aws_cryptography_primitives::types::EccPublicKey) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECCPublicKey_Dder(&input.der)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECCPublicKey_Dder(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "der", + "der is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignInput(input: &crate::deps::aws_cryptography_primitives::types::EcdsaSignInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSASignInput_DsignatureAlgorithm(&input.signature_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HECDSASignInput_DsigningKey(&input.signing_key)?; +validate_aws_Pcryptography_Pprimitives_HECDSASignInput_Dmessage(&input.message)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignInput_for_AwsCryptographicPrimitives_ECDSASign(input: &crate::deps::aws_cryptography_primitives::operation::ecdsa_sign::EcdsaSignInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSASignInput_DsignatureAlgorithm(&input.signature_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HECDSASignInput_DsigningKey(&input.signing_key)?; +validate_aws_Pcryptography_Pprimitives_HECDSASignInput_Dmessage(&input.message)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignInput_Dmessage(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignInput_DsignatureAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature_algorithm", + "signature_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignInput_DsigningKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signing_key", + "signing_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSASignOutput_Dsignature(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignOutput_for_AwsCryptographicPrimitives_ECDSASign(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSASignOutput_Dsignature(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSASignOutput_Dsignature(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature", + "signature is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput(input: &crate::deps::aws_cryptography_primitives::types::EcdsaVerifyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_DsignatureAlgorithm(&input.signature_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_DverificationKey(&input.verification_key)?; +validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_Dmessage(&input.message)?; +validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_Dsignature(&input.signature)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_for_AwsCryptographicPrimitives_ECDSAVerify(input: &crate::deps::aws_cryptography_primitives::operation::ecdsa_verify::EcdsaVerifyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_DsignatureAlgorithm(&input.signature_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_DverificationKey(&input.verification_key)?; +validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_Dmessage(&input.message)?; +validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_Dsignature(&input.signature)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_Dmessage(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_Dsignature(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature", + "signature is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_DsignatureAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature_algorithm", + "signature_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyInput_DverificationKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "verification_key", + "verification_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyOutput(input: &::std::primitive::bool) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSAVerifyOutput_Dsuccess(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyOutput_for_AwsCryptographicPrimitives_ECDSAVerify(input: &::std::primitive::bool) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HECDSAVerifyOutput_Dsuccess(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HECDSAVerifyOutput_Dsuccess(input: &::std::option::Option<::std::primitive::bool>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "success", + "success is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairInput(input: &crate::deps::aws_cryptography_primitives::types::GenerateEccKeyPairInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairInput_DeccCurve(&input.ecc_curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairInput_for_AwsCryptographicPrimitives_GenerateECCKeyPair(input: &crate::deps::aws_cryptography_primitives::operation::generate_ecc_key_pair::GenerateEccKeyPairInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairInput_DeccCurve(&input.ecc_curve)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairInput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput(input: &crate::deps::aws_cryptography_primitives::types::GenerateEccKeyPairOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_for_AwsCryptographicPrimitives_GenerateECCKeyPair(input: &crate::deps::aws_cryptography_primitives::operation::generate_ecc_key_pair::GenerateEccKeyPairOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DprivateKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "private_key", + "private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPrivateKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECCKeyPairOutput_DpublicKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPublicKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyInput(input: &crate::deps::aws_cryptography_primitives::types::GenerateEcdsaSignatureKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyInput_DsignatureAlgorithm(&input.signature_algorithm)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyInput_for_AwsCryptographicPrimitives_GenerateECDSASignatureKey(input: &crate::deps::aws_cryptography_primitives::operation::generate_ecdsa_signature_key::GenerateEcdsaSignatureKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyInput_DsignatureAlgorithm(&input.signature_algorithm)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyInput_DsignatureAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature_algorithm", + "signature_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput(input: &crate::deps::aws_cryptography_primitives::types::GenerateEcdsaSignatureKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DsignatureAlgorithm(&input.signature_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DverificationKey(&input.verification_key)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DsigningKey(&input.signing_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_for_AwsCryptographicPrimitives_GenerateECDSASignatureKey(input: &crate::deps::aws_cryptography_primitives::operation::generate_ecdsa_signature_key::GenerateEcdsaSignatureKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DsignatureAlgorithm(&input.signature_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DverificationKey(&input.verification_key)?; +validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DsigningKey(&input.signing_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DsignatureAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signature_algorithm", + "signature_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DsigningKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "signing_key", + "signing_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateECDSASignatureKeyOutput_DverificationKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "verification_key", + "verification_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesInput(input: &crate::deps::aws_cryptography_primitives::types::GenerateRandomBytesInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesInput_Dlength(&input.length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesInput_for_AwsCryptographicPrimitives_GenerateRandomBytes(input: &crate::deps::aws_cryptography_primitives::operation::generate_random_bytes::GenerateRandomBytesInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesInput_Dlength(&input.length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesInput_Dlength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "length", + "length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "length", + "length failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesOutput_Ddata(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesOutput_for_AwsCryptographicPrimitives_GenerateRandomBytes(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesOutput_Ddata(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRandomBytesOutput_Ddata(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "data", + "data is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairInput(input: &crate::deps::aws_cryptography_primitives::types::GenerateRsaKeyPairInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairInput_DlengthBits(&input.length_bits)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairInput_for_AwsCryptographicPrimitives_GenerateRSAKeyPair(input: &crate::deps::aws_cryptography_primitives::operation::generate_rsa_key_pair::GenerateRsaKeyPairInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairInput_DlengthBits(&input.length_bits)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairInput_DlengthBits(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "length_bits", + "length_bits is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(81..=4096).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "length_bits", + "length_bits failed to satisfy constraint: Member must be between 81 and 4096, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput(input: &crate::deps::aws_cryptography_primitives::types::GenerateRsaKeyPairOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_DprivateKey(&input.private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_for_AwsCryptographicPrimitives_GenerateRSAKeyPair(input: &crate::deps::aws_cryptography_primitives::operation::generate_rsa_key_pair::GenerateRsaKeyPairOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_DprivateKey(&input.private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_DprivateKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "private_key", + "private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HRSAPrivateKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGenerateRSAKeyPairOutput_DpublicKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HRSAPublicKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput(input: &crate::deps::aws_cryptography_primitives::types::GetPublicKeyFromPrivateKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_DprivateKey(&input.private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_for_AwsCryptographicPrimitives_GetPublicKeyFromPrivateKey(input: &crate::deps::aws_cryptography_primitives::operation::get_public_key_from_private_key::GetPublicKeyFromPrivateKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_DprivateKey(&input.private_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyInput_DprivateKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "private_key", + "private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPrivateKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput(input: &crate::deps::aws_cryptography_primitives::types::GetPublicKeyFromPrivateKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_for_AwsCryptographicPrimitives_GetPublicKeyFromPrivateKey(input: &crate::deps::aws_cryptography_primitives::operation::get_public_key_from_private_key::GetPublicKeyFromPrivateKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DprivateKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "private_key", + "private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPrivateKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetPublicKeyFromPrivateKeyOutput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthInput(input: &crate::deps::aws_cryptography_primitives::types::GetRsaKeyModulusLengthInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthInput_for_AwsCryptographicPrimitives_GetRSAKeyModulusLength(input: &crate::deps::aws_cryptography_primitives::operation::get_rsa_key_modulus_length::GetRsaKeyModulusLengthInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthInput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthOutput(input: &crate::deps::aws_cryptography_primitives::types::GetRsaKeyModulusLengthOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthOutput_Dlength(&input.length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthOutput_for_AwsCryptographicPrimitives_GetRSAKeyModulusLength(input: &crate::deps::aws_cryptography_primitives::operation::get_rsa_key_modulus_length::GetRsaKeyModulusLengthOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthOutput_Dlength(&input.length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HGetRSAKeyModulusLengthOutput_Dlength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "length", + "length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(81..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "length", + "length failed to satisfy constraint: Member must be greater than or equal to 81", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput(input: &crate::deps::aws_cryptography_primitives::types::HkdfExpandInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_Dprk(&input.prk)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_Dinfo(&input.info)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_DexpectedLength(&input.expected_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_for_AwsCryptographicPrimitives_HkdfExpand(input: &crate::deps::aws_cryptography_primitives::operation::hkdf_expand::HkdfExpandInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_Dprk(&input.prk)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_Dinfo(&input.info)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_DexpectedLength(&input.expected_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_DdigestAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest_algorithm", + "digest_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_DexpectedLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "expected_length", + "expected_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "expected_length", + "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_Dinfo(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "info", + "info is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandInput_Dprk(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "prk", + "prk is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExpandOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandOutput_for_AwsCryptographicPrimitives_HkdfExpand(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExpandOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExpandOutput_Dokm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "okm", + "okm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput(input: &crate::deps::aws_cryptography_primitives::types::HkdfExtractInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_Dsalt(&input.salt)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_Dikm(&input.ikm)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_for_AwsCryptographicPrimitives_HkdfExtract(input: &crate::deps::aws_cryptography_primitives::operation::hkdf_extract::HkdfExtractInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_Dsalt(&input.salt)?; +validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_Dikm(&input.ikm)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_DdigestAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest_algorithm", + "digest_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_Dikm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ikm", + "ikm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractInput_Dsalt(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExtractOutput_Dprk(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractOutput_for_AwsCryptographicPrimitives_HkdfExtract(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfExtractOutput_Dprk(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfExtractOutput_Dprk(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "prk", + "prk is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput(input: &crate::deps::aws_cryptography_primitives::types::HkdfInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dsalt(&input.salt)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dikm(&input.ikm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dinfo(&input.info)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_DexpectedLength(&input.expected_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput_for_AwsCryptographicPrimitives_Hkdf(input: &crate::deps::aws_cryptography_primitives::operation::hkdf::HkdfInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dsalt(&input.salt)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dikm(&input.ikm)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dinfo(&input.info)?; +validate_aws_Pcryptography_Pprimitives_HHkdfInput_DexpectedLength(&input.expected_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput_DdigestAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest_algorithm", + "digest_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput_DexpectedLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "expected_length", + "expected_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "expected_length", + "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dikm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ikm", + "ikm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dinfo(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "info", + "info is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfInput_Dsalt(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfOutput_for_AwsCryptographicPrimitives_Hkdf(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHkdfOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHkdfOutput_Dokm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "okm", + "okm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacInput(input: &crate::deps::aws_cryptography_primitives::types::HMacInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHMacInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHMacInput_Dkey(&input.key)?; +validate_aws_Pcryptography_Pprimitives_HHMacInput_Dmessage(&input.message)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacInput_for_AwsCryptographicPrimitives_HMac(input: &crate::deps::aws_cryptography_primitives::operation::h_mac::HMacInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHMacInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HHMacInput_Dkey(&input.key)?; +validate_aws_Pcryptography_Pprimitives_HHMacInput_Dmessage(&input.message)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacInput_DdigestAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest_algorithm", + "digest_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacInput_Dkey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "key", + "key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacInput_Dmessage(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHMacOutput_Ddigest(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacOutput_for_AwsCryptographicPrimitives_HMac(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HHMacOutput_Ddigest(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HHMacOutput_Ddigest(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest", + "digest is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput(input: &crate::deps::aws_cryptography_primitives::types::KdfCtrInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dikm(&input.ikm)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_DexpectedLength(&input.expected_length)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dpurpose(&input.purpose)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dnonce(&input.nonce)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_for_AwsCryptographicPrimitives_KdfCounterMode(input: &crate::deps::aws_cryptography_primitives::operation::kdf_counter_mode::KdfCtrInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_DdigestAlgorithm(&input.digest_algorithm)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dikm(&input.ikm)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_DexpectedLength(&input.expected_length)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dpurpose(&input.purpose)?; +validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dnonce(&input.nonce)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_DdigestAlgorithm(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "digest_algorithm", + "digest_algorithm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_DexpectedLength(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "expected_length", + "expected_length is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(0..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "expected_length", + "expected_length failed to satisfy constraint: Member must be greater than or equal to 0", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dikm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ikm", + "ikm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dnonce(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrInput_Dpurpose(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HKdfCtrOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrOutput_for_AwsCryptographicPrimitives_KdfCounterMode(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HKdfCtrOutput_Dokm(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HKdfCtrOutput_Dokm(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "okm", + "okm is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HParsePublicKeyInput(input: &crate::deps::aws_cryptography_primitives::types::ParsePublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HParsePublicKeyInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HParsePublicKeyInput_for_AwsCryptographicPrimitives_ParsePublicKey(input: &crate::deps::aws_cryptography_primitives::operation::parse_public_key::ParsePublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HParsePublicKeyInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HParsePublicKeyInput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HParsePublicKeyOutput(input: &crate::deps::aws_cryptography_primitives::types::ParsePublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HParsePublicKeyOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HParsePublicKeyOutput_for_AwsCryptographicPrimitives_ParsePublicKey(input: &crate::deps::aws_cryptography_primitives::operation::parse_public_key::ParsePublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HParsePublicKeyOutput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HParsePublicKeyOutput_DpublicKey(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_Pprimitives_HECCPublicKey(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptInput(input: &crate::deps::aws_cryptography_primitives::types::RsaDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_Dpadding(&input.padding)?; +validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_DcipherText(&input.cipher_text)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_for_AwsCryptographicPrimitives_RSADecrypt(input: &crate::deps::aws_cryptography_primitives::operation::rsa_decrypt::RsaDecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_Dpadding(&input.padding)?; +validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_DprivateKey(&input.private_key)?; +validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_DcipherText(&input.cipher_text)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_DcipherText(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "cipher_text", + "cipher_text is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_Dpadding(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "padding", + "padding is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptInput_DprivateKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "private_key", + "private_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSADecryptOutput_Dplaintext(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptOutput_for_AwsCryptographicPrimitives_RSADecrypt(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSADecryptOutput_Dplaintext(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSADecryptOutput_Dplaintext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "plaintext", + "plaintext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput(input: &crate::deps::aws_cryptography_primitives::types::RsaEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_Dpadding(&input.padding)?; +validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_Dplaintext(&input.plaintext)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_for_AwsCryptographicPrimitives_RSAEncrypt(input: &crate::deps::aws_cryptography_primitives::operation::rsa_encrypt::RsaEncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_Dpadding(&input.padding)?; +validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_DpublicKey(&input.public_key)?; +validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_Dplaintext(&input.plaintext)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_Dpadding(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "padding", + "padding is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_Dplaintext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "plaintext", + "plaintext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptInput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptOutput(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSAEncryptOutput_DcipherText(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptOutput_for_AwsCryptographicPrimitives_RSAEncrypt(input: &::aws_smithy_types::Blob) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSAEncryptOutput_DcipherText(&Some(input.clone()))?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAEncryptOutput_DcipherText(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "cipher_text", + "cipher_text is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAPrivateKey(input: &crate::deps::aws_cryptography_primitives::types::RsaPrivateKey) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSAPrivateKey_DlengthBits(&input.length_bits)?; +validate_aws_Pcryptography_Pprimitives_HRSAPrivateKey_Dpem(&input.pem)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAPrivateKey_DlengthBits(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "length_bits", + "length_bits is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(81..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "length_bits", + "length_bits failed to satisfy constraint: Member must be greater than or equal to 81", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAPrivateKey_Dpem(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "pem", + "pem is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAPublicKey(input: &crate::deps::aws_cryptography_primitives::types::RsaPublicKey) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HRSAPublicKey_DlengthBits(&input.length_bits)?; +validate_aws_Pcryptography_Pprimitives_HRSAPublicKey_Dpem(&input.pem)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAPublicKey_DlengthBits(input: &::std::option::Option<::std::primitive::i32>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "length_bits", + "length_bits is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(81..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "length_bits", + "length_bits failed to satisfy constraint: Member must be greater than or equal to 81", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HRSAPublicKey_Dpem(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "pem", + "pem is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput(input: &crate::deps::aws_cryptography_primitives::types::ValidatePublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_for_AwsCryptographicPrimitives_ValidatePublicKey(input: &crate::deps::aws_cryptography_primitives::operation::validate_public_key::ValidatePublicKeyInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_DeccCurve(&input.ecc_curve)?; +validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_DpublicKey(&input.public_key)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_DeccCurve(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ecc_curve", + "ecc_curve is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyInput_DpublicKey(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "public_key", + "public_key is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyOutput(input: &crate::deps::aws_cryptography_primitives::types::ValidatePublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyOutput_Dsuccess(&input.success)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyOutput_for_AwsCryptographicPrimitives_ValidatePublicKey(input: &crate::deps::aws_cryptography_primitives::operation::validate_public_key::ValidatePublicKeyOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyOutput_Dsuccess(&input.success)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_Pprimitives_HValidatePublicKeyOutput_Dsuccess(input: &::std::option::Option<::std::primitive::bool>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "success", + "success is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} diff --git a/releases/rust/esdk/src/ecdh.rs b/releases/rust/esdk/src/ecdh.rs index 15e179505..eb44091cd 100644 --- a/releases/rust/esdk/src/ecdh.rs +++ b/releases/rust/esdk/src/ecdh.rs @@ -74,6 +74,9 @@ pub mod ECDH { const ELEM_MAX_BYTES: usize = (ELEM_MAX_BITS + 7) / 8; const PUBLIC_KEY_MAX_LEN: usize = 1 + (2 * ELEM_MAX_BYTES); + // This is the value checked in the Dafny test + const INVALID_KEY: &str = "Invalid X509 Public Key."; + pub(crate) fn X509_to_X962( public_key: &[u8], compress: bool, @@ -86,7 +89,7 @@ pub mod ECDH { let evp_pkey = unsafe { EVP_parse_public_key(&mut cbs) }; if evp_pkey.is_null() { - return Err("Invalid X509 Public Key.".to_string()); + return Err(INVALID_KEY.to_string()); } let ec_key = unsafe { EVP_PKEY_get0_EC_KEY(evp_pkey) }; @@ -326,7 +329,29 @@ pub mod ECDH { // for the moment, it's valid if we can use it to generate a shared secret fn valid_public_key(alg: &ECDHCurveSpec, public_key: &[u8]) -> Result<(), String> { - X509_to_X962(public_key, false, Some(get_nid(alg)))?; + let mut cbs = CBS { + data: public_key.as_ptr(), + len: public_key.len(), + }; + + let evp_pkey = unsafe { EVP_parse_public_key(&mut cbs) }; + if evp_pkey.is_null() { + return Err(INVALID_KEY.to_string()); + } + let ec_key = unsafe { EVP_PKEY_get0_EC_KEY(evp_pkey) }; + + if unsafe {aws_lc_sys::EC_KEY_check_fips(ec_key)} != 1 { + return Err(INVALID_KEY.to_string()); + } + let ec_group = unsafe { EC_KEY_get0_group(ec_key) }; + if ec_group.is_null() { + return Err(INVALID_KEY.to_string()); + } + if get_nid(alg) != unsafe { EC_GROUP_get_curve_name(ec_group) } { + return Err(INVALID_KEY.to_string()); + } + unsafe { EVP_PKEY_free(evp_pkey) }; + Ok(()) } diff --git a/releases/rust/esdk/src/implementation_from_dafny.rs b/releases/rust/esdk/src/implementation_from_dafny.rs index a8a130c73..d41792056 100644 --- a/releases/rust/esdk/src/implementation_from_dafny.rs +++ b/releases/rust/esdk/src/implementation_from_dafny.rs @@ -69645,6 +69645,28 @@ pub mod r#_FileIO_Compile { }; return res.read(); } + pub fn AppendBytesToFile(path: &Sequence, bytes: &Sequence) -> Rc>> { + let mut res = MaybePlacebo::>>>::new(); + let mut isError: bool = ::default(); + let mut errorMsg = MaybePlacebo::>::new(); + let mut _out0: bool = ::default(); + let mut _out1 = MaybePlacebo::>::new(); + let _x = FileIO::INTERNAL_AppendBytesToFile(path, bytes); + _out0 = _x.0; + _out1 = MaybePlacebo::from(_x.1); + isError = _out0; + errorMsg = MaybePlacebo::from(_out1.read()); + if isError { + res = MaybePlacebo::from(Rc::new(Result::<(), Sequence>::Failure { + error: errorMsg.read() + })); + } else { + res = MaybePlacebo::from(Rc::new(Result::<(), Sequence>::Success { + value: () + })); + }; + return res.read(); + } } } pub mod r#_Fixtures_Compile { @@ -94985,23 +95007,30 @@ pub mod r#_TestRequiredEncryptionContext_Compile { } } pub mod Time { - pub use ::dafny_runtime::_System::nat; pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::DafnyCharUTF16; - pub use ::dafny_runtime; - pub use ::dafny_runtime::int; - pub use ::dafny_runtime::string_utf16_of; pub use ::std::convert::Into; pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::int; + pub use ::dafny_runtime::string_utf16_of; pub use ::std::rc::Rc; - pub use crate::implementation_from_dafny::r#_Wrappers_Compile::Result; + pub use ::dafny_runtime::MaybePlacebo; + pub use ::std::default::Default; + pub use ::dafny_runtime::DafnyPrintWrapper; + pub use ::std::fmt::Debug; + pub use ::std::fmt::Formatter; + pub use ::dafny_runtime::DafnyPrint; + pub use ::std::cmp::Eq; + pub use ::std::hash::Hash; + pub use ::std::hash::Hasher; + pub use ::std::convert::AsRef; pub struct _default {} impl _default { - pub fn FormatMilli(diff: &nat) -> Sequence { - let mut whole: Sequence = crate::implementation_from_dafny::r#_StandardLibrary_Compile::r#_String_Compile::_default::Base10Int2String(&dafny_runtime::euclidian_division(diff.clone(), int!(1000))); - let mut frac: Sequence = crate::implementation_from_dafny::r#_StandardLibrary_Compile::r#_String_Compile::_default::Base10Int2String(&dafny_runtime::euclidian_modulo(diff.clone(), int!(1000))); + pub fn FormatMilli(diff: u64) -> Sequence { + let mut whole: Sequence = crate::implementation_from_dafny::r#_StandardLibrary_Compile::r#_String_Compile::_default::Base10Int2String(&Into::::into(diff / 1000)); + let mut frac: Sequence = crate::implementation_from_dafny::r#_StandardLibrary_Compile::r#_String_Compile::_default::Base10Int2String(&Into::::into(diff % 1000)); if frac.cardinality() == int!(1) { whole.concat(&string_utf16_of(".00")).concat(&frac) } else { @@ -95014,22 +95043,252 @@ pub mod Time { } pub fn FormatMilliDiff(start: i64, end: i64) -> Sequence { if start <= end { - _default::FormatMilli(&(Into::::into(end) - Into::::into(start))) + _default::FormatMilli((end - start) as u64) } else { - string_utf16_of("-").concat(&_default::FormatMilli(&(Into::::into(start) - Into::::into(end)))) + string_utf16_of("-").concat(&_default::FormatMilli((start - end) as u64)) } } - pub fn CreateGetCurrentTimeStampSuccess(value: &Sequence) -> Rc, Sequence>> { - Rc::new(Result::, Sequence>::Success { + pub fn GetAbsoluteTime() -> Rc { + let mut output = MaybePlacebo::>::new(); + let mut ClockTime: i64 = ::default(); + let mut _out0: i64 = ::default(); + _out0 = _default::CurrentRelativeTimeMilli(); + ClockTime = _out0; + let mut CpuTime: i64 = ::default(); + let mut _out1: i64 = ::default(); + _out1 = _default::GetProcessCpuTimeMillis(); + CpuTime = _out1; + output = MaybePlacebo::from(Rc::new(AbsoluteTime::AbsoluteTime { + ClockTime: ClockTime as u64, + CpuTime: CpuTime as u64 + })); + return output.read(); + } + pub fn PrintTimeSince(start: &Rc) -> () { + let mut t = MaybePlacebo::>::new(); + let mut _out0 = MaybePlacebo::>::new(); + _out0 = MaybePlacebo::from(_default::TimeSince(start)); + t = MaybePlacebo::from(_out0.read()); + _default::PrintTime(&t.read()); + return (); + } + pub fn PrintTimeSinceShort(start: &Rc) -> () { + let mut t = MaybePlacebo::>::new(); + let mut _out0 = MaybePlacebo::>::new(); + _out0 = MaybePlacebo::from(_default::TimeSince(start)); + t = MaybePlacebo::from(_out0.read()); + _default::PrintTimeShort(&t.read()); + return (); + } + pub fn PrintTimeSinceShortChained(start: &Rc) -> Rc { + let mut x = MaybePlacebo::>::new(); + let mut end = MaybePlacebo::>::new(); + let mut _out0 = MaybePlacebo::>::new(); + _out0 = MaybePlacebo::from(_default::GetAbsoluteTime()); + end = MaybePlacebo::from(_out0.read()); + _default::PrintTimeShort(&_default::TimeDiff(start, &end.read())); + x = MaybePlacebo::from(end.read()); + return x.read(); + } + pub fn TimeDiff(start: &Rc, end: &Rc) -> Rc { + if start.ClockTime().clone() <= end.ClockTime().clone() && start.CpuTime().clone() <= end.CpuTime().clone() { + Rc::new(RelativeTime::RelativeTime { + ClockTime: end.ClockTime().clone() - start.ClockTime().clone(), + CpuTime: end.CpuTime().clone() - start.CpuTime().clone() + }) + } else { + Rc::new(RelativeTime::RelativeTime { + ClockTime: 0, + CpuTime: 0 + }) + } + } + pub fn TimeSince(start: &Rc) -> Rc { + let mut output = MaybePlacebo::>::new(); + let mut end = MaybePlacebo::>::new(); + let mut _out0 = MaybePlacebo::>::new(); + _out0 = MaybePlacebo::from(_default::GetAbsoluteTime()); + end = MaybePlacebo::from(_out0.read()); + output = MaybePlacebo::from(_default::TimeDiff(start, &end.read())); + return output.read(); + } + pub fn PrintTime(time: &Rc) -> () { + print!("{}", DafnyPrintWrapper(&string_utf16_of("Clock Time : "))); + print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.ClockTime().clone()))); + print!("{}", DafnyPrintWrapper(&string_utf16_of(" CPU Time : "))); + print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.CpuTime().clone()))); + print!("{}", DafnyPrintWrapper(&string_utf16_of("\n"))); + return (); + } + pub fn PrintTimeShort(time: &Rc) -> () { + print!("{}", DafnyPrintWrapper(&string_utf16_of("CPU:"))); + print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.CpuTime().clone()))); + print!("{}", DafnyPrintWrapper(&string_utf16_of(" "))); + return (); + } + pub fn CreateGetCurrentTimeStampSuccess(value: &Sequence) -> Rc, Sequence>> { + Rc::new(crate::implementation_from_dafny::r#_Wrappers_Compile::Result::, Sequence>::Success { value: value.clone() }) } - pub fn CreateGetCurrentTimeStampFailure(error: &Sequence) -> Rc, Sequence>> { - Rc::new(Result::, Sequence>::Failure { + pub fn CreateGetCurrentTimeStampFailure(error: &Sequence) -> Rc, Sequence>> { + Rc::new(crate::implementation_from_dafny::r#_Wrappers_Compile::Result::, Sequence>::Failure { error: error.clone() }) } } + + #[derive(PartialEq, Clone)] + pub enum AbsoluteTime { + AbsoluteTime { + ClockTime: u64, + CpuTime: u64 + } + } + + impl AbsoluteTime { + pub fn ClockTime(&self) -> &u64 { + match self { + AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => ClockTime, + } + } + pub fn CpuTime(&self) -> &u64 { + match self { + AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => CpuTime, + } + } + } + + impl Debug + for AbsoluteTime { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { + DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint + for AbsoluteTime { + fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { + match self { + AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => { + write!(_formatter, "Time.AbsoluteTime.AbsoluteTime(")?; + DafnyPrint::fmt_print(ClockTime, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(CpuTime, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq + for AbsoluteTime {} + + impl Hash + for AbsoluteTime { + fn hash<_H: Hasher>(&self, _state: &mut _H) { + match self { + AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => { + Hash::hash(ClockTime, _state); + Hash::hash(CpuTime, _state) + }, + } + } + } + + impl Default + for AbsoluteTime { + fn default() -> AbsoluteTime { + AbsoluteTime::AbsoluteTime { + ClockTime: Default::default(), + CpuTime: Default::default() + } + } + } + + impl AsRef + for &AbsoluteTime { + fn as_ref(&self) -> Self { + self + } + } + + #[derive(PartialEq, Clone)] + pub enum RelativeTime { + RelativeTime { + ClockTime: u64, + CpuTime: u64 + } + } + + impl RelativeTime { + pub fn ClockTime(&self) -> &u64 { + match self { + RelativeTime::RelativeTime{ClockTime, CpuTime, } => ClockTime, + } + } + pub fn CpuTime(&self) -> &u64 { + match self { + RelativeTime::RelativeTime{ClockTime, CpuTime, } => CpuTime, + } + } + } + + impl Debug + for RelativeTime { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { + DafnyPrint::fmt_print(self, f, true) + } + } + + impl DafnyPrint + for RelativeTime { + fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { + match self { + RelativeTime::RelativeTime{ClockTime, CpuTime, } => { + write!(_formatter, "Time.RelativeTime.RelativeTime(")?; + DafnyPrint::fmt_print(ClockTime, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(CpuTime, _formatter, false)?; + write!(_formatter, ")")?; + Ok(()) + }, + } + } + } + + impl Eq + for RelativeTime {} + + impl Hash + for RelativeTime { + fn hash<_H: Hasher>(&self, _state: &mut _H) { + match self { + RelativeTime::RelativeTime{ClockTime, CpuTime, } => { + Hash::hash(ClockTime, _state); + Hash::hash(CpuTime, _state) + }, + } + } + } + + impl Default + for RelativeTime { + fn default() -> RelativeTime { + RelativeTime::RelativeTime { + ClockTime: Default::default(), + CpuTime: Default::default() + } + } + } + + impl AsRef + for &RelativeTime { + fn as_ref(&self) -> Self { + self + } + } } pub mod UTF8 { pub use ::std::rc::Rc; diff --git a/releases/rust/esdk/src/lib.rs b/releases/rust/esdk/src/lib.rs index 8f8fb2cf5..53d53c28a 100644 --- a/releases/rust/esdk/src/lib.rs +++ b/releases/rust/esdk/src/lib.rs @@ -1,34 +1,97 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +//! The AWS Encryption SDK enables secure client-side encryption. +//! +//! Running `cargo test --examples` for this library runs these example keyrings. +//! +//! For details see the [Examples](https://github.com/aws/aws-encryption-sdk-dafny/tree/mainline/releases/rust/esdk/examples) +//! or the [Developer Guide](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html) +//! +//! One of the most common keyrings that you can use is the AWS KMS Keyring. +//! The AWS KMS keyring uses symmetric encryption KMS keys to generate, encrypt and +//! decrypt data keys. You provide the KMS Key and KMS client configuration while +//! providing the keyring. +//! +//! [See full example](https://github.com/aws/aws-encryption-sdk-dafny/blob/mainline/releases/rust/esdk/examples/keyring/aws_kms_keyring_example.rs) +//! +//! ```text +//! // Initialize ESDK client and MPL client +//! let esdk_config = AwsEncryptionSdkConfig::builder().build()?; +//! let esdk_client = esdk_client::Client::from_conf(esdk_config)?; +//! +//! let mpl_config = MaterialProvidersConfig::builder().build()?; +//! let mpl = mpl_client::Client::from_conf(mpl_config)?; +//! +//! // Create KMS Keyring +//! let kms_keyring = mpl +//! .create_aws_kms_keyring() +//! // your configuration here +//! .send() +//! .await?; +//! +//! // Encrypt +//! let encryption_response = esdk_client.encrypt() +//! .plaintext(plaintext) +//! .keyring(kms_keyring) +//! .encryption_context(encryption_context) +//! .send() +//! .await?; +//! +//! let ciphertext = encryption_response +//! .ciphertext +//! .expect("Unable to unwrap ciphertext from encryption response"); +//! +//! // Decrypt +//! let decryption_response = esdk_client.decrypt() +//! .ciphertext(ciphertext) +//! .keyring(kms_keyring) +//! .encryption_context(encryption_context) +//! .send() +//! .await?; +//! +//! let decrypted_plaintext = decryption_response +//! .plaintext +//! .expect("Unable to unwrap plaintext from decryption response"); +//! +//! // Demonstrate that the decrypted plaintext is identical to the original plaintext. +//! // (This is an example for demonstration; you do not need to do this in your own code.) +//! assert_eq!(decrypted_plaintext, aws_smithy_types::Blob::new(plaintext), +//! "Decrypted plaintext should be identical to the original plaintext. Invalid decryption"); +//! +//! ``` + #![allow(warnings, unconditional_panic)] #![allow(nonstandard_style)] #![allow(clippy::never_loop)] #![allow(clippy::absurd_extreme_comparisons)] +/// Client for using encrypt and decrypt operations pub mod client; -pub mod conversions; -pub mod deps; -/// Common errors and error handling utilities. +/// Errors and error handling utilities. pub mod error; /// All operations that this crate can perform. pub mod operation; +/// Types for the transform client. pub mod types; #[cfg(feature = "wrapped-client")] pub mod wrapped; -mod standard_library_conversions; -mod standard_library_externs; - pub use client::Client; pub use types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; -pub use crate::deps::aws_cryptography_keyStore; -pub use crate::deps::aws_cryptography_materialProviders; +/// Branch key support. See [Key Stores](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/keystores.html) +pub use crate::deps::aws_cryptography_keyStore as key_store; +/// [Key Rings](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html) and other fundamentals. +pub use crate::deps::aws_cryptography_materialProviders as material_providers; pub use crate::deps::aws_cryptography_primitives; +/// Rarely needed internal KMS Client, needed for [ClientSupplier](https://github.com/aws/aws-encryption-sdk-dafny/blob/mainline/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs) pub use crate::deps::com_amazonaws_kms; +mod standard_library_conversions; +mod standard_library_externs; + pub(crate) mod implementation_from_dafny; pub(crate) use crate::implementation_from_dafny::r#_Wrappers_Compile; pub(crate) use crate::implementation_from_dafny::software; @@ -46,6 +109,12 @@ pub(crate) use crate::implementation_from_dafny::HMAC; pub(crate) use crate::implementation_from_dafny::UTF8; pub(crate) use crate::implementation_from_dafny::UUID; +// Import smithy-generated modules +pub(crate) mod conversions; +pub(crate) mod deps; +pub(crate) mod validation; + +// Import externs pub(crate) mod aes_gcm; pub(crate) mod aes_kdf_ctr; pub(crate) mod concurrent_call; diff --git a/releases/rust/esdk/src/operation/decrypt.rs b/releases/rust/esdk/src/operation/decrypt.rs index a69680286..d575fb00b 100644 --- a/releases/rust/esdk/src/operation/decrypt.rs +++ b/releases/rust/esdk/src/operation/decrypt.rs @@ -18,12 +18,8 @@ impl Decrypt { crate::operation::decrypt::DecryptOutput, crate::types::error::Error, > { - if input.ciphertext.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "ciphertext", - "ciphertext was not specified but it is required when building DecryptInput", - )).map_err(crate::types::error::Error::wrap_validation_err); -} + crate::validation::validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_for_AwsEncryptionSdk_Decrypt(&input) + .map_err(crate::types::error::Error::wrap_validation_err)?; let inner_input = crate::conversions::decrypt::_decrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).Decrypt(&inner_input); diff --git a/releases/rust/esdk/src/operation/encrypt.rs b/releases/rust/esdk/src/operation/encrypt.rs index 3829cf18d..3d3fe83ca 100644 --- a/releases/rust/esdk/src/operation/encrypt.rs +++ b/releases/rust/esdk/src/operation/encrypt.rs @@ -18,18 +18,8 @@ impl Encrypt { crate::operation::encrypt::EncryptOutput, crate::types::error::Error, > { - if input.plaintext.is_none() { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( - "plaintext", - "plaintext was not specified but it is required when building EncryptInput", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.frame_length, Some(x) if !(1..=4294967296).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "frame_length", - "frame_length failed to satisfy constraint: Member must be between 1 and 4294967296, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} + crate::validation::validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_for_AwsEncryptionSdk_Encrypt(&input) + .map_err(crate::types::error::Error::wrap_validation_err)?; let inner_input = crate::conversions::encrypt::_encrypt_input::to_dafny(input); let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).Encrypt(&inner_input); diff --git a/releases/rust/esdk/src/rsa.rs b/releases/rust/esdk/src/rsa.rs index 9bb76d9cc..650d72a2b 100644 --- a/releases/rust/esdk/src/rsa.rs +++ b/releases/rust/esdk/src/rsa.rs @@ -12,8 +12,8 @@ pub mod RSAEncryption { use crate::_Wrappers_Compile as Wrappers; use crate::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode; use crate::*; - use ::std::rc::Rc; use aws_lc_rs::encoding::{AsDer, Pkcs8V1Der, PublicKeyX509Der}; + use std::rc::Rc; use aws_lc_rs::rsa::KeySize; use aws_lc_rs::rsa::OaepAlgorithm; diff --git a/releases/rust/esdk/src/storm_tracker.rs b/releases/rust/esdk/src/storm_tracker.rs index 7c0b59a7a..9ca4461ca 100644 --- a/releases/rust/esdk/src/storm_tracker.rs +++ b/releases/rust/esdk/src/storm_tracker.rs @@ -25,8 +25,8 @@ pub mod internal_StormTrackingCMC { } } - impl ::dafny_runtime::UpcastObject for StormTrackingCMC { - ::dafny_runtime::UpcastObjectFn!(dyn::std::any::Any); + impl ::dafny_runtime::UpcastObject for StormTrackingCMC { + ::dafny_runtime::UpcastObjectFn!(dyn ::std::any::Any); } impl ::dafny_runtime::UpcastObject diff --git a/releases/rust/esdk/src/time.rs b/releases/rust/esdk/src/time.rs index cb170033f..3182c8020 100644 --- a/releases/rust/esdk/src/time.rs +++ b/releases/rust/esdk/src/time.rs @@ -6,6 +6,7 @@ #![deny(clippy::all)] use crate::*; +use std::convert::TryFrom; use std::time::SystemTime; impl crate::Time::_default { @@ -26,6 +27,13 @@ impl crate::Time::_default { } } + #[allow(non_snake_case)] + #[allow(dead_code)] + pub fn GetProcessCpuTimeMillis() -> i64 { + i64::try_from(cpu_time::ProcessTime::now().as_duration().as_millis()) + .expect("CPU millisecond didn't fit in an i64") + } + #[allow(non_snake_case)] pub fn GetCurrentTimeStamp() -> ::std::rc::Rc< _Wrappers_Compile::Result< diff --git a/releases/rust/esdk/src/types.rs b/releases/rust/esdk/src/types.rs index c9ff218a5..5b35243e0 100644 --- a/releases/rust/esdk/src/types.rs +++ b/releases/rust/esdk/src/types.rs @@ -3,6 +3,7 @@ // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. /// Types for the `AwsEncryptionSdkConfig` pub mod aws_encryption_sdk_config; +pub use crate::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig; pub mod builders; diff --git a/releases/rust/esdk/src/validation.rs b/releases/rust/esdk/src/validation.rs new file mode 100644 index 000000000..999d58bba --- /dev/null +++ b/releases/rust/esdk/src/validation.rs @@ -0,0 +1,374 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig(input: &crate::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig_DcommitmentPolicy(&input.commitment_policy)?; +validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig_DmaxEncryptedDataKeys(&input.max_encrypted_data_keys)?; +validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig_DnetV4__0__0__RetryPolicy(&input.net_v4_0_0_retry_policy)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig_DcommitmentPolicy(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig_DmaxEncryptedDataKeys(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "max_encrypted_data_keys", + "max_encrypted_data_keys failed to satisfy constraint: Member must be greater than or equal to 1", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig_DnetV4__0__0__RetryPolicy(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptInput(input: &crate::types::DecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_Dciphertext(&input.ciphertext)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_DmaterialsManager(&input.materials_manager)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_Dkeyring(&input.keyring)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_DencryptionContext(&input.encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_for_AwsEncryptionSdk_Decrypt(input: &crate::operation::decrypt::DecryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_Dciphertext(&input.ciphertext)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_DmaterialsManager(&input.materials_manager)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_Dkeyring(&input.keyring)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_DencryptionContext(&input.encryption_context)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_Dciphertext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ciphertext", + "ciphertext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_Dkeyring(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptInput_DmaterialsManager(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput(input: &crate::types::DecryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_Dplaintext(&input.plaintext)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_DalgorithmSuiteId(&input.algorithm_suite_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_for_AwsEncryptionSdk_Decrypt(input: &crate::operation::decrypt::DecryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_Dplaintext(&input.plaintext)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_DalgorithmSuiteId(&input.algorithm_suite_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite_id", + "algorithm_suite_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HDecryptOutput_Dplaintext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "plaintext", + "plaintext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput(input: &crate::types::EncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_Dplaintext(&input.plaintext)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DmaterialsManager(&input.materials_manager)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_Dkeyring(&input.keyring)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DframeLength(&input.frame_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_for_AwsEncryptionSdk_Encrypt(input: &crate::operation::encrypt::EncryptInput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_Dplaintext(&input.plaintext)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DmaterialsManager(&input.materials_manager)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_Dkeyring(&input.keyring)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DalgorithmSuiteId(&input.algorithm_suite_id)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DframeLength(&input.frame_length)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DframeLength(input: &::std::option::Option<::std::primitive::i64>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +if !(1..=4294967296).contains(input) { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( + "frame_length", + "frame_length failed to satisfy constraint: Member must be between 1 and 4294967296, inclusive", + )); +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_Dkeyring(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_DmaterialsManager(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_Dplaintext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "plaintext", + "plaintext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput(input: &crate::types::EncryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_Dciphertext(&input.ciphertext)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_DalgorithmSuiteId(&input.algorithm_suite_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_for_AwsEncryptionSdk_Encrypt(input: &crate::operation::encrypt::EncryptOutput) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_Dciphertext(&input.ciphertext)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_DencryptionContext(&input.encryption_context)?; +validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_DalgorithmSuiteId(&input.algorithm_suite_id)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_DalgorithmSuiteId(input: &::std::option::Option) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "algorithm_suite_id", + "algorithm_suite_id is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_Dciphertext(input: &::std::option::Option<::aws_smithy_types::Blob>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "ciphertext", + "ciphertext is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PencryptionSdk_HEncryptOutput_DencryptionContext(input: &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + if input.is_none() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "encryption_context", + "encryption_context is required but was not specified", + )); +} +if input.is_none() { + return ::std::result::Result::Ok(()); +} +let input = input.as_ref().unwrap(); + +validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input)?; + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HCryptographicMaterialsManagerReference(input: &crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext(input: &::std::collections::HashMap<::std::string::String, ::std::string::String>) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + for (inner_key, inner_val) in input.iter() { + validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dkey(inner_key)?; + validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dvalue(inner_val)?; +} + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dkey(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HEncryptionContext_Dvalue(input: &::std::string::String) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +} +pub(crate) fn validate_aws_Pcryptography_PmaterialProviders_HKeyringReference(input: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef) + -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> +{ + + Ok(()) +}