Skip to main content

aws_sdk_gamelift/operation/describe_fleet_events/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_fleet_events::_describe_fleet_events_input::DescribeFleetEventsInputBuilder;
3
4pub use crate::operation::describe_fleet_events::_describe_fleet_events_output::DescribeFleetEventsOutputBuilder;
5
6impl crate::operation::describe_fleet_events::builders::DescribeFleetEventsInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::describe_fleet_events::DescribeFleetEventsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_fleet_events::DescribeFleetEventsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_fleet_events();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeFleetEvents`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Retrieves entries from a fleet's event log. Fleet events are initiated by changes in status, such as during fleet creation and termination, changes in capacity, etc. If a fleet has multiple locations, events are also initiated by changes to status and capacity in remote locations.</p>
27/// <p>You can specify a time range to limit the result set. Use the pagination parameters to retrieve results as a set of sequential pages.</p>
28/// <p>If successful, a collection of event log entries matching the request are returned.</p>
29/// <p><b>Learn more</b></p>
30/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers fleets</a></p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct DescribeFleetEventsFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::describe_fleet_events::builders::DescribeFleetEventsInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::describe_fleet_events::DescribeFleetEventsOutput,
40        crate::operation::describe_fleet_events::DescribeFleetEventsError,
41    > for DescribeFleetEventsFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::describe_fleet_events::DescribeFleetEventsOutput,
49            crate::operation::describe_fleet_events::DescribeFleetEventsError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl DescribeFleetEventsFluentBuilder {
56    /// Creates a new `DescribeFleetEventsFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the DescribeFleetEvents as a reference.
65    pub fn as_input(&self) -> &crate::operation::describe_fleet_events::builders::DescribeFleetEventsInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::describe_fleet_events::DescribeFleetEventsOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::describe_fleet_events::DescribeFleetEventsError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::describe_fleet_events::DescribeFleetEvents::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::describe_fleet_events::DescribeFleetEvents::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::describe_fleet_events::DescribeFleetEventsOutput,
102        crate::operation::describe_fleet_events::DescribeFleetEventsError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// Create a paginator for this request
117    ///
118    /// Paginators are used by calling [`send().await`](crate::operation::describe_fleet_events::paginator::DescribeFleetEventsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
119    pub fn into_paginator(self) -> crate::operation::describe_fleet_events::paginator::DescribeFleetEventsPaginator {
120        crate::operation::describe_fleet_events::paginator::DescribeFleetEventsPaginator::new(self.handle, self.inner)
121    }
122    /// <p>A unique identifier for the fleet to get event logs for. You can use either the fleet ID or ARN value.</p>
123    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.fleet_id(input.into());
125        self
126    }
127    /// <p>A unique identifier for the fleet to get event logs for. You can use either the fleet ID or ARN value.</p>
128    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_fleet_id(input);
130        self
131    }
132    /// <p>A unique identifier for the fleet to get event logs for. You can use either the fleet ID or ARN value.</p>
133    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_fleet_id()
135    }
136    /// <p>The earliest date to retrieve event logs for. If no start time is specified, this call returns entries starting from when the fleet was created to the specified end time. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").</p>
137    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
138        self.inner = self.inner.start_time(input);
139        self
140    }
141    /// <p>The earliest date to retrieve event logs for. If no start time is specified, this call returns entries starting from when the fleet was created to the specified end time. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").</p>
142    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
143        self.inner = self.inner.set_start_time(input);
144        self
145    }
146    /// <p>The earliest date to retrieve event logs for. If no start time is specified, this call returns entries starting from when the fleet was created to the specified end time. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").</p>
147    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
148        self.inner.get_start_time()
149    }
150    /// <p>The most recent date to retrieve event logs for. If no end time is specified, this call returns entries from the specified start time up to the present. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").</p>
151    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
152        self.inner = self.inner.end_time(input);
153        self
154    }
155    /// <p>The most recent date to retrieve event logs for. If no end time is specified, this call returns entries from the specified start time up to the present. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").</p>
156    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
157        self.inner = self.inner.set_end_time(input);
158        self
159    }
160    /// <p>The most recent date to retrieve event logs for. If no end time is specified, this call returns entries from the specified start time up to the present. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").</p>
161    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
162        self.inner.get_end_time()
163    }
164    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
165    pub fn limit(mut self, input: i32) -> Self {
166        self.inner = self.inner.limit(input);
167        self
168    }
169    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
170    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
171        self.inner = self.inner.set_limit(input);
172        self
173    }
174    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
175    pub fn get_limit(&self) -> &::std::option::Option<i32> {
176        self.inner.get_limit()
177    }
178    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
179    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.inner = self.inner.next_token(input.into());
181        self
182    }
183    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
184    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.inner = self.inner.set_next_token(input);
186        self
187    }
188    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
189    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
190        self.inner.get_next_token()
191    }
192}