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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents the specification of a virtual node.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VirtualNodeSpec {
/// <p>The service discovery information for the virtual node. If your virtual node does not expect ingress traffic, you can omit this parameter. If you specify a <code>listener</code>, then you must specify service discovery information.</p>
pub service_discovery: ::std::option::Option<crate::types::ServiceDiscovery>,
/// <p>The listener that the virtual node is expected to receive inbound traffic from. You can specify one listener.</p>
pub listeners: ::std::option::Option<::std::vec::Vec<crate::types::Listener>>,
/// <p>The backends that the virtual node is expected to send outbound traffic to.</p>
pub backends: ::std::option::Option<::std::vec::Vec<crate::types::Backend>>,
/// <p>A reference to an object that represents the defaults for backends.</p>
pub backend_defaults: ::std::option::Option<crate::types::BackendDefaults>,
/// <p>The inbound and outbound access logging information for the virtual node.</p>
pub logging: ::std::option::Option<crate::types::Logging>,
}
impl VirtualNodeSpec {
/// <p>The service discovery information for the virtual node. If your virtual node does not expect ingress traffic, you can omit this parameter. If you specify a <code>listener</code>, then you must specify service discovery information.</p>
pub fn service_discovery(&self) -> ::std::option::Option<&crate::types::ServiceDiscovery> {
self.service_discovery.as_ref()
}
/// <p>The listener that the virtual node is expected to receive inbound traffic from. You can specify one listener.</p>
pub fn listeners(&self) -> ::std::option::Option<&[crate::types::Listener]> {
self.listeners.as_deref()
}
/// <p>The backends that the virtual node is expected to send outbound traffic to.</p>
pub fn backends(&self) -> ::std::option::Option<&[crate::types::Backend]> {
self.backends.as_deref()
}
/// <p>A reference to an object that represents the defaults for backends.</p>
pub fn backend_defaults(&self) -> ::std::option::Option<&crate::types::BackendDefaults> {
self.backend_defaults.as_ref()
}
/// <p>The inbound and outbound access logging information for the virtual node.</p>
pub fn logging(&self) -> ::std::option::Option<&crate::types::Logging> {
self.logging.as_ref()
}
}
impl VirtualNodeSpec {
/// Creates a new builder-style object to manufacture [`VirtualNodeSpec`](crate::types::VirtualNodeSpec).
pub fn builder() -> crate::types::builders::VirtualNodeSpecBuilder {
crate::types::builders::VirtualNodeSpecBuilder::default()
}
}
/// A builder for [`VirtualNodeSpec`](crate::types::VirtualNodeSpec).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct VirtualNodeSpecBuilder {
pub(crate) service_discovery: ::std::option::Option<crate::types::ServiceDiscovery>,
pub(crate) listeners: ::std::option::Option<::std::vec::Vec<crate::types::Listener>>,
pub(crate) backends: ::std::option::Option<::std::vec::Vec<crate::types::Backend>>,
pub(crate) backend_defaults: ::std::option::Option<crate::types::BackendDefaults>,
pub(crate) logging: ::std::option::Option<crate::types::Logging>,
}
impl VirtualNodeSpecBuilder {
/// <p>The service discovery information for the virtual node. If your virtual node does not expect ingress traffic, you can omit this parameter. If you specify a <code>listener</code>, then you must specify service discovery information.</p>
pub fn service_discovery(mut self, input: crate::types::ServiceDiscovery) -> Self {
self.service_discovery = ::std::option::Option::Some(input);
self
}
/// <p>The service discovery information for the virtual node. If your virtual node does not expect ingress traffic, you can omit this parameter. If you specify a <code>listener</code>, then you must specify service discovery information.</p>
pub fn set_service_discovery(mut self, input: ::std::option::Option<crate::types::ServiceDiscovery>) -> Self {
self.service_discovery = input;
self
}
/// <p>The service discovery information for the virtual node. If your virtual node does not expect ingress traffic, you can omit this parameter. If you specify a <code>listener</code>, then you must specify service discovery information.</p>
pub fn get_service_discovery(&self) -> &::std::option::Option<crate::types::ServiceDiscovery> {
&self.service_discovery
}
/// Appends an item to `listeners`.
///
/// To override the contents of this collection use [`set_listeners`](Self::set_listeners).
///
/// <p>The listener that the virtual node is expected to receive inbound traffic from. You can specify one listener.</p>
pub fn listeners(mut self, input: crate::types::Listener) -> Self {
let mut v = self.listeners.unwrap_or_default();
v.push(input);
self.listeners = ::std::option::Option::Some(v);
self
}
/// <p>The listener that the virtual node is expected to receive inbound traffic from. You can specify one listener.</p>
pub fn set_listeners(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Listener>>) -> Self {
self.listeners = input;
self
}
/// <p>The listener that the virtual node is expected to receive inbound traffic from. You can specify one listener.</p>
pub fn get_listeners(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Listener>> {
&self.listeners
}
/// Appends an item to `backends`.
///
/// To override the contents of this collection use [`set_backends`](Self::set_backends).
///
/// <p>The backends that the virtual node is expected to send outbound traffic to.</p>
pub fn backends(mut self, input: crate::types::Backend) -> Self {
let mut v = self.backends.unwrap_or_default();
v.push(input);
self.backends = ::std::option::Option::Some(v);
self
}
/// <p>The backends that the virtual node is expected to send outbound traffic to.</p>
pub fn set_backends(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Backend>>) -> Self {
self.backends = input;
self
}
/// <p>The backends that the virtual node is expected to send outbound traffic to.</p>
pub fn get_backends(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Backend>> {
&self.backends
}
/// <p>A reference to an object that represents the defaults for backends.</p>
pub fn backend_defaults(mut self, input: crate::types::BackendDefaults) -> Self {
self.backend_defaults = ::std::option::Option::Some(input);
self
}
/// <p>A reference to an object that represents the defaults for backends.</p>
pub fn set_backend_defaults(mut self, input: ::std::option::Option<crate::types::BackendDefaults>) -> Self {
self.backend_defaults = input;
self
}
/// <p>A reference to an object that represents the defaults for backends.</p>
pub fn get_backend_defaults(&self) -> &::std::option::Option<crate::types::BackendDefaults> {
&self.backend_defaults
}
/// <p>The inbound and outbound access logging information for the virtual node.</p>
pub fn logging(mut self, input: crate::types::Logging) -> Self {
self.logging = ::std::option::Option::Some(input);
self
}
/// <p>The inbound and outbound access logging information for the virtual node.</p>
pub fn set_logging(mut self, input: ::std::option::Option<crate::types::Logging>) -> Self {
self.logging = input;
self
}
/// <p>The inbound and outbound access logging information for the virtual node.</p>
pub fn get_logging(&self) -> &::std::option::Option<crate::types::Logging> {
&self.logging
}
/// Consumes the builder and constructs a [`VirtualNodeSpec`](crate::types::VirtualNodeSpec).
pub fn build(self) -> crate::types::VirtualNodeSpec {
crate::types::VirtualNodeSpec {
service_discovery: self.service_discovery,
listeners: self.listeners,
backends: self.backends,
backend_defaults: self.backend_defaults,
logging: self.logging,
}
}
}