Skip to main content

aws_sdk_elementalinference/operation/get_fixture/
_get_fixture_output.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, ::std::fmt::Debug)]
5pub struct GetFixtureOutput {
6    /// <p>The ID that you specified in the request.</p>
7    pub fixture_id: ::std::string::String,
8    /// <p>The name of the fixture, as provided by the data source. For example, the names of the two competing teams.</p>
9    pub name: ::std::string::String,
10    /// <p>The group that the fixture belongs to, such as the competition, league, or tournament. The data source doesn't provide this information for every fixture.</p>
11    pub fixture_group: ::std::option::Option<::std::string::String>,
12    /// <p>The scheduled start time of the fixture, as provided by the data source. The actual start time might differ.</p>
13    pub scheduled_start: ::std::option::Option<::aws_smithy_types::DateTime>,
14    /// <p>The status of the fixture in its lifecycle, as provided by the data source. For example, Scheduled or Completed.</p>
15    pub status: ::std::string::String,
16    /// <p>An array of the competitors (the teams or individuals) in the fixture.</p>
17    pub competitors: ::std::vec::Vec<crate::types::Competitor>,
18    _request_id: Option<String>,
19}
20impl GetFixtureOutput {
21    /// <p>The ID that you specified in the request.</p>
22    pub fn fixture_id(&self) -> &str {
23        use std::ops::Deref;
24        self.fixture_id.deref()
25    }
26    /// <p>The name of the fixture, as provided by the data source. For example, the names of the two competing teams.</p>
27    pub fn name(&self) -> &str {
28        use std::ops::Deref;
29        self.name.deref()
30    }
31    /// <p>The group that the fixture belongs to, such as the competition, league, or tournament. The data source doesn't provide this information for every fixture.</p>
32    pub fn fixture_group(&self) -> ::std::option::Option<&str> {
33        self.fixture_group.as_deref()
34    }
35    /// <p>The scheduled start time of the fixture, as provided by the data source. The actual start time might differ.</p>
36    pub fn scheduled_start(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
37        self.scheduled_start.as_ref()
38    }
39    /// <p>The status of the fixture in its lifecycle, as provided by the data source. For example, Scheduled or Completed.</p>
40    pub fn status(&self) -> &str {
41        use std::ops::Deref;
42        self.status.deref()
43    }
44    /// <p>An array of the competitors (the teams or individuals) in the fixture.</p>
45    pub fn competitors(&self) -> &[crate::types::Competitor] {
46        use std::ops::Deref;
47        self.competitors.deref()
48    }
49}
50impl ::aws_types::request_id::RequestId for GetFixtureOutput {
51    fn request_id(&self) -> Option<&str> {
52        self._request_id.as_deref()
53    }
54}
55impl GetFixtureOutput {
56    /// Creates a new builder-style object to manufacture [`GetFixtureOutput`](crate::operation::get_fixture::GetFixtureOutput).
57    pub fn builder() -> crate::operation::get_fixture::builders::GetFixtureOutputBuilder {
58        crate::operation::get_fixture::builders::GetFixtureOutputBuilder::default()
59    }
60}
61
62/// A builder for [`GetFixtureOutput`](crate::operation::get_fixture::GetFixtureOutput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct GetFixtureOutputBuilder {
66    pub(crate) fixture_id: ::std::option::Option<::std::string::String>,
67    pub(crate) name: ::std::option::Option<::std::string::String>,
68    pub(crate) fixture_group: ::std::option::Option<::std::string::String>,
69    pub(crate) scheduled_start: ::std::option::Option<::aws_smithy_types::DateTime>,
70    pub(crate) status: ::std::option::Option<::std::string::String>,
71    pub(crate) competitors: ::std::option::Option<::std::vec::Vec<crate::types::Competitor>>,
72    _request_id: Option<String>,
73}
74impl GetFixtureOutputBuilder {
75    /// <p>The ID that you specified in the request.</p>
76    /// This field is required.
77    pub fn fixture_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.fixture_id = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The ID that you specified in the request.</p>
82    pub fn set_fixture_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.fixture_id = input;
84        self
85    }
86    /// <p>The ID that you specified in the request.</p>
87    pub fn get_fixture_id(&self) -> &::std::option::Option<::std::string::String> {
88        &self.fixture_id
89    }
90    /// <p>The name of the fixture, as provided by the data source. For example, the names of the two competing teams.</p>
91    /// This field is required.
92    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.name = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The name of the fixture, as provided by the data source. For example, the names of the two competing teams.</p>
97    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.name = input;
99        self
100    }
101    /// <p>The name of the fixture, as provided by the data source. For example, the names of the two competing teams.</p>
102    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
103        &self.name
104    }
105    /// <p>The group that the fixture belongs to, such as the competition, league, or tournament. The data source doesn't provide this information for every fixture.</p>
106    pub fn fixture_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.fixture_group = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// <p>The group that the fixture belongs to, such as the competition, league, or tournament. The data source doesn't provide this information for every fixture.</p>
111    pub fn set_fixture_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.fixture_group = input;
113        self
114    }
115    /// <p>The group that the fixture belongs to, such as the competition, league, or tournament. The data source doesn't provide this information for every fixture.</p>
116    pub fn get_fixture_group(&self) -> &::std::option::Option<::std::string::String> {
117        &self.fixture_group
118    }
119    /// <p>The scheduled start time of the fixture, as provided by the data source. The actual start time might differ.</p>
120    pub fn scheduled_start(mut self, input: ::aws_smithy_types::DateTime) -> Self {
121        self.scheduled_start = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The scheduled start time of the fixture, as provided by the data source. The actual start time might differ.</p>
125    pub fn set_scheduled_start(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
126        self.scheduled_start = input;
127        self
128    }
129    /// <p>The scheduled start time of the fixture, as provided by the data source. The actual start time might differ.</p>
130    pub fn get_scheduled_start(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
131        &self.scheduled_start
132    }
133    /// <p>The status of the fixture in its lifecycle, as provided by the data source. For example, Scheduled or Completed.</p>
134    /// This field is required.
135    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.status = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <p>The status of the fixture in its lifecycle, as provided by the data source. For example, Scheduled or Completed.</p>
140    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.status = input;
142        self
143    }
144    /// <p>The status of the fixture in its lifecycle, as provided by the data source. For example, Scheduled or Completed.</p>
145    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
146        &self.status
147    }
148    /// Appends an item to `competitors`.
149    ///
150    /// To override the contents of this collection use [`set_competitors`](Self::set_competitors).
151    ///
152    /// <p>An array of the competitors (the teams or individuals) in the fixture.</p>
153    pub fn competitors(mut self, input: crate::types::Competitor) -> Self {
154        let mut v = self.competitors.unwrap_or_default();
155        v.push(input);
156        self.competitors = ::std::option::Option::Some(v);
157        self
158    }
159    /// <p>An array of the competitors (the teams or individuals) in the fixture.</p>
160    pub fn set_competitors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Competitor>>) -> Self {
161        self.competitors = input;
162        self
163    }
164    /// <p>An array of the competitors (the teams or individuals) in the fixture.</p>
165    pub fn get_competitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Competitor>> {
166        &self.competitors
167    }
168    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
169        self._request_id = Some(request_id.into());
170        self
171    }
172
173    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
174        self._request_id = request_id;
175        self
176    }
177    /// Consumes the builder and constructs a [`GetFixtureOutput`](crate::operation::get_fixture::GetFixtureOutput).
178    /// This method will fail if any of the following fields are not set:
179    /// - [`fixture_id`](crate::operation::get_fixture::builders::GetFixtureOutputBuilder::fixture_id)
180    /// - [`name`](crate::operation::get_fixture::builders::GetFixtureOutputBuilder::name)
181    /// - [`status`](crate::operation::get_fixture::builders::GetFixtureOutputBuilder::status)
182    /// - [`competitors`](crate::operation::get_fixture::builders::GetFixtureOutputBuilder::competitors)
183    pub fn build(self) -> ::std::result::Result<crate::operation::get_fixture::GetFixtureOutput, ::aws_smithy_types::error::operation::BuildError> {
184        ::std::result::Result::Ok(crate::operation::get_fixture::GetFixtureOutput {
185            fixture_id: self.fixture_id.ok_or_else(|| {
186                ::aws_smithy_types::error::operation::BuildError::missing_field(
187                    "fixture_id",
188                    "fixture_id was not specified but it is required when building GetFixtureOutput",
189                )
190            })?,
191            name: self.name.ok_or_else(|| {
192                ::aws_smithy_types::error::operation::BuildError::missing_field(
193                    "name",
194                    "name was not specified but it is required when building GetFixtureOutput",
195                )
196            })?,
197            fixture_group: self.fixture_group,
198            scheduled_start: self.scheduled_start,
199            status: self.status.ok_or_else(|| {
200                ::aws_smithy_types::error::operation::BuildError::missing_field(
201                    "status",
202                    "status was not specified but it is required when building GetFixtureOutput",
203                )
204            })?,
205            competitors: self.competitors.ok_or_else(|| {
206                ::aws_smithy_types::error::operation::BuildError::missing_field(
207                    "competitors",
208                    "competitors was not specified but it is required when building GetFixtureOutput",
209                )
210            })?,
211            _request_id: self._request_id,
212        })
213    }
214}