From afe19e1678334117f3daf13b968b667857f7c8ca Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Sat, 23 Mar 2019 00:37:04 -0700 Subject: [PATCH] Regenerate compute client --- .../com/google/cloud/compute/v1/Instance.java | 66 +++++ .../compute/v1/ShieldedInstanceConfig.java | 221 +++++++++++++++++ .../compute/v1/ShieldedInstanceIdentity.java | 232 ++++++++++++++++++ .../v1/ShieldedInstanceIdentityEntry.java | 182 ++++++++++++++ .../v1/ShieldedInstanceIntegrityPolicy.java | 164 +++++++++++++ .../google-cloud-compute/synth.metadata | 8 +- 6 files changed, 869 insertions(+), 4 deletions(-) create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceConfig.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentity.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentityEntry.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIntegrityPolicy.java diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java index 2a71dc9f88e0..d56bd4df99ca 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Instance.java @@ -48,6 +48,8 @@ public final class Instance implements ApiMessage { private final Scheduling scheduling; private final String selfLink; private final List serviceAccounts; + private final ShieldedInstanceConfig shieldedInstanceConfig; + private final ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicy; private final Boolean startRestricted; private final String status; private final String statusMessage; @@ -75,6 +77,8 @@ private Instance() { this.scheduling = null; this.selfLink = null; this.serviceAccounts = null; + this.shieldedInstanceConfig = null; + this.shieldedInstanceIntegrityPolicy = null; this.startRestricted = null; this.status = null; this.statusMessage = null; @@ -103,6 +107,8 @@ private Instance( Scheduling scheduling, String selfLink, List serviceAccounts, + ShieldedInstanceConfig shieldedInstanceConfig, + ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicy, Boolean startRestricted, String status, String statusMessage, @@ -128,6 +134,8 @@ private Instance( this.scheduling = scheduling; this.selfLink = selfLink; this.serviceAccounts = serviceAccounts; + this.shieldedInstanceConfig = shieldedInstanceConfig; + this.shieldedInstanceIntegrityPolicy = shieldedInstanceIntegrityPolicy; this.startRestricted = startRestricted; this.status = status; this.statusMessage = statusMessage; @@ -197,6 +205,12 @@ public Object getFieldValue(String fieldName) { if ("serviceAccounts".equals(fieldName)) { return serviceAccounts; } + if ("shieldedInstanceConfig".equals(fieldName)) { + return shieldedInstanceConfig; + } + if ("shieldedInstanceIntegrityPolicy".equals(fieldName)) { + return shieldedInstanceIntegrityPolicy; + } if ("startRestricted".equals(fieldName)) { return startRestricted; } @@ -387,6 +401,14 @@ public List getServiceAccountsList() { return serviceAccounts; } + public ShieldedInstanceConfig getShieldedInstanceConfig() { + return shieldedInstanceConfig; + } + + public ShieldedInstanceIntegrityPolicy getShieldedInstanceIntegrityPolicy() { + return shieldedInstanceIntegrityPolicy; + } + /** * [Output Only] Whether a VM has been restricted for start because Compute Engine has detected * suspicious activity. @@ -469,6 +491,8 @@ public static class Builder { private Scheduling scheduling; private String selfLink; private List serviceAccounts; + private ShieldedInstanceConfig shieldedInstanceConfig; + private ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicy; private Boolean startRestricted; private String status; private String statusMessage; @@ -539,6 +563,12 @@ public Builder mergeFrom(Instance other) { if (other.getServiceAccountsList() != null) { this.serviceAccounts = other.serviceAccounts; } + if (other.getShieldedInstanceConfig() != null) { + this.shieldedInstanceConfig = other.shieldedInstanceConfig; + } + if (other.getShieldedInstanceIntegrityPolicy() != null) { + this.shieldedInstanceIntegrityPolicy = other.shieldedInstanceIntegrityPolicy; + } if (other.getStartRestricted() != null) { this.startRestricted = other.startRestricted; } @@ -578,6 +608,8 @@ public Builder mergeFrom(Instance other) { this.scheduling = source.scheduling; this.selfLink = source.selfLink; this.serviceAccounts = source.serviceAccounts; + this.shieldedInstanceConfig = source.shieldedInstanceConfig; + this.shieldedInstanceIntegrityPolicy = source.shieldedInstanceIntegrityPolicy; this.startRestricted = source.startRestricted; this.status = source.status; this.statusMessage = source.statusMessage; @@ -981,6 +1013,25 @@ public Builder addServiceAccounts(ServiceAccount serviceAccounts) { return this; } + public ShieldedInstanceConfig getShieldedInstanceConfig() { + return shieldedInstanceConfig; + } + + public Builder setShieldedInstanceConfig(ShieldedInstanceConfig shieldedInstanceConfig) { + this.shieldedInstanceConfig = shieldedInstanceConfig; + return this; + } + + public ShieldedInstanceIntegrityPolicy getShieldedInstanceIntegrityPolicy() { + return shieldedInstanceIntegrityPolicy; + } + + public Builder setShieldedInstanceIntegrityPolicy( + ShieldedInstanceIntegrityPolicy shieldedInstanceIntegrityPolicy) { + this.shieldedInstanceIntegrityPolicy = shieldedInstanceIntegrityPolicy; + return this; + } + /** * [Output Only] Whether a VM has been restricted for start because Compute Engine has detected * suspicious activity. @@ -1087,6 +1138,8 @@ public Instance build() { scheduling, selfLink, serviceAccounts, + shieldedInstanceConfig, + shieldedInstanceIntegrityPolicy, startRestricted, status, statusMessage, @@ -1116,6 +1169,8 @@ public Builder clone() { newBuilder.setScheduling(this.scheduling); newBuilder.setSelfLink(this.selfLink); newBuilder.addAllServiceAccounts(this.serviceAccounts); + newBuilder.setShieldedInstanceConfig(this.shieldedInstanceConfig); + newBuilder.setShieldedInstanceIntegrityPolicy(this.shieldedInstanceIntegrityPolicy); newBuilder.setStartRestricted(this.startRestricted); newBuilder.setStatus(this.status); newBuilder.setStatusMessage(this.statusMessage); @@ -1188,6 +1243,12 @@ public String toString() { + "serviceAccounts=" + serviceAccounts + ", " + + "shieldedInstanceConfig=" + + shieldedInstanceConfig + + ", " + + "shieldedInstanceIntegrityPolicy=" + + shieldedInstanceIntegrityPolicy + + ", " + "startRestricted=" + startRestricted + ", " @@ -1232,6 +1293,9 @@ public boolean equals(Object o) { && Objects.equals(this.scheduling, that.getScheduling()) && Objects.equals(this.selfLink, that.getSelfLink()) && Objects.equals(this.serviceAccounts, that.getServiceAccountsList()) + && Objects.equals(this.shieldedInstanceConfig, that.getShieldedInstanceConfig()) + && Objects.equals( + this.shieldedInstanceIntegrityPolicy, that.getShieldedInstanceIntegrityPolicy()) && Objects.equals(this.startRestricted, that.getStartRestricted()) && Objects.equals(this.status, that.getStatus()) && Objects.equals(this.statusMessage, that.getStatusMessage()) @@ -1264,6 +1328,8 @@ public int hashCode() { scheduling, selfLink, serviceAccounts, + shieldedInstanceConfig, + shieldedInstanceIntegrityPolicy, startRestricted, status, statusMessage, diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceConfig.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceConfig.java new file mode 100644 index 000000000000..4dcd6c970855 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceConfig.java @@ -0,0 +1,221 @@ +/* + * 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 +/** A set of Shielded Instance options. */ +public final class ShieldedInstanceConfig implements ApiMessage { + private final Boolean enableIntegrityMonitoring; + private final Boolean enableSecureBoot; + private final Boolean enableVtpm; + + private ShieldedInstanceConfig() { + this.enableIntegrityMonitoring = null; + this.enableSecureBoot = null; + this.enableVtpm = null; + } + + private ShieldedInstanceConfig( + Boolean enableIntegrityMonitoring, Boolean enableSecureBoot, Boolean enableVtpm) { + this.enableIntegrityMonitoring = enableIntegrityMonitoring; + this.enableSecureBoot = enableSecureBoot; + this.enableVtpm = enableVtpm; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("enableIntegrityMonitoring".equals(fieldName)) { + return enableIntegrityMonitoring; + } + if ("enableSecureBoot".equals(fieldName)) { + return enableSecureBoot; + } + if ("enableVtpm".equals(fieldName)) { + return enableVtpm; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + /** + * The fields that should be serialized (even if they have empty values). If the containing + * message object has a non-null fieldmask, then all the fields in the field mask (and only those + * fields in the field mask) will be serialized. If the containing object does not have a + * fieldmask, then only non-empty fields will be serialized. + */ + public List getFieldMask() { + return null; + } + + /** Defines whether the instance has integrity monitoring enabled. */ + public Boolean getEnableIntegrityMonitoring() { + return enableIntegrityMonitoring; + } + + /** Defines whether the instance has Secure Boot enabled. */ + public Boolean getEnableSecureBoot() { + return enableSecureBoot; + } + + /** Defines whether the instance has the vTPM enabled. */ + public Boolean getEnableVtpm() { + return enableVtpm; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ShieldedInstanceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ShieldedInstanceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ShieldedInstanceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ShieldedInstanceConfig(); + } + + public static class Builder { + private Boolean enableIntegrityMonitoring; + private Boolean enableSecureBoot; + private Boolean enableVtpm; + + Builder() {} + + public Builder mergeFrom(ShieldedInstanceConfig other) { + if (other == ShieldedInstanceConfig.getDefaultInstance()) return this; + if (other.getEnableIntegrityMonitoring() != null) { + this.enableIntegrityMonitoring = other.enableIntegrityMonitoring; + } + if (other.getEnableSecureBoot() != null) { + this.enableSecureBoot = other.enableSecureBoot; + } + if (other.getEnableVtpm() != null) { + this.enableVtpm = other.enableVtpm; + } + return this; + } + + Builder(ShieldedInstanceConfig source) { + this.enableIntegrityMonitoring = source.enableIntegrityMonitoring; + this.enableSecureBoot = source.enableSecureBoot; + this.enableVtpm = source.enableVtpm; + } + + /** Defines whether the instance has integrity monitoring enabled. */ + public Boolean getEnableIntegrityMonitoring() { + return enableIntegrityMonitoring; + } + + /** Defines whether the instance has integrity monitoring enabled. */ + public Builder setEnableIntegrityMonitoring(Boolean enableIntegrityMonitoring) { + this.enableIntegrityMonitoring = enableIntegrityMonitoring; + return this; + } + + /** Defines whether the instance has Secure Boot enabled. */ + public Boolean getEnableSecureBoot() { + return enableSecureBoot; + } + + /** Defines whether the instance has Secure Boot enabled. */ + public Builder setEnableSecureBoot(Boolean enableSecureBoot) { + this.enableSecureBoot = enableSecureBoot; + return this; + } + + /** Defines whether the instance has the vTPM enabled. */ + public Boolean getEnableVtpm() { + return enableVtpm; + } + + /** Defines whether the instance has the vTPM enabled. */ + public Builder setEnableVtpm(Boolean enableVtpm) { + this.enableVtpm = enableVtpm; + return this; + } + + public ShieldedInstanceConfig build() { + + return new ShieldedInstanceConfig(enableIntegrityMonitoring, enableSecureBoot, enableVtpm); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setEnableIntegrityMonitoring(this.enableIntegrityMonitoring); + newBuilder.setEnableSecureBoot(this.enableSecureBoot); + newBuilder.setEnableVtpm(this.enableVtpm); + return newBuilder; + } + } + + @Override + public String toString() { + return "ShieldedInstanceConfig{" + + "enableIntegrityMonitoring=" + + enableIntegrityMonitoring + + ", " + + "enableSecureBoot=" + + enableSecureBoot + + ", " + + "enableVtpm=" + + enableVtpm + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ShieldedInstanceConfig) { + ShieldedInstanceConfig that = (ShieldedInstanceConfig) o; + return Objects.equals(this.enableIntegrityMonitoring, that.getEnableIntegrityMonitoring()) + && Objects.equals(this.enableSecureBoot, that.getEnableSecureBoot()) + && Objects.equals(this.enableVtpm, that.getEnableVtpm()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(enableIntegrityMonitoring, enableSecureBoot, enableVtpm); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentity.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentity.java new file mode 100644 index 000000000000..ffb87d45e158 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentity.java @@ -0,0 +1,232 @@ +/* + * 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 +/** A shielded Instance identity entry. */ +public final class ShieldedInstanceIdentity implements ApiMessage { + private final ShieldedInstanceIdentityEntry encryptionKey; + private final String kind; + private final ShieldedInstanceIdentityEntry signingKey; + + private ShieldedInstanceIdentity() { + this.encryptionKey = null; + this.kind = null; + this.signingKey = null; + } + + private ShieldedInstanceIdentity( + ShieldedInstanceIdentityEntry encryptionKey, + String kind, + ShieldedInstanceIdentityEntry signingKey) { + this.encryptionKey = encryptionKey; + this.kind = kind; + this.signingKey = signingKey; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("encryptionKey".equals(fieldName)) { + return encryptionKey; + } + if ("kind".equals(fieldName)) { + return kind; + } + if ("signingKey".equals(fieldName)) { + return signingKey; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + /** + * The fields that should be serialized (even if they have empty values). If the containing + * message object has a non-null fieldmask, then all the fields in the field mask (and only those + * fields in the field mask) will be serialized. If the containing object does not have a + * fieldmask, then only non-empty fields will be serialized. + */ + public List getFieldMask() { + return null; + } + + /** An Endorsement Key (EK) issued to the Shielded Instance's vTPM. */ + public ShieldedInstanceIdentityEntry getEncryptionKey() { + return encryptionKey; + } + + /** + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded + * Instance identity entry. + */ + public String getKind() { + return kind; + } + + /** An Attestation Key (AK) issued to the Shielded Instance's vTPM. */ + public ShieldedInstanceIdentityEntry getSigningKey() { + return signingKey; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ShieldedInstanceIdentity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ShieldedInstanceIdentity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ShieldedInstanceIdentity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ShieldedInstanceIdentity(); + } + + public static class Builder { + private ShieldedInstanceIdentityEntry encryptionKey; + private String kind; + private ShieldedInstanceIdentityEntry signingKey; + + Builder() {} + + public Builder mergeFrom(ShieldedInstanceIdentity other) { + if (other == ShieldedInstanceIdentity.getDefaultInstance()) return this; + if (other.getEncryptionKey() != null) { + this.encryptionKey = other.encryptionKey; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getSigningKey() != null) { + this.signingKey = other.signingKey; + } + return this; + } + + Builder(ShieldedInstanceIdentity source) { + this.encryptionKey = source.encryptionKey; + this.kind = source.kind; + this.signingKey = source.signingKey; + } + + /** An Endorsement Key (EK) issued to the Shielded Instance's vTPM. */ + public ShieldedInstanceIdentityEntry getEncryptionKey() { + return encryptionKey; + } + + /** An Endorsement Key (EK) issued to the Shielded Instance's vTPM. */ + public Builder setEncryptionKey(ShieldedInstanceIdentityEntry encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded + * Instance identity entry. + */ + public String getKind() { + return kind; + } + + /** + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded + * Instance identity entry. + */ + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + /** An Attestation Key (AK) issued to the Shielded Instance's vTPM. */ + public ShieldedInstanceIdentityEntry getSigningKey() { + return signingKey; + } + + /** An Attestation Key (AK) issued to the Shielded Instance's vTPM. */ + public Builder setSigningKey(ShieldedInstanceIdentityEntry signingKey) { + this.signingKey = signingKey; + return this; + } + + public ShieldedInstanceIdentity build() { + + return new ShieldedInstanceIdentity(encryptionKey, kind, signingKey); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setEncryptionKey(this.encryptionKey); + newBuilder.setKind(this.kind); + newBuilder.setSigningKey(this.signingKey); + return newBuilder; + } + } + + @Override + public String toString() { + return "ShieldedInstanceIdentity{" + + "encryptionKey=" + + encryptionKey + + ", " + + "kind=" + + kind + + ", " + + "signingKey=" + + signingKey + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ShieldedInstanceIdentity) { + ShieldedInstanceIdentity that = (ShieldedInstanceIdentity) o; + return Objects.equals(this.encryptionKey, that.getEncryptionKey()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.signingKey, that.getSigningKey()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(encryptionKey, kind, signingKey); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentityEntry.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentityEntry.java new file mode 100644 index 000000000000..78785769759b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIdentityEntry.java @@ -0,0 +1,182 @@ +/* + * 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 +/** A Shielded Instance Identity Entry. */ +public final class ShieldedInstanceIdentityEntry implements ApiMessage { + private final String ekCert; + private final String ekPub; + + private ShieldedInstanceIdentityEntry() { + this.ekCert = null; + this.ekPub = null; + } + + private ShieldedInstanceIdentityEntry(String ekCert, String ekPub) { + this.ekCert = ekCert; + this.ekPub = ekPub; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("ekCert".equals(fieldName)) { + return ekCert; + } + if ("ekPub".equals(fieldName)) { + return ekPub; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + /** + * The fields that should be serialized (even if they have empty values). If the containing + * message object has a non-null fieldmask, then all the fields in the field mask (and only those + * fields in the field mask) will be serialized. If the containing object does not have a + * fieldmask, then only non-empty fields will be serialized. + */ + public List getFieldMask() { + return null; + } + + /** A PEM-encoded X.509 certificate. This field can be empty. */ + public String getEkCert() { + return ekCert; + } + + /** A PEM-encoded public key. */ + public String getEkPub() { + return ekPub; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ShieldedInstanceIdentityEntry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ShieldedInstanceIdentityEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ShieldedInstanceIdentityEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ShieldedInstanceIdentityEntry(); + } + + public static class Builder { + private String ekCert; + private String ekPub; + + Builder() {} + + public Builder mergeFrom(ShieldedInstanceIdentityEntry other) { + if (other == ShieldedInstanceIdentityEntry.getDefaultInstance()) return this; + if (other.getEkCert() != null) { + this.ekCert = other.ekCert; + } + if (other.getEkPub() != null) { + this.ekPub = other.ekPub; + } + return this; + } + + Builder(ShieldedInstanceIdentityEntry source) { + this.ekCert = source.ekCert; + this.ekPub = source.ekPub; + } + + /** A PEM-encoded X.509 certificate. This field can be empty. */ + public String getEkCert() { + return ekCert; + } + + /** A PEM-encoded X.509 certificate. This field can be empty. */ + public Builder setEkCert(String ekCert) { + this.ekCert = ekCert; + return this; + } + + /** A PEM-encoded public key. */ + public String getEkPub() { + return ekPub; + } + + /** A PEM-encoded public key. */ + public Builder setEkPub(String ekPub) { + this.ekPub = ekPub; + return this; + } + + public ShieldedInstanceIdentityEntry build() { + + return new ShieldedInstanceIdentityEntry(ekCert, ekPub); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setEkCert(this.ekCert); + newBuilder.setEkPub(this.ekPub); + return newBuilder; + } + } + + @Override + public String toString() { + return "ShieldedInstanceIdentityEntry{" + "ekCert=" + ekCert + ", " + "ekPub=" + ekPub + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ShieldedInstanceIdentityEntry) { + ShieldedInstanceIdentityEntry that = (ShieldedInstanceIdentityEntry) o; + return Objects.equals(this.ekCert, that.getEkCert()) + && Objects.equals(this.ekPub, that.getEkPub()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(ekCert, ekPub); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIntegrityPolicy.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIntegrityPolicy.java new file mode 100644 index 000000000000..22e053b3d33b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ShieldedInstanceIntegrityPolicy.java @@ -0,0 +1,164 @@ +/* + * 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 +/** The policy describes the baseline against which Instance boot integrity is measured. */ +public final class ShieldedInstanceIntegrityPolicy implements ApiMessage { + private final Boolean updateAutoLearnPolicy; + + private ShieldedInstanceIntegrityPolicy() { + this.updateAutoLearnPolicy = null; + } + + private ShieldedInstanceIntegrityPolicy(Boolean updateAutoLearnPolicy) { + this.updateAutoLearnPolicy = updateAutoLearnPolicy; + } + + @Override + public Object getFieldValue(String fieldName) { + if ("updateAutoLearnPolicy".equals(fieldName)) { + return updateAutoLearnPolicy; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + /** + * The fields that should be serialized (even if they have empty values). If the containing + * message object has a non-null fieldmask, then all the fields in the field mask (and only those + * fields in the field mask) will be serialized. If the containing object does not have a + * fieldmask, then only non-empty fields will be serialized. + */ + public List getFieldMask() { + return null; + } + + /** + * Updates the integrity policy baseline using the measurements from the VM instance's most recent + * boot. + */ + public Boolean getUpdateAutoLearnPolicy() { + return updateAutoLearnPolicy; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ShieldedInstanceIntegrityPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ShieldedInstanceIntegrityPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ShieldedInstanceIntegrityPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ShieldedInstanceIntegrityPolicy(); + } + + public static class Builder { + private Boolean updateAutoLearnPolicy; + + Builder() {} + + public Builder mergeFrom(ShieldedInstanceIntegrityPolicy other) { + if (other == ShieldedInstanceIntegrityPolicy.getDefaultInstance()) return this; + if (other.getUpdateAutoLearnPolicy() != null) { + this.updateAutoLearnPolicy = other.updateAutoLearnPolicy; + } + return this; + } + + Builder(ShieldedInstanceIntegrityPolicy source) { + this.updateAutoLearnPolicy = source.updateAutoLearnPolicy; + } + + /** + * Updates the integrity policy baseline using the measurements from the VM instance's most + * recent boot. + */ + public Boolean getUpdateAutoLearnPolicy() { + return updateAutoLearnPolicy; + } + + /** + * Updates the integrity policy baseline using the measurements from the VM instance's most + * recent boot. + */ + public Builder setUpdateAutoLearnPolicy(Boolean updateAutoLearnPolicy) { + this.updateAutoLearnPolicy = updateAutoLearnPolicy; + return this; + } + + public ShieldedInstanceIntegrityPolicy build() { + return new ShieldedInstanceIntegrityPolicy(updateAutoLearnPolicy); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setUpdateAutoLearnPolicy(this.updateAutoLearnPolicy); + return newBuilder; + } + } + + @Override + public String toString() { + return "ShieldedInstanceIntegrityPolicy{" + + "updateAutoLearnPolicy=" + + updateAutoLearnPolicy + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ShieldedInstanceIntegrityPolicy) { + ShieldedInstanceIntegrityPolicy that = (ShieldedInstanceIntegrityPolicy) o; + return Objects.equals(this.updateAutoLearnPolicy, that.getUpdateAutoLearnPolicy()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(updateAutoLearnPolicy); + } +} diff --git a/google-cloud-clients/google-cloud-compute/synth.metadata b/google-cloud-clients/google-cloud-compute/synth.metadata index 1fbd06626d19..396abb575e71 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-03-08T08:37:03.640656Z", + "updateTime": "2019-03-23T07:37:04.485920Z", "sources": [ { "git": { "name": "discovery-artifact-manager", "remote": "https://github.com/googleapis/discovery-artifact-manager.git", - "sha": "d6f22d5a41026993e91d51e896987968a392787d" + "sha": "891ad31c01291863e08aaff6d3fe85ca34c44fe9" } }, { "generator": { "name": "artman", - "version": "0.16.15", - "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" + "version": "0.16.19", + "dockerImage": "googleapis/artman@sha256:70ba28fda87e032ae44e6df41b7fc342c1b0cce1ed90658c4890eb4f613038c2" } } ]