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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// 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 GetFileOutput {
    /// <p>The full commit ID of the commit that contains the content returned by GetFile.</p>
    pub commit_id: ::std::string::String,
    /// <p>The blob ID of the object that represents the file content.</p>
    pub blob_id: ::std::string::String,
    /// <p>The fully qualified path to the specified file. Returns the name and extension of the file.</p>
    pub file_path: ::std::string::String,
    /// <p>The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.</p><note>
    /// <p>The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.</p>
    /// </note>
    pub file_mode: crate::types::FileModeTypeEnum,
    /// <p>The size of the contents of the file, in bytes.</p>
    pub file_size: i64,
    /// <p>The base-64 encoded binary data object that represents the content of the file.</p>
    pub file_content: ::aws_smithy_types::Blob,
    _request_id: Option<String>,
}
impl GetFileOutput {
    /// <p>The full commit ID of the commit that contains the content returned by GetFile.</p>
    pub fn commit_id(&self) -> &str {
        use std::ops::Deref;
        self.commit_id.deref()
    }
    /// <p>The blob ID of the object that represents the file content.</p>
    pub fn blob_id(&self) -> &str {
        use std::ops::Deref;
        self.blob_id.deref()
    }
    /// <p>The fully qualified path to the specified file. Returns the name and extension of the file.</p>
    pub fn file_path(&self) -> &str {
        use std::ops::Deref;
        self.file_path.deref()
    }
    /// <p>The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.</p><note>
    /// <p>The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.</p>
    /// </note>
    pub fn file_mode(&self) -> &crate::types::FileModeTypeEnum {
        &self.file_mode
    }
    /// <p>The size of the contents of the file, in bytes.</p>
    pub fn file_size(&self) -> i64 {
        self.file_size
    }
    /// <p>The base-64 encoded binary data object that represents the content of the file.</p>
    pub fn file_content(&self) -> &::aws_smithy_types::Blob {
        &self.file_content
    }
}
impl ::aws_types::request_id::RequestId for GetFileOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetFileOutput {
    /// Creates a new builder-style object to manufacture [`GetFileOutput`](crate::operation::get_file::GetFileOutput).
    pub fn builder() -> crate::operation::get_file::builders::GetFileOutputBuilder {
        crate::operation::get_file::builders::GetFileOutputBuilder::default()
    }
}

/// A builder for [`GetFileOutput`](crate::operation::get_file::GetFileOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetFileOutputBuilder {
    pub(crate) commit_id: ::std::option::Option<::std::string::String>,
    pub(crate) blob_id: ::std::option::Option<::std::string::String>,
    pub(crate) file_path: ::std::option::Option<::std::string::String>,
    pub(crate) file_mode: ::std::option::Option<crate::types::FileModeTypeEnum>,
    pub(crate) file_size: ::std::option::Option<i64>,
    pub(crate) file_content: ::std::option::Option<::aws_smithy_types::Blob>,
    _request_id: Option<String>,
}
impl GetFileOutputBuilder {
    /// <p>The full commit ID of the commit that contains the content returned by GetFile.</p>
    /// This field is required.
    pub fn commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.commit_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The full commit ID of the commit that contains the content returned by GetFile.</p>
    pub fn set_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.commit_id = input;
        self
    }
    /// <p>The full commit ID of the commit that contains the content returned by GetFile.</p>
    pub fn get_commit_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.commit_id
    }
    /// <p>The blob ID of the object that represents the file content.</p>
    /// This field is required.
    pub fn blob_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.blob_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The blob ID of the object that represents the file content.</p>
    pub fn set_blob_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.blob_id = input;
        self
    }
    /// <p>The blob ID of the object that represents the file content.</p>
    pub fn get_blob_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.blob_id
    }
    /// <p>The fully qualified path to the specified file. Returns the name and extension of the file.</p>
    /// This field is required.
    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The fully qualified path to the specified file. Returns the name and extension of the file.</p>
    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_path = input;
        self
    }
    /// <p>The fully qualified path to the specified file. Returns the name and extension of the file.</p>
    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_path
    }
    /// <p>The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.</p><note>
    /// <p>The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.</p>
    /// </note>
    /// This field is required.
    pub fn file_mode(mut self, input: crate::types::FileModeTypeEnum) -> Self {
        self.file_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.</p><note>
    /// <p>The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.</p>
    /// </note>
    pub fn set_file_mode(mut self, input: ::std::option::Option<crate::types::FileModeTypeEnum>) -> Self {
        self.file_mode = input;
        self
    }
    /// <p>The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.</p><note>
    /// <p>The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.</p>
    /// </note>
    pub fn get_file_mode(&self) -> &::std::option::Option<crate::types::FileModeTypeEnum> {
        &self.file_mode
    }
    /// <p>The size of the contents of the file, in bytes.</p>
    /// This field is required.
    pub fn file_size(mut self, input: i64) -> Self {
        self.file_size = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the contents of the file, in bytes.</p>
    pub fn set_file_size(mut self, input: ::std::option::Option<i64>) -> Self {
        self.file_size = input;
        self
    }
    /// <p>The size of the contents of the file, in bytes.</p>
    pub fn get_file_size(&self) -> &::std::option::Option<i64> {
        &self.file_size
    }
    /// <p>The base-64 encoded binary data object that represents the content of the file.</p>
    /// This field is required.
    pub fn file_content(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.file_content = ::std::option::Option::Some(input);
        self
    }
    /// <p>The base-64 encoded binary data object that represents the content of the file.</p>
    pub fn set_file_content(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.file_content = input;
        self
    }
    /// <p>The base-64 encoded binary data object that represents the content of the file.</p>
    pub fn get_file_content(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.file_content
    }
    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 [`GetFileOutput`](crate::operation::get_file::GetFileOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`commit_id`](crate::operation::get_file::builders::GetFileOutputBuilder::commit_id)
    /// - [`blob_id`](crate::operation::get_file::builders::GetFileOutputBuilder::blob_id)
    /// - [`file_path`](crate::operation::get_file::builders::GetFileOutputBuilder::file_path)
    /// - [`file_mode`](crate::operation::get_file::builders::GetFileOutputBuilder::file_mode)
    /// - [`file_content`](crate::operation::get_file::builders::GetFileOutputBuilder::file_content)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_file::GetFileOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_file::GetFileOutput {
            commit_id: self.commit_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "commit_id",
                    "commit_id was not specified but it is required when building GetFileOutput",
                )
            })?,
            blob_id: self.blob_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "blob_id",
                    "blob_id was not specified but it is required when building GetFileOutput",
                )
            })?,
            file_path: self.file_path.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_path",
                    "file_path was not specified but it is required when building GetFileOutput",
                )
            })?,
            file_mode: self.file_mode.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_mode",
                    "file_mode was not specified but it is required when building GetFileOutput",
                )
            })?,
            file_size: self.file_size.unwrap_or_default(),
            file_content: self.file_content.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_content",
                    "file_content was not specified but it is required when building GetFileOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}