aws_sdk_codecommit/operation/get_file/
_get_file_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetFileInput {
6    /// <p>The name of the repository that contains the file.</p>
7    pub repository_name: ::std::option::Option<::std::string::String>,
8    /// <p>The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.</p>
9    pub commit_specifier: ::std::option::Option<::std::string::String>,
10    /// <p>The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.</p>
11    pub file_path: ::std::option::Option<::std::string::String>,
12}
13impl GetFileInput {
14    /// <p>The name of the repository that contains the file.</p>
15    pub fn repository_name(&self) -> ::std::option::Option<&str> {
16        self.repository_name.as_deref()
17    }
18    /// <p>The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.</p>
19    pub fn commit_specifier(&self) -> ::std::option::Option<&str> {
20        self.commit_specifier.as_deref()
21    }
22    /// <p>The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.</p>
23    pub fn file_path(&self) -> ::std::option::Option<&str> {
24        self.file_path.as_deref()
25    }
26}
27impl GetFileInput {
28    /// Creates a new builder-style object to manufacture [`GetFileInput`](crate::operation::get_file::GetFileInput).
29    pub fn builder() -> crate::operation::get_file::builders::GetFileInputBuilder {
30        crate::operation::get_file::builders::GetFileInputBuilder::default()
31    }
32}
33
34/// A builder for [`GetFileInput`](crate::operation::get_file::GetFileInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetFileInputBuilder {
38    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
39    pub(crate) commit_specifier: ::std::option::Option<::std::string::String>,
40    pub(crate) file_path: ::std::option::Option<::std::string::String>,
41}
42impl GetFileInputBuilder {
43    /// <p>The name of the repository that contains the file.</p>
44    /// This field is required.
45    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.repository_name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The name of the repository that contains the file.</p>
50    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.repository_name = input;
52        self
53    }
54    /// <p>The name of the repository that contains the file.</p>
55    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.repository_name
57    }
58    /// <p>The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.</p>
59    pub fn commit_specifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.commit_specifier = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.</p>
64    pub fn set_commit_specifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.commit_specifier = input;
66        self
67    }
68    /// <p>The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.</p>
69    pub fn get_commit_specifier(&self) -> &::std::option::Option<::std::string::String> {
70        &self.commit_specifier
71    }
72    /// <p>The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.</p>
73    /// This field is required.
74    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.file_path = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.</p>
79    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.file_path = input;
81        self
82    }
83    /// <p>The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.</p>
84    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
85        &self.file_path
86    }
87    /// Consumes the builder and constructs a [`GetFileInput`](crate::operation::get_file::GetFileInput).
88    pub fn build(self) -> ::std::result::Result<crate::operation::get_file::GetFileInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::get_file::GetFileInput {
90            repository_name: self.repository_name,
91            commit_specifier: self.commit_specifier,
92            file_path: self.file_path,
93        })
94    }
95}