aws_sdk_gamelift/operation/accept_match/
_accept_match_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct AcceptMatchInput {
6    /// <p>A unique identifier for a matchmaking ticket. The ticket must be in status <code>REQUIRES_ACCEPTANCE</code>; otherwise this request will fail.</p>
7    pub ticket_id: ::std::option::Option<::std::string::String>,
8    /// <p>A unique identifier for a player delivering the response. This parameter can include one or multiple player IDs.</p>
9    pub player_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>Player response to the proposed match.</p>
11    pub acceptance_type: ::std::option::Option<crate::types::AcceptanceType>,
12}
13impl AcceptMatchInput {
14    /// <p>A unique identifier for a matchmaking ticket. The ticket must be in status <code>REQUIRES_ACCEPTANCE</code>; otherwise this request will fail.</p>
15    pub fn ticket_id(&self) -> ::std::option::Option<&str> {
16        self.ticket_id.as_deref()
17    }
18    /// <p>A unique identifier for a player delivering the response. This parameter can include one or multiple player IDs.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.player_ids.is_none()`.
21    pub fn player_ids(&self) -> &[::std::string::String] {
22        self.player_ids.as_deref().unwrap_or_default()
23    }
24    /// <p>Player response to the proposed match.</p>
25    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    /// Creates a new builder-style object to manufacture [`AcceptMatchInput`](crate::operation::accept_match::AcceptMatchInput).
40    pub fn builder() -> crate::operation::accept_match::builders::AcceptMatchInputBuilder {
41        crate::operation::accept_match::builders::AcceptMatchInputBuilder::default()
42    }
43}
44
45/// A builder for [`AcceptMatchInput`](crate::operation::accept_match::AcceptMatchInput).
46#[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    /// <p>A unique identifier for a matchmaking ticket. The ticket must be in status <code>REQUIRES_ACCEPTANCE</code>; otherwise this request will fail.</p>
55    /// This field is required.
56    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    /// <p>A unique identifier for a matchmaking ticket. The ticket must be in status <code>REQUIRES_ACCEPTANCE</code>; otherwise this request will fail.</p>
61    pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.ticket_id = input;
63        self
64    }
65    /// <p>A unique identifier for a matchmaking ticket. The ticket must be in status <code>REQUIRES_ACCEPTANCE</code>; otherwise this request will fail.</p>
66    pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
67        &self.ticket_id
68    }
69    /// Appends an item to `player_ids`.
70    ///
71    /// To override the contents of this collection use [`set_player_ids`](Self::set_player_ids).
72    ///
73    /// <p>A unique identifier for a player delivering the response. This parameter can include one or multiple player IDs.</p>
74    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    /// <p>A unique identifier for a player delivering the response. This parameter can include one or multiple player IDs.</p>
81    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    /// <p>A unique identifier for a player delivering the response. This parameter can include one or multiple player IDs.</p>
86    pub fn get_player_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
87        &self.player_ids
88    }
89    /// <p>Player response to the proposed match.</p>
90    /// This field is required.
91    pub fn acceptance_type(mut self, input: crate::types::AcceptanceType) -> Self {
92        self.acceptance_type = ::std::option::Option::Some(input);
93        self
94    }
95    /// <p>Player response to the proposed match.</p>
96    pub fn set_acceptance_type(mut self, input: ::std::option::Option<crate::types::AcceptanceType>) -> Self {
97        self.acceptance_type = input;
98        self
99    }
100    /// <p>Player response to the proposed match.</p>
101    pub fn get_acceptance_type(&self) -> &::std::option::Option<crate::types::AcceptanceType> {
102        &self.acceptance_type
103    }
104    /// Consumes the builder and constructs a [`AcceptMatchInput`](crate::operation::accept_match::AcceptMatchInput).
105    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}