aws_sdk_ssm/operation/cancel_command/
_cancel_command_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CancelCommandInput {
7 pub command_id: ::std::option::Option<::std::string::String>,
9 pub instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11}
12impl CancelCommandInput {
13 pub fn command_id(&self) -> ::std::option::Option<&str> {
15 self.command_id.as_deref()
16 }
17 pub fn instance_ids(&self) -> &[::std::string::String] {
21 self.instance_ids.as_deref().unwrap_or_default()
22 }
23}
24impl CancelCommandInput {
25 pub fn builder() -> crate::operation::cancel_command::builders::CancelCommandInputBuilder {
27 crate::operation::cancel_command::builders::CancelCommandInputBuilder::default()
28 }
29}
30
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct CancelCommandInputBuilder {
35 pub(crate) command_id: ::std::option::Option<::std::string::String>,
36 pub(crate) instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
37}
38impl CancelCommandInputBuilder {
39 pub fn command_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42 self.command_id = ::std::option::Option::Some(input.into());
43 self
44 }
45 pub fn set_command_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47 self.command_id = input;
48 self
49 }
50 pub fn get_command_id(&self) -> &::std::option::Option<::std::string::String> {
52 &self.command_id
53 }
54 pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 let mut v = self.instance_ids.unwrap_or_default();
61 v.push(input.into());
62 self.instance_ids = ::std::option::Option::Some(v);
63 self
64 }
65 pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
67 self.instance_ids = input;
68 self
69 }
70 pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
72 &self.instance_ids
73 }
74 pub fn build(
76 self,
77 ) -> ::std::result::Result<crate::operation::cancel_command::CancelCommandInput, ::aws_smithy_types::error::operation::BuildError> {
78 ::std::result::Result::Ok(crate::operation::cancel_command::CancelCommandInput {
79 command_id: self.command_id,
80 instance_ids: self.instance_ids,
81 })
82 }
83}