aws_sdk_route53domains/operation/view_billing/
_view_billing_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The ViewBilling response includes the following elements.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ViewBillingOutput {
7    /// <p>If there are more billing records than you specified for <code>MaxItems</code> in the request, submit another request and include the value of <code>NextPageMarker</code> in the value of <code>Marker</code>.</p>
8    pub next_page_marker: ::std::option::Option<::std::string::String>,
9    /// <p>A summary of billing records.</p>
10    pub billing_records: ::std::option::Option<::std::vec::Vec<crate::types::BillingRecord>>,
11    _request_id: Option<String>,
12}
13impl ViewBillingOutput {
14    /// <p>If there are more billing records than you specified for <code>MaxItems</code> in the request, submit another request and include the value of <code>NextPageMarker</code> in the value of <code>Marker</code>.</p>
15    pub fn next_page_marker(&self) -> ::std::option::Option<&str> {
16        self.next_page_marker.as_deref()
17    }
18    /// <p>A summary of billing records.</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 `.billing_records.is_none()`.
21    pub fn billing_records(&self) -> &[crate::types::BillingRecord] {
22        self.billing_records.as_deref().unwrap_or_default()
23    }
24}
25impl ::aws_types::request_id::RequestId for ViewBillingOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl ViewBillingOutput {
31    /// Creates a new builder-style object to manufacture [`ViewBillingOutput`](crate::operation::view_billing::ViewBillingOutput).
32    pub fn builder() -> crate::operation::view_billing::builders::ViewBillingOutputBuilder {
33        crate::operation::view_billing::builders::ViewBillingOutputBuilder::default()
34    }
35}
36
37/// A builder for [`ViewBillingOutput`](crate::operation::view_billing::ViewBillingOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct ViewBillingOutputBuilder {
41    pub(crate) next_page_marker: ::std::option::Option<::std::string::String>,
42    pub(crate) billing_records: ::std::option::Option<::std::vec::Vec<crate::types::BillingRecord>>,
43    _request_id: Option<String>,
44}
45impl ViewBillingOutputBuilder {
46    /// <p>If there are more billing records than you specified for <code>MaxItems</code> in the request, submit another request and include the value of <code>NextPageMarker</code> in the value of <code>Marker</code>.</p>
47    pub fn next_page_marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.next_page_marker = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>If there are more billing records than you specified for <code>MaxItems</code> in the request, submit another request and include the value of <code>NextPageMarker</code> in the value of <code>Marker</code>.</p>
52    pub fn set_next_page_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.next_page_marker = input;
54        self
55    }
56    /// <p>If there are more billing records than you specified for <code>MaxItems</code> in the request, submit another request and include the value of <code>NextPageMarker</code> in the value of <code>Marker</code>.</p>
57    pub fn get_next_page_marker(&self) -> &::std::option::Option<::std::string::String> {
58        &self.next_page_marker
59    }
60    /// Appends an item to `billing_records`.
61    ///
62    /// To override the contents of this collection use [`set_billing_records`](Self::set_billing_records).
63    ///
64    /// <p>A summary of billing records.</p>
65    pub fn billing_records(mut self, input: crate::types::BillingRecord) -> Self {
66        let mut v = self.billing_records.unwrap_or_default();
67        v.push(input);
68        self.billing_records = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>A summary of billing records.</p>
72    pub fn set_billing_records(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BillingRecord>>) -> Self {
73        self.billing_records = input;
74        self
75    }
76    /// <p>A summary of billing records.</p>
77    pub fn get_billing_records(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BillingRecord>> {
78        &self.billing_records
79    }
80    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81        self._request_id = Some(request_id.into());
82        self
83    }
84
85    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86        self._request_id = request_id;
87        self
88    }
89    /// Consumes the builder and constructs a [`ViewBillingOutput`](crate::operation::view_billing::ViewBillingOutput).
90    pub fn build(self) -> crate::operation::view_billing::ViewBillingOutput {
91        crate::operation::view_billing::ViewBillingOutput {
92            next_page_marker: self.next_page_marker,
93            billing_records: self.billing_records,
94            _request_id: self._request_id,
95        }
96    }
97}