// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DeleteAssociationInput {
/// <p>The name of the SSM document.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The managed node ID.</p><note>
/// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
/// </note>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>The association ID that you want to delete.</p>
pub association_id: ::std::option::Option<::std::string::String>,
}
impl DeleteAssociationInput {
/// <p>The name of the SSM document.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The managed node ID.</p><note>
/// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
/// </note>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>The association ID that you want to delete.</p>
pub fn association_id(&self) -> ::std::option::Option<&str> {
self.association_id.as_deref()
}
}
static DELETEASSOCIATIONINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteAssociationInput$Name",
"com.amazonaws.ssm.synthetic",
"DeleteAssociationInput",
),
::aws_smithy_schema::ShapeType::String,
"Name",
0,
);
static DELETEASSOCIATIONINPUT_MEMBER_INSTANCE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteAssociationInput$InstanceId",
"com.amazonaws.ssm.synthetic",
"DeleteAssociationInput",
),
::aws_smithy_schema::ShapeType::String,
"InstanceId",
1,
);
static DELETEASSOCIATIONINPUT_MEMBER_ASSOCIATION_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteAssociationInput$AssociationId",
"com.amazonaws.ssm.synthetic",
"DeleteAssociationInput",
),
::aws_smithy_schema::ShapeType::String,
"AssociationId",
2,
);
static DELETEASSOCIATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ssm.synthetic#DeleteAssociationInput",
"com.amazonaws.ssm.synthetic",
"DeleteAssociationInput",
),
::aws_smithy_schema::ShapeType::Structure,
&[
&DELETEASSOCIATIONINPUT_MEMBER_NAME,
&DELETEASSOCIATIONINPUT_MEMBER_INSTANCE_ID,
&DELETEASSOCIATIONINPUT_MEMBER_ASSOCIATION_ID,
],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DeleteAssociationRequest");
impl DeleteAssociationInput {
/// The schema for this shape.
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DELETEASSOCIATIONINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DeleteAssociationInput {
fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
Self::SCHEMA
}
#[allow(unused_variables, clippy::diverging_sub_expression)]
fn serialize_members(
&self,
ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
if let Some(ref val) = self.name {
ser.write_string(&DELETEASSOCIATIONINPUT_MEMBER_NAME, val)?;
}
if let Some(ref val) = self.instance_id {
ser.write_string(&DELETEASSOCIATIONINPUT_MEMBER_INSTANCE_ID, val)?;
}
if let Some(ref val) = self.association_id {
ser.write_string(&DELETEASSOCIATIONINPUT_MEMBER_ASSOCIATION_ID, val)?;
}
Ok(())
}
}
impl crate::operation::delete_association::builders::DeleteAssociationInputBuilder {
#[allow(
unused_variables,
unreachable_code,
clippy::single_match,
clippy::match_single_binding,
clippy::diverging_sub_expression
)]
pub(crate) fn deserialize_members(
&mut self,
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
deserializer.read_struct(&DELETEASSOCIATIONINPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.name = Some(deser.read_string(member)?);
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.instance_id = Some(deser.read_string(member)?);
}
}
Some(2) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.association_id = Some(deser.read_string(member)?);
}
}
_ => {}
}
Ok(())
})
}
}
impl DeleteAssociationInput {
/// Deserializes this structure from a [`ShapeDeserializer`].
pub fn deserialize(
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
let mut builder = Self::builder();
builder.deserialize_members(deserializer)?;
builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
}
}
impl DeleteAssociationInput {
/// Creates a new builder-style object to manufacture [`DeleteAssociationInput`](crate::operation::delete_association::DeleteAssociationInput).
pub fn builder() -> crate::operation::delete_association::builders::DeleteAssociationInputBuilder {
crate::operation::delete_association::builders::DeleteAssociationInputBuilder::default()
}
}
/// A builder for [`DeleteAssociationInput`](crate::operation::delete_association::DeleteAssociationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeleteAssociationInputBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) association_id: ::std::option::Option<::std::string::String>,
}
impl DeleteAssociationInputBuilder {
/// <p>The name of the SSM document.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the SSM document.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the SSM document.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The managed node ID.</p><note>
/// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
/// </note>
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The managed node ID.</p><note>
/// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
/// </note>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The managed node ID.</p><note>
/// <p><code>InstanceId</code> has been deprecated. To specify a managed node ID for an association, use the <code>Targets</code> parameter. Requests that include the parameter <code>InstanceID</code> with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter <code>InstanceId</code>, you can't use the parameters <code>AssociationName</code>, <code>DocumentVersion</code>, <code>MaxErrors</code>, <code>MaxConcurrency</code>, <code>OutputLocation</code>, or <code>ScheduleExpression</code>. To use these parameters, you must use the <code>Targets</code> parameter.</p>
/// </note>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>The association ID that you want to delete.</p>
pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.association_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The association ID that you want to delete.</p>
pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.association_id = input;
self
}
/// <p>The association ID that you want to delete.</p>
pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
&self.association_id
}
/// Consumes the builder and constructs a [`DeleteAssociationInput`](crate::operation::delete_association::DeleteAssociationInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::delete_association::DeleteAssociationInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::delete_association::DeleteAssociationInput {
name: self.name,
instance_id: self.instance_id,
association_id: self.association_id,
})
}
}