Struct aws_sdk_ssm::error::CreateAssociationBatchError
source · #[non_exhaustive]pub struct CreateAssociationBatchError {
pub kind: CreateAssociationBatchErrorKind,
/* private fields */
}
Expand description
Error type for the CreateAssociationBatch
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: CreateAssociationBatchErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateAssociationBatchError
impl CreateAssociationBatchError
sourcepub fn new(kind: CreateAssociationBatchErrorKind, meta: Error) -> Self
pub fn new(kind: CreateAssociationBatchErrorKind, meta: Error) -> Self
Creates a new CreateAssociationBatchError
.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the CreateAssociationBatchError::Unhandled
variant from any error type.
Examples found in repository?
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 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993
pub fn parse_create_association_batch_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateAssociationBatchOutput,
crate::error::CreateAssociationBatchError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateAssociationBatchError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateAssociationBatchError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AssociationLimitExceeded" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::AssociationLimitExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::association_limit_exceeded::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_association_limit_exceeded_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DuplicateInstanceId" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::DuplicateInstanceId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::duplicate_instance_id::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_duplicate_instance_id_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidDocument" => {
crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidDocument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_document::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_document_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidDocumentVersion" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidDocumentVersion({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_document_version::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_document_version_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidInstanceId" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidInstanceId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_instance_id::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_instance_id_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidOutputLocation" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidOutputLocation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_output_location::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_output_location_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameters" => {
crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidParameters({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_parameters::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameters_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidSchedule" => {
crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidSchedule({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_schedule::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_schedule_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidTarget" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidTarget({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_target::Builder::default();
let _ = response;
output =
crate::json_deser::deser_structure_crate_error_invalid_target_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidTargetMaps" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidTargetMaps({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_target_maps::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_target_maps_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedPlatformType" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::UnsupportedPlatformType({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unsupported_platform_type::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_platform_type_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateAssociationBatchError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateAssociationBatchError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
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 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993
pub fn parse_create_association_batch_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateAssociationBatchOutput,
crate::error::CreateAssociationBatchError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateAssociationBatchError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateAssociationBatchError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AssociationLimitExceeded" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::AssociationLimitExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::association_limit_exceeded::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_association_limit_exceeded_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DuplicateInstanceId" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::DuplicateInstanceId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::duplicate_instance_id::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_duplicate_instance_id_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidDocument" => {
crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidDocument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_document::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_document_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidDocumentVersion" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidDocumentVersion({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_document_version::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_document_version_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidInstanceId" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidInstanceId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_instance_id::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_instance_id_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidOutputLocation" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidOutputLocation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_output_location::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_output_location_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameters" => {
crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidParameters({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_parameters::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameters_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidSchedule" => {
crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidSchedule({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_schedule::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_schedule_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidTarget" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidTarget({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_target::Builder::default();
let _ = response;
output =
crate::json_deser::deser_structure_crate_error_invalid_target_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidTargetMaps" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::InvalidTargetMaps({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_target_maps::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_target_maps_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedPlatformType" => crate::error::CreateAssociationBatchError {
meta: generic,
kind: crate::error::CreateAssociationBatchErrorKind::UnsupportedPlatformType({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unsupported_platform_type::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_platform_type_json_err(response.body().as_ref(), output).map_err(crate::error::CreateAssociationBatchError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateAssociationBatchError::generic(generic),
})
}
sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_association_limit_exceeded(&self) -> bool
pub fn is_association_limit_exceeded(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::AssociationLimitExceeded
.
sourcepub fn is_duplicate_instance_id(&self) -> bool
pub fn is_duplicate_instance_id(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::DuplicateInstanceId
.
sourcepub fn is_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InternalServerError
.
sourcepub fn is_invalid_document(&self) -> bool
pub fn is_invalid_document(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidDocument
.
sourcepub fn is_invalid_document_version(&self) -> bool
pub fn is_invalid_document_version(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidDocumentVersion
.
sourcepub fn is_invalid_instance_id(&self) -> bool
pub fn is_invalid_instance_id(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidInstanceId
.
sourcepub fn is_invalid_output_location(&self) -> bool
pub fn is_invalid_output_location(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidOutputLocation
.
sourcepub fn is_invalid_parameters(&self) -> bool
pub fn is_invalid_parameters(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidParameters
.
sourcepub fn is_invalid_schedule(&self) -> bool
pub fn is_invalid_schedule(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidSchedule
.
sourcepub fn is_invalid_target(&self) -> bool
pub fn is_invalid_target(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidTarget
.
sourcepub fn is_invalid_target_maps(&self) -> bool
pub fn is_invalid_target_maps(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::InvalidTargetMaps
.
sourcepub fn is_unsupported_platform_type(&self) -> bool
pub fn is_unsupported_platform_type(&self) -> bool
Returns true
if the error kind is CreateAssociationBatchErrorKind::UnsupportedPlatformType
.