Skip to main content

aws_sdk_glue/operation/check_schema_version_validity/
_check_schema_version_validity_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 CheckSchemaVersionValidityInput {
6    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
7    pub data_format: ::std::option::Option<crate::types::DataFormat>,
8    /// <p>The definition of the schema that has to be validated.</p>
9    pub schema_definition: ::std::option::Option<::std::string::String>,
10}
11impl CheckSchemaVersionValidityInput {
12    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
13    pub fn data_format(&self) -> ::std::option::Option<&crate::types::DataFormat> {
14        self.data_format.as_ref()
15    }
16    /// <p>The definition of the schema that has to be validated.</p>
17    pub fn schema_definition(&self) -> ::std::option::Option<&str> {
18        self.schema_definition.as_deref()
19    }
20}
21impl CheckSchemaVersionValidityInput {
22    /// Creates a new builder-style object to manufacture [`CheckSchemaVersionValidityInput`](crate::operation::check_schema_version_validity::CheckSchemaVersionValidityInput).
23    pub fn builder() -> crate::operation::check_schema_version_validity::builders::CheckSchemaVersionValidityInputBuilder {
24        crate::operation::check_schema_version_validity::builders::CheckSchemaVersionValidityInputBuilder::default()
25    }
26}
27
28/// A builder for [`CheckSchemaVersionValidityInput`](crate::operation::check_schema_version_validity::CheckSchemaVersionValidityInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct CheckSchemaVersionValidityInputBuilder {
32    pub(crate) data_format: ::std::option::Option<crate::types::DataFormat>,
33    pub(crate) schema_definition: ::std::option::Option<::std::string::String>,
34}
35impl CheckSchemaVersionValidityInputBuilder {
36    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
37    /// This field is required.
38    pub fn data_format(mut self, input: crate::types::DataFormat) -> Self {
39        self.data_format = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
43    pub fn set_data_format(mut self, input: ::std::option::Option<crate::types::DataFormat>) -> Self {
44        self.data_format = input;
45        self
46    }
47    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
48    pub fn get_data_format(&self) -> &::std::option::Option<crate::types::DataFormat> {
49        &self.data_format
50    }
51    /// <p>The definition of the schema that has to be validated.</p>
52    /// This field is required.
53    pub fn schema_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.schema_definition = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The definition of the schema that has to be validated.</p>
58    pub fn set_schema_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.schema_definition = input;
60        self
61    }
62    /// <p>The definition of the schema that has to be validated.</p>
63    pub fn get_schema_definition(&self) -> &::std::option::Option<::std::string::String> {
64        &self.schema_definition
65    }
66    /// Consumes the builder and constructs a [`CheckSchemaVersionValidityInput`](crate::operation::check_schema_version_validity::CheckSchemaVersionValidityInput).
67    pub fn build(
68        self,
69    ) -> ::std::result::Result<
70        crate::operation::check_schema_version_validity::CheckSchemaVersionValidityInput,
71        ::aws_smithy_types::error::operation::BuildError,
72    > {
73        ::std::result::Result::Ok(crate::operation::check_schema_version_validity::CheckSchemaVersionValidityInput {
74            data_format: self.data_format,
75            schema_definition: self.schema_definition,
76        })
77    }
78}