aws_sdk_elasticsearch/types/
_package_source.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The S3 location for importing the package specified as <code>S3BucketName</code> and <code>S3Key</code></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PackageSource {
7    /// <p>Name of the bucket containing the package.</p>
8    pub s3_bucket_name: ::std::option::Option<::std::string::String>,
9    /// <p>Key (file name) of the package.</p>
10    pub s3_key: ::std::option::Option<::std::string::String>,
11}
12impl PackageSource {
13    /// <p>Name of the bucket containing the package.</p>
14    pub fn s3_bucket_name(&self) -> ::std::option::Option<&str> {
15        self.s3_bucket_name.as_deref()
16    }
17    /// <p>Key (file name) of the package.</p>
18    pub fn s3_key(&self) -> ::std::option::Option<&str> {
19        self.s3_key.as_deref()
20    }
21}
22impl PackageSource {
23    /// Creates a new builder-style object to manufacture [`PackageSource`](crate::types::PackageSource).
24    pub fn builder() -> crate::types::builders::PackageSourceBuilder {
25        crate::types::builders::PackageSourceBuilder::default()
26    }
27}
28
29/// A builder for [`PackageSource`](crate::types::PackageSource).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct PackageSourceBuilder {
33    pub(crate) s3_bucket_name: ::std::option::Option<::std::string::String>,
34    pub(crate) s3_key: ::std::option::Option<::std::string::String>,
35}
36impl PackageSourceBuilder {
37    /// <p>Name of the bucket containing the package.</p>
38    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.s3_bucket_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>Name of the bucket containing the package.</p>
43    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.s3_bucket_name = input;
45        self
46    }
47    /// <p>Name of the bucket containing the package.</p>
48    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.s3_bucket_name
50    }
51    /// <p>Key (file name) of the package.</p>
52    pub fn s3_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.s3_key = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>Key (file name) of the package.</p>
57    pub fn set_s3_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.s3_key = input;
59        self
60    }
61    /// <p>Key (file name) of the package.</p>
62    pub fn get_s3_key(&self) -> &::std::option::Option<::std::string::String> {
63        &self.s3_key
64    }
65    /// Consumes the builder and constructs a [`PackageSource`](crate::types::PackageSource).
66    pub fn build(self) -> crate::types::PackageSource {
67        crate::types::PackageSource {
68            s3_bucket_name: self.s3_bucket_name,
69            s3_key: self.s3_key,
70        }
71    }
72}