aws_sdk_cloudsearch/operation/define_expression/_define_expression_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for the parameters to the <code><code>DefineExpression</code></code> operation. Specifies the name of the domain you want to update and the expression you want to configure.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DefineExpressionInput {
7 /// <p>A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
8 pub domain_name: ::std::option::Option<::std::string::String>,
9 /// <p>A named expression that can be evaluated at search time. Can be used to sort the search results, define other expressions, or return computed information in the search results.</p>
10 pub expression: ::std::option::Option<crate::types::Expression>,
11}
12impl DefineExpressionInput {
13 /// <p>A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
14 pub fn domain_name(&self) -> ::std::option::Option<&str> {
15 self.domain_name.as_deref()
16 }
17 /// <p>A named expression that can be evaluated at search time. Can be used to sort the search results, define other expressions, or return computed information in the search results.</p>
18 pub fn expression(&self) -> ::std::option::Option<&crate::types::Expression> {
19 self.expression.as_ref()
20 }
21}
22impl DefineExpressionInput {
23 /// Creates a new builder-style object to manufacture [`DefineExpressionInput`](crate::operation::define_expression::DefineExpressionInput).
24 pub fn builder() -> crate::operation::define_expression::builders::DefineExpressionInputBuilder {
25 crate::operation::define_expression::builders::DefineExpressionInputBuilder::default()
26 }
27}
28
29/// A builder for [`DefineExpressionInput`](crate::operation::define_expression::DefineExpressionInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct DefineExpressionInputBuilder {
33 pub(crate) domain_name: ::std::option::Option<::std::string::String>,
34 pub(crate) expression: ::std::option::Option<crate::types::Expression>,
35}
36impl DefineExpressionInputBuilder {
37 /// <p>A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
38 /// This field is required.
39 pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40 self.domain_name = ::std::option::Option::Some(input.into());
41 self
42 }
43 /// <p>A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
44 pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45 self.domain_name = input;
46 self
47 }
48 /// <p>A string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).</p>
49 pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
50 &self.domain_name
51 }
52 /// <p>A named expression that can be evaluated at search time. Can be used to sort the search results, define other expressions, or return computed information in the search results.</p>
53 /// This field is required.
54 pub fn expression(mut self, input: crate::types::Expression) -> Self {
55 self.expression = ::std::option::Option::Some(input);
56 self
57 }
58 /// <p>A named expression that can be evaluated at search time. Can be used to sort the search results, define other expressions, or return computed information in the search results.</p>
59 pub fn set_expression(mut self, input: ::std::option::Option<crate::types::Expression>) -> Self {
60 self.expression = input;
61 self
62 }
63 /// <p>A named expression that can be evaluated at search time. Can be used to sort the search results, define other expressions, or return computed information in the search results.</p>
64 pub fn get_expression(&self) -> &::std::option::Option<crate::types::Expression> {
65 &self.expression
66 }
67 /// Consumes the builder and constructs a [`DefineExpressionInput`](crate::operation::define_expression::DefineExpressionInput).
68 pub fn build(
69 self,
70 ) -> ::std::result::Result<crate::operation::define_expression::DefineExpressionInput, ::aws_smithy_types::error::operation::BuildError> {
71 ::std::result::Result::Ok(crate::operation::define_expression::DefineExpressionInput {
72 domain_name: self.domain_name,
73 expression: self.expression,
74 })
75 }
76}