1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSampledRequestsOutput {
/// <p>A complex type that contains detailed information about each of the requests in the sample.</p>
pub sampled_requests: ::std::option::Option<::std::vec::Vec<crate::types::SampledHttpRequest>>,
/// <p>The total number of requests from which <code>GetSampledRequests</code> got a sample of <code>MaxItems</code> requests. If <code>PopulationSize</code> is less than <code>MaxItems</code>, the sample includes every request that your Amazon Web Services resource received during the specified time range.</p>
pub population_size: i64,
/// <p>Usually, <code>TimeWindow</code> is the time range that you specified in the <code>GetSampledRequests</code> request. However, if your Amazon Web Services resource received more than 5,000 requests during the time range that you specified in the request, <code>GetSampledRequests</code> returns the time range for the first 5,000 requests. Times are in Coordinated Universal Time (UTC) format.</p>
pub time_window: ::std::option::Option<crate::types::TimeWindow>,
_request_id: Option<String>,
}
impl GetSampledRequestsOutput {
/// <p>A complex type that contains detailed information about each of the requests in the sample.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sampled_requests.is_none()`.
pub fn sampled_requests(&self) -> &[crate::types::SampledHttpRequest] {
self.sampled_requests.as_deref().unwrap_or_default()
}
/// <p>The total number of requests from which <code>GetSampledRequests</code> got a sample of <code>MaxItems</code> requests. If <code>PopulationSize</code> is less than <code>MaxItems</code>, the sample includes every request that your Amazon Web Services resource received during the specified time range.</p>
pub fn population_size(&self) -> i64 {
self.population_size
}
/// <p>Usually, <code>TimeWindow</code> is the time range that you specified in the <code>GetSampledRequests</code> request. However, if your Amazon Web Services resource received more than 5,000 requests during the time range that you specified in the request, <code>GetSampledRequests</code> returns the time range for the first 5,000 requests. Times are in Coordinated Universal Time (UTC) format.</p>
pub fn time_window(&self) -> ::std::option::Option<&crate::types::TimeWindow> {
self.time_window.as_ref()
}
}
impl ::aws_types::request_id::RequestId for GetSampledRequestsOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetSampledRequestsOutput {
/// Creates a new builder-style object to manufacture [`GetSampledRequestsOutput`](crate::operation::get_sampled_requests::GetSampledRequestsOutput).
pub fn builder() -> crate::operation::get_sampled_requests::builders::GetSampledRequestsOutputBuilder {
crate::operation::get_sampled_requests::builders::GetSampledRequestsOutputBuilder::default()
}
}
/// A builder for [`GetSampledRequestsOutput`](crate::operation::get_sampled_requests::GetSampledRequestsOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetSampledRequestsOutputBuilder {
pub(crate) sampled_requests: ::std::option::Option<::std::vec::Vec<crate::types::SampledHttpRequest>>,
pub(crate) population_size: ::std::option::Option<i64>,
pub(crate) time_window: ::std::option::Option<crate::types::TimeWindow>,
_request_id: Option<String>,
}
impl GetSampledRequestsOutputBuilder {
/// Appends an item to `sampled_requests`.
///
/// To override the contents of this collection use [`set_sampled_requests`](Self::set_sampled_requests).
///
/// <p>A complex type that contains detailed information about each of the requests in the sample.</p>
pub fn sampled_requests(mut self, input: crate::types::SampledHttpRequest) -> Self {
let mut v = self.sampled_requests.unwrap_or_default();
v.push(input);
self.sampled_requests = ::std::option::Option::Some(v);
self
}
/// <p>A complex type that contains detailed information about each of the requests in the sample.</p>
pub fn set_sampled_requests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SampledHttpRequest>>) -> Self {
self.sampled_requests = input;
self
}
/// <p>A complex type that contains detailed information about each of the requests in the sample.</p>
pub fn get_sampled_requests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SampledHttpRequest>> {
&self.sampled_requests
}
/// <p>The total number of requests from which <code>GetSampledRequests</code> got a sample of <code>MaxItems</code> requests. If <code>PopulationSize</code> is less than <code>MaxItems</code>, the sample includes every request that your Amazon Web Services resource received during the specified time range.</p>
pub fn population_size(mut self, input: i64) -> Self {
self.population_size = ::std::option::Option::Some(input);
self
}
/// <p>The total number of requests from which <code>GetSampledRequests</code> got a sample of <code>MaxItems</code> requests. If <code>PopulationSize</code> is less than <code>MaxItems</code>, the sample includes every request that your Amazon Web Services resource received during the specified time range.</p>
pub fn set_population_size(mut self, input: ::std::option::Option<i64>) -> Self {
self.population_size = input;
self
}
/// <p>The total number of requests from which <code>GetSampledRequests</code> got a sample of <code>MaxItems</code> requests. If <code>PopulationSize</code> is less than <code>MaxItems</code>, the sample includes every request that your Amazon Web Services resource received during the specified time range.</p>
pub fn get_population_size(&self) -> &::std::option::Option<i64> {
&self.population_size
}
/// <p>Usually, <code>TimeWindow</code> is the time range that you specified in the <code>GetSampledRequests</code> request. However, if your Amazon Web Services resource received more than 5,000 requests during the time range that you specified in the request, <code>GetSampledRequests</code> returns the time range for the first 5,000 requests. Times are in Coordinated Universal Time (UTC) format.</p>
pub fn time_window(mut self, input: crate::types::TimeWindow) -> Self {
self.time_window = ::std::option::Option::Some(input);
self
}
/// <p>Usually, <code>TimeWindow</code> is the time range that you specified in the <code>GetSampledRequests</code> request. However, if your Amazon Web Services resource received more than 5,000 requests during the time range that you specified in the request, <code>GetSampledRequests</code> returns the time range for the first 5,000 requests. Times are in Coordinated Universal Time (UTC) format.</p>
pub fn set_time_window(mut self, input: ::std::option::Option<crate::types::TimeWindow>) -> Self {
self.time_window = input;
self
}
/// <p>Usually, <code>TimeWindow</code> is the time range that you specified in the <code>GetSampledRequests</code> request. However, if your Amazon Web Services resource received more than 5,000 requests during the time range that you specified in the request, <code>GetSampledRequests</code> returns the time range for the first 5,000 requests. Times are in Coordinated Universal Time (UTC) format.</p>
pub fn get_time_window(&self) -> &::std::option::Option<crate::types::TimeWindow> {
&self.time_window
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetSampledRequestsOutput`](crate::operation::get_sampled_requests::GetSampledRequestsOutput).
pub fn build(self) -> crate::operation::get_sampled_requests::GetSampledRequestsOutput {
crate::operation::get_sampled_requests::GetSampledRequestsOutput {
sampled_requests: self.sampled_requests,
population_size: self.population_size.unwrap_or_default(),
time_window: self.time_window,
_request_id: self._request_id,
}
}
}