1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Object Identifier is unique value to identify objects.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ObjectIdentifier {
/// <p>Key name of the object.</p> <important>
/// <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> XML related object key constraints</a>.</p>
/// </important>
pub key: ::std::option::Option<::std::string::String>,
/// <p>VersionId for the specific version of the object to delete.</p>
pub version_id: ::std::option::Option<::std::string::String>,
}
impl ObjectIdentifier {
/// <p>Key name of the object.</p> <important>
/// <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> XML related object key constraints</a>.</p>
/// </important>
pub fn key(&self) -> ::std::option::Option<&str> {
self.key.as_deref()
}
/// <p>VersionId for the specific version of the object to delete.</p>
pub fn version_id(&self) -> ::std::option::Option<&str> {
self.version_id.as_deref()
}
}
impl ObjectIdentifier {
/// Creates a new builder-style object to manufacture [`ObjectIdentifier`](crate::types::ObjectIdentifier).
pub fn builder() -> crate::types::builders::ObjectIdentifierBuilder {
crate::types::builders::ObjectIdentifierBuilder::default()
}
}
/// A builder for [`ObjectIdentifier`](crate::types::ObjectIdentifier).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ObjectIdentifierBuilder {
pub(crate) key: ::std::option::Option<::std::string::String>,
pub(crate) version_id: ::std::option::Option<::std::string::String>,
}
impl ObjectIdentifierBuilder {
/// <p>Key name of the object.</p> <important>
/// <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> XML related object key constraints</a>.</p>
/// </important>
pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key = ::std::option::Option::Some(input.into());
self
}
/// <p>Key name of the object.</p> <important>
/// <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> XML related object key constraints</a>.</p>
/// </important>
pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key = input;
self
}
/// <p>Key name of the object.</p> <important>
/// <p>Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints"> XML related object key constraints</a>.</p>
/// </important>
pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
&self.key
}
/// <p>VersionId for the specific version of the object to delete.</p>
pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version_id = ::std::option::Option::Some(input.into());
self
}
/// <p>VersionId for the specific version of the object to delete.</p>
pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version_id = input;
self
}
/// <p>VersionId for the specific version of the object to delete.</p>
pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
&self.version_id
}
/// Consumes the builder and constructs a [`ObjectIdentifier`](crate::types::ObjectIdentifier).
pub fn build(self) -> crate::types::ObjectIdentifier {
crate::types::ObjectIdentifier {
key: self.key,
version_id: self.version_id,
}
}
}