aws_sdk_codedeploy/types/_target_group_pair_info.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about two target groups and how traffic is routed during an Amazon ECS deployment. An optional test traffic route can be specified.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TargetGroupPairInfo {
7 /// <p>One pair of target groups. One is associated with the original task set. The second is associated with the task set that serves traffic after the deployment is complete.</p>
8 pub target_groups: ::std::option::Option<::std::vec::Vec<crate::types::TargetGroupInfo>>,
9 /// <p>The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.</p>
10 pub prod_traffic_route: ::std::option::Option<crate::types::TrafficRoute>,
11 /// <p>An optional path used by a load balancer to route test traffic after an Amazon ECS deployment. Validation can occur while test traffic is served during a deployment.</p>
12 pub test_traffic_route: ::std::option::Option<crate::types::TrafficRoute>,
13}
14impl TargetGroupPairInfo {
15 /// <p>One pair of target groups. One is associated with the original task set. The second is associated with the task set that serves traffic after the deployment is complete.</p>
16 ///
17 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_groups.is_none()`.
18 pub fn target_groups(&self) -> &[crate::types::TargetGroupInfo] {
19 self.target_groups.as_deref().unwrap_or_default()
20 }
21 /// <p>The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.</p>
22 pub fn prod_traffic_route(&self) -> ::std::option::Option<&crate::types::TrafficRoute> {
23 self.prod_traffic_route.as_ref()
24 }
25 /// <p>An optional path used by a load balancer to route test traffic after an Amazon ECS deployment. Validation can occur while test traffic is served during a deployment.</p>
26 pub fn test_traffic_route(&self) -> ::std::option::Option<&crate::types::TrafficRoute> {
27 self.test_traffic_route.as_ref()
28 }
29}
30impl TargetGroupPairInfo {
31 /// Creates a new builder-style object to manufacture [`TargetGroupPairInfo`](crate::types::TargetGroupPairInfo).
32 pub fn builder() -> crate::types::builders::TargetGroupPairInfoBuilder {
33 crate::types::builders::TargetGroupPairInfoBuilder::default()
34 }
35}
36
37/// A builder for [`TargetGroupPairInfo`](crate::types::TargetGroupPairInfo).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct TargetGroupPairInfoBuilder {
41 pub(crate) target_groups: ::std::option::Option<::std::vec::Vec<crate::types::TargetGroupInfo>>,
42 pub(crate) prod_traffic_route: ::std::option::Option<crate::types::TrafficRoute>,
43 pub(crate) test_traffic_route: ::std::option::Option<crate::types::TrafficRoute>,
44}
45impl TargetGroupPairInfoBuilder {
46 /// Appends an item to `target_groups`.
47 ///
48 /// To override the contents of this collection use [`set_target_groups`](Self::set_target_groups).
49 ///
50 /// <p>One pair of target groups. One is associated with the original task set. The second is associated with the task set that serves traffic after the deployment is complete.</p>
51 pub fn target_groups(mut self, input: crate::types::TargetGroupInfo) -> Self {
52 let mut v = self.target_groups.unwrap_or_default();
53 v.push(input);
54 self.target_groups = ::std::option::Option::Some(v);
55 self
56 }
57 /// <p>One pair of target groups. One is associated with the original task set. The second is associated with the task set that serves traffic after the deployment is complete.</p>
58 pub fn set_target_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetGroupInfo>>) -> Self {
59 self.target_groups = input;
60 self
61 }
62 /// <p>One pair of target groups. One is associated with the original task set. The second is associated with the task set that serves traffic after the deployment is complete.</p>
63 pub fn get_target_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetGroupInfo>> {
64 &self.target_groups
65 }
66 /// <p>The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.</p>
67 pub fn prod_traffic_route(mut self, input: crate::types::TrafficRoute) -> Self {
68 self.prod_traffic_route = ::std::option::Option::Some(input);
69 self
70 }
71 /// <p>The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.</p>
72 pub fn set_prod_traffic_route(mut self, input: ::std::option::Option<crate::types::TrafficRoute>) -> Self {
73 self.prod_traffic_route = input;
74 self
75 }
76 /// <p>The path used by a load balancer to route production traffic when an Amazon ECS deployment is complete.</p>
77 pub fn get_prod_traffic_route(&self) -> &::std::option::Option<crate::types::TrafficRoute> {
78 &self.prod_traffic_route
79 }
80 /// <p>An optional path used by a load balancer to route test traffic after an Amazon ECS deployment. Validation can occur while test traffic is served during a deployment.</p>
81 pub fn test_traffic_route(mut self, input: crate::types::TrafficRoute) -> Self {
82 self.test_traffic_route = ::std::option::Option::Some(input);
83 self
84 }
85 /// <p>An optional path used by a load balancer to route test traffic after an Amazon ECS deployment. Validation can occur while test traffic is served during a deployment.</p>
86 pub fn set_test_traffic_route(mut self, input: ::std::option::Option<crate::types::TrafficRoute>) -> Self {
87 self.test_traffic_route = input;
88 self
89 }
90 /// <p>An optional path used by a load balancer to route test traffic after an Amazon ECS deployment. Validation can occur while test traffic is served during a deployment.</p>
91 pub fn get_test_traffic_route(&self) -> &::std::option::Option<crate::types::TrafficRoute> {
92 &self.test_traffic_route
93 }
94 /// Consumes the builder and constructs a [`TargetGroupPairInfo`](crate::types::TargetGroupPairInfo).
95 pub fn build(self) -> crate::types::TargetGroupPairInfo {
96 crate::types::TargetGroupPairInfo {
97 target_groups: self.target_groups,
98 prod_traffic_route: self.prod_traffic_route,
99 test_traffic_route: self.test_traffic_route,
100 }
101 }
102}