aws_sdk_codecommit/types/
_object_types.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about the type of an object in a merge operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ObjectTypes {
7    /// <p>The type of the object in the source branch.</p>
8    pub source: ::std::option::Option<crate::types::ObjectTypeEnum>,
9    /// <p>The type of the object in the destination branch.</p>
10    pub destination: ::std::option::Option<crate::types::ObjectTypeEnum>,
11    /// <p>The type of the object in the base commit of the merge.</p>
12    pub base: ::std::option::Option<crate::types::ObjectTypeEnum>,
13}
14impl ObjectTypes {
15    /// <p>The type of the object in the source branch.</p>
16    pub fn source(&self) -> ::std::option::Option<&crate::types::ObjectTypeEnum> {
17        self.source.as_ref()
18    }
19    /// <p>The type of the object in the destination branch.</p>
20    pub fn destination(&self) -> ::std::option::Option<&crate::types::ObjectTypeEnum> {
21        self.destination.as_ref()
22    }
23    /// <p>The type of the object in the base commit of the merge.</p>
24    pub fn base(&self) -> ::std::option::Option<&crate::types::ObjectTypeEnum> {
25        self.base.as_ref()
26    }
27}
28impl ObjectTypes {
29    /// Creates a new builder-style object to manufacture [`ObjectTypes`](crate::types::ObjectTypes).
30    pub fn builder() -> crate::types::builders::ObjectTypesBuilder {
31        crate::types::builders::ObjectTypesBuilder::default()
32    }
33}
34
35/// A builder for [`ObjectTypes`](crate::types::ObjectTypes).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ObjectTypesBuilder {
39    pub(crate) source: ::std::option::Option<crate::types::ObjectTypeEnum>,
40    pub(crate) destination: ::std::option::Option<crate::types::ObjectTypeEnum>,
41    pub(crate) base: ::std::option::Option<crate::types::ObjectTypeEnum>,
42}
43impl ObjectTypesBuilder {
44    /// <p>The type of the object in the source branch.</p>
45    pub fn source(mut self, input: crate::types::ObjectTypeEnum) -> Self {
46        self.source = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The type of the object in the source branch.</p>
50    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ObjectTypeEnum>) -> Self {
51        self.source = input;
52        self
53    }
54    /// <p>The type of the object in the source branch.</p>
55    pub fn get_source(&self) -> &::std::option::Option<crate::types::ObjectTypeEnum> {
56        &self.source
57    }
58    /// <p>The type of the object in the destination branch.</p>
59    pub fn destination(mut self, input: crate::types::ObjectTypeEnum) -> Self {
60        self.destination = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The type of the object in the destination branch.</p>
64    pub fn set_destination(mut self, input: ::std::option::Option<crate::types::ObjectTypeEnum>) -> Self {
65        self.destination = input;
66        self
67    }
68    /// <p>The type of the object in the destination branch.</p>
69    pub fn get_destination(&self) -> &::std::option::Option<crate::types::ObjectTypeEnum> {
70        &self.destination
71    }
72    /// <p>The type of the object in the base commit of the merge.</p>
73    pub fn base(mut self, input: crate::types::ObjectTypeEnum) -> Self {
74        self.base = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>The type of the object in the base commit of the merge.</p>
78    pub fn set_base(mut self, input: ::std::option::Option<crate::types::ObjectTypeEnum>) -> Self {
79        self.base = input;
80        self
81    }
82    /// <p>The type of the object in the base commit of the merge.</p>
83    pub fn get_base(&self) -> &::std::option::Option<crate::types::ObjectTypeEnum> {
84        &self.base
85    }
86    /// Consumes the builder and constructs a [`ObjectTypes`](crate::types::ObjectTypes).
87    pub fn build(self) -> crate::types::ObjectTypes {
88        crate::types::ObjectTypes {
89            source: self.source,
90            destination: self.destination,
91            base: self.base,
92        }
93    }
94}