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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains the value of a column.</p><note>
/// <p>This data structure is only used with the deprecated <code>ExecuteSql</code> operation. Use the <code>BatchExecuteStatement</code> or <code>ExecuteStatement</code> operation instead.</p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Value {
/// <p>An array of column values.</p>
ArrayValues(::std::vec::Vec<crate::types::Value>),
/// <p>A value for a column of big integer data type.</p>
BigIntValue(i64),
/// <p>A value for a column of BIT data type.</p>
BitValue(bool),
/// <p>A value for a column of BLOB data type.</p>
BlobValue(::aws_smithy_types::Blob),
/// <p>A value for a column of double data type.</p>
DoubleValue(f64),
/// <p>A value for a column of integer data type.</p>
IntValue(i32),
/// <p>A NULL value.</p>
IsNull(bool),
/// <p>A value for a column of real data type.</p>
RealValue(f32),
/// <p>A value for a column of string data type.</p>
StringValue(::std::string::String),
/// <p>A value for a column of STRUCT data type.</p>
StructValue(crate::types::StructValue),
/// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
/// An unknown enum variant
///
/// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
/// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
/// by the client. This can happen when the server adds new functionality, but the client has not been updated.
/// To investigate this, consider turning on debug logging to print the raw HTTP response.
#[non_exhaustive]
Unknown,
}
impl Value {
/// Tries to convert the enum instance into [`ArrayValues`](crate::types::Value::ArrayValues), extracting the inner [`Vec`](::std::vec::Vec).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_array_values(&self) -> ::std::result::Result<&::std::vec::Vec<crate::types::Value>, &Self> {
if let Value::ArrayValues(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`ArrayValues`](crate::types::Value::ArrayValues).
pub fn is_array_values(&self) -> bool {
self.as_array_values().is_ok()
}
/// Tries to convert the enum instance into [`BigIntValue`](crate::types::Value::BigIntValue), extracting the inner [`i64`](i64).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_big_int_value(&self) -> ::std::result::Result<&i64, &Self> {
if let Value::BigIntValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`BigIntValue`](crate::types::Value::BigIntValue).
pub fn is_big_int_value(&self) -> bool {
self.as_big_int_value().is_ok()
}
/// Tries to convert the enum instance into [`BitValue`](crate::types::Value::BitValue), extracting the inner [`bool`](bool).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_bit_value(&self) -> ::std::result::Result<&bool, &Self> {
if let Value::BitValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`BitValue`](crate::types::Value::BitValue).
pub fn is_bit_value(&self) -> bool {
self.as_bit_value().is_ok()
}
/// Tries to convert the enum instance into [`BlobValue`](crate::types::Value::BlobValue), extracting the inner [`Blob`](::aws_smithy_types::Blob).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_blob_value(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
if let Value::BlobValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`BlobValue`](crate::types::Value::BlobValue).
pub fn is_blob_value(&self) -> bool {
self.as_blob_value().is_ok()
}
/// Tries to convert the enum instance into [`DoubleValue`](crate::types::Value::DoubleValue), extracting the inner [`f64`](f64).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_double_value(&self) -> ::std::result::Result<&f64, &Self> {
if let Value::DoubleValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`DoubleValue`](crate::types::Value::DoubleValue).
pub fn is_double_value(&self) -> bool {
self.as_double_value().is_ok()
}
/// Tries to convert the enum instance into [`IntValue`](crate::types::Value::IntValue), extracting the inner [`i32`](i32).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_int_value(&self) -> ::std::result::Result<&i32, &Self> {
if let Value::IntValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`IntValue`](crate::types::Value::IntValue).
pub fn is_int_value(&self) -> bool {
self.as_int_value().is_ok()
}
/// Tries to convert the enum instance into [`IsNull`](crate::types::Value::IsNull), extracting the inner [`bool`](bool).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_is_null(&self) -> ::std::result::Result<&bool, &Self> {
if let Value::IsNull(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`IsNull`](crate::types::Value::IsNull).
pub fn is_is_null(&self) -> bool {
self.as_is_null().is_ok()
}
/// Tries to convert the enum instance into [`RealValue`](crate::types::Value::RealValue), extracting the inner [`f32`](f32).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_real_value(&self) -> ::std::result::Result<&f32, &Self> {
if let Value::RealValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`RealValue`](crate::types::Value::RealValue).
pub fn is_real_value(&self) -> bool {
self.as_real_value().is_ok()
}
/// Tries to convert the enum instance into [`StringValue`](crate::types::Value::StringValue), extracting the inner [`String`](::std::string::String).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
if let Value::StringValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`StringValue`](crate::types::Value::StringValue).
pub fn is_string_value(&self) -> bool {
self.as_string_value().is_ok()
}
/// Tries to convert the enum instance into [`StructValue`](crate::types::Value::StructValue), extracting the inner [`StructValue`](crate::types::StructValue).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_struct_value(&self) -> ::std::result::Result<&crate::types::StructValue, &Self> {
if let Value::StructValue(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`StructValue`](crate::types::Value::StructValue).
pub fn is_struct_value(&self) -> bool {
self.as_struct_value().is_ok()
}
/// Returns true if the enum instance is the `Unknown` variant.
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}