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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The attributes of a VSAM type data set.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VsamAttributes {
    /// <p>The record format of the data set.</p>
    pub format: ::std::string::String,
    /// <p>The character set used by the data set. Can be ASCII, EBCDIC, or unknown.</p>
    pub encoding: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether indexes for this dataset are stored as compressed values. If you have a large data set (typically &gt; 100 Mb), consider setting this flag to True.</p>
    pub compressed: bool,
    /// <p>The primary key of the data set.</p>
    pub primary_key: ::std::option::Option<crate::types::PrimaryKey>,
    /// <p>The alternate key definitions, if any. A legacy dataset might not have any alternate key defined, but if those alternate keys definitions exist, provide them as some applications will make use of them.</p>
    pub alternate_keys: ::std::option::Option<::std::vec::Vec<crate::types::AlternateKey>>,
}
impl VsamAttributes {
    /// <p>The record format of the data set.</p>
    pub fn format(&self) -> &str {
        use std::ops::Deref;
        self.format.deref()
    }
    /// <p>The character set used by the data set. Can be ASCII, EBCDIC, or unknown.</p>
    pub fn encoding(&self) -> ::std::option::Option<&str> {
        self.encoding.as_deref()
    }
    /// <p>Indicates whether indexes for this dataset are stored as compressed values. If you have a large data set (typically &gt; 100 Mb), consider setting this flag to True.</p>
    pub fn compressed(&self) -> bool {
        self.compressed
    }
    /// <p>The primary key of the data set.</p>
    pub fn primary_key(&self) -> ::std::option::Option<&crate::types::PrimaryKey> {
        self.primary_key.as_ref()
    }
    /// <p>The alternate key definitions, if any. A legacy dataset might not have any alternate key defined, but if those alternate keys definitions exist, provide them as some applications will make use of them.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.alternate_keys.is_none()`.
    pub fn alternate_keys(&self) -> &[crate::types::AlternateKey] {
        self.alternate_keys.as_deref().unwrap_or_default()
    }
}
impl VsamAttributes {
    /// Creates a new builder-style object to manufacture [`VsamAttributes`](crate::types::VsamAttributes).
    pub fn builder() -> crate::types::builders::VsamAttributesBuilder {
        crate::types::builders::VsamAttributesBuilder::default()
    }
}

/// A builder for [`VsamAttributes`](crate::types::VsamAttributes).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct VsamAttributesBuilder {
    pub(crate) format: ::std::option::Option<::std::string::String>,
    pub(crate) encoding: ::std::option::Option<::std::string::String>,
    pub(crate) compressed: ::std::option::Option<bool>,
    pub(crate) primary_key: ::std::option::Option<crate::types::PrimaryKey>,
    pub(crate) alternate_keys: ::std::option::Option<::std::vec::Vec<crate::types::AlternateKey>>,
}
impl VsamAttributesBuilder {
    /// <p>The record format of the data set.</p>
    /// This field is required.
    pub fn format(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.format = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The record format of the data set.</p>
    pub fn set_format(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.format = input;
        self
    }
    /// <p>The record format of the data set.</p>
    pub fn get_format(&self) -> &::std::option::Option<::std::string::String> {
        &self.format
    }
    /// <p>The character set used by the data set. Can be ASCII, EBCDIC, or unknown.</p>
    pub fn encoding(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.encoding = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The character set used by the data set. Can be ASCII, EBCDIC, or unknown.</p>
    pub fn set_encoding(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.encoding = input;
        self
    }
    /// <p>The character set used by the data set. Can be ASCII, EBCDIC, or unknown.</p>
    pub fn get_encoding(&self) -> &::std::option::Option<::std::string::String> {
        &self.encoding
    }
    /// <p>Indicates whether indexes for this dataset are stored as compressed values. If you have a large data set (typically &gt; 100 Mb), consider setting this flag to True.</p>
    pub fn compressed(mut self, input: bool) -> Self {
        self.compressed = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether indexes for this dataset are stored as compressed values. If you have a large data set (typically &gt; 100 Mb), consider setting this flag to True.</p>
    pub fn set_compressed(mut self, input: ::std::option::Option<bool>) -> Self {
        self.compressed = input;
        self
    }
    /// <p>Indicates whether indexes for this dataset are stored as compressed values. If you have a large data set (typically &gt; 100 Mb), consider setting this flag to True.</p>
    pub fn get_compressed(&self) -> &::std::option::Option<bool> {
        &self.compressed
    }
    /// <p>The primary key of the data set.</p>
    pub fn primary_key(mut self, input: crate::types::PrimaryKey) -> Self {
        self.primary_key = ::std::option::Option::Some(input);
        self
    }
    /// <p>The primary key of the data set.</p>
    pub fn set_primary_key(mut self, input: ::std::option::Option<crate::types::PrimaryKey>) -> Self {
        self.primary_key = input;
        self
    }
    /// <p>The primary key of the data set.</p>
    pub fn get_primary_key(&self) -> &::std::option::Option<crate::types::PrimaryKey> {
        &self.primary_key
    }
    /// Appends an item to `alternate_keys`.
    ///
    /// To override the contents of this collection use [`set_alternate_keys`](Self::set_alternate_keys).
    ///
    /// <p>The alternate key definitions, if any. A legacy dataset might not have any alternate key defined, but if those alternate keys definitions exist, provide them as some applications will make use of them.</p>
    pub fn alternate_keys(mut self, input: crate::types::AlternateKey) -> Self {
        let mut v = self.alternate_keys.unwrap_or_default();
        v.push(input);
        self.alternate_keys = ::std::option::Option::Some(v);
        self
    }
    /// <p>The alternate key definitions, if any. A legacy dataset might not have any alternate key defined, but if those alternate keys definitions exist, provide them as some applications will make use of them.</p>
    pub fn set_alternate_keys(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AlternateKey>>) -> Self {
        self.alternate_keys = input;
        self
    }
    /// <p>The alternate key definitions, if any. A legacy dataset might not have any alternate key defined, but if those alternate keys definitions exist, provide them as some applications will make use of them.</p>
    pub fn get_alternate_keys(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AlternateKey>> {
        &self.alternate_keys
    }
    /// Consumes the builder and constructs a [`VsamAttributes`](crate::types::VsamAttributes).
    /// This method will fail if any of the following fields are not set:
    /// - [`format`](crate::types::builders::VsamAttributesBuilder::format)
    pub fn build(self) -> ::std::result::Result<crate::types::VsamAttributes, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::VsamAttributes {
            format: self.format.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "format",
                    "format was not specified but it is required when building VsamAttributes",
                )
            })?,
            encoding: self.encoding,
            compressed: self.compressed.unwrap_or_default(),
            primary_key: self.primary_key,
            alternate_keys: self.alternate_keys,
        })
    }
}