#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateRouteInput {
pub api_id: ::std::option::Option<::std::string::String>,
pub api_key_required: ::std::option::Option<bool>,
pub authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
pub authorizer_id: ::std::option::Option<::std::string::String>,
pub model_selection_expression: ::std::option::Option<::std::string::String>,
pub operation_name: ::std::option::Option<::std::string::String>,
pub request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
pub route_key: ::std::option::Option<::std::string::String>,
pub route_response_selection_expression: ::std::option::Option<::std::string::String>,
pub target: ::std::option::Option<::std::string::String>,
}
impl CreateRouteInput {
pub fn api_id(&self) -> ::std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn api_key_required(&self) -> ::std::option::Option<bool> {
self.api_key_required
}
pub fn authorization_scopes(&self) -> &[::std::string::String] {
self.authorization_scopes.as_deref().unwrap_or_default()
}
pub fn authorization_type(&self) -> ::std::option::Option<&crate::types::AuthorizationType> {
self.authorization_type.as_ref()
}
pub fn authorizer_id(&self) -> ::std::option::Option<&str> {
self.authorizer_id.as_deref()
}
pub fn model_selection_expression(&self) -> ::std::option::Option<&str> {
self.model_selection_expression.as_deref()
}
pub fn operation_name(&self) -> ::std::option::Option<&str> {
self.operation_name.as_deref()
}
pub fn request_models(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.request_models.as_ref()
}
pub fn request_parameters(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
self.request_parameters.as_ref()
}
pub fn route_key(&self) -> ::std::option::Option<&str> {
self.route_key.as_deref()
}
pub fn route_response_selection_expression(&self) -> ::std::option::Option<&str> {
self.route_response_selection_expression.as_deref()
}
pub fn target(&self) -> ::std::option::Option<&str> {
self.target.as_deref()
}
}
impl CreateRouteInput {
pub fn builder() -> crate::operation::create_route::builders::CreateRouteInputBuilder {
crate::operation::create_route::builders::CreateRouteInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateRouteInputBuilder {
pub(crate) api_id: ::std::option::Option<::std::string::String>,
pub(crate) api_key_required: ::std::option::Option<bool>,
pub(crate) authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
pub(crate) authorizer_id: ::std::option::Option<::std::string::String>,
pub(crate) model_selection_expression: ::std::option::Option<::std::string::String>,
pub(crate) operation_name: ::std::option::Option<::std::string::String>,
pub(crate) request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
pub(crate) route_key: ::std::option::Option<::std::string::String>,
pub(crate) route_response_selection_expression: ::std::option::Option<::std::string::String>,
pub(crate) target: ::std::option::Option<::std::string::String>,
}
impl CreateRouteInputBuilder {
pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.api_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
&self.api_id
}
pub fn api_key_required(mut self, input: bool) -> Self {
self.api_key_required = ::std::option::Option::Some(input);
self
}
pub fn set_api_key_required(mut self, input: ::std::option::Option<bool>) -> Self {
self.api_key_required = input;
self
}
pub fn get_api_key_required(&self) -> &::std::option::Option<bool> {
&self.api_key_required
}
pub fn authorization_scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.authorization_scopes.unwrap_or_default();
v.push(input.into());
self.authorization_scopes = ::std::option::Option::Some(v);
self
}
pub fn set_authorization_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.authorization_scopes = input;
self
}
pub fn get_authorization_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.authorization_scopes
}
pub fn authorization_type(mut self, input: crate::types::AuthorizationType) -> Self {
self.authorization_type = ::std::option::Option::Some(input);
self
}
pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::AuthorizationType>) -> Self {
self.authorization_type = input;
self
}
pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::AuthorizationType> {
&self.authorization_type
}
pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.authorizer_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.authorizer_id = input;
self
}
pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
&self.authorizer_id
}
pub fn model_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.model_selection_expression = ::std::option::Option::Some(input.into());
self
}
pub fn set_model_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.model_selection_expression = input;
self
}
pub fn get_model_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
&self.model_selection_expression
}
pub fn operation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.operation_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.operation_name = input;
self
}
pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
&self.operation_name
}
pub fn request_models(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.request_models.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.request_models = ::std::option::Option::Some(hash_map);
self
}
pub fn set_request_models(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.request_models = input;
self
}
pub fn get_request_models(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.request_models
}
pub fn request_parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ParameterConstraints) -> Self {
let mut hash_map = self.request_parameters.unwrap_or_default();
hash_map.insert(k.into(), v);
self.request_parameters = ::std::option::Option::Some(hash_map);
self
}
pub fn set_request_parameters(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
) -> Self {
self.request_parameters = input;
self
}
pub fn get_request_parameters(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
&self.request_parameters
}
pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.route_key = ::std::option::Option::Some(input.into());
self
}
pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.route_key = input;
self
}
pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
&self.route_key
}
pub fn route_response_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.route_response_selection_expression = ::std::option::Option::Some(input.into());
self
}
pub fn set_route_response_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.route_response_selection_expression = input;
self
}
pub fn get_route_response_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
&self.route_response_selection_expression
}
pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target = ::std::option::Option::Some(input.into());
self
}
pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target = input;
self
}
pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
&self.target
}
pub fn build(self) -> ::std::result::Result<crate::operation::create_route::CreateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_route::CreateRouteInput {
api_id: self.api_id,
api_key_required: self.api_key_required,
authorization_scopes: self.authorization_scopes,
authorization_type: self.authorization_type,
authorizer_id: self.authorizer_id,
model_selection_expression: self.model_selection_expression,
operation_name: self.operation_name,
request_models: self.request_models,
request_parameters: self.request_parameters,
route_key: self.route_key,
route_response_selection_expression: self.route_response_selection_expression,
target: self.target,
})
}
}