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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies a JSON classifier for <code>CreateClassifier</code> to create.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateJsonClassifierRequest {
    /// <p>The name of the classifier.</p>
    pub name: ::std::string::String,
    /// <p>A <code>JsonPath</code> string defining the JSON data for the classifier to classify. Glue supports a subset of JsonPath, as described in <a href="https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json">Writing JsonPath Custom Classifiers</a>.</p>
    pub json_path: ::std::string::String,
}
impl CreateJsonClassifierRequest {
    /// <p>The name of the classifier.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>A <code>JsonPath</code> string defining the JSON data for the classifier to classify. Glue supports a subset of JsonPath, as described in <a href="https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json">Writing JsonPath Custom Classifiers</a>.</p>
    pub fn json_path(&self) -> &str {
        use std::ops::Deref;
        self.json_path.deref()
    }
}
impl CreateJsonClassifierRequest {
    /// Creates a new builder-style object to manufacture [`CreateJsonClassifierRequest`](crate::types::CreateJsonClassifierRequest).
    pub fn builder() -> crate::types::builders::CreateJsonClassifierRequestBuilder {
        crate::types::builders::CreateJsonClassifierRequestBuilder::default()
    }
}

/// A builder for [`CreateJsonClassifierRequest`](crate::types::CreateJsonClassifierRequest).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateJsonClassifierRequestBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) json_path: ::std::option::Option<::std::string::String>,
}
impl CreateJsonClassifierRequestBuilder {
    /// <p>The name of the classifier.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the classifier.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the classifier.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A <code>JsonPath</code> string defining the JSON data for the classifier to classify. Glue supports a subset of JsonPath, as described in <a href="https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json">Writing JsonPath Custom Classifiers</a>.</p>
    /// This field is required.
    pub fn json_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.json_path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A <code>JsonPath</code> string defining the JSON data for the classifier to classify. Glue supports a subset of JsonPath, as described in <a href="https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json">Writing JsonPath Custom Classifiers</a>.</p>
    pub fn set_json_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.json_path = input;
        self
    }
    /// <p>A <code>JsonPath</code> string defining the JSON data for the classifier to classify. Glue supports a subset of JsonPath, as described in <a href="https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json">Writing JsonPath Custom Classifiers</a>.</p>
    pub fn get_json_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.json_path
    }
    /// Consumes the builder and constructs a [`CreateJsonClassifierRequest`](crate::types::CreateJsonClassifierRequest).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::CreateJsonClassifierRequestBuilder::name)
    /// - [`json_path`](crate::types::builders::CreateJsonClassifierRequestBuilder::json_path)
    pub fn build(self) -> ::std::result::Result<crate::types::CreateJsonClassifierRequest, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::CreateJsonClassifierRequest {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building CreateJsonClassifierRequest",
                )
            })?,
            json_path: self.json_path.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "json_path",
                    "json_path was not specified but it is required when building CreateJsonClassifierRequest",
                )
            })?,
        })
    }
}