#[non_exhaustive]
pub enum EncryptionAlgorithmSpec {
RsaesOaepSha1,
RsaesOaepSha256,
Sm2Pke,
SymmetricDefault,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against EncryptionAlgorithmSpec
, it is important to ensure
your code is forward-compatible. That is, if a match arm handles a case for a
feature that is supported by the service but has not been represented as an enum
variant in a current version of SDK, your code should continue to work when you
upgrade SDK to a future version in which the enum does include a variant for that
feature.
Here is an example of how you can make a match expression forward-compatible:
# let encryptionalgorithmspec = unimplemented!();
match encryptionalgorithmspec {
EncryptionAlgorithmSpec::RsaesOaepSha1 => { /* ... */ },
EncryptionAlgorithmSpec::RsaesOaepSha256 => { /* ... */ },
EncryptionAlgorithmSpec::Sm2Pke => { /* ... */ },
EncryptionAlgorithmSpec::SymmetricDefault => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when encryptionalgorithmspec
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant EncryptionAlgorithmSpec::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
EncryptionAlgorithmSpec::Unknown(UnknownVariantValue("NewFeature".to_owned()))
and calling as_str
on it yields "NewFeature"
.
This match expression is forward-compatible when executed with a newer
version of SDK where the variant EncryptionAlgorithmSpec::NewFeature
is defined.
Specifically, when encryptionalgorithmspec
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on EncryptionAlgorithmSpec::NewFeature
also yielding "NewFeature"
.
Explicitly matching on the Unknown
variant should
be avoided for two reasons:
- The inner data
UnknownVariantValue
is opaque, and no further information can be extracted. - It might inadvertently shadow other intended match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RsaesOaepSha1
RsaesOaepSha256
Sm2Pke
SymmetricDefault
Unknown(UnknownVariantValue)
Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl EncryptionAlgorithmSpec
impl EncryptionAlgorithmSpec
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the &str
value of the enum member.
Examples found in repository?
More examples
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802
pub fn serialize_structure_crate_input_decrypt_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DecryptInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_33) = &input.ciphertext_blob {
object
.key("CiphertextBlob")
.string_unchecked(&aws_smithy_types::base64::encode(var_33));
}
if let Some(var_34) = &input.encryption_context {
#[allow(unused_mut)]
let mut object_35 = object.key("EncryptionContext").start_object();
for (key_36, value_37) in var_34 {
{
object_35.key(key_36.as_str()).string(value_37.as_str());
}
}
object_35.finish();
}
if let Some(var_38) = &input.grant_tokens {
let mut array_39 = object.key("GrantTokens").start_array();
for item_40 in var_38 {
{
array_39.value().string(item_40.as_str());
}
}
array_39.finish();
}
if let Some(var_41) = &input.key_id {
object.key("KeyId").string(var_41.as_str());
}
if let Some(var_42) = &input.encryption_algorithm {
object.key("EncryptionAlgorithm").string(var_42.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_delete_alias_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DeleteAliasInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_43) = &input.alias_name {
object.key("AliasName").string(var_43.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_delete_custom_key_store_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DeleteCustomKeyStoreInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_44) = &input.custom_key_store_id {
object.key("CustomKeyStoreId").string(var_44.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_delete_imported_key_material_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DeleteImportedKeyMaterialInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_45) = &input.key_id {
object.key("KeyId").string(var_45.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_custom_key_stores_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeCustomKeyStoresInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_46) = &input.custom_key_store_id {
object.key("CustomKeyStoreId").string(var_46.as_str());
}
if let Some(var_47) = &input.custom_key_store_name {
object.key("CustomKeyStoreName").string(var_47.as_str());
}
if let Some(var_48) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_48).into()),
);
}
if let Some(var_49) = &input.marker {
object.key("Marker").string(var_49.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_describe_key_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeKeyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_50) = &input.key_id {
object.key("KeyId").string(var_50.as_str());
}
if let Some(var_51) = &input.grant_tokens {
let mut array_52 = object.key("GrantTokens").start_array();
for item_53 in var_51 {
{
array_52.value().string(item_53.as_str());
}
}
array_52.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_disable_key_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DisableKeyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_54) = &input.key_id {
object.key("KeyId").string(var_54.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_disable_key_rotation_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DisableKeyRotationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_55) = &input.key_id {
object.key("KeyId").string(var_55.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_disconnect_custom_key_store_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DisconnectCustomKeyStoreInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_56) = &input.custom_key_store_id {
object.key("CustomKeyStoreId").string(var_56.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_enable_key_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::EnableKeyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_57) = &input.key_id {
object.key("KeyId").string(var_57.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_enable_key_rotation_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::EnableKeyRotationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_58) = &input.key_id {
object.key("KeyId").string(var_58.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_encrypt_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::EncryptInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_59) = &input.key_id {
object.key("KeyId").string(var_59.as_str());
}
if let Some(var_60) = &input.plaintext {
object
.key("Plaintext")
.string_unchecked(&aws_smithy_types::base64::encode(var_60));
}
if let Some(var_61) = &input.encryption_context {
#[allow(unused_mut)]
let mut object_62 = object.key("EncryptionContext").start_object();
for (key_63, value_64) in var_61 {
{
object_62.key(key_63.as_str()).string(value_64.as_str());
}
}
object_62.finish();
}
if let Some(var_65) = &input.grant_tokens {
let mut array_66 = object.key("GrantTokens").start_array();
for item_67 in var_65 {
{
array_66.value().string(item_67.as_str());
}
}
array_66.finish();
}
if let Some(var_68) = &input.encryption_algorithm {
object.key("EncryptionAlgorithm").string(var_68.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_generate_data_key_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GenerateDataKeyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_69) = &input.key_id {
object.key("KeyId").string(var_69.as_str());
}
if let Some(var_70) = &input.encryption_context {
#[allow(unused_mut)]
let mut object_71 = object.key("EncryptionContext").start_object();
for (key_72, value_73) in var_70 {
{
object_71.key(key_72.as_str()).string(value_73.as_str());
}
}
object_71.finish();
}
if let Some(var_74) = &input.number_of_bytes {
object.key("NumberOfBytes").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_74).into()),
);
}
if let Some(var_75) = &input.key_spec {
object.key("KeySpec").string(var_75.as_str());
}
if let Some(var_76) = &input.grant_tokens {
let mut array_77 = object.key("GrantTokens").start_array();
for item_78 in var_76 {
{
array_77.value().string(item_78.as_str());
}
}
array_77.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_generate_data_key_pair_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GenerateDataKeyPairInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_79) = &input.encryption_context {
#[allow(unused_mut)]
let mut object_80 = object.key("EncryptionContext").start_object();
for (key_81, value_82) in var_79 {
{
object_80.key(key_81.as_str()).string(value_82.as_str());
}
}
object_80.finish();
}
if let Some(var_83) = &input.key_id {
object.key("KeyId").string(var_83.as_str());
}
if let Some(var_84) = &input.key_pair_spec {
object.key("KeyPairSpec").string(var_84.as_str());
}
if let Some(var_85) = &input.grant_tokens {
let mut array_86 = object.key("GrantTokens").start_array();
for item_87 in var_85 {
{
array_86.value().string(item_87.as_str());
}
}
array_86.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_generate_data_key_pair_without_plaintext_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GenerateDataKeyPairWithoutPlaintextInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_88) = &input.encryption_context {
#[allow(unused_mut)]
let mut object_89 = object.key("EncryptionContext").start_object();
for (key_90, value_91) in var_88 {
{
object_89.key(key_90.as_str()).string(value_91.as_str());
}
}
object_89.finish();
}
if let Some(var_92) = &input.key_id {
object.key("KeyId").string(var_92.as_str());
}
if let Some(var_93) = &input.key_pair_spec {
object.key("KeyPairSpec").string(var_93.as_str());
}
if let Some(var_94) = &input.grant_tokens {
let mut array_95 = object.key("GrantTokens").start_array();
for item_96 in var_94 {
{
array_95.value().string(item_96.as_str());
}
}
array_95.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_generate_data_key_without_plaintext_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GenerateDataKeyWithoutPlaintextInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_97) = &input.key_id {
object.key("KeyId").string(var_97.as_str());
}
if let Some(var_98) = &input.encryption_context {
#[allow(unused_mut)]
let mut object_99 = object.key("EncryptionContext").start_object();
for (key_100, value_101) in var_98 {
{
object_99.key(key_100.as_str()).string(value_101.as_str());
}
}
object_99.finish();
}
if let Some(var_102) = &input.key_spec {
object.key("KeySpec").string(var_102.as_str());
}
if let Some(var_103) = &input.number_of_bytes {
object.key("NumberOfBytes").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_103).into()),
);
}
if let Some(var_104) = &input.grant_tokens {
let mut array_105 = object.key("GrantTokens").start_array();
for item_106 in var_104 {
{
array_105.value().string(item_106.as_str());
}
}
array_105.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_generate_mac_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GenerateMacInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_107) = &input.message {
object
.key("Message")
.string_unchecked(&aws_smithy_types::base64::encode(var_107));
}
if let Some(var_108) = &input.key_id {
object.key("KeyId").string(var_108.as_str());
}
if let Some(var_109) = &input.mac_algorithm {
object.key("MacAlgorithm").string(var_109.as_str());
}
if let Some(var_110) = &input.grant_tokens {
let mut array_111 = object.key("GrantTokens").start_array();
for item_112 in var_110 {
{
array_111.value().string(item_112.as_str());
}
}
array_111.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_generate_random_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GenerateRandomInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_113) = &input.number_of_bytes {
object.key("NumberOfBytes").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_113).into()),
);
}
if let Some(var_114) = &input.custom_key_store_id {
object.key("CustomKeyStoreId").string(var_114.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_get_key_policy_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GetKeyPolicyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_115) = &input.key_id {
object.key("KeyId").string(var_115.as_str());
}
if let Some(var_116) = &input.policy_name {
object.key("PolicyName").string(var_116.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_get_key_rotation_status_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GetKeyRotationStatusInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_117) = &input.key_id {
object.key("KeyId").string(var_117.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_get_parameters_for_import_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GetParametersForImportInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_118) = &input.key_id {
object.key("KeyId").string(var_118.as_str());
}
if let Some(var_119) = &input.wrapping_algorithm {
object.key("WrappingAlgorithm").string(var_119.as_str());
}
if let Some(var_120) = &input.wrapping_key_spec {
object.key("WrappingKeySpec").string(var_120.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_get_public_key_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::GetPublicKeyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_121) = &input.key_id {
object.key("KeyId").string(var_121.as_str());
}
if let Some(var_122) = &input.grant_tokens {
let mut array_123 = object.key("GrantTokens").start_array();
for item_124 in var_122 {
{
array_123.value().string(item_124.as_str());
}
}
array_123.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_import_key_material_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ImportKeyMaterialInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_125) = &input.key_id {
object.key("KeyId").string(var_125.as_str());
}
if let Some(var_126) = &input.import_token {
object
.key("ImportToken")
.string_unchecked(&aws_smithy_types::base64::encode(var_126));
}
if let Some(var_127) = &input.encrypted_key_material {
object
.key("EncryptedKeyMaterial")
.string_unchecked(&aws_smithy_types::base64::encode(var_127));
}
if let Some(var_128) = &input.valid_to {
object
.key("ValidTo")
.date_time(var_128, aws_smithy_types::date_time::Format::EpochSeconds)?;
}
if let Some(var_129) = &input.expiration_model {
object.key("ExpirationModel").string(var_129.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_list_aliases_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListAliasesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_130) = &input.key_id {
object.key("KeyId").string(var_130.as_str());
}
if let Some(var_131) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_131).into()),
);
}
if let Some(var_132) = &input.marker {
object.key("Marker").string(var_132.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_list_grants_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListGrantsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_133) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_133).into()),
);
}
if let Some(var_134) = &input.marker {
object.key("Marker").string(var_134.as_str());
}
if let Some(var_135) = &input.key_id {
object.key("KeyId").string(var_135.as_str());
}
if let Some(var_136) = &input.grant_id {
object.key("GrantId").string(var_136.as_str());
}
if let Some(var_137) = &input.grantee_principal {
object.key("GranteePrincipal").string(var_137.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_list_key_policies_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListKeyPoliciesInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_138) = &input.key_id {
object.key("KeyId").string(var_138.as_str());
}
if let Some(var_139) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_139).into()),
);
}
if let Some(var_140) = &input.marker {
object.key("Marker").string(var_140.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_list_keys_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListKeysInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_141) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_141).into()),
);
}
if let Some(var_142) = &input.marker {
object.key("Marker").string(var_142.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_list_resource_tags_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListResourceTagsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_143) = &input.key_id {
object.key("KeyId").string(var_143.as_str());
}
if let Some(var_144) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_144).into()),
);
}
if let Some(var_145) = &input.marker {
object.key("Marker").string(var_145.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_list_retirable_grants_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ListRetirableGrantsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_146) = &input.limit {
object.key("Limit").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_146).into()),
);
}
if let Some(var_147) = &input.marker {
object.key("Marker").string(var_147.as_str());
}
if let Some(var_148) = &input.retiring_principal {
object.key("RetiringPrincipal").string(var_148.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_put_key_policy_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::PutKeyPolicyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_149) = &input.key_id {
object.key("KeyId").string(var_149.as_str());
}
if let Some(var_150) = &input.policy_name {
object.key("PolicyName").string(var_150.as_str());
}
if let Some(var_151) = &input.policy {
object.key("Policy").string(var_151.as_str());
}
if input.bypass_policy_lockout_safety_check {
object
.key("BypassPolicyLockoutSafetyCheck")
.boolean(input.bypass_policy_lockout_safety_check);
}
Ok(())
}
pub fn serialize_structure_crate_input_re_encrypt_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ReEncryptInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_152) = &input.ciphertext_blob {
object
.key("CiphertextBlob")
.string_unchecked(&aws_smithy_types::base64::encode(var_152));
}
if let Some(var_153) = &input.source_encryption_context {
#[allow(unused_mut)]
let mut object_154 = object.key("SourceEncryptionContext").start_object();
for (key_155, value_156) in var_153 {
{
object_154.key(key_155.as_str()).string(value_156.as_str());
}
}
object_154.finish();
}
if let Some(var_157) = &input.source_key_id {
object.key("SourceKeyId").string(var_157.as_str());
}
if let Some(var_158) = &input.destination_key_id {
object.key("DestinationKeyId").string(var_158.as_str());
}
if let Some(var_159) = &input.destination_encryption_context {
#[allow(unused_mut)]
let mut object_160 = object.key("DestinationEncryptionContext").start_object();
for (key_161, value_162) in var_159 {
{
object_160.key(key_161.as_str()).string(value_162.as_str());
}
}
object_160.finish();
}
if let Some(var_163) = &input.source_encryption_algorithm {
object
.key("SourceEncryptionAlgorithm")
.string(var_163.as_str());
}
if let Some(var_164) = &input.destination_encryption_algorithm {
object
.key("DestinationEncryptionAlgorithm")
.string(var_164.as_str());
}
if let Some(var_165) = &input.grant_tokens {
let mut array_166 = object.key("GrantTokens").start_array();
for item_167 in var_165 {
{
array_166.value().string(item_167.as_str());
}
}
array_166.finish();
}
Ok(())
}
Trait Implementations§
source§impl AsRef<str> for EncryptionAlgorithmSpec
impl AsRef<str> for EncryptionAlgorithmSpec
source§impl Clone for EncryptionAlgorithmSpec
impl Clone for EncryptionAlgorithmSpec
source§fn clone(&self) -> EncryptionAlgorithmSpec
fn clone(&self) -> EncryptionAlgorithmSpec
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EncryptionAlgorithmSpec
impl Debug for EncryptionAlgorithmSpec
source§impl From<&str> for EncryptionAlgorithmSpec
impl From<&str> for EncryptionAlgorithmSpec
source§impl FromStr for EncryptionAlgorithmSpec
impl FromStr for EncryptionAlgorithmSpec
source§impl Hash for EncryptionAlgorithmSpec
impl Hash for EncryptionAlgorithmSpec
source§impl Ord for EncryptionAlgorithmSpec
impl Ord for EncryptionAlgorithmSpec
source§fn cmp(&self, other: &EncryptionAlgorithmSpec) -> Ordering
fn cmp(&self, other: &EncryptionAlgorithmSpec) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<EncryptionAlgorithmSpec> for EncryptionAlgorithmSpec
impl PartialEq<EncryptionAlgorithmSpec> for EncryptionAlgorithmSpec
source§fn eq(&self, other: &EncryptionAlgorithmSpec) -> bool
fn eq(&self, other: &EncryptionAlgorithmSpec) -> bool
source§impl PartialOrd<EncryptionAlgorithmSpec> for EncryptionAlgorithmSpec
impl PartialOrd<EncryptionAlgorithmSpec> for EncryptionAlgorithmSpec
source§fn partial_cmp(&self, other: &EncryptionAlgorithmSpec) -> Option<Ordering>
fn partial_cmp(&self, other: &EncryptionAlgorithmSpec) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for EncryptionAlgorithmSpec
impl StructuralEq for EncryptionAlgorithmSpec
impl StructuralPartialEq for EncryptionAlgorithmSpec
Auto Trait Implementations§
impl RefUnwindSafe for EncryptionAlgorithmSpec
impl Send for EncryptionAlgorithmSpec
impl Sync for EncryptionAlgorithmSpec
impl Unpin for EncryptionAlgorithmSpec
impl UnwindSafe for EncryptionAlgorithmSpec
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.