aws_sdk_s3/operation/create_session/_create_session_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 CreateSessionInput {
6 /// <p>Specifies the mode of the session that will be created, either <code>ReadWrite</code> or <code>ReadOnly</code>. By default, a <code>ReadWrite</code> session is created. A <code>ReadWrite</code> session is capable of executing all the Zonal endpoint APIs on a directory bucket. A <code>ReadOnly</code> session is constrained to execute the following Zonal endpoint APIs: <code>GetObject</code>, <code>HeadObject</code>, <code>ListObjectsV2</code>, <code>GetObjectAttributes</code>, <code>ListParts</code>, and <code>ListMultipartUploads</code>.</p>
7 pub session_mode: ::std::option::Option<crate::types::SessionMode>,
8 /// <p>The name of the bucket that you create a session for.</p>
9 pub bucket: ::std::option::Option<::std::string::String>,
10}
11impl CreateSessionInput {
12 /// <p>Specifies the mode of the session that will be created, either <code>ReadWrite</code> or <code>ReadOnly</code>. By default, a <code>ReadWrite</code> session is created. A <code>ReadWrite</code> session is capable of executing all the Zonal endpoint APIs on a directory bucket. A <code>ReadOnly</code> session is constrained to execute the following Zonal endpoint APIs: <code>GetObject</code>, <code>HeadObject</code>, <code>ListObjectsV2</code>, <code>GetObjectAttributes</code>, <code>ListParts</code>, and <code>ListMultipartUploads</code>.</p>
13 pub fn session_mode(&self) -> ::std::option::Option<&crate::types::SessionMode> {
14 self.session_mode.as_ref()
15 }
16 /// <p>The name of the bucket that you create a session for.</p>
17 pub fn bucket(&self) -> ::std::option::Option<&str> {
18 self.bucket.as_deref()
19 }
20}
21impl CreateSessionInput {
22 /// Creates a new builder-style object to manufacture [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
23 pub fn builder() -> crate::operation::create_session::builders::CreateSessionInputBuilder {
24 crate::operation::create_session::builders::CreateSessionInputBuilder::default()
25 }
26}
27
28/// A builder for [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct CreateSessionInputBuilder {
32 pub(crate) session_mode: ::std::option::Option<crate::types::SessionMode>,
33 pub(crate) bucket: ::std::option::Option<::std::string::String>,
34}
35impl CreateSessionInputBuilder {
36 /// <p>Specifies the mode of the session that will be created, either <code>ReadWrite</code> or <code>ReadOnly</code>. By default, a <code>ReadWrite</code> session is created. A <code>ReadWrite</code> session is capable of executing all the Zonal endpoint APIs on a directory bucket. A <code>ReadOnly</code> session is constrained to execute the following Zonal endpoint APIs: <code>GetObject</code>, <code>HeadObject</code>, <code>ListObjectsV2</code>, <code>GetObjectAttributes</code>, <code>ListParts</code>, and <code>ListMultipartUploads</code>.</p>
37 pub fn session_mode(mut self, input: crate::types::SessionMode) -> Self {
38 self.session_mode = ::std::option::Option::Some(input);
39 self
40 }
41 /// <p>Specifies the mode of the session that will be created, either <code>ReadWrite</code> or <code>ReadOnly</code>. By default, a <code>ReadWrite</code> session is created. A <code>ReadWrite</code> session is capable of executing all the Zonal endpoint APIs on a directory bucket. A <code>ReadOnly</code> session is constrained to execute the following Zonal endpoint APIs: <code>GetObject</code>, <code>HeadObject</code>, <code>ListObjectsV2</code>, <code>GetObjectAttributes</code>, <code>ListParts</code>, and <code>ListMultipartUploads</code>.</p>
42 pub fn set_session_mode(mut self, input: ::std::option::Option<crate::types::SessionMode>) -> Self {
43 self.session_mode = input;
44 self
45 }
46 /// <p>Specifies the mode of the session that will be created, either <code>ReadWrite</code> or <code>ReadOnly</code>. By default, a <code>ReadWrite</code> session is created. A <code>ReadWrite</code> session is capable of executing all the Zonal endpoint APIs on a directory bucket. A <code>ReadOnly</code> session is constrained to execute the following Zonal endpoint APIs: <code>GetObject</code>, <code>HeadObject</code>, <code>ListObjectsV2</code>, <code>GetObjectAttributes</code>, <code>ListParts</code>, and <code>ListMultipartUploads</code>.</p>
47 pub fn get_session_mode(&self) -> &::std::option::Option<crate::types::SessionMode> {
48 &self.session_mode
49 }
50 /// <p>The name of the bucket that you create a session for.</p>
51 /// This field is required.
52 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.bucket = ::std::option::Option::Some(input.into());
54 self
55 }
56 /// <p>The name of the bucket that you create a session for.</p>
57 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.bucket = input;
59 self
60 }
61 /// <p>The name of the bucket that you create a session for.</p>
62 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
63 &self.bucket
64 }
65 /// Consumes the builder and constructs a [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput).
66 pub fn build(
67 self,
68 ) -> ::std::result::Result<crate::operation::create_session::CreateSessionInput, ::aws_smithy_types::error::operation::BuildError> {
69 ::std::result::Result::Ok(crate::operation::create_session::CreateSessionInput {
70 session_mode: self.session_mode,
71 bucket: self.bucket,
72 })
73 }
74}