aws_sdk_gamelift/operation/accept_match/
_accept_match_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct AcceptMatchInput {
6 pub ticket_id: ::std::option::Option<::std::string::String>,
8 pub player_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10 pub acceptance_type: ::std::option::Option<crate::types::AcceptanceType>,
12}
13impl AcceptMatchInput {
14 pub fn ticket_id(&self) -> ::std::option::Option<&str> {
16 self.ticket_id.as_deref()
17 }
18 pub fn player_ids(&self) -> &[::std::string::String] {
22 self.player_ids.as_deref().unwrap_or_default()
23 }
24 pub fn acceptance_type(&self) -> ::std::option::Option<&crate::types::AcceptanceType> {
26 self.acceptance_type.as_ref()
27 }
28}
29impl ::std::fmt::Debug for AcceptMatchInput {
30 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31 let mut formatter = f.debug_struct("AcceptMatchInput");
32 formatter.field("ticket_id", &self.ticket_id);
33 formatter.field("player_ids", &"*** Sensitive Data Redacted ***");
34 formatter.field("acceptance_type", &self.acceptance_type);
35 formatter.finish()
36 }
37}
38impl AcceptMatchInput {
39 pub fn builder() -> crate::operation::accept_match::builders::AcceptMatchInputBuilder {
41 crate::operation::accept_match::builders::AcceptMatchInputBuilder::default()
42 }
43}
44
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
47#[non_exhaustive]
48pub struct AcceptMatchInputBuilder {
49 pub(crate) ticket_id: ::std::option::Option<::std::string::String>,
50 pub(crate) player_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
51 pub(crate) acceptance_type: ::std::option::Option<crate::types::AcceptanceType>,
52}
53impl AcceptMatchInputBuilder {
54 pub fn ticket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57 self.ticket_id = ::std::option::Option::Some(input.into());
58 self
59 }
60 pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62 self.ticket_id = input;
63 self
64 }
65 pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
67 &self.ticket_id
68 }
69 pub fn player_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 let mut v = self.player_ids.unwrap_or_default();
76 v.push(input.into());
77 self.player_ids = ::std::option::Option::Some(v);
78 self
79 }
80 pub fn set_player_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
82 self.player_ids = input;
83 self
84 }
85 pub fn get_player_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
87 &self.player_ids
88 }
89 pub fn acceptance_type(mut self, input: crate::types::AcceptanceType) -> Self {
92 self.acceptance_type = ::std::option::Option::Some(input);
93 self
94 }
95 pub fn set_acceptance_type(mut self, input: ::std::option::Option<crate::types::AcceptanceType>) -> Self {
97 self.acceptance_type = input;
98 self
99 }
100 pub fn get_acceptance_type(&self) -> &::std::option::Option<crate::types::AcceptanceType> {
102 &self.acceptance_type
103 }
104 pub fn build(self) -> ::std::result::Result<crate::operation::accept_match::AcceptMatchInput, ::aws_smithy_types::error::operation::BuildError> {
106 ::std::result::Result::Ok(crate::operation::accept_match::AcceptMatchInput {
107 ticket_id: self.ticket_id,
108 player_ids: self.player_ids,
109 acceptance_type: self.acceptance_type,
110 })
111 }
112}
113impl ::std::fmt::Debug for AcceptMatchInputBuilder {
114 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
115 let mut formatter = f.debug_struct("AcceptMatchInputBuilder");
116 formatter.field("ticket_id", &self.ticket_id);
117 formatter.field("player_ids", &"*** Sensitive Data Redacted ***");
118 formatter.field("acceptance_type", &self.acceptance_type);
119 formatter.finish()
120 }
121}