3434 * beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==)
3535 */
3636public final class ForwardingRule implements ApiMessage {
37+ private final Boolean allPorts ;
3738 private final String backendService ;
3839 private final String creationTimestamp ;
3940 private final String description ;
@@ -61,6 +62,7 @@ public final class ForwardingRule implements ApiMessage {
6162 private final String target ;
6263
6364 private ForwardingRule () {
65+ this .allPorts = null ;
6466 this .backendService = null ;
6567 this .creationTimestamp = null ;
6668 this .description = null ;
@@ -84,6 +86,7 @@ private ForwardingRule() {
8486 }
8587
8688 private ForwardingRule (
89+ Boolean allPorts ,
8790 String backendService ,
8891 String creationTimestamp ,
8992 String description ,
@@ -104,6 +107,7 @@ private ForwardingRule(
104107 String serviceName ,
105108 String subnetwork ,
106109 String target ) {
110+ this .allPorts = allPorts ;
107111 this .backendService = backendService ;
108112 this .creationTimestamp = creationTimestamp ;
109113 this .description = description ;
@@ -128,6 +132,9 @@ private ForwardingRule(
128132
129133 @ Override
130134 public Object getFieldValue (String fieldName ) {
135+ if ("allPorts" .equals (fieldName )) {
136+ return allPorts ;
137+ }
131138 if ("backendService" .equals (fieldName )) {
132139 return backendService ;
133140 }
@@ -209,6 +216,19 @@ public List<String> getFieldMask() {
209216 return null ;
210217 }
211218
219+ /**
220+ * This field is used along with the backend_service field for internal load balancing or with the
221+ * target field for internal TargetInstance. This field cannot be used with port or portRange
222+ * fields.
223+ *
224+ * <p>When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to
225+ * allow packets addressed to any ports will be forwarded to the backends configured with this
226+ * forwarding rule.
227+ */
228+ public Boolean getAllPorts () {
229+ return allPorts ;
230+ }
231+
212232 /**
213233 * This field is only used for INTERNAL load balancing.
214234 *
@@ -427,8 +447,8 @@ public String getSubnetwork() {
427447 * The URL of the target resource to receive the matched traffic. For regional forwarding rules,
428448 * this target must live in the same region as the forwarding rule. For global forwarding rules,
429449 * this target must be a global load balancing resource. The forwarded traffic must be of a type
430- * appropriate to the target object. For INTERNAL_SELF_MANAGED" load balancing, only HTTP and
431- * HTTPS targets are valid.
450+ * appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS
451+ * targets are valid.
432452 */
433453 public String getTarget () {
434454 return target ;
@@ -457,6 +477,7 @@ public static ForwardingRule getDefaultInstance() {
457477 }
458478
459479 public static class Builder {
480+ private Boolean allPorts ;
460481 private String backendService ;
461482 private String creationTimestamp ;
462483 private String description ;
@@ -482,6 +503,9 @@ public static class Builder {
482503
483504 public Builder mergeFrom (ForwardingRule other ) {
484505 if (other == ForwardingRule .getDefaultInstance ()) return this ;
506+ if (other .getAllPorts () != null ) {
507+ this .allPorts = other .allPorts ;
508+ }
485509 if (other .getBackendService () != null ) {
486510 this .backendService = other .backendService ;
487511 }
@@ -546,6 +570,7 @@ public Builder mergeFrom(ForwardingRule other) {
546570 }
547571
548572 Builder (ForwardingRule source ) {
573+ this .allPorts = source .allPorts ;
549574 this .backendService = source .backendService ;
550575 this .creationTimestamp = source .creationTimestamp ;
551576 this .description = source .description ;
@@ -568,6 +593,33 @@ public Builder mergeFrom(ForwardingRule other) {
568593 this .target = source .target ;
569594 }
570595
596+ /**
597+ * This field is used along with the backend_service field for internal load balancing or with
598+ * the target field for internal TargetInstance. This field cannot be used with port or
599+ * portRange fields.
600+ *
601+ * <p>When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to
602+ * allow packets addressed to any ports will be forwarded to the backends configured with this
603+ * forwarding rule.
604+ */
605+ public Boolean getAllPorts () {
606+ return allPorts ;
607+ }
608+
609+ /**
610+ * This field is used along with the backend_service field for internal load balancing or with
611+ * the target field for internal TargetInstance. This field cannot be used with port or
612+ * portRange fields.
613+ *
614+ * <p>When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to
615+ * allow packets addressed to any ports will be forwarded to the backends configured with this
616+ * forwarding rule.
617+ */
618+ public Builder setAllPorts (Boolean allPorts ) {
619+ this .allPorts = allPorts ;
620+ return this ;
621+ }
622+
571623 /**
572624 * This field is only used for INTERNAL load balancing.
573625 *
@@ -1045,7 +1097,7 @@ public Builder setSubnetwork(String subnetwork) {
10451097 * The URL of the target resource to receive the matched traffic. For regional forwarding rules,
10461098 * this target must live in the same region as the forwarding rule. For global forwarding rules,
10471099 * this target must be a global load balancing resource. The forwarded traffic must be of a type
1048- * appropriate to the target object. For INTERNAL_SELF_MANAGED" load balancing, only HTTP and
1100+ * appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and
10491101 * HTTPS targets are valid.
10501102 */
10511103 public String getTarget () {
@@ -1056,7 +1108,7 @@ public String getTarget() {
10561108 * The URL of the target resource to receive the matched traffic. For regional forwarding rules,
10571109 * this target must live in the same region as the forwarding rule. For global forwarding rules,
10581110 * this target must be a global load balancing resource. The forwarded traffic must be of a type
1059- * appropriate to the target object. For INTERNAL_SELF_MANAGED" load balancing, only HTTP and
1111+ * appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and
10601112 * HTTPS targets are valid.
10611113 */
10621114 public Builder setTarget (String target ) {
@@ -1067,6 +1119,7 @@ public Builder setTarget(String target) {
10671119 public ForwardingRule build () {
10681120
10691121 return new ForwardingRule (
1122+ allPorts ,
10701123 backendService ,
10711124 creationTimestamp ,
10721125 description ,
@@ -1091,6 +1144,7 @@ public ForwardingRule build() {
10911144
10921145 public Builder clone () {
10931146 Builder newBuilder = new Builder ();
1147+ newBuilder .setAllPorts (this .allPorts );
10941148 newBuilder .setBackendService (this .backendService );
10951149 newBuilder .setCreationTimestamp (this .creationTimestamp );
10961150 newBuilder .setDescription (this .description );
@@ -1118,6 +1172,9 @@ public Builder clone() {
11181172 @ Override
11191173 public String toString () {
11201174 return "ForwardingRule{"
1175+ + "allPorts="
1176+ + allPorts
1177+ + ", "
11211178 + "backendService="
11221179 + backendService
11231180 + ", "
@@ -1187,7 +1244,8 @@ public boolean equals(Object o) {
11871244 }
11881245 if (o instanceof ForwardingRule ) {
11891246 ForwardingRule that = (ForwardingRule ) o ;
1190- return Objects .equals (this .backendService , that .getBackendService ())
1247+ return Objects .equals (this .allPorts , that .getAllPorts ())
1248+ && Objects .equals (this .backendService , that .getBackendService ())
11911249 && Objects .equals (this .creationTimestamp , that .getCreationTimestamp ())
11921250 && Objects .equals (this .description , that .getDescription ())
11931251 && Objects .equals (this .iPAddress , that .getIPAddress ())
@@ -1214,6 +1272,7 @@ public boolean equals(Object o) {
12141272 @ Override
12151273 public int hashCode () {
12161274 return Objects .hash (
1275+ allPorts ,
12171276 backendService ,
12181277 creationTimestamp ,
12191278 description ,
0 commit comments