Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate compute client #5416

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (https://compute.googleapis.com/compute/v1/projects/) and
* default port (443) are used.
* <li>The default service address (https://www.googleapis.com/compute/v1/projects/) and default
* port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (https://compute.googleapis.com/compute/v1/projects/) and
* default port (443) are used.
* <li>The default service address (https://www.googleapis.com/compute/v1/projects/) and default
* port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public final class AttachedDiskInitializeParams implements ApiMessage {
private final Map<String, String> labels;
private final String sourceImage;
private final CustomerEncryptionKey sourceImageEncryptionKey;
private final String sourceSnapshot;
private final CustomerEncryptionKey sourceSnapshotEncryptionKey;

private AttachedDiskInitializeParams() {
this.description = null;
Expand All @@ -50,6 +52,8 @@ private AttachedDiskInitializeParams() {
this.labels = null;
this.sourceImage = null;
this.sourceImageEncryptionKey = null;
this.sourceSnapshot = null;
this.sourceSnapshotEncryptionKey = null;
}

private AttachedDiskInitializeParams(
Expand All @@ -59,14 +63,18 @@ private AttachedDiskInitializeParams(
String diskType,
Map<String, String> labels,
String sourceImage,
CustomerEncryptionKey sourceImageEncryptionKey) {
CustomerEncryptionKey sourceImageEncryptionKey,
String sourceSnapshot,
CustomerEncryptionKey sourceSnapshotEncryptionKey) {
this.description = description;
this.diskName = diskName;
this.diskSizeGb = diskSizeGb;
this.diskType = diskType;
this.labels = labels;
this.sourceImage = sourceImage;
this.sourceImageEncryptionKey = sourceImageEncryptionKey;
this.sourceSnapshot = sourceSnapshot;
this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey;
}

@Override
Expand All @@ -92,6 +100,12 @@ public Object getFieldValue(String fieldName) {
if ("sourceImageEncryptionKey".equals(fieldName)) {
return sourceImageEncryptionKey;
}
if ("sourceSnapshot".equals(fieldName)) {
return sourceSnapshot;
}
if ("sourceSnapshotEncryptionKey".equals(fieldName)) {
return sourceSnapshotEncryptionKey;
}
return null;
}

Expand Down Expand Up @@ -191,6 +205,24 @@ public CustomerEncryptionKey getSourceImageEncryptionKey() {
return sourceImageEncryptionKey;
}

/**
* The source snapshot to create this disk. When creating a new instance, one of
* initializeParams.sourceSnapshot or disks.source is required except for local SSD.
*
* <p>To create a disk with a snapshot that you created, specify the snapshot name in the
* following format: global/snapshots/my-backup
*
* <p>If the source snapshot is deleted later, this field will not be set.
*/
public String getSourceSnapshot() {
return sourceSnapshot;
}

/** The customer-supplied encryption key of the source snapshot. */
public CustomerEncryptionKey getSourceSnapshotEncryptionKey() {
return sourceSnapshotEncryptionKey;
}

public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
Expand Down Expand Up @@ -221,6 +253,8 @@ public static class Builder {
private Map<String, String> labels;
private String sourceImage;
private CustomerEncryptionKey sourceImageEncryptionKey;
private String sourceSnapshot;
private CustomerEncryptionKey sourceSnapshotEncryptionKey;

Builder() {}

Expand All @@ -247,6 +281,12 @@ public Builder mergeFrom(AttachedDiskInitializeParams other) {
if (other.getSourceImageEncryptionKey() != null) {
this.sourceImageEncryptionKey = other.sourceImageEncryptionKey;
}
if (other.getSourceSnapshot() != null) {
this.sourceSnapshot = other.sourceSnapshot;
}
if (other.getSourceSnapshotEncryptionKey() != null) {
this.sourceSnapshotEncryptionKey = other.sourceSnapshotEncryptionKey;
}
return this;
}

Expand All @@ -258,6 +298,8 @@ public Builder mergeFrom(AttachedDiskInitializeParams other) {
this.labels = source.labels;
this.sourceImage = source.sourceImage;
this.sourceImageEncryptionKey = source.sourceImageEncryptionKey;
this.sourceSnapshot = source.sourceSnapshot;
this.sourceSnapshotEncryptionKey = source.sourceSnapshotEncryptionKey;
}

/** An optional description. Provide this property when creating the disk. */
Expand Down Expand Up @@ -423,6 +465,45 @@ public Builder setSourceImageEncryptionKey(CustomerEncryptionKey sourceImageEncr
return this;
}

/**
* The source snapshot to create this disk. When creating a new instance, one of
* initializeParams.sourceSnapshot or disks.source is required except for local SSD.
*
* <p>To create a disk with a snapshot that you created, specify the snapshot name in the
* following format: global/snapshots/my-backup
*
* <p>If the source snapshot is deleted later, this field will not be set.
*/
public String getSourceSnapshot() {
return sourceSnapshot;
}

/**
* The source snapshot to create this disk. When creating a new instance, one of
* initializeParams.sourceSnapshot or disks.source is required except for local SSD.
*
* <p>To create a disk with a snapshot that you created, specify the snapshot name in the
* following format: global/snapshots/my-backup
*
* <p>If the source snapshot is deleted later, this field will not be set.
*/
public Builder setSourceSnapshot(String sourceSnapshot) {
this.sourceSnapshot = sourceSnapshot;
return this;
}

/** The customer-supplied encryption key of the source snapshot. */
public CustomerEncryptionKey getSourceSnapshotEncryptionKey() {
return sourceSnapshotEncryptionKey;
}

/** The customer-supplied encryption key of the source snapshot. */
public Builder setSourceSnapshotEncryptionKey(
CustomerEncryptionKey sourceSnapshotEncryptionKey) {
this.sourceSnapshotEncryptionKey = sourceSnapshotEncryptionKey;
return this;
}

public AttachedDiskInitializeParams build() {

return new AttachedDiskInitializeParams(
Expand All @@ -432,7 +513,9 @@ public AttachedDiskInitializeParams build() {
diskType,
labels,
sourceImage,
sourceImageEncryptionKey);
sourceImageEncryptionKey,
sourceSnapshot,
sourceSnapshotEncryptionKey);
}

public Builder clone() {
Expand All @@ -444,6 +527,8 @@ public Builder clone() {
newBuilder.putAllLabels(this.labels);
newBuilder.setSourceImage(this.sourceImage);
newBuilder.setSourceImageEncryptionKey(this.sourceImageEncryptionKey);
newBuilder.setSourceSnapshot(this.sourceSnapshot);
newBuilder.setSourceSnapshotEncryptionKey(this.sourceSnapshotEncryptionKey);
return newBuilder;
}
}
Expand Down Expand Up @@ -471,6 +556,12 @@ public String toString() {
+ ", "
+ "sourceImageEncryptionKey="
+ sourceImageEncryptionKey
+ ", "
+ "sourceSnapshot="
+ sourceSnapshot
+ ", "
+ "sourceSnapshotEncryptionKey="
+ sourceSnapshotEncryptionKey
+ "}";
}

Expand All @@ -487,14 +578,25 @@ public boolean equals(Object o) {
&& Objects.equals(this.diskType, that.getDiskType())
&& Objects.equals(this.labels, that.getLabelsMap())
&& Objects.equals(this.sourceImage, that.getSourceImage())
&& Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey());
&& Objects.equals(this.sourceImageEncryptionKey, that.getSourceImageEncryptionKey())
&& Objects.equals(this.sourceSnapshot, that.getSourceSnapshot())
&& Objects.equals(
this.sourceSnapshotEncryptionKey, that.getSourceSnapshotEncryptionKey());
}
return false;
}

@Override
public int hashCode() {
return Objects.hash(
description, diskName, diskSizeGb, diskType, labels, sourceImage, sourceImageEncryptionKey);
description,
diskName,
diskSizeGb,
diskType,
labels,
sourceImage,
sourceImageEncryptionKey,
sourceSnapshot,
sourceSnapshotEncryptionKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (https://compute.googleapis.com/compute/v1/projects/) and
* default port (443) are used.
* <li>The default service address (https://www.googleapis.com/compute/v1/projects/) and default
* port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (https://compute.googleapis.com/compute/v1/projects/) and
* default port (443) are used.
* <li>The default service address (https://www.googleapis.com/compute/v1/projects/) and default
* port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (https://compute.googleapis.com/compute/v1/projects/) and
* default port (443) are used.
* <li>The default service address (https://www.googleapis.com/compute/v1/projects/) and default
* port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ public String getFields() {
return fields;
}

/** Application consistent snapshot (ie. VSS). */
/**
* [Input Only] Specifies to create an application consistent snapshot by informing the OS to
* prepare for the snapshot process. Currently only supported on Windows instances using the
* Volume Shadow Copy Service (VSS).
*/
public Boolean getGuestFlush() {
return guestFlush;
}
Expand Down Expand Up @@ -359,12 +363,20 @@ public Builder setFields(String fields) {
return this;
}

/** Application consistent snapshot (ie. VSS). */
/**
* [Input Only] Specifies to create an application consistent snapshot by informing the OS to
* prepare for the snapshot process. Currently only supported on Windows instances using the
* Volume Shadow Copy Service (VSS).
*/
public Boolean getGuestFlush() {
return guestFlush;
}

/** Application consistent snapshot (ie. VSS). */
/**
* [Input Only] Specifies to create an application consistent snapshot by informing the OS to
* prepare for the snapshot process. Currently only supported on Windows instances using the
* Volume Shadow Copy Service (VSS).
*/
public Builder setGuestFlush(Boolean guestFlush) {
this.guestFlush = guestFlush;
return this;
Expand Down
Loading