Skip to main content

aws_sdk_ec2/types/
_storage_location.rs

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