aws_sdk_rekognition/types/
_s3_object.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides the S3 bucket name and object name.</p>
4/// <p>The region for the S3 bucket containing the S3 object must match the region you use for Amazon Rekognition operations.</p>
5/// <p>For Amazon Rekognition to process an S3 object, the user must have permission to access the S3 object. For more information, see How Amazon Rekognition works with IAM in the Amazon Rekognition Developer Guide.</p>
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct S3Object {
9    /// <p>Name of the S3 bucket.</p>
10    pub bucket: ::std::option::Option<::std::string::String>,
11    /// <p>S3 object key name.</p>
12    pub name: ::std::option::Option<::std::string::String>,
13    /// <p>If the bucket is versioning enabled, you can specify the object version.</p>
14    pub version: ::std::option::Option<::std::string::String>,
15}
16impl S3Object {
17    /// <p>Name of the S3 bucket.</p>
18    pub fn bucket(&self) -> ::std::option::Option<&str> {
19        self.bucket.as_deref()
20    }
21    /// <p>S3 object key name.</p>
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// <p>If the bucket is versioning enabled, you can specify the object version.</p>
26    pub fn version(&self) -> ::std::option::Option<&str> {
27        self.version.as_deref()
28    }
29}
30impl S3Object {
31    /// Creates a new builder-style object to manufacture [`S3Object`](crate::types::S3Object).
32    pub fn builder() -> crate::types::builders::S3ObjectBuilder {
33        crate::types::builders::S3ObjectBuilder::default()
34    }
35}
36
37/// A builder for [`S3Object`](crate::types::S3Object).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct S3ObjectBuilder {
41    pub(crate) bucket: ::std::option::Option<::std::string::String>,
42    pub(crate) name: ::std::option::Option<::std::string::String>,
43    pub(crate) version: ::std::option::Option<::std::string::String>,
44}
45impl S3ObjectBuilder {
46    /// <p>Name of the S3 bucket.</p>
47    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.bucket = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>Name of the S3 bucket.</p>
52    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.bucket = input;
54        self
55    }
56    /// <p>Name of the S3 bucket.</p>
57    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
58        &self.bucket
59    }
60    /// <p>S3 object key name.</p>
61    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>S3 object key name.</p>
66    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.name = input;
68        self
69    }
70    /// <p>S3 object key name.</p>
71    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.name
73    }
74    /// <p>If the bucket is versioning enabled, you can specify the object version.</p>
75    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.version = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>If the bucket is versioning enabled, you can specify the object version.</p>
80    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.version = input;
82        self
83    }
84    /// <p>If the bucket is versioning enabled, you can specify the object version.</p>
85    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
86        &self.version
87    }
88    /// Consumes the builder and constructs a [`S3Object`](crate::types::S3Object).
89    pub fn build(self) -> crate::types::S3Object {
90        crate::types::S3Object {
91            bucket: self.bucket,
92            name: self.name,
93            version: self.version,
94        }
95    }
96}