aws_sdk_appmesh/types/
_grpc_gateway_route.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that represents a gRPC gateway route.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GrpcGatewayRoute {
7    /// <p>An object that represents the criteria for determining a request match.</p>
8    pub r#match: ::std::option::Option<crate::types::GrpcGatewayRouteMatch>,
9    /// <p>An object that represents the action to take if a match is determined.</p>
10    pub action: ::std::option::Option<crate::types::GrpcGatewayRouteAction>,
11}
12impl GrpcGatewayRoute {
13    /// <p>An object that represents the criteria for determining a request match.</p>
14    pub fn r#match(&self) -> ::std::option::Option<&crate::types::GrpcGatewayRouteMatch> {
15        self.r#match.as_ref()
16    }
17    /// <p>An object that represents the action to take if a match is determined.</p>
18    pub fn action(&self) -> ::std::option::Option<&crate::types::GrpcGatewayRouteAction> {
19        self.action.as_ref()
20    }
21}
22impl GrpcGatewayRoute {
23    /// Creates a new builder-style object to manufacture [`GrpcGatewayRoute`](crate::types::GrpcGatewayRoute).
24    pub fn builder() -> crate::types::builders::GrpcGatewayRouteBuilder {
25        crate::types::builders::GrpcGatewayRouteBuilder::default()
26    }
27}
28
29/// A builder for [`GrpcGatewayRoute`](crate::types::GrpcGatewayRoute).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GrpcGatewayRouteBuilder {
33    pub(crate) r#match: ::std::option::Option<crate::types::GrpcGatewayRouteMatch>,
34    pub(crate) action: ::std::option::Option<crate::types::GrpcGatewayRouteAction>,
35}
36impl GrpcGatewayRouteBuilder {
37    /// <p>An object that represents the criteria for determining a request match.</p>
38    /// This field is required.
39    pub fn r#match(mut self, input: crate::types::GrpcGatewayRouteMatch) -> Self {
40        self.r#match = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>An object that represents the criteria for determining a request match.</p>
44    pub fn set_match(mut self, input: ::std::option::Option<crate::types::GrpcGatewayRouteMatch>) -> Self {
45        self.r#match = input;
46        self
47    }
48    /// <p>An object that represents the criteria for determining a request match.</p>
49    pub fn get_match(&self) -> &::std::option::Option<crate::types::GrpcGatewayRouteMatch> {
50        &self.r#match
51    }
52    /// <p>An object that represents the action to take if a match is determined.</p>
53    /// This field is required.
54    pub fn action(mut self, input: crate::types::GrpcGatewayRouteAction) -> Self {
55        self.action = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>An object that represents the action to take if a match is determined.</p>
59    pub fn set_action(mut self, input: ::std::option::Option<crate::types::GrpcGatewayRouteAction>) -> Self {
60        self.action = input;
61        self
62    }
63    /// <p>An object that represents the action to take if a match is determined.</p>
64    pub fn get_action(&self) -> &::std::option::Option<crate::types::GrpcGatewayRouteAction> {
65        &self.action
66    }
67    /// Consumes the builder and constructs a [`GrpcGatewayRoute`](crate::types::GrpcGatewayRoute).
68    pub fn build(self) -> crate::types::GrpcGatewayRoute {
69        crate::types::GrpcGatewayRoute {
70            r#match: self.r#match,
71            action: self.action,
72        }
73    }
74}