aws_sdk_appmesh/types/
_virtual_gateway_grpc_connection_pool.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that represents a type of connection pool.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VirtualGatewayGrpcConnectionPool {
7    /// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
8    pub max_requests: i32,
9}
10impl VirtualGatewayGrpcConnectionPool {
11    /// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
12    pub fn max_requests(&self) -> i32 {
13        self.max_requests
14    }
15}
16impl VirtualGatewayGrpcConnectionPool {
17    /// Creates a new builder-style object to manufacture [`VirtualGatewayGrpcConnectionPool`](crate::types::VirtualGatewayGrpcConnectionPool).
18    pub fn builder() -> crate::types::builders::VirtualGatewayGrpcConnectionPoolBuilder {
19        crate::types::builders::VirtualGatewayGrpcConnectionPoolBuilder::default()
20    }
21}
22
23/// A builder for [`VirtualGatewayGrpcConnectionPool`](crate::types::VirtualGatewayGrpcConnectionPool).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct VirtualGatewayGrpcConnectionPoolBuilder {
27    pub(crate) max_requests: ::std::option::Option<i32>,
28}
29impl VirtualGatewayGrpcConnectionPoolBuilder {
30    /// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
31    /// This field is required.
32    pub fn max_requests(mut self, input: i32) -> Self {
33        self.max_requests = ::std::option::Option::Some(input);
34        self
35    }
36    /// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
37    pub fn set_max_requests(mut self, input: ::std::option::Option<i32>) -> Self {
38        self.max_requests = input;
39        self
40    }
41    /// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
42    pub fn get_max_requests(&self) -> &::std::option::Option<i32> {
43        &self.max_requests
44    }
45    /// Consumes the builder and constructs a [`VirtualGatewayGrpcConnectionPool`](crate::types::VirtualGatewayGrpcConnectionPool).
46    /// This method will fail if any of the following fields are not set:
47    /// - [`max_requests`](crate::types::builders::VirtualGatewayGrpcConnectionPoolBuilder::max_requests)
48    pub fn build(self) -> ::std::result::Result<crate::types::VirtualGatewayGrpcConnectionPool, ::aws_smithy_types::error::operation::BuildError> {
49        ::std::result::Result::Ok(crate::types::VirtualGatewayGrpcConnectionPool {
50            max_requests: self.max_requests.ok_or_else(|| {
51                ::aws_smithy_types::error::operation::BuildError::missing_field(
52                    "max_requests",
53                    "max_requests was not specified but it is required when building VirtualGatewayGrpcConnectionPool",
54                )
55            })?,
56        })
57    }
58}