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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EvaluateMappingTemplateInput {
/// <p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>
pub template: ::std::option::Option<::std::string::String>,
/// <p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>
pub context: ::std::option::Option<::std::string::String>,
}
impl EvaluateMappingTemplateInput {
/// <p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>
pub fn template(&self) -> ::std::option::Option<&str> {
self.template.as_deref()
}
/// <p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>
pub fn context(&self) -> ::std::option::Option<&str> {
self.context.as_deref()
}
}
impl EvaluateMappingTemplateInput {
/// Creates a new builder-style object to manufacture [`EvaluateMappingTemplateInput`](crate::operation::evaluate_mapping_template::EvaluateMappingTemplateInput).
pub fn builder() -> crate::operation::evaluate_mapping_template::builders::EvaluateMappingTemplateInputBuilder {
crate::operation::evaluate_mapping_template::builders::EvaluateMappingTemplateInputBuilder::default()
}
}
/// A builder for [`EvaluateMappingTemplateInput`](crate::operation::evaluate_mapping_template::EvaluateMappingTemplateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EvaluateMappingTemplateInputBuilder {
pub(crate) template: ::std::option::Option<::std::string::String>,
pub(crate) context: ::std::option::Option<::std::string::String>,
}
impl EvaluateMappingTemplateInputBuilder {
/// <p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>
/// This field is required.
pub fn template(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template = ::std::option::Option::Some(input.into());
self
}
/// <p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>
pub fn set_template(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template = input;
self
}
/// <p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>
pub fn get_template(&self) -> &::std::option::Option<::std::string::String> {
&self.template
}
/// <p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>
/// This field is required.
pub fn context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.context = ::std::option::Option::Some(input.into());
self
}
/// <p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>
pub fn set_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.context = input;
self
}
/// <p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>
pub fn get_context(&self) -> &::std::option::Option<::std::string::String> {
&self.context
}
/// Consumes the builder and constructs a [`EvaluateMappingTemplateInput`](crate::operation::evaluate_mapping_template::EvaluateMappingTemplateInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::evaluate_mapping_template::EvaluateMappingTemplateInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::evaluate_mapping_template::EvaluateMappingTemplateInput {
template: self.template,
context: self.context,
})
}
}