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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents a type of connection pool.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VirtualGatewayGrpcConnectionPool {
/// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
pub max_requests: i32,
}
impl VirtualGatewayGrpcConnectionPool {
/// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
pub fn max_requests(&self) -> i32 {
self.max_requests
}
}
impl VirtualGatewayGrpcConnectionPool {
/// Creates a new builder-style object to manufacture [`VirtualGatewayGrpcConnectionPool`](crate::types::VirtualGatewayGrpcConnectionPool).
pub fn builder() -> crate::types::builders::VirtualGatewayGrpcConnectionPoolBuilder {
crate::types::builders::VirtualGatewayGrpcConnectionPoolBuilder::default()
}
}
/// A builder for [`VirtualGatewayGrpcConnectionPool`](crate::types::VirtualGatewayGrpcConnectionPool).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VirtualGatewayGrpcConnectionPoolBuilder {
pub(crate) max_requests: ::std::option::Option<i32>,
}
impl VirtualGatewayGrpcConnectionPoolBuilder {
/// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
/// This field is required.
pub fn max_requests(mut self, input: i32) -> Self {
self.max_requests = ::std::option::Option::Some(input);
self
}
/// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
pub fn set_max_requests(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_requests = input;
self
}
/// <p>Maximum number of inflight requests Envoy can concurrently support across hosts in upstream cluster.</p>
pub fn get_max_requests(&self) -> &::std::option::Option<i32> {
&self.max_requests
}
/// Consumes the builder and constructs a [`VirtualGatewayGrpcConnectionPool`](crate::types::VirtualGatewayGrpcConnectionPool).
/// This method will fail if any of the following fields are not set:
/// - [`max_requests`](crate::types::builders::VirtualGatewayGrpcConnectionPoolBuilder::max_requests)
pub fn build(self) -> ::std::result::Result<crate::types::VirtualGatewayGrpcConnectionPool, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::VirtualGatewayGrpcConnectionPool {
max_requests: self.max_requests.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"max_requests",
"max_requests was not specified but it is required when building VirtualGatewayGrpcConnectionPool",
)
})?,
})
}
}