aws_sdk_codeguruprofiler/operation/get_profile/
_get_profile_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetProfileOutput {
7 pub profile: ::aws_smithy_types::Blob,
9 pub content_type: ::std::string::String,
11 pub content_encoding: ::std::option::Option<::std::string::String>,
13 _request_id: Option<String>,
14}
15impl GetProfileOutput {
16 pub fn profile(&self) -> &::aws_smithy_types::Blob {
18 &self.profile
19 }
20 pub fn content_type(&self) -> &str {
22 use std::ops::Deref;
23 self.content_type.deref()
24 }
25 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 pub fn builder() -> crate::operation::get_profile::builders::GetProfileOutputBuilder {
38 crate::operation::get_profile::builders::GetProfileOutputBuilder::default()
39 }
40}
41
42#[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 pub fn profile(mut self, input: ::aws_smithy_types::Blob) -> Self {
55 self.profile = ::std::option::Option::Some(input);
56 self
57 }
58 pub fn set_profile(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
60 self.profile = input;
61 self
62 }
63 pub fn get_profile(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
65 &self.profile
66 }
67 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 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.content_type = input;
76 self
77 }
78 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
80 &self.content_type
81 }
82 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 pub fn set_content_encoding(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.content_encoding = input;
90 self
91 }
92 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 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}