diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java index 94e3950952f8..9eef9ccac7e1 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AttachDiskInstanceHttpRequest.java @@ -158,10 +158,7 @@ public String getFields() { return fields; } - /** - * Whether to force attach the disk even if it's currently attached to another instance. This is - * only available for regional disks. - */ + /** Whether to force attach the disk even if it's currently attached to another instance. */ public Boolean getForceAttach() { return forceAttach; } @@ -348,18 +345,12 @@ public Builder setFields(String fields) { return this; } - /** - * Whether to force attach the disk even if it's currently attached to another instance. This is - * only available for regional disks. - */ + /** Whether to force attach the disk even if it's currently attached to another instance. */ public Boolean getForceAttach() { return forceAttach; } - /** - * Whether to force attach the disk even if it's currently attached to another instance. This is - * only available for regional disks. - */ + /** Whether to force attach the disk even if it's currently attached to another instance. */ public Builder setForceAttach(Boolean forceAttach) { this.forceAttach = forceAttach; return this; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Condition.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Condition.java index 926326417397..91a6ae9ae268 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Condition.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Condition.java @@ -31,7 +31,6 @@ public final class Condition implements ApiMessage { private final String op; private final String svc; private final String sys; - private final String value; private final List values; private Condition() { @@ -39,17 +38,14 @@ private Condition() { this.op = null; this.svc = null; this.sys = null; - this.value = null; this.values = null; } - private Condition( - String iam, String op, String svc, String sys, String value, List values) { + private Condition(String iam, String op, String svc, String sys, List values) { this.iam = iam; this.op = op; this.svc = svc; this.sys = sys; - this.value = value; this.values = values; } @@ -67,9 +63,6 @@ public Object getFieldValue(String fieldName) { if ("sys".equals(fieldName)) { return sys; } - if ("value".equals(fieldName)) { - return value; - } if ("values".equals(fieldName)) { return values; } @@ -117,12 +110,7 @@ public String getSys() { return sys; } - /** DEPRECATED. Use 'values' instead. */ - public String getValue() { - return value; - } - - /** The objects of the condition. This is mutually exclusive with 'value'. */ + /** The objects of the condition. */ public List getValuesList() { return values; } @@ -154,7 +142,6 @@ public static class Builder { private String op; private String svc; private String sys; - private String value; private List values; Builder() {} @@ -173,9 +160,6 @@ public Builder mergeFrom(Condition other) { if (other.getSys() != null) { this.sys = other.sys; } - if (other.getValue() != null) { - this.value = other.value; - } if (other.getValuesList() != null) { this.values = other.values; } @@ -187,7 +171,6 @@ public Builder mergeFrom(Condition other) { this.op = source.op; this.svc = source.svc; this.sys = source.sys; - this.value = source.value; this.values = source.values; } @@ -241,23 +224,12 @@ public Builder setSys(String sys) { return this; } - /** DEPRECATED. Use 'values' instead. */ - public String getValue() { - return value; - } - - /** DEPRECATED. Use 'values' instead. */ - public Builder setValue(String value) { - this.value = value; - return this; - } - - /** The objects of the condition. This is mutually exclusive with 'value'. */ + /** The objects of the condition. */ public List getValuesList() { return values; } - /** The objects of the condition. This is mutually exclusive with 'value'. */ + /** The objects of the condition. */ public Builder addAllValues(List values) { if (this.values == null) { this.values = new LinkedList<>(); @@ -266,7 +238,7 @@ public Builder addAllValues(List values) { return this; } - /** The objects of the condition. This is mutually exclusive with 'value'. */ + /** The objects of the condition. */ public Builder addValues(String values) { if (this.values == null) { this.values = new LinkedList<>(); @@ -277,7 +249,7 @@ public Builder addValues(String values) { public Condition build() { - return new Condition(iam, op, svc, sys, value, values); + return new Condition(iam, op, svc, sys, values); } public Builder clone() { @@ -286,7 +258,6 @@ public Builder clone() { newBuilder.setOp(this.op); newBuilder.setSvc(this.svc); newBuilder.setSys(this.sys); - newBuilder.setValue(this.value); newBuilder.addAllValues(this.values); return newBuilder; } @@ -307,9 +278,6 @@ public String toString() { + "sys=" + sys + ", " - + "value=" - + value - + ", " + "values=" + values + "}"; @@ -326,7 +294,6 @@ public boolean equals(Object o) { && Objects.equals(this.op, that.getOp()) && Objects.equals(this.svc, that.getSvc()) && Objects.equals(this.sys, that.getSys()) - && Objects.equals(this.value, that.getValue()) && Objects.equals(this.values, that.getValuesList()); } return false; @@ -334,6 +301,6 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(iam, op, svc, sys, value, values); + return Objects.hash(iam, op, svc, sys, values); } } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java index bf88ef0ba396..be66f586278d 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ForwardingRule.java @@ -34,6 +34,7 @@ * beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) */ public final class ForwardingRule implements ApiMessage { + private final Boolean allPorts; private final String backendService; private final String creationTimestamp; private final String description; @@ -61,6 +62,7 @@ public final class ForwardingRule implements ApiMessage { private final String target; private ForwardingRule() { + this.allPorts = null; this.backendService = null; this.creationTimestamp = null; this.description = null; @@ -84,6 +86,7 @@ private ForwardingRule() { } private ForwardingRule( + Boolean allPorts, String backendService, String creationTimestamp, String description, @@ -104,6 +107,7 @@ private ForwardingRule( String serviceName, String subnetwork, String target) { + this.allPorts = allPorts; this.backendService = backendService; this.creationTimestamp = creationTimestamp; this.description = description; @@ -128,6 +132,9 @@ private ForwardingRule( @Override public Object getFieldValue(String fieldName) { + if ("allPorts".equals(fieldName)) { + return allPorts; + } if ("backendService".equals(fieldName)) { return backendService; } @@ -209,6 +216,19 @@ public List getFieldMask() { return null; } + /** + * This field is used along with the backend_service field for internal load balancing or with the + * target field for internal TargetInstance. This field cannot be used with port or portRange + * fields. + * + *

When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to + * allow packets addressed to any ports will be forwarded to the backends configured with this + * forwarding rule. + */ + public Boolean getAllPorts() { + return allPorts; + } + /** * This field is only used for INTERNAL load balancing. * @@ -427,8 +447,8 @@ public String getSubnetwork() { * The URL of the target resource to receive the matched traffic. For regional forwarding rules, * this target must live in the same region as the forwarding rule. For global forwarding rules, * this target must be a global load balancing resource. The forwarded traffic must be of a type - * appropriate to the target object. For INTERNAL_SELF_MANAGED" load balancing, only HTTP and - * HTTPS targets are valid. + * appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS + * targets are valid. */ public String getTarget() { return target; @@ -457,6 +477,7 @@ public static ForwardingRule getDefaultInstance() { } public static class Builder { + private Boolean allPorts; private String backendService; private String creationTimestamp; private String description; @@ -482,6 +503,9 @@ public static class Builder { public Builder mergeFrom(ForwardingRule other) { if (other == ForwardingRule.getDefaultInstance()) return this; + if (other.getAllPorts() != null) { + this.allPorts = other.allPorts; + } if (other.getBackendService() != null) { this.backendService = other.backendService; } @@ -546,6 +570,7 @@ public Builder mergeFrom(ForwardingRule other) { } Builder(ForwardingRule source) { + this.allPorts = source.allPorts; this.backendService = source.backendService; this.creationTimestamp = source.creationTimestamp; this.description = source.description; @@ -568,6 +593,33 @@ public Builder mergeFrom(ForwardingRule other) { this.target = source.target; } + /** + * This field is used along with the backend_service field for internal load balancing or with + * the target field for internal TargetInstance. This field cannot be used with port or + * portRange fields. + * + *

When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to + * allow packets addressed to any ports will be forwarded to the backends configured with this + * forwarding rule. + */ + public Boolean getAllPorts() { + return allPorts; + } + + /** + * This field is used along with the backend_service field for internal load balancing or with + * the target field for internal TargetInstance. This field cannot be used with port or + * portRange fields. + * + *

When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to + * allow packets addressed to any ports will be forwarded to the backends configured with this + * forwarding rule. + */ + public Builder setAllPorts(Boolean allPorts) { + this.allPorts = allPorts; + return this; + } + /** * This field is only used for INTERNAL load balancing. * @@ -1045,7 +1097,7 @@ public Builder setSubnetwork(String subnetwork) { * The URL of the target resource to receive the matched traffic. For regional forwarding rules, * this target must live in the same region as the forwarding rule. For global forwarding rules, * this target must be a global load balancing resource. The forwarded traffic must be of a type - * appropriate to the target object. For INTERNAL_SELF_MANAGED" load balancing, only HTTP and + * appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and * HTTPS targets are valid. */ public String getTarget() { @@ -1056,7 +1108,7 @@ public String getTarget() { * The URL of the target resource to receive the matched traffic. For regional forwarding rules, * this target must live in the same region as the forwarding rule. For global forwarding rules, * this target must be a global load balancing resource. The forwarded traffic must be of a type - * appropriate to the target object. For INTERNAL_SELF_MANAGED" load balancing, only HTTP and + * appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and * HTTPS targets are valid. */ public Builder setTarget(String target) { @@ -1067,6 +1119,7 @@ public Builder setTarget(String target) { public ForwardingRule build() { return new ForwardingRule( + allPorts, backendService, creationTimestamp, description, @@ -1091,6 +1144,7 @@ public ForwardingRule build() { public Builder clone() { Builder newBuilder = new Builder(); + newBuilder.setAllPorts(this.allPorts); newBuilder.setBackendService(this.backendService); newBuilder.setCreationTimestamp(this.creationTimestamp); newBuilder.setDescription(this.description); @@ -1118,6 +1172,9 @@ public Builder clone() { @Override public String toString() { return "ForwardingRule{" + + "allPorts=" + + allPorts + + ", " + "backendService=" + backendService + ", " @@ -1187,7 +1244,8 @@ public boolean equals(Object o) { } if (o instanceof ForwardingRule) { ForwardingRule that = (ForwardingRule) o; - return Objects.equals(this.backendService, that.getBackendService()) + return Objects.equals(this.allPorts, that.getAllPorts()) + && Objects.equals(this.backendService, that.getBackendService()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) && Objects.equals(this.description, that.getDescription()) && Objects.equals(this.iPAddress, that.getIPAddress()) @@ -1214,6 +1272,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + allPorts, backendService, creationTimestamp, description, diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java index 7458a77b898a..b6e5c69f776c 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -436,7 +436,7 @@ public final AggregatedListInstancesPagedResponse aggregatedListInstances( * * @param instance The instance name for this request. * @param forceAttach Whether to force attach the disk even if it's currently attached to another - * instance. This is only available for regional disks. + * instance. * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -472,7 +472,7 @@ public final Operation attachDiskInstance( * * @param instance The instance name for this request. * @param forceAttach Whether to force attach the disk even if it's currently attached to another - * instance. This is only available for regional disks. + * instance. * @param attachedDiskResource An instance-attached disk resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkOpticalPower.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkOpticalPower.java index a38af6872490..b7aa305ab37d 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkOpticalPower.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkOpticalPower.java @@ -67,14 +67,22 @@ public List getFieldMask() { return null; } + /** + * The status of the current value when compared to the warning and alarm levels for the receiving + * or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning + * threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - + * HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value + * has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high + * alarm threshold. + */ public String getState() { return state; } /** - * Value of the current optical power, read in dBm. Take a known good optical value, give it a 10% - * margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm - * alarm are good optical value estimates for most links. + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good + * optical value, give it a 10% margin and trigger warnings relative to that value. In general, a + * -7dBm warning and a -11dBm alarm are good optical value estimates for most links. */ public Float getValue() { return value; @@ -124,28 +132,44 @@ public Builder mergeFrom(InterconnectDiagnosticsLinkOpticalPower other) { this.value = source.value; } + /** + * The status of the current value when compared to the warning and alarm levels for the + * receiving or transmitting transceiver. Possible states include: - OK: The value has not + * crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning + * threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - + * LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has + * crossed above the high alarm threshold. + */ public String getState() { return state; } + /** + * The status of the current value when compared to the warning and alarm levels for the + * receiving or transmitting transceiver. Possible states include: - OK: The value has not + * crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning + * threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - + * LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has + * crossed above the high alarm threshold. + */ public Builder setState(String state) { this.state = state; return this; } /** - * Value of the current optical power, read in dBm. Take a known good optical value, give it a - * 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a - * -11dBm alarm are good optical value estimates for most links. + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good + * optical value, give it a 10% margin and trigger warnings relative to that value. In general, + * a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. */ public Float getValue() { return value; } /** - * Value of the current optical power, read in dBm. Take a known good optical value, give it a - * 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a - * -11dBm alarm are good optical value estimates for most links. + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good + * optical value, give it a 10% margin and trigger warnings relative to that value. In general, + * a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. */ public Builder setValue(Float value) { this.value = value; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkStatus.java index 198d2e10b71f..0605021a5ccc 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkStatus.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectDiagnosticsLinkStatus.java @@ -120,10 +120,18 @@ public InterconnectDiagnosticsLinkLACPStatus getLacpStatus() { return lacpStatus; } + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of + * the received light level. + */ public InterconnectDiagnosticsLinkOpticalPower getReceivingOpticalPower() { return receivingOpticalPower; } + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of + * the transmitted light level. + */ public InterconnectDiagnosticsLinkOpticalPower getTransmittingOpticalPower() { return transmittingOpticalPower; } @@ -255,20 +263,36 @@ public Builder setLacpStatus(InterconnectDiagnosticsLinkLACPStatus lacpStatus) { return this; } + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status + * of the received light level. + */ public InterconnectDiagnosticsLinkOpticalPower getReceivingOpticalPower() { return receivingOpticalPower; } + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status + * of the received light level. + */ public Builder setReceivingOpticalPower( InterconnectDiagnosticsLinkOpticalPower receivingOpticalPower) { this.receivingOpticalPower = receivingOpticalPower; return this; } + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status + * of the transmitted light level. + */ public InterconnectDiagnosticsLinkOpticalPower getTransmittingOpticalPower() { return transmittingOpticalPower; } + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status + * of the transmitted light level. + */ public Builder setTransmittingOpticalPower( InterconnectDiagnosticsLinkOpticalPower transmittingOpticalPower) { this.transmittingOpticalPower = transmittingOpticalPower; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java index f09c0a4cc285..887e5b3d9d3d 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Network.java @@ -180,8 +180,9 @@ public String getGatewayIPv4() { } /** - * The range of internal addresses that are legal on this network. This range is a CIDR - * specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on + * this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the + * client when the network is created. */ public String getIPv4Range() { return iPv4Range; @@ -394,18 +395,18 @@ public Builder setGatewayIPv4(String gatewayIPv4) { } /** - * The range of internal addresses that are legal on this network. This range is a CIDR - * specification, for example: 192.168.0.0/16. Provided by the client when the network is - * created. + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal + * on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by + * the client when the network is created. */ public String getIPv4Range() { return iPv4Range; } /** - * The range of internal addresses that are legal on this network. This range is a CIDR - * specification, for example: 192.168.0.0/16. Provided by the client when the network is - * created. + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal + * on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by + * the client when the network is created. */ public Builder setIPv4Range(String iPv4Range) { this.iPv4Range = iPv4Range; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java index 56c752ad67c2..4ad2e87c986d 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworkPeering.java @@ -31,6 +31,7 @@ */ public final class NetworkPeering implements ApiMessage { private final Boolean autoCreateRoutes; + private final Boolean exchangeSubnetRoutes; private final String name; private final String network; private final String state; @@ -38,6 +39,7 @@ public final class NetworkPeering implements ApiMessage { private NetworkPeering() { this.autoCreateRoutes = null; + this.exchangeSubnetRoutes = null; this.name = null; this.network = null; this.state = null; @@ -45,8 +47,14 @@ private NetworkPeering() { } private NetworkPeering( - Boolean autoCreateRoutes, String name, String network, String state, String stateDetails) { + Boolean autoCreateRoutes, + Boolean exchangeSubnetRoutes, + String name, + String network, + String state, + String stateDetails) { this.autoCreateRoutes = autoCreateRoutes; + this.exchangeSubnetRoutes = exchangeSubnetRoutes; this.name = name; this.network = network; this.state = state; @@ -58,6 +66,9 @@ public Object getFieldValue(String fieldName) { if ("autoCreateRoutes".equals(fieldName)) { return autoCreateRoutes; } + if ("exchangeSubnetRoutes".equals(fieldName)) { + return exchangeSubnetRoutes; + } if ("name".equals(fieldName)) { return name; } @@ -92,15 +103,26 @@ public List getFieldMask() { } /** - * Indicates whether full mesh connectivity is created and managed automatically. When it is set - * to true, Google Compute Engine will automatically create and manage the routes between two - * networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route - * packets to peer network. + * This field will be deprecated soon. Prefer using exchange_subnet_routes instead. Indicates + * whether full mesh connectivity is created and managed automatically. When it is set to true, + * Google Compute Engine will automatically create and manage the routes between two networks when + * the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer + * network. */ public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } + /** + * Whether full mesh connectivity is created and managed automatically. When it is set to true, + * Google Compute Engine will automatically create and manage the routes between two networks when + * the peering state is ACTIVE. Otherwise, user needs to create routes manually to route packets + * to peer network. + */ + public Boolean getExchangeSubnetRoutes() { + return exchangeSubnetRoutes; + } + /** * Name of this peering. Provided by the client when the peering is created. The name must comply * with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression @@ -155,6 +177,7 @@ public static NetworkPeering getDefaultInstance() { public static class Builder { private Boolean autoCreateRoutes; + private Boolean exchangeSubnetRoutes; private String name; private String network; private String state; @@ -167,6 +190,9 @@ public Builder mergeFrom(NetworkPeering other) { if (other.getAutoCreateRoutes() != null) { this.autoCreateRoutes = other.autoCreateRoutes; } + if (other.getExchangeSubnetRoutes() != null) { + this.exchangeSubnetRoutes = other.exchangeSubnetRoutes; + } if (other.getName() != null) { this.name = other.name; } @@ -184,6 +210,7 @@ public Builder mergeFrom(NetworkPeering other) { Builder(NetworkPeering source) { this.autoCreateRoutes = source.autoCreateRoutes; + this.exchangeSubnetRoutes = source.exchangeSubnetRoutes; this.name = source.name; this.network = source.network; this.state = source.state; @@ -191,26 +218,49 @@ public Builder mergeFrom(NetworkPeering other) { } /** - * Indicates whether full mesh connectivity is created and managed automatically. When it is set - * to true, Google Compute Engine will automatically create and manage the routes between two - * networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route - * packets to peer network. + * This field will be deprecated soon. Prefer using exchange_subnet_routes instead. Indicates + * whether full mesh connectivity is created and managed automatically. When it is set to true, + * Google Compute Engine will automatically create and manage the routes between two networks + * when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to + * peer network. */ public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } /** - * Indicates whether full mesh connectivity is created and managed automatically. When it is set - * to true, Google Compute Engine will automatically create and manage the routes between two - * networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route - * packets to peer network. + * This field will be deprecated soon. Prefer using exchange_subnet_routes instead. Indicates + * whether full mesh connectivity is created and managed automatically. When it is set to true, + * Google Compute Engine will automatically create and manage the routes between two networks + * when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to + * peer network. */ public Builder setAutoCreateRoutes(Boolean autoCreateRoutes) { this.autoCreateRoutes = autoCreateRoutes; return this; } + /** + * Whether full mesh connectivity is created and managed automatically. When it is set to true, + * Google Compute Engine will automatically create and manage the routes between two networks + * when the peering state is ACTIVE. Otherwise, user needs to create routes manually to route + * packets to peer network. + */ + public Boolean getExchangeSubnetRoutes() { + return exchangeSubnetRoutes; + } + + /** + * Whether full mesh connectivity is created and managed automatically. When it is set to true, + * Google Compute Engine will automatically create and manage the routes between two networks + * when the peering state is ACTIVE. Otherwise, user needs to create routes manually to route + * packets to peer network. + */ + public Builder setExchangeSubnetRoutes(Boolean exchangeSubnetRoutes) { + this.exchangeSubnetRoutes = exchangeSubnetRoutes; + return this; + } + /** * Name of this peering. Provided by the client when the peering is created. The name must * comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular @@ -277,12 +327,14 @@ public Builder setStateDetails(String stateDetails) { public NetworkPeering build() { - return new NetworkPeering(autoCreateRoutes, name, network, state, stateDetails); + return new NetworkPeering( + autoCreateRoutes, exchangeSubnetRoutes, name, network, state, stateDetails); } public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAutoCreateRoutes(this.autoCreateRoutes); + newBuilder.setExchangeSubnetRoutes(this.exchangeSubnetRoutes); newBuilder.setName(this.name); newBuilder.setNetwork(this.network); newBuilder.setState(this.state); @@ -297,6 +349,9 @@ public String toString() { + "autoCreateRoutes=" + autoCreateRoutes + ", " + + "exchangeSubnetRoutes=" + + exchangeSubnetRoutes + + ", " + "name=" + name + ", " @@ -319,6 +374,7 @@ public boolean equals(Object o) { if (o instanceof NetworkPeering) { NetworkPeering that = (NetworkPeering) o; return Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) + && Objects.equals(this.exchangeSubnetRoutes, that.getExchangeSubnetRoutes()) && Objects.equals(this.name, that.getName()) && Objects.equals(this.network, that.getNetwork()) && Objects.equals(this.state, that.getState()) @@ -329,6 +385,6 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(autoCreateRoutes, name, network, state, stateDetails); + return Objects.hash(autoCreateRoutes, exchangeSubnetRoutes, name, network, state, stateDetails); } } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java index cb738af6a6cc..61df24c21de2 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NetworksAddPeeringRequest.java @@ -27,17 +27,21 @@ public final class NetworksAddPeeringRequest implements ApiMessage { private final Boolean autoCreateRoutes; private final String name; + private final NetworkPeering networkPeering; private final String peerNetwork; private NetworksAddPeeringRequest() { this.autoCreateRoutes = null; this.name = null; + this.networkPeering = null; this.peerNetwork = null; } - private NetworksAddPeeringRequest(Boolean autoCreateRoutes, String name, String peerNetwork) { + private NetworksAddPeeringRequest( + Boolean autoCreateRoutes, String name, NetworkPeering networkPeering, String peerNetwork) { this.autoCreateRoutes = autoCreateRoutes; this.name = name; + this.networkPeering = networkPeering; this.peerNetwork = peerNetwork; } @@ -49,6 +53,9 @@ public Object getFieldValue(String fieldName) { if ("name".equals(fieldName)) { return name; } + if ("networkPeering".equals(fieldName)) { + return networkPeering; + } if ("peerNetwork".equals(fieldName)) { return peerNetwork; } @@ -73,7 +80,10 @@ public List getFieldMask() { return null; } - /** Whether Google Compute Engine manages the routes automatically. */ + /** + * This field will be deprecated soon. Prefer using exchange_subnet_routes in network_peering + * instead. Whether Google Compute Engine manages the routes automatically. + */ public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } @@ -83,6 +93,16 @@ public String getName() { return name; } + /** + * Network peering parameters. In order to specify route policies for peering using import/export + * custom routes, you will have to fill all peering related parameters (name, peer network, + * exchange_subnet_routes) in network_peeringfield. Corresponding fields in + * NetworksAddPeeringRequest will be deprecated soon. + */ + public NetworkPeering getNetworkPeering() { + return networkPeering; + } + /** * URL of the peer network. It can be either full URL or partial URL. The peer network may belong * to a different project. If the partial URL does not contain project, it is assumed that the @@ -117,6 +137,7 @@ public static NetworksAddPeeringRequest getDefaultInstance() { public static class Builder { private Boolean autoCreateRoutes; private String name; + private NetworkPeering networkPeering; private String peerNetwork; Builder() {} @@ -129,6 +150,9 @@ public Builder mergeFrom(NetworksAddPeeringRequest other) { if (other.getName() != null) { this.name = other.name; } + if (other.getNetworkPeering() != null) { + this.networkPeering = other.networkPeering; + } if (other.getPeerNetwork() != null) { this.peerNetwork = other.peerNetwork; } @@ -138,15 +162,22 @@ public Builder mergeFrom(NetworksAddPeeringRequest other) { Builder(NetworksAddPeeringRequest source) { this.autoCreateRoutes = source.autoCreateRoutes; this.name = source.name; + this.networkPeering = source.networkPeering; this.peerNetwork = source.peerNetwork; } - /** Whether Google Compute Engine manages the routes automatically. */ + /** + * This field will be deprecated soon. Prefer using exchange_subnet_routes in network_peering + * instead. Whether Google Compute Engine manages the routes automatically. + */ public Boolean getAutoCreateRoutes() { return autoCreateRoutes; } - /** Whether Google Compute Engine manages the routes automatically. */ + /** + * This field will be deprecated soon. Prefer using exchange_subnet_routes in network_peering + * instead. Whether Google Compute Engine manages the routes automatically. + */ public Builder setAutoCreateRoutes(Boolean autoCreateRoutes) { this.autoCreateRoutes = autoCreateRoutes; return this; @@ -163,6 +194,27 @@ public Builder setName(String name) { return this; } + /** + * Network peering parameters. In order to specify route policies for peering using + * import/export custom routes, you will have to fill all peering related parameters (name, peer + * network, exchange_subnet_routes) in network_peeringfield. Corresponding fields in + * NetworksAddPeeringRequest will be deprecated soon. + */ + public NetworkPeering getNetworkPeering() { + return networkPeering; + } + + /** + * Network peering parameters. In order to specify route policies for peering using + * import/export custom routes, you will have to fill all peering related parameters (name, peer + * network, exchange_subnet_routes) in network_peeringfield. Corresponding fields in + * NetworksAddPeeringRequest will be deprecated soon. + */ + public Builder setNetworkPeering(NetworkPeering networkPeering) { + this.networkPeering = networkPeering; + return this; + } + /** * URL of the peer network. It can be either full URL or partial URL. The peer network may * belong to a different project. If the partial URL does not contain project, it is assumed @@ -184,13 +236,14 @@ public Builder setPeerNetwork(String peerNetwork) { public NetworksAddPeeringRequest build() { - return new NetworksAddPeeringRequest(autoCreateRoutes, name, peerNetwork); + return new NetworksAddPeeringRequest(autoCreateRoutes, name, networkPeering, peerNetwork); } public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAutoCreateRoutes(this.autoCreateRoutes); newBuilder.setName(this.name); + newBuilder.setNetworkPeering(this.networkPeering); newBuilder.setPeerNetwork(this.peerNetwork); return newBuilder; } @@ -205,6 +258,9 @@ public String toString() { + "name=" + name + ", " + + "networkPeering=" + + networkPeering + + ", " + "peerNetwork=" + peerNetwork + "}"; @@ -219,6 +275,7 @@ public boolean equals(Object o) { NetworksAddPeeringRequest that = (NetworksAddPeeringRequest) o; return Objects.equals(this.autoCreateRoutes, that.getAutoCreateRoutes()) && Objects.equals(this.name, that.getName()) + && Objects.equals(this.networkPeering, that.getNetworkPeering()) && Objects.equals(this.peerNetwork, that.getPeerNetwork()); } return false; @@ -226,6 +283,6 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(autoCreateRoutes, name, peerNetwork); + return Objects.hash(autoCreateRoutes, name, networkPeering, peerNetwork); } } diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java index 88f0b6f50da5..2524e8722f74 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ForwardingRuleClientTest.java @@ -247,6 +247,7 @@ public void deleteForwardingRuleExceptionTest() throws Exception { public void getForwardingRuleTest() { String iPAddress = "iPAddress-551149873"; String iPProtocol = "iPProtocol323774237"; + Boolean allPorts = true; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); String creationTimestamp = "creationTimestamp567396278"; @@ -270,6 +271,7 @@ public void getForwardingRuleTest() { ForwardingRule.newBuilder() .setIPAddress(iPAddress) .setIPProtocol(iPProtocol) + .setAllPorts(allPorts) .setBackendService(backendService.toString()) .setCreationTimestamp(creationTimestamp) .setDescription(description) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java index 88896124384b..c7b8bd490023 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalForwardingRuleClientTest.java @@ -180,6 +180,7 @@ public void deleteGlobalForwardingRuleExceptionTest() throws Exception { public void getGlobalForwardingRuleTest() { String iPAddress = "iPAddress-551149873"; String iPProtocol = "iPProtocol323774237"; + Boolean allPorts = true; ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); String creationTimestamp = "creationTimestamp567396278"; @@ -203,6 +204,7 @@ public void getGlobalForwardingRuleTest() { ForwardingRule.newBuilder() .setIPAddress(iPAddress) .setIPProtocol(iPProtocol) + .setAllPorts(allPorts) .setBackendService(backendService.toString()) .setCreationTimestamp(creationTimestamp) .setDescription(description) diff --git a/google-cloud-clients/google-cloud-compute/synth.metadata b/google-cloud-clients/google-cloud-compute/synth.metadata index 97f1c69653ad..a2d48230cb9f 100644 --- a/google-cloud-clients/google-cloud-compute/synth.metadata +++ b/google-cloud-clients/google-cloud-compute/synth.metadata @@ -1,18 +1,18 @@ { - "updateTime": "2019-02-09T08:37:05.422209Z", + "updateTime": "2019-02-21T08:37:13.725039Z", "sources": [ { "git": { "name": "discovery-artifact-manager", "remote": "https://github.com/googleapis/discovery-artifact-manager.git", - "sha": "9bfc9a0670b380d45348ce4539207cc1683d9960" + "sha": "08a158ea995a7cff450f31c9eb889dadaea17fbb" } }, { "generator": { "name": "artman", - "version": "0.16.11", - "dockerImage": "googleapis/artman@sha256:34191bf23693554c7dcf6a252004e0cd042074fd062751ccca884c7c5887a78a" + "version": "0.16.14", + "dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7" } } ]