aws_sdk_codecommit/operation/get_blob/
_get_blob_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a get blob operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetBlobOutput {
7    /// <p>The content of the blob, usually a file.</p>
8    pub content: ::aws_smithy_types::Blob,
9    _request_id: Option<String>,
10}
11impl GetBlobOutput {
12    /// <p>The content of the blob, usually a file.</p>
13    pub fn content(&self) -> &::aws_smithy_types::Blob {
14        &self.content
15    }
16}
17impl ::aws_types::request_id::RequestId for GetBlobOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl GetBlobOutput {
23    /// Creates a new builder-style object to manufacture [`GetBlobOutput`](crate::operation::get_blob::GetBlobOutput).
24    pub fn builder() -> crate::operation::get_blob::builders::GetBlobOutputBuilder {
25        crate::operation::get_blob::builders::GetBlobOutputBuilder::default()
26    }
27}
28
29/// A builder for [`GetBlobOutput`](crate::operation::get_blob::GetBlobOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetBlobOutputBuilder {
33    pub(crate) content: ::std::option::Option<::aws_smithy_types::Blob>,
34    _request_id: Option<String>,
35}
36impl GetBlobOutputBuilder {
37    /// <p>The content of the blob, usually a file.</p>
38    /// This field is required.
39    pub fn content(mut self, input: ::aws_smithy_types::Blob) -> Self {
40        self.content = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>The content of the blob, usually a file.</p>
44    pub fn set_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
45        self.content = input;
46        self
47    }
48    /// <p>The content of the blob, usually a file.</p>
49    pub fn get_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
50        &self.content
51    }
52    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
53        self._request_id = Some(request_id.into());
54        self
55    }
56
57    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
58        self._request_id = request_id;
59        self
60    }
61    /// Consumes the builder and constructs a [`GetBlobOutput`](crate::operation::get_blob::GetBlobOutput).
62    /// This method will fail if any of the following fields are not set:
63    /// - [`content`](crate::operation::get_blob::builders::GetBlobOutputBuilder::content)
64    pub fn build(self) -> ::std::result::Result<crate::operation::get_blob::GetBlobOutput, ::aws_smithy_types::error::operation::BuildError> {
65        ::std::result::Result::Ok(crate::operation::get_blob::GetBlobOutput {
66            content: self.content.ok_or_else(|| {
67                ::aws_smithy_types::error::operation::BuildError::missing_field(
68                    "content",
69                    "content was not specified but it is required when building GetBlobOutput",
70                )
71            })?,
72            _request_id: self._request_id,
73        })
74    }
75}