aws_sdk_codeguruprofiler/operation/get_profile/
_get_profile_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The structure representing the getProfileResponse.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetProfileOutput {
7    /// <p>Information about the profile.</p>
8    pub profile: ::aws_smithy_types::Blob,
9    /// <p>The content type of the profile in the payload. It is either <code>application/json</code> or the default <code>application/x-amzn-ion</code>.</p>
10    pub content_type: ::std::string::String,
11    /// <p>The content encoding of the profile.</p>
12    pub content_encoding: ::std::option::Option<::std::string::String>,
13    _request_id: Option<String>,
14}
15impl GetProfileOutput {
16    /// <p>Information about the profile.</p>
17    pub fn profile(&self) -> &::aws_smithy_types::Blob {
18        &self.profile
19    }
20    /// <p>The content type of the profile in the payload. It is either <code>application/json</code> or the default <code>application/x-amzn-ion</code>.</p>
21    pub fn content_type(&self) -> &str {
22        use std::ops::Deref;
23        self.content_type.deref()
24    }
25    /// <p>The content encoding of the profile.</p>
26    pub fn content_encoding(&self) -> ::std::option::Option<&str> {
27        self.content_encoding.as_deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for GetProfileOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl GetProfileOutput {
36    /// Creates a new builder-style object to manufacture [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
37    pub fn builder() -> crate::operation::get_profile::builders::GetProfileOutputBuilder {
38        crate::operation::get_profile::builders::GetProfileOutputBuilder::default()
39    }
40}
41
42/// A builder for [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetProfileOutputBuilder {
46    pub(crate) profile: ::std::option::Option<::aws_smithy_types::Blob>,
47    pub(crate) content_type: ::std::option::Option<::std::string::String>,
48    pub(crate) content_encoding: ::std::option::Option<::std::string::String>,
49    _request_id: Option<String>,
50}
51impl GetProfileOutputBuilder {
52    /// <p>Information about the profile.</p>
53    /// This field is required.
54    pub fn profile(mut self, input: ::aws_smithy_types::Blob) -> Self {
55        self.profile = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>Information about the profile.</p>
59    pub fn set_profile(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
60        self.profile = input;
61        self
62    }
63    /// <p>Information about the profile.</p>
64    pub fn get_profile(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
65        &self.profile
66    }
67    /// <p>The content type of the profile in the payload. It is either <code>application/json</code> or the default <code>application/x-amzn-ion</code>.</p>
68    /// This field is required.
69    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.content_type = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The content type of the profile in the payload. It is either <code>application/json</code> or the default <code>application/x-amzn-ion</code>.</p>
74    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.content_type = input;
76        self
77    }
78    /// <p>The content type of the profile in the payload. It is either <code>application/json</code> or the default <code>application/x-amzn-ion</code>.</p>
79    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
80        &self.content_type
81    }
82    /// <p>The content encoding of the profile.</p>
83    pub fn content_encoding(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.content_encoding = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The content encoding of the profile.</p>
88    pub fn set_content_encoding(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.content_encoding = input;
90        self
91    }
92    /// <p>The content encoding of the profile.</p>
93    pub fn get_content_encoding(&self) -> &::std::option::Option<::std::string::String> {
94        &self.content_encoding
95    }
96    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
97        self._request_id = Some(request_id.into());
98        self
99    }
100
101    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
102        self._request_id = request_id;
103        self
104    }
105    /// Consumes the builder and constructs a [`GetProfileOutput`](crate::operation::get_profile::GetProfileOutput).
106    /// This method will fail if any of the following fields are not set:
107    /// - [`profile`](crate::operation::get_profile::builders::GetProfileOutputBuilder::profile)
108    /// - [`content_type`](crate::operation::get_profile::builders::GetProfileOutputBuilder::content_type)
109    pub fn build(self) -> ::std::result::Result<crate::operation::get_profile::GetProfileOutput, ::aws_smithy_types::error::operation::BuildError> {
110        ::std::result::Result::Ok(crate::operation::get_profile::GetProfileOutput {
111            profile: self.profile.ok_or_else(|| {
112                ::aws_smithy_types::error::operation::BuildError::missing_field(
113                    "profile",
114                    "profile was not specified but it is required when building GetProfileOutput",
115                )
116            })?,
117            content_type: self.content_type.ok_or_else(|| {
118                ::aws_smithy_types::error::operation::BuildError::missing_field(
119                    "content_type",
120                    "content_type was not specified but it is required when building GetProfileOutput",
121                )
122            })?,
123            content_encoding: self.content_encoding,
124            _request_id: self._request_id,
125        })
126    }
127}