From 055d50889cbf0cfa7339c0e010566ee502c0a9c8 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Wed, 23 Jan 2019 00:36:51 -0800 Subject: [PATCH] Regenerate compute client --- .../cloud/compute/v1/FixedOrPercent.java | 204 +++++++++++++++ .../cloud/compute/v1/ForwardingRule.java | 64 +++++ .../cloud/compute/v1/InstanceClient.java | 12 +- .../compute/v1/InstanceGroupManager.java | 107 ++++++++ .../v1/InstanceGroupManagerStatus.java | 142 +++++++++++ .../v1/InstanceGroupManagerUpdatePolicy.java | 234 ++++++++++++++++++ .../v1/InstanceGroupManagerVersion.java | 205 +++++++++++++++ .../compute/v1/ForwardingRuleClientTest.java | 4 + .../v1/GlobalForwardingRuleClientTest.java | 4 + .../google-cloud-compute/synth.metadata | 8 +- 10 files changed, 976 insertions(+), 8 deletions(-) create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FixedOrPercent.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerStatus.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerUpdatePolicy.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerVersion.java diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FixedOrPercent.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FixedOrPercent.java new file mode 100644 index 000000000000..9530f06cef1d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/FixedOrPercent.java @@ -0,0 +1,204 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class FixedOrPercent implements ApiMessage { + private final Integer calculated; + private final Integer fixed; + private final Integer percent; + + private FixedOrPercent() { + this.calculated = null; + this.fixed = null; + this.percent = null; + } + + private FixedOrPercent(Integer calculated, Integer fixed, Integer percent) { + this.calculated = calculated; + this.fixed = fixed; + this.percent = percent; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("calculated".equals(fieldName)) { + return calculated; + } + if ("fixed".equals(fieldName)) { + return fixed; + } + if ("percent".equals(fieldName)) { + return percent; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public Integer getCalculated() { + return calculated; + } + + public Integer getFixed() { + return fixed; + } + + public Integer getPercent() { + return percent; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(FixedOrPercent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static FixedOrPercent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final FixedOrPercent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new FixedOrPercent(); + } + + public static class Builder { + private Integer calculated; + private Integer fixed; + private Integer percent; + + Builder() {} + + public Builder mergeFrom(FixedOrPercent other) { + if (other == FixedOrPercent.getDefaultInstance()) return this; + if (other.getCalculated() != null) { + this.calculated = other.calculated; + } + if (other.getFixed() != null) { + this.fixed = other.fixed; + } + if (other.getPercent() != null) { + this.percent = other.percent; + } + return this; + } + + Builder(FixedOrPercent source) { + this.calculated = source.calculated; + this.fixed = source.fixed; + this.percent = source.percent; + } + + public Integer getCalculated() { + return calculated; + } + + public Builder setCalculated(Integer calculated) { + this.calculated = calculated; + return this; + } + + public Integer getFixed() { + return fixed; + } + + public Builder setFixed(Integer fixed) { + this.fixed = fixed; + return this; + } + + public Integer getPercent() { + return percent; + } + + public Builder setPercent(Integer percent) { + this.percent = percent; + return this; + } + + public FixedOrPercent build() { + + return new FixedOrPercent(calculated, fixed, percent); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCalculated(this.calculated); + newBuilder.setFixed(this.fixed); + newBuilder.setPercent(this.percent); + return newBuilder; + } + } + + @Override + public String toString() { + return "FixedOrPercent{" + + "calculated=" + + calculated + + ", " + + "fixed=" + + fixed + + ", " + + "percent=" + + percent + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FixedOrPercent) { + FixedOrPercent that = (FixedOrPercent) o; + return Objects.equals(this.calculated, that.getCalculated()) + && Objects.equals(this.fixed, that.getFixed()) + && Objects.equals(this.percent, that.getPercent()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(calculated, fixed, percent); + } +} 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 1f8380c42c0e..6f53a1dae830 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 @@ -48,6 +48,8 @@ public final class ForwardingRule implements ApiMessage { private final List ports; private final String region; private final String selfLink; + private final String serviceLabel; + private final String serviceName; private final String subnetwork; private final String target; @@ -68,6 +70,8 @@ private ForwardingRule() { this.ports = null; this.region = null; this.selfLink = null; + this.serviceLabel = null; + this.serviceName = null; this.subnetwork = null; this.target = null; } @@ -89,6 +93,8 @@ private ForwardingRule( List ports, String region, String selfLink, + String serviceLabel, + String serviceName, String subnetwork, String target) { this.backendService = backendService; @@ -107,6 +113,8 @@ private ForwardingRule( this.ports = ports; this.region = region; this.selfLink = selfLink; + this.serviceLabel = serviceLabel; + this.serviceName = serviceName; this.subnetwork = subnetwork; this.target = target; } @@ -161,6 +169,12 @@ public Object getFieldValue(String fieldName) { if ("selfLink".equals(fieldName)) { return selfLink; } + if ("serviceLabel".equals(fieldName)) { + return serviceLabel; + } + if ("serviceName".equals(fieldName)) { + return serviceName; + } if ("subnetwork".equals(fieldName)) { return subnetwork; } @@ -246,6 +260,14 @@ public String getSelfLink() { return selfLink; } + public String getServiceLabel() { + return serviceLabel; + } + + public String getServiceName() { + return serviceName; + } + public String getSubnetwork() { return subnetwork; } @@ -293,6 +315,8 @@ public static class Builder { private List ports; private String region; private String selfLink; + private String serviceLabel; + private String serviceName; private String subnetwork; private String target; @@ -348,6 +372,12 @@ public Builder mergeFrom(ForwardingRule other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getServiceLabel() != null) { + this.serviceLabel = other.serviceLabel; + } + if (other.getServiceName() != null) { + this.serviceName = other.serviceName; + } if (other.getSubnetwork() != null) { this.subnetwork = other.subnetwork; } @@ -374,6 +404,8 @@ public Builder mergeFrom(ForwardingRule other) { this.ports = source.ports; this.region = source.region; this.selfLink = source.selfLink; + this.serviceLabel = source.serviceLabel; + this.serviceName = source.serviceName; this.subnetwork = source.subnetwork; this.target = source.target; } @@ -533,6 +565,24 @@ public Builder setSelfLink(String selfLink) { return this; } + public String getServiceLabel() { + return serviceLabel; + } + + public Builder setServiceLabel(String serviceLabel) { + this.serviceLabel = serviceLabel; + return this; + } + + public String getServiceName() { + return serviceName; + } + + public Builder setServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + public String getSubnetwork() { return subnetwork; } @@ -570,6 +620,8 @@ public ForwardingRule build() { ports, region, selfLink, + serviceLabel, + serviceName, subnetwork, target); } @@ -592,6 +644,8 @@ public Builder clone() { newBuilder.addAllPorts(this.ports); newBuilder.setRegion(this.region); newBuilder.setSelfLink(this.selfLink); + newBuilder.setServiceLabel(this.serviceLabel); + newBuilder.setServiceName(this.serviceName); newBuilder.setSubnetwork(this.subnetwork); newBuilder.setTarget(this.target); return newBuilder; @@ -649,6 +703,12 @@ public String toString() { + "selfLink=" + selfLink + ", " + + "serviceLabel=" + + serviceLabel + + ", " + + "serviceName=" + + serviceName + + ", " + "subnetwork=" + subnetwork + ", " @@ -680,6 +740,8 @@ public boolean equals(Object o) { && Objects.equals(this.ports, that.getPortsList()) && Objects.equals(this.region, that.getRegion()) && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.serviceLabel, that.getServiceLabel()) + && Objects.equals(this.serviceName, that.getServiceName()) && Objects.equals(this.subnetwork, that.getSubnetwork()) && Objects.equals(this.target, that.getTarget()); } @@ -705,6 +767,8 @@ public int hashCode() { ports, region, selfLink, + serviceLabel, + serviceName, subnetwork, target); } 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 f2bd3aa3b502..1e5eb0c61f5f 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 @@ -1610,7 +1610,8 @@ public final ListReferrersInstancesPagedResponse listReferrersInstances( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Performs a reset on the instance. For more information, see Resetting an instance. + * Performs a reset on the instance. This is a hard reset; the VM does not do a graceful shutdown. + * For more information, see Resetting an instance. * *

Sample code: * @@ -1636,7 +1637,8 @@ public final Operation resetInstance(ProjectZoneInstanceName instance) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Performs a reset on the instance. For more information, see Resetting an instance. + * Performs a reset on the instance. This is a hard reset; the VM does not do a graceful shutdown. + * For more information, see Resetting an instance. * *

Sample code: * @@ -1660,7 +1662,8 @@ public final Operation resetInstance(String instance) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Performs a reset on the instance. For more information, see Resetting an instance. + * Performs a reset on the instance. This is a hard reset; the VM does not do a graceful shutdown. + * For more information, see Resetting an instance. * *

Sample code: * @@ -1684,7 +1687,8 @@ public final Operation resetInstance(ResetInstanceHttpRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Performs a reset on the instance. For more information, see Resetting an instance. + * Performs a reset on the instance. This is a hard reset; the VM does not do a graceful shutdown. + * For more information, see Resetting an instance. * *

Sample code: * diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java index 1b8b68a106b2..66dff0682b92 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManager.java @@ -41,8 +41,11 @@ public final class InstanceGroupManager implements ApiMessage { private final List namedPorts; private final String region; private final String selfLink; + private final InstanceGroupManagerStatus status; private final List targetPools; private final Integer targetSize; + private final InstanceGroupManagerUpdatePolicy updatePolicy; + private final List versions; private final String zone; private InstanceGroupManager() { @@ -61,8 +64,11 @@ private InstanceGroupManager() { this.namedPorts = null; this.region = null; this.selfLink = null; + this.status = null; this.targetPools = null; this.targetSize = null; + this.updatePolicy = null; + this.versions = null; this.zone = null; } @@ -82,8 +88,11 @@ private InstanceGroupManager( List namedPorts, String region, String selfLink, + InstanceGroupManagerStatus status, List targetPools, Integer targetSize, + InstanceGroupManagerUpdatePolicy updatePolicy, + List versions, String zone) { this.autoHealingPolicies = autoHealingPolicies; this.baseInstanceName = baseInstanceName; @@ -100,8 +109,11 @@ private InstanceGroupManager( this.namedPorts = namedPorts; this.region = region; this.selfLink = selfLink; + this.status = status; this.targetPools = targetPools; this.targetSize = targetSize; + this.updatePolicy = updatePolicy; + this.versions = versions; this.zone = zone; } @@ -152,12 +164,21 @@ public Object getFieldValue(String fieldName) { if ("selfLink".equals(fieldName)) { return selfLink; } + if ("status".equals(fieldName)) { + return status; + } if ("targetPools".equals(fieldName)) { return targetPools; } if ("targetSize".equals(fieldName)) { return targetSize; } + if ("updatePolicy".equals(fieldName)) { + return updatePolicy; + } + if ("versions".equals(fieldName)) { + return versions; + } if ("zone".equals(fieldName)) { return zone; } @@ -236,6 +257,10 @@ public String getSelfLink() { return selfLink; } + public InstanceGroupManagerStatus getStatus() { + return status; + } + public List getTargetPoolsList() { return targetPools; } @@ -244,6 +269,14 @@ public Integer getTargetSize() { return targetSize; } + public InstanceGroupManagerUpdatePolicy getUpdatePolicy() { + return updatePolicy; + } + + public List getVersionsList() { + return versions; + } + public String getZone() { return zone; } @@ -286,8 +319,11 @@ public static class Builder { private List namedPorts; private String region; private String selfLink; + private InstanceGroupManagerStatus status; private List targetPools; private Integer targetSize; + private InstanceGroupManagerUpdatePolicy updatePolicy; + private List versions; private String zone; Builder() {} @@ -339,12 +375,21 @@ public Builder mergeFrom(InstanceGroupManager other) { if (other.getSelfLink() != null) { this.selfLink = other.selfLink; } + if (other.getStatus() != null) { + this.status = other.status; + } if (other.getTargetPoolsList() != null) { this.targetPools = other.targetPools; } if (other.getTargetSize() != null) { this.targetSize = other.targetSize; } + if (other.getUpdatePolicy() != null) { + this.updatePolicy = other.updatePolicy; + } + if (other.getVersionsList() != null) { + this.versions = other.versions; + } if (other.getZone() != null) { this.zone = other.zone; } @@ -367,8 +412,11 @@ public Builder mergeFrom(InstanceGroupManager other) { this.namedPorts = source.namedPorts; this.region = source.region; this.selfLink = source.selfLink; + this.status = source.status; this.targetPools = source.targetPools; this.targetSize = source.targetSize; + this.updatePolicy = source.updatePolicy; + this.versions = source.versions; this.zone = source.zone; } @@ -531,6 +579,15 @@ public Builder setSelfLink(String selfLink) { return this; } + public InstanceGroupManagerStatus getStatus() { + return status; + } + + public Builder setStatus(InstanceGroupManagerStatus status) { + this.status = status; + return this; + } + public List getTargetPoolsList() { return targetPools; } @@ -560,6 +617,35 @@ public Builder setTargetSize(Integer targetSize) { return this; } + public InstanceGroupManagerUpdatePolicy getUpdatePolicy() { + return updatePolicy; + } + + public Builder setUpdatePolicy(InstanceGroupManagerUpdatePolicy updatePolicy) { + this.updatePolicy = updatePolicy; + return this; + } + + public List getVersionsList() { + return versions; + } + + public Builder addAllVersions(List versions) { + if (this.versions == null) { + this.versions = new LinkedList<>(); + } + this.versions.addAll(versions); + return this; + } + + public Builder addVersions(InstanceGroupManagerVersion versions) { + if (this.versions == null) { + this.versions = new LinkedList<>(); + } + this.versions.add(versions); + return this; + } + public String getZone() { return zone; } @@ -587,8 +673,11 @@ public InstanceGroupManager build() { namedPorts, region, selfLink, + status, targetPools, targetSize, + updatePolicy, + versions, zone); } @@ -609,8 +698,11 @@ public Builder clone() { newBuilder.addAllNamedPorts(this.namedPorts); newBuilder.setRegion(this.region); newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); newBuilder.addAllTargetPools(this.targetPools); newBuilder.setTargetSize(this.targetSize); + newBuilder.setUpdatePolicy(this.updatePolicy); + newBuilder.addAllVersions(this.versions); newBuilder.setZone(this.zone); return newBuilder; } @@ -664,12 +756,21 @@ public String toString() { + "selfLink=" + selfLink + ", " + + "status=" + + status + + ", " + "targetPools=" + targetPools + ", " + "targetSize=" + targetSize + ", " + + "updatePolicy=" + + updatePolicy + + ", " + + "versions=" + + versions + + ", " + "zone=" + zone + "}"; @@ -697,8 +798,11 @@ public boolean equals(Object o) { && Objects.equals(this.namedPorts, that.getNamedPortsList()) && Objects.equals(this.region, that.getRegion()) && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()) && Objects.equals(this.targetPools, that.getTargetPoolsList()) && Objects.equals(this.targetSize, that.getTargetSize()) + && Objects.equals(this.updatePolicy, that.getUpdatePolicy()) + && Objects.equals(this.versions, that.getVersionsList()) && Objects.equals(this.zone, that.getZone()); } return false; @@ -722,8 +826,11 @@ public int hashCode() { namedPorts, region, selfLink, + status, targetPools, targetSize, + updatePolicy, + versions, zone); } } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerStatus.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerStatus.java new file mode 100644 index 000000000000..227c8820d688 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerStatus.java @@ -0,0 +1,142 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerStatus implements ApiMessage { + private final Boolean isStable; + + private InstanceGroupManagerStatus() { + this.isStable = null; + } + + private InstanceGroupManagerStatus(Boolean isStable) { + this.isStable = isStable; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("isStable".equals(fieldName)) { + return isStable; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public Boolean getIsStable() { + return isStable; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(InstanceGroupManagerStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagerStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final InstanceGroupManagerStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new InstanceGroupManagerStatus(); + } + + public static class Builder { + private Boolean isStable; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagerStatus other) { + if (other == InstanceGroupManagerStatus.getDefaultInstance()) return this; + if (other.getIsStable() != null) { + this.isStable = other.isStable; + } + return this; + } + + Builder(InstanceGroupManagerStatus source) { + this.isStable = source.isStable; + } + + public Boolean getIsStable() { + return isStable; + } + + public Builder setIsStable(Boolean isStable) { + this.isStable = isStable; + return this; + } + + public InstanceGroupManagerStatus build() { + return new InstanceGroupManagerStatus(isStable); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIsStable(this.isStable); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagerStatus{" + "isStable=" + isStable + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerStatus) { + InstanceGroupManagerStatus that = (InstanceGroupManagerStatus) o; + return Objects.equals(this.isStable, that.getIsStable()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(isStable); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerUpdatePolicy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerUpdatePolicy.java new file mode 100644 index 000000000000..7ed3a69f847c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerUpdatePolicy.java @@ -0,0 +1,234 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerUpdatePolicy implements ApiMessage { + private final FixedOrPercent maxSurge; + private final FixedOrPercent maxUnavailable; + private final String minimalAction; + private final String type; + + private InstanceGroupManagerUpdatePolicy() { + this.maxSurge = null; + this.maxUnavailable = null; + this.minimalAction = null; + this.type = null; + } + + private InstanceGroupManagerUpdatePolicy( + FixedOrPercent maxSurge, FixedOrPercent maxUnavailable, String minimalAction, String type) { + this.maxSurge = maxSurge; + this.maxUnavailable = maxUnavailable; + this.minimalAction = minimalAction; + this.type = type; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("maxSurge".equals(fieldName)) { + return maxSurge; + } + if ("maxUnavailable".equals(fieldName)) { + return maxUnavailable; + } + if ("minimalAction".equals(fieldName)) { + return minimalAction; + } + if ("type".equals(fieldName)) { + return type; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public FixedOrPercent getMaxSurge() { + return maxSurge; + } + + public FixedOrPercent getMaxUnavailable() { + return maxUnavailable; + } + + public String getMinimalAction() { + return minimalAction; + } + + public String getType() { + return type; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(InstanceGroupManagerUpdatePolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagerUpdatePolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final InstanceGroupManagerUpdatePolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new InstanceGroupManagerUpdatePolicy(); + } + + public static class Builder { + private FixedOrPercent maxSurge; + private FixedOrPercent maxUnavailable; + private String minimalAction; + private String type; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagerUpdatePolicy other) { + if (other == InstanceGroupManagerUpdatePolicy.getDefaultInstance()) return this; + if (other.getMaxSurge() != null) { + this.maxSurge = other.maxSurge; + } + if (other.getMaxUnavailable() != null) { + this.maxUnavailable = other.maxUnavailable; + } + if (other.getMinimalAction() != null) { + this.minimalAction = other.minimalAction; + } + if (other.getType() != null) { + this.type = other.type; + } + return this; + } + + Builder(InstanceGroupManagerUpdatePolicy source) { + this.maxSurge = source.maxSurge; + this.maxUnavailable = source.maxUnavailable; + this.minimalAction = source.minimalAction; + this.type = source.type; + } + + public FixedOrPercent getMaxSurge() { + return maxSurge; + } + + public Builder setMaxSurge(FixedOrPercent maxSurge) { + this.maxSurge = maxSurge; + return this; + } + + public FixedOrPercent getMaxUnavailable() { + return maxUnavailable; + } + + public Builder setMaxUnavailable(FixedOrPercent maxUnavailable) { + this.maxUnavailable = maxUnavailable; + return this; + } + + public String getMinimalAction() { + return minimalAction; + } + + public Builder setMinimalAction(String minimalAction) { + this.minimalAction = minimalAction; + return this; + } + + public String getType() { + return type; + } + + public Builder setType(String type) { + this.type = type; + return this; + } + + public InstanceGroupManagerUpdatePolicy build() { + + return new InstanceGroupManagerUpdatePolicy(maxSurge, maxUnavailable, minimalAction, type); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setMaxSurge(this.maxSurge); + newBuilder.setMaxUnavailable(this.maxUnavailable); + newBuilder.setMinimalAction(this.minimalAction); + newBuilder.setType(this.type); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagerUpdatePolicy{" + + "maxSurge=" + + maxSurge + + ", " + + "maxUnavailable=" + + maxUnavailable + + ", " + + "minimalAction=" + + minimalAction + + ", " + + "type=" + + type + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerUpdatePolicy) { + InstanceGroupManagerUpdatePolicy that = (InstanceGroupManagerUpdatePolicy) o; + return Objects.equals(this.maxSurge, that.getMaxSurge()) + && Objects.equals(this.maxUnavailable, that.getMaxUnavailable()) + && Objects.equals(this.minimalAction, that.getMinimalAction()) + && Objects.equals(this.type, that.getType()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(maxSurge, maxUnavailable, minimalAction, type); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerVersion.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerVersion.java new file mode 100644 index 000000000000..04530b1e9355 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerVersion.java @@ -0,0 +1,205 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.compute.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.ApiMessage; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class InstanceGroupManagerVersion implements ApiMessage { + private final String instanceTemplate; + private final String name; + private final FixedOrPercent targetSize; + + private InstanceGroupManagerVersion() { + this.instanceTemplate = null; + this.name = null; + this.targetSize = null; + } + + private InstanceGroupManagerVersion( + String instanceTemplate, String name, FixedOrPercent targetSize) { + this.instanceTemplate = instanceTemplate; + this.name = name; + this.targetSize = targetSize; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("instanceTemplate".equals(fieldName)) { + return instanceTemplate; + } + if ("name".equals(fieldName)) { + return name; + } + if ("targetSize".equals(fieldName)) { + return targetSize; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public String getName() { + return name; + } + + public FixedOrPercent getTargetSize() { + return targetSize; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(InstanceGroupManagerVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static InstanceGroupManagerVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final InstanceGroupManagerVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new InstanceGroupManagerVersion(); + } + + public static class Builder { + private String instanceTemplate; + private String name; + private FixedOrPercent targetSize; + + Builder() {} + + public Builder mergeFrom(InstanceGroupManagerVersion other) { + if (other == InstanceGroupManagerVersion.getDefaultInstance()) return this; + if (other.getInstanceTemplate() != null) { + this.instanceTemplate = other.instanceTemplate; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getTargetSize() != null) { + this.targetSize = other.targetSize; + } + return this; + } + + Builder(InstanceGroupManagerVersion source) { + this.instanceTemplate = source.instanceTemplate; + this.name = source.name; + this.targetSize = source.targetSize; + } + + public String getInstanceTemplate() { + return instanceTemplate; + } + + public Builder setInstanceTemplate(String instanceTemplate) { + this.instanceTemplate = instanceTemplate; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public FixedOrPercent getTargetSize() { + return targetSize; + } + + public Builder setTargetSize(FixedOrPercent targetSize) { + this.targetSize = targetSize; + return this; + } + + public InstanceGroupManagerVersion build() { + + return new InstanceGroupManagerVersion(instanceTemplate, name, targetSize); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setInstanceTemplate(this.instanceTemplate); + newBuilder.setName(this.name); + newBuilder.setTargetSize(this.targetSize); + return newBuilder; + } + } + + @Override + public String toString() { + return "InstanceGroupManagerVersion{" + + "instanceTemplate=" + + instanceTemplate + + ", " + + "name=" + + name + + ", " + + "targetSize=" + + targetSize + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceGroupManagerVersion) { + InstanceGroupManagerVersion that = (InstanceGroupManagerVersion) o; + return Objects.equals(this.instanceTemplate, that.getInstanceTemplate()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.targetSize, that.getTargetSize()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(instanceTemplate, name, targetSize); + } +} 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 7bcb49353645..88f0b6f50da5 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 @@ -261,6 +261,8 @@ public void getForwardingRuleTest() { String portRange = "portRange217518079"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; + String serviceLabel = "serviceLabel-1730474774"; + String serviceName = "serviceName359880149"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String target = "target-880905839"; @@ -281,6 +283,8 @@ public void getForwardingRuleTest() { .setPortRange(portRange) .setRegion(region.toString()) .setSelfLink(selfLink) + .setServiceLabel(serviceLabel) + .setServiceName(serviceName) .setSubnetwork(subnetwork.toString()) .setTarget(target) .build(); 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 eb92bfd76e83..88896124384b 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 @@ -194,6 +194,8 @@ public void getGlobalForwardingRuleTest() { String portRange = "portRange217518079"; ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); String selfLink = "selfLink-1691268851"; + String serviceLabel = "serviceLabel-1730474774"; + String serviceName = "serviceName359880149"; ProjectRegionSubnetworkName subnetwork = ProjectRegionSubnetworkName.of("[PROJECT]", "[REGION]", "[SUBNETWORK]"); String target = "target-880905839"; @@ -214,6 +216,8 @@ public void getGlobalForwardingRuleTest() { .setPortRange(portRange) .setRegion(region.toString()) .setSelfLink(selfLink) + .setServiceLabel(serviceLabel) + .setServiceName(serviceName) .setSubnetwork(subnetwork.toString()) .setTarget(target) .build(); diff --git a/google-cloud-clients/google-cloud-compute/synth.metadata b/google-cloud-clients/google-cloud-compute/synth.metadata index 431ce8724ba7..125576c991f8 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-01-17T08:37:47.445365Z", + "updateTime": "2019-01-23T08:36:51.719159Z", "sources": [ { "git": { "name": "discovery-artifact-manager", "remote": "https://github.com/googleapis/discovery-artifact-manager.git", - "sha": "01b82d5d2308f7e0f342d9303e173bd6381607e4" + "sha": "3f68e5a1583e709ebb03a492e9f54953fa9ea522" } }, { "generator": { "name": "artman", - "version": "0.16.6", - "dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e" + "version": "0.16.7", + "dockerImage": "googleapis/artman@sha256:d6c8ced606eb49973ca95d2af7c55a681acc042db0f87d135968349e7bf6dd80" } } ]