diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Document.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Document.java index 1913a99992f1..4e41f93ce169 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Document.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Document.java @@ -213,7 +213,7 @@ public int getFieldsCount() { * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -251,7 +251,7 @@ public java.util.Map getFi * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -280,7 +280,7 @@ public java.util.Map getFi * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -314,7 +314,7 @@ public com.google.firestore.v1beta1.Value getFieldsOrDefault( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -393,7 +393,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { /** *
    * Output only. The time at which the document was last changed.
-   * This value is initally set to the `create_time` then increases
+   * This value is initially set to the `create_time` then increases
    * monotonically with each change to the document. It can also be
    * compared to values from other documents and the `read_time` of a query.
    * 
@@ -406,7 +406,7 @@ public boolean hasUpdateTime() { /** *
    * Output only. The time at which the document was last changed.
-   * This value is initally set to the `create_time` then increases
+   * This value is initially set to the `create_time` then increases
    * monotonically with each change to the document. It can also be
    * compared to values from other documents and the `read_time` of a query.
    * 
@@ -419,7 +419,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { /** *
    * Output only. The time at which the document was last changed.
-   * This value is initally set to the `create_time` then increases
+   * This value is initially set to the `create_time` then increases
    * monotonically with each change to the document. It can also be
    * compared to values from other documents and the `read_time` of a query.
    * 
@@ -976,7 +976,7 @@ public int getFieldsCount() { * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1014,7 +1014,7 @@ public java.util.Map getFi * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1043,7 +1043,7 @@ public java.util.Map getFi * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1077,7 +1077,7 @@ public com.google.firestore.v1beta1.Value getFieldsOrDefault( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1119,7 +1119,7 @@ public Builder clearFields() { * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1160,7 +1160,7 @@ public Builder removeFields( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1194,7 +1194,7 @@ public Builder putFields( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -1408,7 +1408,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1421,7 +1421,7 @@ public boolean hasUpdateTime() { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1438,7 +1438,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1461,7 +1461,7 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1482,7 +1482,7 @@ public Builder setUpdateTime( /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1507,7 +1507,7 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1528,7 +1528,7 @@ public Builder clearUpdateTime() { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1543,7 +1543,7 @@ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
@@ -1561,7 +1561,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { /** *
      * Output only. The time at which the document was last changed.
-     * This value is initally set to the `create_time` then increases
+     * This value is initially set to the `create_time` then increases
      * monotonically with each change to the document. It can also be
      * compared to values from other documents and the `read_time` of a query.
      * 
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentOrBuilder.java index 85b01bfc0ecd..0f96db324528 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentOrBuilder.java @@ -32,7 +32,7 @@ public interface DocumentOrBuilder extends * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -58,7 +58,7 @@ public interface DocumentOrBuilder extends * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -91,7 +91,7 @@ boolean containsFields( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -118,7 +118,7 @@ boolean containsFields( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -147,7 +147,7 @@ com.google.firestore.v1beta1.Value getFieldsOrDefault( * The document's fields. * The map keys represent field names. * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * Field names matching the regular expression `__.*__` are reserved. Reserved * field names are forbidden except in certain documented contexts. The map @@ -208,7 +208,7 @@ com.google.firestore.v1beta1.Value getFieldsOrThrow( /** *
    * Output only. The time at which the document was last changed.
-   * This value is initally set to the `create_time` then increases
+   * This value is initially set to the `create_time` then increases
    * monotonically with each change to the document. It can also be
    * compared to values from other documents and the `read_time` of a query.
    * 
@@ -219,7 +219,7 @@ com.google.firestore.v1beta1.Value getFieldsOrThrow( /** *
    * Output only. The time at which the document was last changed.
-   * This value is initally set to the `create_time` then increases
+   * This value is initially set to the `create_time` then increases
    * monotonically with each change to the document. It can also be
    * compared to values from other documents and the `read_time` of a query.
    * 
@@ -230,7 +230,7 @@ com.google.firestore.v1beta1.Value getFieldsOrThrow( /** *
    * Output only. The time at which the document was last changed.
-   * This value is initally set to the `create_time` then increases
+   * This value is initially set to the `create_time` then increases
    * monotonically with each change to the document. It can also be
    * compared to values from other documents and the `read_time` of a query.
    * 
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java index c0c5ea68a2b0..dc3ec1df4c95 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/DocumentTransform.java @@ -139,6 +139,104 @@ public interface FieldTransformOrBuilder extends */ com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue getSetToServerValue(); + /** + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + boolean hasAppendMissingElements(); + /** + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + com.google.firestore.v1beta1.ArrayValue getAppendMissingElements(); + /** + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + com.google.firestore.v1beta1.ArrayValueOrBuilder getAppendMissingElementsOrBuilder(); + + /** + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + boolean hasRemoveAllFromArray(); + /** + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + com.google.firestore.v1beta1.ArrayValue getRemoveAllFromArray(); + /** + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + com.google.firestore.v1beta1.ArrayValueOrBuilder getRemoveAllFromArrayOrBuilder(); + public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.TransformTypeCase getTransformTypeCase(); } /** @@ -197,6 +295,34 @@ private FieldTransform( transformType_ = rawValue; break; } + case 50: { + com.google.firestore.v1beta1.ArrayValue.Builder subBuilder = null; + if (transformTypeCase_ == 6) { + subBuilder = ((com.google.firestore.v1beta1.ArrayValue) transformType_).toBuilder(); + } + transformType_ = + input.readMessage(com.google.firestore.v1beta1.ArrayValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1beta1.ArrayValue) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 6; + break; + } + case 58: { + com.google.firestore.v1beta1.ArrayValue.Builder subBuilder = null; + if (transformTypeCase_ == 7) { + subBuilder = ((com.google.firestore.v1beta1.ArrayValue) transformType_).toBuilder(); + } + transformType_ = + input.readMessage(com.google.firestore.v1beta1.ArrayValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.firestore.v1beta1.ArrayValue) transformType_); + transformType_ = subBuilder.buildPartial(); + } + transformTypeCase_ = 7; + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -354,6 +480,8 @@ private ServerValue(int value) { public enum TransformTypeCase implements com.google.protobuf.Internal.EnumLite { SET_TO_SERVER_VALUE(2), + APPEND_MISSING_ELEMENTS(6), + REMOVE_ALL_FROM_ARRAY(7), TRANSFORMTYPE_NOT_SET(0); private final int value; private TransformTypeCase(int value) { @@ -370,6 +498,8 @@ public static TransformTypeCase valueOf(int value) { public static TransformTypeCase forNumber(int value) { switch (value) { case 2: return SET_TO_SERVER_VALUE; + case 6: return APPEND_MISSING_ELEMENTS; + case 7: return REMOVE_ALL_FROM_ARRAY; case 0: return TRANSFORMTYPE_NOT_SET; default: return null; } @@ -460,6 +590,130 @@ public com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue return com.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue.SERVER_VALUE_UNSPECIFIED; } + public static final int APPEND_MISSING_ELEMENTS_FIELD_NUMBER = 6; + /** + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public boolean hasAppendMissingElements() { + return transformTypeCase_ == 6; + } + /** + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1beta1.ArrayValue getAppendMissingElements() { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + /** + *
+     * Append the given elements in order if they are not already present in
+     * the current field value.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * first set to the empty array.
+     * Equivalent numbers of different types (e.g. 3L and 3.0) are
+     * considered equal when checking if a value is missing.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * If the input contains multiple equivalent values, only the first will
+     * be considered.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1beta1.ArrayValueOrBuilder getAppendMissingElementsOrBuilder() { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + + public static final int REMOVE_ALL_FROM_ARRAY_FIELD_NUMBER = 7; + /** + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public boolean hasRemoveAllFromArray() { + return transformTypeCase_ == 7; + } + /** + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1beta1.ArrayValue getRemoveAllFromArray() { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + /** + *
+     * Remove all of the given elements from the array in the field.
+     * If the field is not an array, or if the field does not yet exist, it is
+     * set to the empty array.
+     * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+     * considered equal when deciding whether an element should be removed.
+     * NaN is equal to NaN, and Null is equal to Null.
+     * This will remove all equivalent values if there are duplicates.
+     * The corresponding transform_result will be the null value.
+     * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1beta1.ArrayValueOrBuilder getRemoveAllFromArrayOrBuilder() { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -480,6 +734,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (transformTypeCase_ == 2) { output.writeEnum(2, ((java.lang.Integer) transformType_)); } + if (transformTypeCase_ == 6) { + output.writeMessage(6, (com.google.firestore.v1beta1.ArrayValue) transformType_); + } + if (transformTypeCase_ == 7) { + output.writeMessage(7, (com.google.firestore.v1beta1.ArrayValue) transformType_); + } unknownFields.writeTo(output); } @@ -496,6 +756,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, ((java.lang.Integer) transformType_)); } + if (transformTypeCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (com.google.firestore.v1beta1.ArrayValue) transformType_); + } + if (transformTypeCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (com.google.firestore.v1beta1.ArrayValue) transformType_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -522,6 +790,14 @@ public boolean equals(final java.lang.Object obj) { result = result && getSetToServerValueValue() == other.getSetToServerValueValue(); break; + case 6: + result = result && getAppendMissingElements() + .equals(other.getAppendMissingElements()); + break; + case 7: + result = result && getRemoveAllFromArray() + .equals(other.getRemoveAllFromArray()); + break; case 0: default: } @@ -543,6 +819,14 @@ public int hashCode() { hash = (37 * hash) + SET_TO_SERVER_VALUE_FIELD_NUMBER; hash = (53 * hash) + getSetToServerValueValue(); break; + case 6: + hash = (37 * hash) + APPEND_MISSING_ELEMENTS_FIELD_NUMBER; + hash = (53 * hash) + getAppendMissingElements().hashCode(); + break; + case 7: + hash = (37 * hash) + REMOVE_ALL_FROM_ARRAY_FIELD_NUMBER; + hash = (53 * hash) + getRemoveAllFromArray().hashCode(); + break; case 0: default: } @@ -717,6 +1001,20 @@ public com.google.firestore.v1beta1.DocumentTransform.FieldTransform buildPartia if (transformTypeCase_ == 2) { result.transformType_ = transformType_; } + if (transformTypeCase_ == 6) { + if (appendMissingElementsBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = appendMissingElementsBuilder_.build(); + } + } + if (transformTypeCase_ == 7) { + if (removeAllFromArrayBuilder_ == null) { + result.transformType_ = transformType_; + } else { + result.transformType_ = removeAllFromArrayBuilder_.build(); + } + } result.transformTypeCase_ = transformTypeCase_; onBuilt(); return result; @@ -775,6 +1073,14 @@ public Builder mergeFrom(com.google.firestore.v1beta1.DocumentTransform.FieldTra setSetToServerValueValue(other.getSetToServerValueValue()); break; } + case APPEND_MISSING_ELEMENTS: { + mergeAppendMissingElements(other.getAppendMissingElements()); + break; + } + case REMOVE_ALL_FROM_ARRAY: { + mergeRemoveAllFromArray(other.getRemoveAllFromArray()); + break; + } case TRANSFORMTYPE_NOT_SET: { break; } @@ -990,6 +1296,494 @@ public Builder clearSetToServerValue() { } return this; } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, com.google.firestore.v1beta1.ArrayValueOrBuilder> appendMissingElementsBuilder_; + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public boolean hasAppendMissingElements() { + return transformTypeCase_ == 6; + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1beta1.ArrayValue getAppendMissingElements() { + if (appendMissingElementsBuilder_ == null) { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } else { + if (transformTypeCase_ == 6) { + return appendMissingElementsBuilder_.getMessage(); + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public Builder setAppendMissingElements(com.google.firestore.v1beta1.ArrayValue value) { + if (appendMissingElementsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + appendMissingElementsBuilder_.setMessage(value); + } + transformTypeCase_ = 6; + return this; + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public Builder setAppendMissingElements( + com.google.firestore.v1beta1.ArrayValue.Builder builderForValue) { + if (appendMissingElementsBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + appendMissingElementsBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 6; + return this; + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public Builder mergeAppendMissingElements(com.google.firestore.v1beta1.ArrayValue value) { + if (appendMissingElementsBuilder_ == null) { + if (transformTypeCase_ == 6 && + transformType_ != com.google.firestore.v1beta1.ArrayValue.getDefaultInstance()) { + transformType_ = com.google.firestore.v1beta1.ArrayValue.newBuilder((com.google.firestore.v1beta1.ArrayValue) transformType_) + .mergeFrom(value).buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 6) { + appendMissingElementsBuilder_.mergeFrom(value); + } + appendMissingElementsBuilder_.setMessage(value); + } + transformTypeCase_ = 6; + return this; + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public Builder clearAppendMissingElements() { + if (appendMissingElementsBuilder_ == null) { + if (transformTypeCase_ == 6) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 6) { + transformTypeCase_ = 0; + transformType_ = null; + } + appendMissingElementsBuilder_.clear(); + } + return this; + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1beta1.ArrayValue.Builder getAppendMissingElementsBuilder() { + return getAppendMissingElementsFieldBuilder().getBuilder(); + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + public com.google.firestore.v1beta1.ArrayValueOrBuilder getAppendMissingElementsOrBuilder() { + if ((transformTypeCase_ == 6) && (appendMissingElementsBuilder_ != null)) { + return appendMissingElementsBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 6) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + } + /** + *
+       * Append the given elements in order if they are not already present in
+       * the current field value.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * first set to the empty array.
+       * Equivalent numbers of different types (e.g. 3L and 3.0) are
+       * considered equal when checking if a value is missing.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * If the input contains multiple equivalent values, only the first will
+       * be considered.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue append_missing_elements = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, com.google.firestore.v1beta1.ArrayValueOrBuilder> + getAppendMissingElementsFieldBuilder() { + if (appendMissingElementsBuilder_ == null) { + if (!(transformTypeCase_ == 6)) { + transformType_ = com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + appendMissingElementsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, com.google.firestore.v1beta1.ArrayValueOrBuilder>( + (com.google.firestore.v1beta1.ArrayValue) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 6; + onChanged();; + return appendMissingElementsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, com.google.firestore.v1beta1.ArrayValueOrBuilder> removeAllFromArrayBuilder_; + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public boolean hasRemoveAllFromArray() { + return transformTypeCase_ == 7; + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1beta1.ArrayValue getRemoveAllFromArray() { + if (removeAllFromArrayBuilder_ == null) { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } else { + if (transformTypeCase_ == 7) { + return removeAllFromArrayBuilder_.getMessage(); + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public Builder setRemoveAllFromArray(com.google.firestore.v1beta1.ArrayValue value) { + if (removeAllFromArrayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transformType_ = value; + onChanged(); + } else { + removeAllFromArrayBuilder_.setMessage(value); + } + transformTypeCase_ = 7; + return this; + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public Builder setRemoveAllFromArray( + com.google.firestore.v1beta1.ArrayValue.Builder builderForValue) { + if (removeAllFromArrayBuilder_ == null) { + transformType_ = builderForValue.build(); + onChanged(); + } else { + removeAllFromArrayBuilder_.setMessage(builderForValue.build()); + } + transformTypeCase_ = 7; + return this; + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public Builder mergeRemoveAllFromArray(com.google.firestore.v1beta1.ArrayValue value) { + if (removeAllFromArrayBuilder_ == null) { + if (transformTypeCase_ == 7 && + transformType_ != com.google.firestore.v1beta1.ArrayValue.getDefaultInstance()) { + transformType_ = com.google.firestore.v1beta1.ArrayValue.newBuilder((com.google.firestore.v1beta1.ArrayValue) transformType_) + .mergeFrom(value).buildPartial(); + } else { + transformType_ = value; + } + onChanged(); + } else { + if (transformTypeCase_ == 7) { + removeAllFromArrayBuilder_.mergeFrom(value); + } + removeAllFromArrayBuilder_.setMessage(value); + } + transformTypeCase_ = 7; + return this; + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public Builder clearRemoveAllFromArray() { + if (removeAllFromArrayBuilder_ == null) { + if (transformTypeCase_ == 7) { + transformTypeCase_ = 0; + transformType_ = null; + onChanged(); + } + } else { + if (transformTypeCase_ == 7) { + transformTypeCase_ = 0; + transformType_ = null; + } + removeAllFromArrayBuilder_.clear(); + } + return this; + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1beta1.ArrayValue.Builder getRemoveAllFromArrayBuilder() { + return getRemoveAllFromArrayFieldBuilder().getBuilder(); + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + public com.google.firestore.v1beta1.ArrayValueOrBuilder getRemoveAllFromArrayOrBuilder() { + if ((transformTypeCase_ == 7) && (removeAllFromArrayBuilder_ != null)) { + return removeAllFromArrayBuilder_.getMessageOrBuilder(); + } else { + if (transformTypeCase_ == 7) { + return (com.google.firestore.v1beta1.ArrayValue) transformType_; + } + return com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + } + /** + *
+       * Remove all of the given elements from the array in the field.
+       * If the field is not an array, or if the field does not yet exist, it is
+       * set to the empty array.
+       * Equivalent numbers of the different types (e.g. 3L and 3.0) are
+       * considered equal when deciding whether an element should be removed.
+       * NaN is equal to NaN, and Null is equal to Null.
+       * This will remove all equivalent values if there are duplicates.
+       * The corresponding transform_result will be the null value.
+       * 
+ * + * .google.firestore.v1beta1.ArrayValue remove_all_from_array = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, com.google.firestore.v1beta1.ArrayValueOrBuilder> + getRemoveAllFromArrayFieldBuilder() { + if (removeAllFromArrayBuilder_ == null) { + if (!(transformTypeCase_ == 7)) { + transformType_ = com.google.firestore.v1beta1.ArrayValue.getDefaultInstance(); + } + removeAllFromArrayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1beta1.ArrayValue, com.google.firestore.v1beta1.ArrayValue.Builder, com.google.firestore.v1beta1.ArrayValueOrBuilder>( + (com.google.firestore.v1beta1.ArrayValue) transformType_, + getParentForChildren(), + isClean()); + transformType_ = null; + } + transformTypeCase_ = 7; + onChanged();; + return removeAllFromArrayBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/FirestoreProto.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/FirestoreProto.java index 00da6dafbe5e..f5552191403d 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/FirestoreProto.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/FirestoreProto.java @@ -277,7 +277,7 @@ public static void registerAllExtensions( "CollectionIdsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\t" + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"L\n\031L" + "istCollectionIdsResponse\022\026\n\016collection_i" + - "ds\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\255\022\n\tFi" + + "ds\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\310\023\n\tFi" + "restore\022\236\001\n\013GetDocument\022,.google.firesto" + "re.v1beta1.GetDocumentRequest\032\".google.f" + "irestore.v1beta1.Document\"=\202\323\344\223\0027\0225/v1be" + @@ -318,30 +318,34 @@ public static void registerAllExtensions( "llback\022).google.firestore.v1beta1.Rollba" + "ckRequest\032\026.google.protobuf.Empty\"H\202\323\344\223\002" + "B\"=/v1beta1/{database=projects/*/databas" + - "es/*}/documents:rollback:\001*\022\253\001\n\010RunQuery" + + "es/*}/documents:rollback:\001*\022\364\001\n\010RunQuery" + "\022).google.firestore.v1beta1.RunQueryRequ" + "est\032*.google.firestore.v1beta1.RunQueryR" + - "esponse\"F\202\323\344\223\002@\";/v1beta1/{parent=projec" + - "ts/*/databases/*/documents}:runQuery:\001*0" + - "\001\022\243\001\n\005Write\022&.google.firestore.v1beta1.W" + - "riteRequest\032\'.google.firestore.v1beta1.W" + - "riteResponse\"E\202\323\344\223\002?\":/v1beta1/{database" + - "=projects/*/databases/*}/documents:write" + - ":\001*(\0010\001\022\247\001\n\006Listen\022\'.google.firestore.v1" + - "beta1.ListenRequest\032(.google.firestore.v" + - "1beta1.ListenResponse\"F\202\323\344\223\002@\";/v1beta1/" + - "{database=projects/*/databases/*}/docume" + - "nts:listen:\001*(\0010\001\022\315\001\n\021ListCollectionIds\022" + - "2.google.firestore.v1beta1.ListCollectio" + - "nIdsRequest\0323.google.firestore.v1beta1.L" + - "istCollectionIdsResponse\"O\202\323\344\223\002I\"D/v1bet" + - "a1/{parent=projects/*/databases/*/docume" + - "nts}:listCollectionIds:\001*B\274\001\n\034com.google" + - ".firestore.v1beta1B\016FirestoreProtoP\001ZAgo" + - "ogle.golang.org/genproto/googleapis/fire" + - "store/v1beta1;firestore\242\002\004GCFS\252\002\036Google." + - "Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\F" + - "irestore\\V1beta1b\006proto3" + "esponse\"\216\001\202\323\344\223\002\207\001\";/v1beta1/{parent=proj" + + "ects/*/databases/*/documents}:runQuery:\001" + + "*ZE\"@/v1beta1/{parent=projects/*/databas" + + "es/*/documents/*/**}:runQuery:\001*0\001\022\243\001\n\005W" + + "rite\022&.google.firestore.v1beta1.WriteReq" + + "uest\032\'.google.firestore.v1beta1.WriteRes" + + "ponse\"E\202\323\344\223\002?\":/v1beta1/{database=projec" + + "ts/*/databases/*}/documents:write:\001*(\0010\001" + + "\022\247\001\n\006Listen\022\'.google.firestore.v1beta1.L" + + "istenRequest\032(.google.firestore.v1beta1." + + "ListenResponse\"F\202\323\344\223\002@\";/v1beta1/{databa" + + "se=projects/*/databases/*}/documents:lis" + + "ten:\001*(\0010\001\022\237\002\n\021ListCollectionIds\0222.googl" + + "e.firestore.v1beta1.ListCollectionIdsReq" + + "uest\0323.google.firestore.v1beta1.ListColl" + + "ectionIdsResponse\"\240\001\202\323\344\223\002\231\001\"D/v1beta1/{p" + + "arent=projects/*/databases/*/documents}:" + + "listCollectionIds:\001*ZN\"I/v1beta1/{parent" + + "=projects/*/databases/*/documents/*/**}:" + + "listCollectionIds:\001*B\274\001\n\034com.google.fire" + + "store.v1beta1B\016FirestoreProtoP\001ZAgoogle." + + "golang.org/genproto/googleapis/firestore" + + "/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud" + + ".Firestore.V1Beta1\312\002\036Google\\Cloud\\Firest" + + "ore\\V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/QueryProto.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/QueryProto.java index 54877cb56fb6..91fee5618495 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/QueryProto.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/QueryProto.java @@ -77,7 +77,7 @@ public static void registerAllExtensions( "google.firestore.v1beta1\032\034google/api/ann" + "otations.proto\032\'google/firestore/v1beta1" + "/document.proto\032\036google/protobuf/wrapper" + - "s.proto\"\245\017\n\017StructuredQuery\022D\n\006select\030\001 " + + "s.proto\"\271\017\n\017StructuredQuery\022D\n\006select\030\001 " + "\001(\01324.google.firestore.v1beta1.Structure" + "dQuery.Projection\022J\n\004from\030\002 \003(\0132<.google" + ".firestore.v1beta1.StructuredQuery.Colle" + @@ -102,37 +102,38 @@ public static void registerAllExtensions( "ery.CompositeFilter.Operator\022A\n\007filters\030" + "\002 \003(\01320.google.firestore.v1beta1.Structu" + "redQuery.Filter\"-\n\010Operator\022\030\n\024OPERATOR_" + - "UNSPECIFIED\020\000\022\007\n\003AND\020\001\032\330\002\n\013FieldFilter\022G" + + "UNSPECIFIED\020\000\022\007\n\003AND\020\001\032\354\002\n\013FieldFilter\022G" + "\n\005field\030\001 \001(\01328.google.firestore.v1beta1" + ".StructuredQuery.FieldReference\022J\n\002op\030\002 " + "\001(\0162>.google.firestore.v1beta1.Structure" + "dQuery.FieldFilter.Operator\022.\n\005value\030\003 \001" + - "(\0132\037.google.firestore.v1beta1.Value\"\203\001\n\010" + + "(\0132\037.google.firestore.v1beta1.Value\"\227\001\n\010" + "Operator\022\030\n\024OPERATOR_UNSPECIFIED\020\000\022\r\n\tLE" + "SS_THAN\020\001\022\026\n\022LESS_THAN_OR_EQUAL\020\002\022\020\n\014GRE" + "ATER_THAN\020\003\022\031\n\025GREATER_THAN_OR_EQUAL\020\004\022\t" + - "\n\005EQUAL\020\005\032\363\001\n\013UnaryFilter\022J\n\002op\030\001 \001(\0162>." + - "google.firestore.v1beta1.StructuredQuery" + - ".UnaryFilter.Operator\022I\n\005field\030\002 \001(\01328.g" + - "oogle.firestore.v1beta1.StructuredQuery." + - "FieldReferenceH\000\"=\n\010Operator\022\030\n\024OPERATOR" + - "_UNSPECIFIED\020\000\022\n\n\006IS_NAN\020\002\022\013\n\007IS_NULL\020\003B" + - "\016\n\014operand_type\032\230\001\n\005Order\022G\n\005field\030\001 \001(\013" + - "28.google.firestore.v1beta1.StructuredQu" + - "ery.FieldReference\022F\n\tdirection\030\002 \001(\01623." + - "google.firestore.v1beta1.StructuredQuery" + - ".Direction\032$\n\016FieldReference\022\022\n\nfield_pa" + - "th\030\002 \001(\t\032V\n\nProjection\022H\n\006fields\030\002 \003(\01328" + - ".google.firestore.v1beta1.StructuredQuer" + - "y.FieldReference\"E\n\tDirection\022\031\n\025DIRECTI" + - "ON_UNSPECIFIED\020\000\022\r\n\tASCENDING\020\001\022\016\n\nDESCE" + - "NDING\020\002\"I\n\006Cursor\022/\n\006values\030\001 \003(\0132\037.goog" + - "le.firestore.v1beta1.Value\022\016\n\006before\030\002 \001" + - "(\010B\270\001\n\034com.google.firestore.v1beta1B\nQue" + - "ryProtoP\001ZAgoogle.golang.org/genproto/go" + - "ogleapis/firestore/v1beta1;firestore\242\002\004G" + - "CFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036G" + - "oogle\\Cloud\\Firestore\\V1beta1b\006proto3" + "\n\005EQUAL\020\005\022\022\n\016ARRAY_CONTAINS\020\007\032\363\001\n\013UnaryF" + + "ilter\022J\n\002op\030\001 \001(\0162>.google.firestore.v1b" + + "eta1.StructuredQuery.UnaryFilter.Operato" + + "r\022I\n\005field\030\002 \001(\01328.google.firestore.v1be" + + "ta1.StructuredQuery.FieldReferenceH\000\"=\n\010" + + "Operator\022\030\n\024OPERATOR_UNSPECIFIED\020\000\022\n\n\006IS" + + "_NAN\020\002\022\013\n\007IS_NULL\020\003B\016\n\014operand_type\032\230\001\n\005" + + "Order\022G\n\005field\030\001 \001(\01328.google.firestore." + + "v1beta1.StructuredQuery.FieldReference\022F" + + "\n\tdirection\030\002 \001(\01623.google.firestore.v1b" + + "eta1.StructuredQuery.Direction\032$\n\016FieldR" + + "eference\022\022\n\nfield_path\030\002 \001(\t\032V\n\nProjecti" + + "on\022H\n\006fields\030\002 \003(\01328.google.firestore.v1" + + "beta1.StructuredQuery.FieldReference\"E\n\t" + + "Direction\022\031\n\025DIRECTION_UNSPECIFIED\020\000\022\r\n\t" + + "ASCENDING\020\001\022\016\n\nDESCENDING\020\002\"I\n\006Cursor\022/\n" + + "\006values\030\001 \003(\0132\037.google.firestore.v1beta1" + + ".Value\022\016\n\006before\030\002 \001(\010B\270\001\n\034com.google.fi" + + "restore.v1beta1B\nQueryProtoP\001ZAgoogle.go" + + "lang.org/genproto/googleapis/firestore/v" + + "1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.F" + + "irestore.V1Beta1\312\002\036Google\\Cloud\\Firestor" + + "e\\V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/StructuredQuery.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/StructuredQuery.java index b2313a10f804..10e4b990672b 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/StructuredQuery.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/StructuredQuery.java @@ -3747,6 +3747,14 @@ public enum Operator * EQUAL = 5; */ EQUAL(5), + /** + *
+       * Contains. Requires that the field is an array.
+       * 
+ * + * ARRAY_CONTAINS = 7; + */ + ARRAY_CONTAINS(7), UNRECOGNIZED(-1), ; @@ -3799,6 +3807,14 @@ public enum Operator * EQUAL = 5; */ public static final int EQUAL_VALUE = 5; + /** + *
+       * Contains. Requires that the field is an array.
+       * 
+ * + * ARRAY_CONTAINS = 7; + */ + public static final int ARRAY_CONTAINS_VALUE = 7; public final int getNumber() { @@ -3825,6 +3841,7 @@ public static Operator forNumber(int value) { case 3: return GREATER_THAN; case 4: return GREATER_THAN_OR_EQUAL; case 5: return EQUAL; + case 7: return ARRAY_CONTAINS; default: return null; } } diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Value.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Value.java index 44e861c923bb..5e5f0b2efd61 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Value.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Value.java @@ -517,7 +517,8 @@ public com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder() { /** *
    * An array value.
-   * Cannot contain another array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
    * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -528,7 +529,8 @@ public boolean hasArrayValue() { /** *
    * An array value.
-   * Cannot contain another array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
    * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -542,7 +544,8 @@ public com.google.firestore.v1beta1.ArrayValue getArrayValue() { /** *
    * An array value.
-   * Cannot contain another array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
    * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2027,7 +2030,8 @@ public com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder() { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2038,7 +2042,8 @@ public boolean hasArrayValue() { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2059,7 +2064,8 @@ public com.google.firestore.v1beta1.ArrayValue getArrayValue() { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2080,7 +2086,8 @@ public Builder setArrayValue(com.google.firestore.v1beta1.ArrayValue value) { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2099,7 +2106,8 @@ public Builder setArrayValue( /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2126,7 +2134,8 @@ public Builder mergeArrayValue(com.google.firestore.v1beta1.ArrayValue value) { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2150,7 +2159,8 @@ public Builder clearArrayValue() { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2161,7 +2171,8 @@ public com.google.firestore.v1beta1.ArrayValue.Builder getArrayValueBuilder() { /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -2179,7 +2190,8 @@ public com.google.firestore.v1beta1.ArrayValueOrBuilder getArrayValueOrBuilder() /** *
      * An array value.
-     * Cannot contain another array value.
+     * Cannot directly contain another array value, though can contain an
+     * map which contains another array.
      * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/ValueOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/ValueOrBuilder.java index bf47dde19c30..3d981e390c1d 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/ValueOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/ValueOrBuilder.java @@ -165,7 +165,8 @@ public interface ValueOrBuilder extends /** *
    * An array value.
-   * Cannot contain another array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
    * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -174,7 +175,8 @@ public interface ValueOrBuilder extends /** *
    * An array value.
-   * Cannot contain another array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
    * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; @@ -183,7 +185,8 @@ public interface ValueOrBuilder extends /** *
    * An array value.
-   * Cannot contain another array value.
+   * Cannot directly contain another array value, though can contain an
+   * map which contains another array.
    * 
* * .google.firestore.v1beta1.ArrayValue array_value = 9; diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Write.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Write.java index c9b13787aff7..124e4186174a 100644 --- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Write.java +++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/Write.java @@ -322,9 +322,10 @@ public com.google.firestore.v1beta1.DocumentTransformOrBuilder getTransformOrBui *
    * The fields to update in this write.
    * This field can be set only when the operation is `update`.
-   * None of the field paths in the mask may contain a reserved name.
-   * If the document exists on the server and has fields not referenced in the
-   * mask, they are left unchanged.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
    * Fields referenced in the mask, but not present in the input document, are
    * deleted from the document on the server.
    * The field paths in this mask must not contain a reserved field name.
@@ -339,9 +340,10 @@ public boolean hasUpdateMask() {
    * 
    * The fields to update in this write.
    * This field can be set only when the operation is `update`.
-   * None of the field paths in the mask may contain a reserved name.
-   * If the document exists on the server and has fields not referenced in the
-   * mask, they are left unchanged.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
    * Fields referenced in the mask, but not present in the input document, are
    * deleted from the document on the server.
    * The field paths in this mask must not contain a reserved field name.
@@ -356,9 +358,10 @@ public com.google.firestore.v1beta1.DocumentMask getUpdateMask() {
    * 
    * The fields to update in this write.
    * This field can be set only when the operation is `update`.
-   * None of the field paths in the mask may contain a reserved name.
-   * If the document exists on the server and has fields not referenced in the
-   * mask, they are left unchanged.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
    * Fields referenced in the mask, but not present in the input document, are
    * deleted from the document on the server.
    * The field paths in this mask must not contain a reserved field name.
@@ -1348,9 +1351,10 @@ public com.google.firestore.v1beta1.DocumentTransformOrBuilder getTransformOrBui
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1365,9 +1369,10 @@ public boolean hasUpdateMask() {
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1386,9 +1391,10 @@ public com.google.firestore.v1beta1.DocumentMask getUpdateMask() {
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1413,9 +1419,10 @@ public Builder setUpdateMask(com.google.firestore.v1beta1.DocumentMask value) {
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1438,9 +1445,10 @@ public Builder setUpdateMask(
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1467,9 +1475,10 @@ public Builder mergeUpdateMask(com.google.firestore.v1beta1.DocumentMask value)
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1492,9 +1501,10 @@ public Builder clearUpdateMask() {
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1511,9 +1521,10 @@ public com.google.firestore.v1beta1.DocumentMask.Builder getUpdateMaskBuilder()
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
@@ -1533,9 +1544,10 @@ public com.google.firestore.v1beta1.DocumentMaskOrBuilder getUpdateMaskOrBuilder
      * 
      * The fields to update in this write.
      * This field can be set only when the operation is `update`.
-     * None of the field paths in the mask may contain a reserved name.
-     * If the document exists on the server and has fields not referenced in the
-     * mask, they are left unchanged.
+     * If the mask is not set for an `update` and the document exists, any
+     * existing data will be overwritten.
+     * If the mask is set and the document on the server has fields not covered by
+     * the mask, they are left unchanged.
      * Fields referenced in the mask, but not present in the input document, are
      * deleted from the document on the server.
      * The field paths in this mask must not contain a reserved field name.
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteOrBuilder.java
index 1983d1ca4b1d..70af1ca200f1 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteOrBuilder.java
@@ -90,9 +90,10 @@ public interface WriteOrBuilder extends
    * 
    * The fields to update in this write.
    * This field can be set only when the operation is `update`.
-   * None of the field paths in the mask may contain a reserved name.
-   * If the document exists on the server and has fields not referenced in the
-   * mask, they are left unchanged.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
    * Fields referenced in the mask, but not present in the input document, are
    * deleted from the document on the server.
    * The field paths in this mask must not contain a reserved field name.
@@ -105,9 +106,10 @@ public interface WriteOrBuilder extends
    * 
    * The fields to update in this write.
    * This field can be set only when the operation is `update`.
-   * None of the field paths in the mask may contain a reserved name.
-   * If the document exists on the server and has fields not referenced in the
-   * mask, they are left unchanged.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
    * Fields referenced in the mask, but not present in the input document, are
    * deleted from the document on the server.
    * The field paths in this mask must not contain a reserved field name.
@@ -120,9 +122,10 @@ public interface WriteOrBuilder extends
    * 
    * The fields to update in this write.
    * This field can be set only when the operation is `update`.
-   * None of the field paths in the mask may contain a reserved name.
-   * If the document exists on the server and has fields not referenced in the
-   * mask, they are left unchanged.
+   * If the mask is not set for an `update` and the document exists, any
+   * existing data will be overwritten.
+   * If the mask is set and the document on the server has fields not covered by
+   * the mask, they are left unchanged.
    * Fields referenced in the mask, but not present in the input document, are
    * deleted from the document on the server.
    * The field paths in this mask must not contain a reserved field name.
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java
index c24cb82386ff..c3995d62c01a 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/java/com/google/firestore/v1beta1/WriteProto.java
@@ -75,33 +75,37 @@ public static void registerAllExtensions(
       "pdate_mask\030\003 \001(\0132&.google.firestore.v1be" +
       "ta1.DocumentMask\022@\n\020current_document\030\004 \001" +
       "(\0132&.google.firestore.v1beta1.Preconditi" +
-      "onB\013\n\toperation\"\332\002\n\021DocumentTransform\022\020\n" +
+      "onB\013\n\toperation\"\352\003\n\021DocumentTransform\022\020\n" +
       "\010document\030\001 \001(\t\022T\n\020field_transforms\030\002 \003(" +
       "\0132:.google.firestore.v1beta1.DocumentTra" +
-      "nsform.FieldTransform\032\334\001\n\016FieldTransform" +
+      "nsform.FieldTransform\032\354\002\n\016FieldTransform" +
       "\022\022\n\nfield_path\030\001 \001(\t\022e\n\023set_to_server_va" +
       "lue\030\002 \001(\0162F.google.firestore.v1beta1.Doc" +
       "umentTransform.FieldTransform.ServerValu" +
-      "eH\000\"=\n\013ServerValue\022\034\n\030SERVER_VALUE_UNSPE" +
-      "CIFIED\020\000\022\020\n\014REQUEST_TIME\020\001B\020\n\016transform_" +
-      "type\"z\n\013WriteResult\022/\n\013update_time\030\001 \001(\013" +
-      "2\032.google.protobuf.Timestamp\022:\n\021transfor" +
-      "m_results\030\002 \003(\0132\037.google.firestore.v1bet" +
-      "a1.Value\"v\n\016DocumentChange\0224\n\010document\030\001" +
-      " \001(\0132\".google.firestore.v1beta1.Document" +
-      "\022\022\n\ntarget_ids\030\005 \003(\005\022\032\n\022removed_target_i" +
-      "ds\030\006 \003(\005\"m\n\016DocumentDelete\022\020\n\010document\030\001" +
-      " \001(\t\022\032\n\022removed_target_ids\030\006 \003(\005\022-\n\tread" +
-      "_time\030\004 \001(\0132\032.google.protobuf.Timestamp\"" +
-      "m\n\016DocumentRemove\022\020\n\010document\030\001 \001(\t\022\032\n\022r" +
-      "emoved_target_ids\030\002 \003(\005\022-\n\tread_time\030\004 \001" +
-      "(\0132\032.google.protobuf.Timestamp\"3\n\017Existe" +
-      "nceFilter\022\021\n\ttarget_id\030\001 \001(\005\022\r\n\005count\030\002 " +
-      "\001(\005B\270\001\n\034com.google.firestore.v1beta1B\nWr" +
-      "iteProtoP\001ZAgoogle.golang.org/genproto/g" +
-      "oogleapis/firestore/v1beta1;firestore\242\002\004" +
-      "GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036" +
-      "Google\\Cloud\\Firestore\\V1beta1b\006proto3"
+      "eH\000\022G\n\027append_missing_elements\030\006 \001(\0132$.g" +
+      "oogle.firestore.v1beta1.ArrayValueH\000\022E\n\025" +
+      "remove_all_from_array\030\007 \001(\0132$.google.fir" +
+      "estore.v1beta1.ArrayValueH\000\"=\n\013ServerVal" +
+      "ue\022\034\n\030SERVER_VALUE_UNSPECIFIED\020\000\022\020\n\014REQU" +
+      "EST_TIME\020\001B\020\n\016transform_type\"z\n\013WriteRes" +
+      "ult\022/\n\013update_time\030\001 \001(\0132\032.google.protob" +
+      "uf.Timestamp\022:\n\021transform_results\030\002 \003(\0132" +
+      "\037.google.firestore.v1beta1.Value\"v\n\016Docu" +
+      "mentChange\0224\n\010document\030\001 \001(\0132\".google.fi" +
+      "restore.v1beta1.Document\022\022\n\ntarget_ids\030\005" +
+      " \003(\005\022\032\n\022removed_target_ids\030\006 \003(\005\"m\n\016Docu" +
+      "mentDelete\022\020\n\010document\030\001 \001(\t\022\032\n\022removed_" +
+      "target_ids\030\006 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.go" +
+      "ogle.protobuf.Timestamp\"m\n\016DocumentRemov" +
+      "e\022\020\n\010document\030\001 \001(\t\022\032\n\022removed_target_id" +
+      "s\030\002 \003(\005\022-\n\tread_time\030\004 \001(\0132\032.google.prot" +
+      "obuf.Timestamp\"3\n\017ExistenceFilter\022\021\n\ttar" +
+      "get_id\030\001 \001(\005\022\r\n\005count\030\002 \001(\005B\270\001\n\034com.goog" +
+      "le.firestore.v1beta1B\nWriteProtoP\001ZAgoog" +
+      "le.golang.org/genproto/googleapis/firest" +
+      "ore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cl" +
+      "oud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Fir" +
+      "estore\\V1beta1b\006proto3"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
         new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
@@ -136,7 +140,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
     internal_static_google_firestore_v1beta1_DocumentTransform_FieldTransform_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_google_firestore_v1beta1_DocumentTransform_FieldTransform_descriptor,
-        new java.lang.String[] { "FieldPath", "SetToServerValue", "TransformType", });
+        new java.lang.String[] { "FieldPath", "SetToServerValue", "AppendMissingElements", "RemoveAllFromArray", "TransformType", });
     internal_static_google_firestore_v1beta1_WriteResult_descriptor =
       getDescriptor().getMessageTypes().get(2);
     internal_static_google_firestore_v1beta1_WriteResult_fieldAccessorTable = new
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto
index 1422c44853ef..d6b3dce03f1b 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/common.proto
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc.
+// Copyright 2018 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto
index 9ba580a3526d..aaa90516cd0c 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/document.proto
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc.
+// Copyright 2018 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ message Document {
   // The map keys represent field names.
   //
   // A simple field name contains only characters `a` to `z`, `A` to `Z`,
-  // `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example,
+  // `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
   // `foo_bar_17`.
   //
   // Field names matching the regular expression `__.*__` are reserved. Reserved
@@ -73,7 +73,7 @@ message Document {
 
   // Output only. The time at which the document was last changed.
   //
-  // This value is initally set to the `create_time` then increases
+  // This value is initially set to the `create_time` then increases
   // monotonically with each change to the document. It can also be
   // compared to values from other documents and the `read_time` of a query.
   google.protobuf.Timestamp update_time = 4;
@@ -123,7 +123,8 @@ message Value {
 
     // An array value.
     //
-    // Cannot contain another array value.
+    // Cannot directly contain another array value, though can contain an
+    // map which contains another array.
     ArrayValue array_value = 9;
 
     // A map value.
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto
index f8707198f000..7b6c8914b4c7 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/firestore.proto
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc.
+// Copyright 2018 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -32,11 +32,8 @@ option java_outer_classname = "FirestoreProto";
 option java_package = "com.google.firestore.v1beta1";
 option objc_class_prefix = "GCFS";
 option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
-
 // Specification of the Firestore API.
 
-
-
 // The Cloud Firestore service.
 //
 // This service exposes several types of comparable timestamps:
@@ -56,27 +53,39 @@ option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
 service Firestore {
   // Gets a single document.
   rpc GetDocument(GetDocumentRequest) returns (Document) {
-    option (google.api.http) = { get: "/v1beta1/{name=projects/*/databases/*/documents/*/**}" };
+    option (google.api.http) = {
+      get: "/v1beta1/{name=projects/*/databases/*/documents/*/**}"
+    };
   }
 
   // Lists documents.
   rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
-    option (google.api.http) = { get: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}" };
+    option (google.api.http) = {
+      get: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}"
+    };
   }
 
   // Creates a new document.
   rpc CreateDocument(CreateDocumentRequest) returns (Document) {
-    option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}" body: "document" };
+    option (google.api.http) = {
+      post: "/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}"
+      body: "document"
+    };
   }
 
   // Updates or inserts a document.
   rpc UpdateDocument(UpdateDocumentRequest) returns (Document) {
-    option (google.api.http) = { patch: "/v1beta1/{document.name=projects/*/databases/*/documents/*/**}" body: "document" };
+    option (google.api.http) = {
+      patch: "/v1beta1/{document.name=projects/*/databases/*/documents/*/**}"
+      body: "document"
+    };
   }
 
   // Deletes a document.
   rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
-    option (google.api.http) = { delete: "/v1beta1/{name=projects/*/databases/*/documents/*/**}" };
+    option (google.api.http) = {
+      delete: "/v1beta1/{name=projects/*/databases/*/documents/*/**}"
+    };
   }
 
   // Gets multiple documents.
@@ -84,42 +93,74 @@ service Firestore {
   // Documents returned by this method are not guaranteed to be returned in the
   // same order that they were requested.
   rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (stream BatchGetDocumentsResponse) {
-    option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:batchGet" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{database=projects/*/databases/*}/documents:batchGet"
+      body: "*"
+    };
   }
 
   // Starts a new transaction.
   rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) {
-    option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction"
+      body: "*"
+    };
   }
 
   // Commits a transaction, while optionally updating documents.
   rpc Commit(CommitRequest) returns (CommitResponse) {
-    option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:commit" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{database=projects/*/databases/*}/documents:commit"
+      body: "*"
+    };
   }
 
   // Rolls back a transaction.
   rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) {
-    option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:rollback" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{database=projects/*/databases/*}/documents:rollback"
+      body: "*"
+    };
   }
 
   // Runs a query.
   rpc RunQuery(RunQueryRequest) returns (stream RunQueryResponse) {
-    option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*/documents}:runQuery" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{parent=projects/*/databases/*/documents}:runQuery"
+      body: "*"
+      additional_bindings {
+        post: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}:runQuery"
+        body: "*"
+      }
+    };
   }
 
   // Streams batches of document updates and deletes, in order.
   rpc Write(stream WriteRequest) returns (stream WriteResponse) {
-    option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:write" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{database=projects/*/databases/*}/documents:write"
+      body: "*"
+    };
   }
 
   // Listens to changes.
   rpc Listen(stream ListenRequest) returns (stream ListenResponse) {
-    option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:listen" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{database=projects/*/databases/*}/documents:listen"
+      body: "*"
+    };
   }
 
   // Lists all the collection IDs underneath a document.
   rpc ListCollectionIds(ListCollectionIdsRequest) returns (ListCollectionIdsResponse) {
-    option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds" body: "*" };
+    option (google.api.http) = {
+      post: "/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds"
+      body: "*"
+      additional_bindings {
+        post: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds"
+        body: "*"
+      }
+    };
   }
 }
 
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto
index 215a5c294419..02d0aaaabd89 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/query.proto
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc.
+// Copyright 2018 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -99,6 +99,9 @@ message StructuredQuery {
 
       // Equal.
       EQUAL = 5;
+
+      // Contains. Requires that the field is an array.
+      ARRAY_CONTAINS = 7;
     }
 
     // The field to filter by.
diff --git a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto
index 02fdb1104b3f..9901e31010a2 100644
--- a/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto
+++ b/google-api-grpc/proto-google-cloud-firestore-v1beta1/src/main/proto/google/firestore/v1beta1/write.proto
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc.
+// Copyright 2018 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -51,9 +51,10 @@ message Write {
   // The fields to update in this write.
   //
   // This field can be set only when the operation is `update`.
-  // None of the field paths in the mask may contain a reserved name.
-  // If the document exists on the server and has fields not referenced in the
-  // mask, they are left unchanged.
+  // If the mask is not set for an `update` and the document exists, any
+  // existing data will be overwritten.
+  // If the mask is set and the document on the server has fields not covered by
+  // the mask, they are left unchanged.
   // Fields referenced in the mask, but not present in the input document, are
   // deleted from the document on the server.
   // The field paths in this mask must not contain a reserved field name.
@@ -87,6 +88,32 @@ message DocumentTransform {
     oneof transform_type {
       // Sets the field to the given server value.
       ServerValue set_to_server_value = 2;
+
+      // Append the given elements in order if they are not already present in
+      // the current field value.
+      // If the field is not an array, or if the field does not yet exist, it is
+      // first set to the empty array.
+      //
+      // Equivalent numbers of different types (e.g. 3L and 3.0) are
+      // considered equal when checking if a value is missing.
+      // NaN is equal to NaN, and Null is equal to Null.
+      // If the input contains multiple equivalent values, only the first will
+      // be considered.
+      //
+      // The corresponding transform_result will be the null value.
+      ArrayValue append_missing_elements = 6;
+
+      // Remove all of the given elements from the array in the field.
+      // If the field is not an array, or if the field does not yet exist, it is
+      // set to the empty array.
+      //
+      // Equivalent numbers of the different types (e.g. 3L and 3.0) are
+      // considered equal when deciding whether an element should be removed.
+      // NaN is equal to NaN, and Null is equal to Null.
+      // This will remove all equivalent values if there are duplicates.
+      //
+      // The corresponding transform_result will be the null value.
+      ArrayValue remove_all_from_array = 7;
     }
   }
 
diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java
index 9289801b5444..5a2a03039fb3 100644
--- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java
+++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java
@@ -309,11 +309,26 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .readRowsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming"));
+
+      builder
+          .sampleRowKeysSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .mutateRowSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder
+          .mutateRowsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .checkAndMutateRowSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java
index 700c7be5d262..90683ed7e4e2 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AccessConfig.java
@@ -28,6 +28,7 @@ public final class AccessConfig implements ApiMessage {
   private final String kind;
   private final String name;
   private final String natIP;
+  private final String networkTier;
   private final String publicPtrDomainName;
   private final Boolean setPublicPtr;
   private final String type;
@@ -36,6 +37,7 @@ private AccessConfig() {
     this.kind = null;
     this.name = null;
     this.natIP = null;
+    this.networkTier = null;
     this.publicPtrDomainName = null;
     this.setPublicPtr = null;
     this.type = null;
@@ -45,12 +47,14 @@ private AccessConfig(
       String kind,
       String name,
       String natIP,
+      String networkTier,
       String publicPtrDomainName,
       Boolean setPublicPtr,
       String type) {
     this.kind = kind;
     this.name = name;
     this.natIP = natIP;
+    this.networkTier = networkTier;
     this.publicPtrDomainName = publicPtrDomainName;
     this.setPublicPtr = setPublicPtr;
     this.type = type;
@@ -67,6 +71,9 @@ public Object getFieldValue(String fieldName) {
     if (fieldName.equals("natIP")) {
       return natIP;
     }
+    if (fieldName.equals("networkTier")) {
+      return networkTier;
+    }
     if (fieldName.equals("publicPtrDomainName")) {
       return publicPtrDomainName;
     }
@@ -103,6 +110,10 @@ public String getNatIP() {
     return natIP;
   }
 
+  public String getNetworkTier() {
+    return networkTier;
+  }
+
   public String getPublicPtrDomainName() {
     return publicPtrDomainName;
   }
@@ -141,6 +152,7 @@ public static class Builder {
     private String kind;
     private String name;
     private String natIP;
+    private String networkTier;
     private String publicPtrDomainName;
     private Boolean setPublicPtr;
     private String type;
@@ -158,6 +170,9 @@ public Builder mergeFrom(AccessConfig other) {
       if (other.getNatIP() != null) {
         this.natIP = other.natIP;
       }
+      if (other.getNetworkTier() != null) {
+        this.networkTier = other.networkTier;
+      }
       if (other.getPublicPtrDomainName() != null) {
         this.publicPtrDomainName = other.publicPtrDomainName;
       }
@@ -174,6 +189,7 @@ public Builder mergeFrom(AccessConfig other) {
       this.kind = source.kind;
       this.name = source.name;
       this.natIP = source.natIP;
+      this.networkTier = source.networkTier;
       this.publicPtrDomainName = source.publicPtrDomainName;
       this.setPublicPtr = source.setPublicPtr;
       this.type = source.type;
@@ -206,6 +222,15 @@ public Builder setNatIP(String natIP) {
       return this;
     }
 
+    public String getNetworkTier() {
+      return networkTier;
+    }
+
+    public Builder setNetworkTier(String networkTier) {
+      this.networkTier = networkTier;
+      return this;
+    }
+
     public String getPublicPtrDomainName() {
       return publicPtrDomainName;
     }
@@ -235,7 +260,8 @@ public Builder setType(String type) {
 
     public AccessConfig build() {
 
-      return new AccessConfig(kind, name, natIP, publicPtrDomainName, setPublicPtr, type);
+      return new AccessConfig(
+          kind, name, natIP, networkTier, publicPtrDomainName, setPublicPtr, type);
     }
 
     public Builder clone() {
@@ -243,6 +269,7 @@ public Builder clone() {
       newBuilder.setKind(this.kind);
       newBuilder.setName(this.name);
       newBuilder.setNatIP(this.natIP);
+      newBuilder.setNetworkTier(this.networkTier);
       newBuilder.setPublicPtrDomainName(this.publicPtrDomainName);
       newBuilder.setSetPublicPtr(this.setPublicPtr);
       newBuilder.setType(this.type);
@@ -262,6 +289,9 @@ public String toString() {
         + "natIP="
         + natIP
         + ", "
+        + "networkTier="
+        + networkTier
+        + ", "
         + "publicPtrDomainName="
         + publicPtrDomainName
         + ", "
@@ -283,6 +313,7 @@ public boolean equals(Object o) {
       return Objects.equals(this.kind, that.getKind())
           && Objects.equals(this.name, that.getName())
           && Objects.equals(this.natIP, that.getNatIP())
+          && Objects.equals(this.networkTier, that.getNetworkTier())
           && Objects.equals(this.publicPtrDomainName, that.getPublicPtrDomainName())
           && Objects.equals(this.setPublicPtr, that.getSetPublicPtr())
           && Objects.equals(this.type, that.getType());
@@ -292,6 +323,6 @@ public boolean equals(Object o) {
 
   @Override
   public int hashCode() {
-    return Objects.hash(kind, name, natIP, publicPtrDomainName, setPublicPtr, type);
+    return Objects.hash(kind, name, natIP, networkTier, publicPtrDomainName, setPublicPtr, type);
   }
 }
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddNodesNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddNodesNodeGroupHttpRequest.java
new file mode 100644
index 000000000000..f984ccaa9be4
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddNodesNodeGroupHttpRequest.java
@@ -0,0 +1,447 @@
+/*
+ * Copyright 2018 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 AddNodesNodeGroupHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeGroup;
+  private final NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private AddNodesNodeGroupHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeGroup = null;
+    this.nodeGroupsAddNodesRequestResource = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private AddNodesNodeGroupHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeGroup,
+      NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeGroup = nodeGroup;
+    this.nodeGroupsAddNodesRequestResource = nodeGroupsAddNodesRequestResource;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeGroup")) {
+      return nodeGroup;
+    }
+    if (fieldName.equals("nodeGroupsAddNodesRequestResource")) {
+      return nodeGroupsAddNodesRequestResource;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public NodeGroupsAddNodesRequest getApiMessageRequestBody() {
+    return nodeGroupsAddNodesRequestResource;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeGroup() {
+    return nodeGroup;
+  }
+
+  public NodeGroupsAddNodesRequest getNodeGroupsAddNodesRequestResource() {
+    return nodeGroupsAddNodesRequestResource;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(AddNodesNodeGroupHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static AddNodesNodeGroupHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final AddNodesNodeGroupHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new AddNodesNodeGroupHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeGroup;
+    private NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(AddNodesNodeGroupHttpRequest other) {
+      if (other == AddNodesNodeGroupHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeGroup() != null) {
+        this.nodeGroup = other.nodeGroup;
+      }
+      if (other.getNodeGroupsAddNodesRequestResource() != null) {
+        this.nodeGroupsAddNodesRequestResource = other.nodeGroupsAddNodesRequestResource;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(AddNodesNodeGroupHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeGroup = source.nodeGroup;
+      this.nodeGroupsAddNodesRequestResource = source.nodeGroupsAddNodesRequestResource;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeGroup() {
+      return nodeGroup;
+    }
+
+    public Builder setNodeGroup(String nodeGroup) {
+      this.nodeGroup = nodeGroup;
+      return this;
+    }
+
+    public NodeGroupsAddNodesRequest getNodeGroupsAddNodesRequestResource() {
+      return nodeGroupsAddNodesRequestResource;
+    }
+
+    public Builder setNodeGroupsAddNodesRequestResource(
+        NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource) {
+      this.nodeGroupsAddNodesRequestResource = nodeGroupsAddNodesRequestResource;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public AddNodesNodeGroupHttpRequest build() {
+      String missing = "";
+
+      if (nodeGroup == null) {
+        missing += " nodeGroup";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new AddNodesNodeGroupHttpRequest(
+          access_token,
+          callback,
+          fields,
+          key,
+          nodeGroup,
+          nodeGroupsAddNodesRequestResource,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeGroup(this.nodeGroup);
+      newBuilder.setNodeGroupsAddNodesRequestResource(this.nodeGroupsAddNodesRequestResource);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "AddNodesNodeGroupHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeGroup="
+        + nodeGroup
+        + ", "
+        + "nodeGroupsAddNodesRequestResource="
+        + nodeGroupsAddNodesRequestResource
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof AddNodesNodeGroupHttpRequest) {
+      AddNodesNodeGroupHttpRequest that = (AddNodesNodeGroupHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeGroup, that.getNodeGroup())
+          && Objects.equals(
+              this.nodeGroupsAddNodesRequestResource, that.getNodeGroupsAddNodesRequestResource())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        key,
+        nodeGroup,
+        nodeGroupsAddNodesRequestResource,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddSignedUrlKeyBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddSignedUrlKeyBackendBucketHttpRequest.java
new file mode 100644
index 000000000000..99c013647841
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddSignedUrlKeyBackendBucketHttpRequest.java
@@ -0,0 +1,445 @@
+/*
+ * Copyright 2018 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 AddSignedUrlKeyBackendBucketHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String backendBucket;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final SignedUrlKey signedUrlKeyResource;
+  private final String userIp;
+
+  private AddSignedUrlKeyBackendBucketHttpRequest() {
+    this.access_token = null;
+    this.backendBucket = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.signedUrlKeyResource = null;
+    this.userIp = null;
+  }
+
+  private AddSignedUrlKeyBackendBucketHttpRequest(
+      String access_token,
+      String backendBucket,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      SignedUrlKey signedUrlKeyResource,
+      String userIp) {
+    this.access_token = access_token;
+    this.backendBucket = backendBucket;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.signedUrlKeyResource = signedUrlKeyResource;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("backendBucket")) {
+      return backendBucket;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("signedUrlKeyResource")) {
+      return signedUrlKeyResource;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public SignedUrlKey getApiMessageRequestBody() {
+    return signedUrlKeyResource;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getBackendBucket() {
+    return backendBucket;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public SignedUrlKey getSignedUrlKeyResource() {
+    return signedUrlKeyResource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(AddSignedUrlKeyBackendBucketHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static AddSignedUrlKeyBackendBucketHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final AddSignedUrlKeyBackendBucketHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new AddSignedUrlKeyBackendBucketHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String backendBucket;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private SignedUrlKey signedUrlKeyResource;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(AddSignedUrlKeyBackendBucketHttpRequest other) {
+      if (other == AddSignedUrlKeyBackendBucketHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getBackendBucket() != null) {
+        this.backendBucket = other.backendBucket;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getSignedUrlKeyResource() != null) {
+        this.signedUrlKeyResource = other.signedUrlKeyResource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(AddSignedUrlKeyBackendBucketHttpRequest source) {
+      this.access_token = source.access_token;
+      this.backendBucket = source.backendBucket;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.signedUrlKeyResource = source.signedUrlKeyResource;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getBackendBucket() {
+      return backendBucket;
+    }
+
+    public Builder setBackendBucket(String backendBucket) {
+      this.backendBucket = backendBucket;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public SignedUrlKey getSignedUrlKeyResource() {
+      return signedUrlKeyResource;
+    }
+
+    public Builder setSignedUrlKeyResource(SignedUrlKey signedUrlKeyResource) {
+      this.signedUrlKeyResource = signedUrlKeyResource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public AddSignedUrlKeyBackendBucketHttpRequest build() {
+      String missing = "";
+
+      if (backendBucket == null) {
+        missing += " backendBucket";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new AddSignedUrlKeyBackendBucketHttpRequest(
+          access_token,
+          backendBucket,
+          callback,
+          fields,
+          key,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          signedUrlKeyResource,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setBackendBucket(this.backendBucket);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setSignedUrlKeyResource(this.signedUrlKeyResource);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "AddSignedUrlKeyBackendBucketHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "backendBucket="
+        + backendBucket
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "signedUrlKeyResource="
+        + signedUrlKeyResource
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof AddSignedUrlKeyBackendBucketHttpRequest) {
+      AddSignedUrlKeyBackendBucketHttpRequest that = (AddSignedUrlKeyBackendBucketHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.backendBucket, that.getBackendBucket())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.signedUrlKeyResource, that.getSignedUrlKeyResource())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        backendBucket,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        signedUrlKeyResource,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddSignedUrlKeyBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddSignedUrlKeyBackendServiceHttpRequest.java
new file mode 100644
index 000000000000..8a77b832bbc6
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AddSignedUrlKeyBackendServiceHttpRequest.java
@@ -0,0 +1,445 @@
+/*
+ * Copyright 2018 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 AddSignedUrlKeyBackendServiceHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String backendService;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final SignedUrlKey signedUrlKeyResource;
+  private final String userIp;
+
+  private AddSignedUrlKeyBackendServiceHttpRequest() {
+    this.access_token = null;
+    this.backendService = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.signedUrlKeyResource = null;
+    this.userIp = null;
+  }
+
+  private AddSignedUrlKeyBackendServiceHttpRequest(
+      String access_token,
+      String backendService,
+      String callback,
+      String fields,
+      String key,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      SignedUrlKey signedUrlKeyResource,
+      String userIp) {
+    this.access_token = access_token;
+    this.backendService = backendService;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.signedUrlKeyResource = signedUrlKeyResource;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("backendService")) {
+      return backendService;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("signedUrlKeyResource")) {
+      return signedUrlKeyResource;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public SignedUrlKey getApiMessageRequestBody() {
+    return signedUrlKeyResource;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getBackendService() {
+    return backendService;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public SignedUrlKey getSignedUrlKeyResource() {
+    return signedUrlKeyResource;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(AddSignedUrlKeyBackendServiceHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static AddSignedUrlKeyBackendServiceHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final AddSignedUrlKeyBackendServiceHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new AddSignedUrlKeyBackendServiceHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String backendService;
+    private String callback;
+    private String fields;
+    private String key;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private SignedUrlKey signedUrlKeyResource;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(AddSignedUrlKeyBackendServiceHttpRequest other) {
+      if (other == AddSignedUrlKeyBackendServiceHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getBackendService() != null) {
+        this.backendService = other.backendService;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getSignedUrlKeyResource() != null) {
+        this.signedUrlKeyResource = other.signedUrlKeyResource;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(AddSignedUrlKeyBackendServiceHttpRequest source) {
+      this.access_token = source.access_token;
+      this.backendService = source.backendService;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.signedUrlKeyResource = source.signedUrlKeyResource;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getBackendService() {
+      return backendService;
+    }
+
+    public Builder setBackendService(String backendService) {
+      this.backendService = backendService;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public SignedUrlKey getSignedUrlKeyResource() {
+      return signedUrlKeyResource;
+    }
+
+    public Builder setSignedUrlKeyResource(SignedUrlKey signedUrlKeyResource) {
+      this.signedUrlKeyResource = signedUrlKeyResource;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public AddSignedUrlKeyBackendServiceHttpRequest build() {
+      String missing = "";
+
+      if (backendService == null) {
+        missing += " backendService";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new AddSignedUrlKeyBackendServiceHttpRequest(
+          access_token,
+          backendService,
+          callback,
+          fields,
+          key,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          signedUrlKeyResource,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setBackendService(this.backendService);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setSignedUrlKeyResource(this.signedUrlKeyResource);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "AddSignedUrlKeyBackendServiceHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "backendService="
+        + backendService
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "signedUrlKeyResource="
+        + signedUrlKeyResource
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof AddSignedUrlKeyBackendServiceHttpRequest) {
+      AddSignedUrlKeyBackendServiceHttpRequest that = (AddSignedUrlKeyBackendServiceHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.backendService, that.getBackendService())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.signedUrlKeyResource, that.getSignedUrlKeyResource())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        backendService,
+        callback,
+        fields,
+        key,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        signedUrlKeyResource,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java
index a9e258b8051e..c887c8d4f20b 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Address.java
@@ -34,6 +34,7 @@ public final class Address implements ApiMessage {
   private final String ipVersion;
   private final String kind;
   private final String name;
+  private final String networkTier;
   private final String region;
   private final String selfLink;
   private final String status;
@@ -49,6 +50,7 @@ private Address() {
     this.ipVersion = null;
     this.kind = null;
     this.name = null;
+    this.networkTier = null;
     this.region = null;
     this.selfLink = null;
     this.status = null;
@@ -65,6 +67,7 @@ private Address(
       String ipVersion,
       String kind,
       String name,
+      String networkTier,
       String region,
       String selfLink,
       String status,
@@ -78,6 +81,7 @@ private Address(
     this.ipVersion = ipVersion;
     this.kind = kind;
     this.name = name;
+    this.networkTier = networkTier;
     this.region = region;
     this.selfLink = selfLink;
     this.status = status;
@@ -111,6 +115,9 @@ public Object getFieldValue(String fieldName) {
     if (fieldName.equals("name")) {
       return name;
     }
+    if (fieldName.equals("networkTier")) {
+      return networkTier;
+    }
     if (fieldName.equals("region")) {
       return region;
     }
@@ -173,6 +180,10 @@ public String getName() {
     return name;
   }
 
+  public String getNetworkTier() {
+    return networkTier;
+  }
+
   public String getRegion() {
     return region;
   }
@@ -224,6 +235,7 @@ public static class Builder {
     private String ipVersion;
     private String kind;
     private String name;
+    private String networkTier;
     private String region;
     private String selfLink;
     private String status;
@@ -258,6 +270,9 @@ public Builder mergeFrom(Address other) {
       if (other.getName() != null) {
         this.name = other.name;
       }
+      if (other.getNetworkTier() != null) {
+        this.networkTier = other.networkTier;
+      }
       if (other.getRegion() != null) {
         this.region = other.region;
       }
@@ -285,6 +300,7 @@ public Builder mergeFrom(Address other) {
       this.ipVersion = source.ipVersion;
       this.kind = source.kind;
       this.name = source.name;
+      this.networkTier = source.networkTier;
       this.region = source.region;
       this.selfLink = source.selfLink;
       this.status = source.status;
@@ -364,6 +380,15 @@ public Builder setName(String name) {
       return this;
     }
 
+    public String getNetworkTier() {
+      return networkTier;
+    }
+
+    public Builder setNetworkTier(String networkTier) {
+      this.networkTier = networkTier;
+      return this;
+    }
+
     public String getRegion() {
       return region;
     }
@@ -431,6 +456,7 @@ public Address build() {
           ipVersion,
           kind,
           name,
+          networkTier,
           region,
           selfLink,
           status,
@@ -448,6 +474,7 @@ public Builder clone() {
       newBuilder.setIpVersion(this.ipVersion);
       newBuilder.setKind(this.kind);
       newBuilder.setName(this.name);
+      newBuilder.setNetworkTier(this.networkTier);
       newBuilder.setRegion(this.region);
       newBuilder.setSelfLink(this.selfLink);
       newBuilder.setStatus(this.status);
@@ -484,6 +511,9 @@ public String toString() {
         + "name="
         + name
         + ", "
+        + "networkTier="
+        + networkTier
+        + ", "
         + "region="
         + region
         + ", "
@@ -516,6 +546,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.ipVersion, that.getIpVersion())
           && Objects.equals(this.kind, that.getKind())
           && Objects.equals(this.name, that.getName())
+          && Objects.equals(this.networkTier, that.getNetworkTier())
           && Objects.equals(this.region, that.getRegion())
           && Objects.equals(this.selfLink, that.getSelfLink())
           && Objects.equals(this.status, that.getStatus())
@@ -536,6 +567,7 @@ public int hashCode() {
         ipVersion,
         kind,
         name,
+        networkTier,
         region,
         selfLink,
         status,
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeGroupsHttpRequest.java
new file mode 100644
index 000000000000..ffe75ac0e191
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeGroupsHttpRequest.java
@@ -0,0 +1,509 @@
+/*
+ * Copyright 2018 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 AggregatedListNodeGroupsHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String filter;
+  private final String key;
+  private final Integer maxResults;
+  private final String orderBy;
+  private final String pageToken;
+  private final String prettyPrint;
+  private final String project;
+  private final String quotaUser;
+  private final String userIp;
+
+  private AggregatedListNodeGroupsHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.filter = null;
+    this.key = null;
+    this.maxResults = null;
+    this.orderBy = null;
+    this.pageToken = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+  private AggregatedListNodeGroupsHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String filter,
+      String key,
+      Integer maxResults,
+      String orderBy,
+      String pageToken,
+      String prettyPrint,
+      String project,
+      String quotaUser,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.filter = filter;
+    this.key = key;
+    this.maxResults = maxResults;
+    this.orderBy = orderBy;
+    this.pageToken = pageToken;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("filter")) {
+      return filter;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("maxResults")) {
+      return maxResults;
+    }
+    if (fieldName.equals("orderBy")) {
+      return orderBy;
+    }
+    if (fieldName.equals("pageToken")) {
+      return pageToken;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("project")) {
+      return project;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getFilter() {
+    return filter;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public Integer getMaxResults() {
+    return maxResults;
+  }
+
+  public String getOrderBy() {
+    return orderBy;
+  }
+
+  public String getPageToken() {
+    return pageToken;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(AggregatedListNodeGroupsHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static AggregatedListNodeGroupsHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final AggregatedListNodeGroupsHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new AggregatedListNodeGroupsHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String filter;
+    private String key;
+    private Integer maxResults;
+    private String orderBy;
+    private String pageToken;
+    private String prettyPrint;
+    private String project;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(AggregatedListNodeGroupsHttpRequest other) {
+      if (other == AggregatedListNodeGroupsHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getFilter() != null) {
+        this.filter = other.filter;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getMaxResults() != null) {
+        this.maxResults = other.maxResults;
+      }
+      if (other.getOrderBy() != null) {
+        this.orderBy = other.orderBy;
+      }
+      if (other.getPageToken() != null) {
+        this.pageToken = other.pageToken;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(AggregatedListNodeGroupsHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.filter = source.filter;
+      this.key = source.key;
+      this.maxResults = source.maxResults;
+      this.orderBy = source.orderBy;
+      this.pageToken = source.pageToken;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getFilter() {
+      return filter;
+    }
+
+    public Builder setFilter(String filter) {
+      this.filter = filter;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public Integer getMaxResults() {
+      return maxResults;
+    }
+
+    public Builder setMaxResults(Integer maxResults) {
+      this.maxResults = maxResults;
+      return this;
+    }
+
+    public String getOrderBy() {
+      return orderBy;
+    }
+
+    public Builder setOrderBy(String orderBy) {
+      this.orderBy = orderBy;
+      return this;
+    }
+
+    public String getPageToken() {
+      return pageToken;
+    }
+
+    public Builder setPageToken(String pageToken) {
+      this.pageToken = pageToken;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public AggregatedListNodeGroupsHttpRequest build() {
+      String missing = "";
+
+      if (project == null) {
+        missing += " project";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new AggregatedListNodeGroupsHttpRequest(
+          access_token,
+          callback,
+          fields,
+          filter,
+          key,
+          maxResults,
+          orderBy,
+          pageToken,
+          prettyPrint,
+          project,
+          quotaUser,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setFilter(this.filter);
+      newBuilder.setKey(this.key);
+      newBuilder.setMaxResults(this.maxResults);
+      newBuilder.setOrderBy(this.orderBy);
+      newBuilder.setPageToken(this.pageToken);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "AggregatedListNodeGroupsHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "filter="
+        + filter
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "maxResults="
+        + maxResults
+        + ", "
+        + "orderBy="
+        + orderBy
+        + ", "
+        + "pageToken="
+        + pageToken
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "project="
+        + project
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof AggregatedListNodeGroupsHttpRequest) {
+      AggregatedListNodeGroupsHttpRequest that = (AggregatedListNodeGroupsHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.filter, that.getFilter())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.maxResults, that.getMaxResults())
+          && Objects.equals(this.orderBy, that.getOrderBy())
+          && Objects.equals(this.pageToken, that.getPageToken())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.project, that.getProject())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        filter,
+        key,
+        maxResults,
+        orderBy,
+        pageToken,
+        prettyPrint,
+        project,
+        quotaUser,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeTemplatesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeTemplatesHttpRequest.java
new file mode 100644
index 000000000000..b17e455ab68a
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeTemplatesHttpRequest.java
@@ -0,0 +1,509 @@
+/*
+ * Copyright 2018 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 AggregatedListNodeTemplatesHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String filter;
+  private final String key;
+  private final Integer maxResults;
+  private final String orderBy;
+  private final String pageToken;
+  private final String prettyPrint;
+  private final String project;
+  private final String quotaUser;
+  private final String userIp;
+
+  private AggregatedListNodeTemplatesHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.filter = null;
+    this.key = null;
+    this.maxResults = null;
+    this.orderBy = null;
+    this.pageToken = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+  private AggregatedListNodeTemplatesHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String filter,
+      String key,
+      Integer maxResults,
+      String orderBy,
+      String pageToken,
+      String prettyPrint,
+      String project,
+      String quotaUser,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.filter = filter;
+    this.key = key;
+    this.maxResults = maxResults;
+    this.orderBy = orderBy;
+    this.pageToken = pageToken;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("filter")) {
+      return filter;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("maxResults")) {
+      return maxResults;
+    }
+    if (fieldName.equals("orderBy")) {
+      return orderBy;
+    }
+    if (fieldName.equals("pageToken")) {
+      return pageToken;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("project")) {
+      return project;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getFilter() {
+    return filter;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public Integer getMaxResults() {
+    return maxResults;
+  }
+
+  public String getOrderBy() {
+    return orderBy;
+  }
+
+  public String getPageToken() {
+    return pageToken;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(AggregatedListNodeTemplatesHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static AggregatedListNodeTemplatesHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final AggregatedListNodeTemplatesHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new AggregatedListNodeTemplatesHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String filter;
+    private String key;
+    private Integer maxResults;
+    private String orderBy;
+    private String pageToken;
+    private String prettyPrint;
+    private String project;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(AggregatedListNodeTemplatesHttpRequest other) {
+      if (other == AggregatedListNodeTemplatesHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getFilter() != null) {
+        this.filter = other.filter;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getMaxResults() != null) {
+        this.maxResults = other.maxResults;
+      }
+      if (other.getOrderBy() != null) {
+        this.orderBy = other.orderBy;
+      }
+      if (other.getPageToken() != null) {
+        this.pageToken = other.pageToken;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(AggregatedListNodeTemplatesHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.filter = source.filter;
+      this.key = source.key;
+      this.maxResults = source.maxResults;
+      this.orderBy = source.orderBy;
+      this.pageToken = source.pageToken;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getFilter() {
+      return filter;
+    }
+
+    public Builder setFilter(String filter) {
+      this.filter = filter;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public Integer getMaxResults() {
+      return maxResults;
+    }
+
+    public Builder setMaxResults(Integer maxResults) {
+      this.maxResults = maxResults;
+      return this;
+    }
+
+    public String getOrderBy() {
+      return orderBy;
+    }
+
+    public Builder setOrderBy(String orderBy) {
+      this.orderBy = orderBy;
+      return this;
+    }
+
+    public String getPageToken() {
+      return pageToken;
+    }
+
+    public Builder setPageToken(String pageToken) {
+      this.pageToken = pageToken;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public AggregatedListNodeTemplatesHttpRequest build() {
+      String missing = "";
+
+      if (project == null) {
+        missing += " project";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new AggregatedListNodeTemplatesHttpRequest(
+          access_token,
+          callback,
+          fields,
+          filter,
+          key,
+          maxResults,
+          orderBy,
+          pageToken,
+          prettyPrint,
+          project,
+          quotaUser,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setFilter(this.filter);
+      newBuilder.setKey(this.key);
+      newBuilder.setMaxResults(this.maxResults);
+      newBuilder.setOrderBy(this.orderBy);
+      newBuilder.setPageToken(this.pageToken);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "AggregatedListNodeTemplatesHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "filter="
+        + filter
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "maxResults="
+        + maxResults
+        + ", "
+        + "orderBy="
+        + orderBy
+        + ", "
+        + "pageToken="
+        + pageToken
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "project="
+        + project
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof AggregatedListNodeTemplatesHttpRequest) {
+      AggregatedListNodeTemplatesHttpRequest that = (AggregatedListNodeTemplatesHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.filter, that.getFilter())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.maxResults, that.getMaxResults())
+          && Objects.equals(this.orderBy, that.getOrderBy())
+          && Objects.equals(this.pageToken, that.getPageToken())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.project, that.getProject())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        filter,
+        key,
+        maxResults,
+        orderBy,
+        pageToken,
+        prettyPrint,
+        project,
+        quotaUser,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeTypesHttpRequest.java
new file mode 100644
index 000000000000..7c1a7e48d59f
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AggregatedListNodeTypesHttpRequest.java
@@ -0,0 +1,509 @@
+/*
+ * Copyright 2018 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 AggregatedListNodeTypesHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String filter;
+  private final String key;
+  private final Integer maxResults;
+  private final String orderBy;
+  private final String pageToken;
+  private final String prettyPrint;
+  private final String project;
+  private final String quotaUser;
+  private final String userIp;
+
+  private AggregatedListNodeTypesHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.filter = null;
+    this.key = null;
+    this.maxResults = null;
+    this.orderBy = null;
+    this.pageToken = null;
+    this.prettyPrint = null;
+    this.project = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+  private AggregatedListNodeTypesHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String filter,
+      String key,
+      Integer maxResults,
+      String orderBy,
+      String pageToken,
+      String prettyPrint,
+      String project,
+      String quotaUser,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.filter = filter;
+    this.key = key;
+    this.maxResults = maxResults;
+    this.orderBy = orderBy;
+    this.pageToken = pageToken;
+    this.prettyPrint = prettyPrint;
+    this.project = project;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("filter")) {
+      return filter;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("maxResults")) {
+      return maxResults;
+    }
+    if (fieldName.equals("orderBy")) {
+      return orderBy;
+    }
+    if (fieldName.equals("pageToken")) {
+      return pageToken;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("project")) {
+      return project;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getFilter() {
+    return filter;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public Integer getMaxResults() {
+    return maxResults;
+  }
+
+  public String getOrderBy() {
+    return orderBy;
+  }
+
+  public String getPageToken() {
+    return pageToken;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getProject() {
+    return project;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(AggregatedListNodeTypesHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static AggregatedListNodeTypesHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final AggregatedListNodeTypesHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new AggregatedListNodeTypesHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String filter;
+    private String key;
+    private Integer maxResults;
+    private String orderBy;
+    private String pageToken;
+    private String prettyPrint;
+    private String project;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(AggregatedListNodeTypesHttpRequest other) {
+      if (other == AggregatedListNodeTypesHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getFilter() != null) {
+        this.filter = other.filter;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getMaxResults() != null) {
+        this.maxResults = other.maxResults;
+      }
+      if (other.getOrderBy() != null) {
+        this.orderBy = other.orderBy;
+      }
+      if (other.getPageToken() != null) {
+        this.pageToken = other.pageToken;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getProject() != null) {
+        this.project = other.project;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(AggregatedListNodeTypesHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.filter = source.filter;
+      this.key = source.key;
+      this.maxResults = source.maxResults;
+      this.orderBy = source.orderBy;
+      this.pageToken = source.pageToken;
+      this.prettyPrint = source.prettyPrint;
+      this.project = source.project;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getFilter() {
+      return filter;
+    }
+
+    public Builder setFilter(String filter) {
+      this.filter = filter;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public Integer getMaxResults() {
+      return maxResults;
+    }
+
+    public Builder setMaxResults(Integer maxResults) {
+      this.maxResults = maxResults;
+      return this;
+    }
+
+    public String getOrderBy() {
+      return orderBy;
+    }
+
+    public Builder setOrderBy(String orderBy) {
+      this.orderBy = orderBy;
+      return this;
+    }
+
+    public String getPageToken() {
+      return pageToken;
+    }
+
+    public Builder setPageToken(String pageToken) {
+      this.pageToken = pageToken;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getProject() {
+      return project;
+    }
+
+    public Builder setProject(String project) {
+      this.project = project;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public AggregatedListNodeTypesHttpRequest build() {
+      String missing = "";
+
+      if (project == null) {
+        missing += " project";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new AggregatedListNodeTypesHttpRequest(
+          access_token,
+          callback,
+          fields,
+          filter,
+          key,
+          maxResults,
+          orderBy,
+          pageToken,
+          prettyPrint,
+          project,
+          quotaUser,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setFilter(this.filter);
+      newBuilder.setKey(this.key);
+      newBuilder.setMaxResults(this.maxResults);
+      newBuilder.setOrderBy(this.orderBy);
+      newBuilder.setPageToken(this.pageToken);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setProject(this.project);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "AggregatedListNodeTypesHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "filter="
+        + filter
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "maxResults="
+        + maxResults
+        + ", "
+        + "orderBy="
+        + orderBy
+        + ", "
+        + "pageToken="
+        + pageToken
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "project="
+        + project
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof AggregatedListNodeTypesHttpRequest) {
+      AggregatedListNodeTypesHttpRequest that = (AggregatedListNodeTypesHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.filter, that.getFilter())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.maxResults, that.getMaxResults())
+          && Objects.equals(this.orderBy, that.getOrderBy())
+          && Objects.equals(this.pageToken, that.getPageToken())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.project, that.getProject())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        filter,
+        key,
+        maxResults,
+        orderBy,
+        pageToken,
+        prettyPrint,
+        project,
+        quotaUser,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java
index de81f2a92f73..8d0bc786521b 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java
@@ -43,7 +43,8 @@
  * 
  * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
  *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
- *   Operation response = backendBucketClient.deleteBackendBucket(backendBucket);
+ *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+ *   Operation response = backendBucketClient.addSignedUrlKeyBackendBucket(backendBucket, signedUrlKeyResource);
  * }
  * 
  * 
@@ -152,6 +153,123 @@ public BackendBucketStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   Operation response = backendBucketClient.addSignedUrlKeyBackendBucket(backendBucket, signedUrlKeyResource);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param signedUrlKeyResource Represents a customer-supplied Signing Key used by Cloud CDN Signed + * URLs + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addSignedUrlKeyBackendBucket( + ProjectGlobalBackendBucketName backendBucket, SignedUrlKey signedUrlKeyResource) { + + AddSignedUrlKeyBackendBucketHttpRequest request = + AddSignedUrlKeyBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setSignedUrlKeyResource(signedUrlKeyResource) + .build(); + return addSignedUrlKeyBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   Operation response = backendBucketClient.addSignedUrlKeyBackendBucket(backendBucket.toString(), signedUrlKeyResource);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param signedUrlKeyResource Represents a customer-supplied Signing Key used by Cloud CDN Signed + * URLs + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addSignedUrlKeyBackendBucket( + String backendBucket, SignedUrlKey signedUrlKeyResource) { + + AddSignedUrlKeyBackendBucketHttpRequest request = + AddSignedUrlKeyBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket) + .setSignedUrlKeyResource(signedUrlKeyResource) + .build(); + return addSignedUrlKeyBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   AddSignedUrlKeyBackendBucketHttpRequest request = AddSignedUrlKeyBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setSignedUrlKeyResource(signedUrlKeyResource)
+   *     .build();
+   *   Operation response = backendBucketClient.addSignedUrlKeyBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addSignedUrlKeyBackendBucket( + AddSignedUrlKeyBackendBucketHttpRequest request) { + return addSignedUrlKeyBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   AddSignedUrlKeyBackendBucketHttpRequest request = AddSignedUrlKeyBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setSignedUrlKeyResource(signedUrlKeyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendBucketClient.addSignedUrlKeyBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + addSignedUrlKeyBackendBucketCallable() { + return stub.addSignedUrlKeyBackendBucketCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes the specified BackendBucket resource. @@ -250,6 +368,120 @@ public final Operation deleteBackendBucket(DeleteBackendBucketHttpRequest reques return stub.deleteBackendBucketCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String keyName = "";
+   *   Operation response = backendBucketClient.deleteSignedUrlKeyBackendBucket(backendBucket, keyName);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param keyName The name of the Signed URL Key to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSignedUrlKeyBackendBucket( + ProjectGlobalBackendBucketName backendBucket, String keyName) { + + DeleteSignedUrlKeyBackendBucketHttpRequest request = + DeleteSignedUrlKeyBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket == null ? null : backendBucket.toString()) + .setKeyName(keyName) + .build(); + return deleteSignedUrlKeyBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String keyName = "";
+   *   Operation response = backendBucketClient.deleteSignedUrlKeyBackendBucket(backendBucket.toString(), keyName);
+   * }
+   * 
+ * + * @param backendBucket Name of the BackendBucket resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param keyName The name of the Signed URL Key to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSignedUrlKeyBackendBucket(String backendBucket, String keyName) { + + DeleteSignedUrlKeyBackendBucketHttpRequest request = + DeleteSignedUrlKeyBackendBucketHttpRequest.newBuilder() + .setBackendBucket(backendBucket) + .setKeyName(keyName) + .build(); + return deleteSignedUrlKeyBackendBucket(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String keyName = "";
+   *   DeleteSignedUrlKeyBackendBucketHttpRequest request = DeleteSignedUrlKeyBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setKeyName(keyName)
+   *     .build();
+   *   Operation response = backendBucketClient.deleteSignedUrlKeyBackendBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSignedUrlKeyBackendBucket( + DeleteSignedUrlKeyBackendBucketHttpRequest request) { + return deleteSignedUrlKeyBackendBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + *

Sample code: + * + *


+   * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
+   *   ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]");
+   *   String keyName = "";
+   *   DeleteSignedUrlKeyBackendBucketHttpRequest request = DeleteSignedUrlKeyBackendBucketHttpRequest.newBuilder()
+   *     .setBackendBucket(backendBucket.toString())
+   *     .setKeyName(keyName)
+   *     .build();
+   *   ApiFuture<Operation> future = backendBucketClient.deleteSignedUrlKeyBackendBucketCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + deleteSignedUrlKeyBackendBucketCallable() { + return stub.deleteSignedUrlKeyBackendBucketCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns the specified BackendBucket resource. Gets a list of available backend buckets by diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java index 1e47fbf5864d..2610369f2a1e 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketSettings.java @@ -48,13 +48,13 @@ * *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteBackendBucket to 30 seconds: + * example, to set the total timeout of addSignedUrlKeyBackendBucket to 30 seconds: * *

  * 
  * BackendBucketSettings.Builder backendBucketSettingsBuilder =
  *     BackendBucketSettings.newBuilder();
- * backendBucketSettingsBuilder.deleteBackendBucketSettings().getRetrySettings().toBuilder()
+ * backendBucketSettingsBuilder.addSignedUrlKeyBackendBucketSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * BackendBucketSettings backendBucketSettings = backendBucketSettingsBuilder.build();
  * 
@@ -63,12 +63,25 @@
 @Generated("by gapic-generator")
 @BetaApi
 public class BackendBucketSettings extends ClientSettings {
+  /** Returns the object with the settings used for calls to addSignedUrlKeyBackendBucket. */
+  public UnaryCallSettings
+      addSignedUrlKeyBackendBucketSettings() {
+    return ((BackendBucketStubSettings) getStubSettings()).addSignedUrlKeyBackendBucketSettings();
+  }
+
   /** Returns the object with the settings used for calls to deleteBackendBucket. */
   public UnaryCallSettings
       deleteBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).deleteBackendBucketSettings();
   }
 
+  /** Returns the object with the settings used for calls to deleteSignedUrlKeyBackendBucket. */
+  public UnaryCallSettings
+      deleteSignedUrlKeyBackendBucketSettings() {
+    return ((BackendBucketStubSettings) getStubSettings())
+        .deleteSignedUrlKeyBackendBucketSettings();
+  }
+
   /** Returns the object with the settings used for calls to getBackendBucket. */
   public UnaryCallSettings getBackendBucketSettings() {
     return ((BackendBucketStubSettings) getStubSettings()).getBackendBucketSettings();
@@ -200,12 +213,24 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to addSignedUrlKeyBackendBucket. */
+    public UnaryCallSettings.Builder
+        addSignedUrlKeyBackendBucketSettings() {
+      return getStubSettingsBuilder().addSignedUrlKeyBackendBucketSettings();
+    }
+
     /** Returns the builder for the settings used for calls to deleteBackendBucket. */
     public UnaryCallSettings.Builder
         deleteBackendBucketSettings() {
       return getStubSettingsBuilder().deleteBackendBucketSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteSignedUrlKeyBackendBucket. */
+    public UnaryCallSettings.Builder
+        deleteSignedUrlKeyBackendBucketSettings() {
+      return getStubSettingsBuilder().deleteSignedUrlKeyBackendBucketSettings();
+    }
+
     /** Returns the builder for the settings used for calls to getBackendBucket. */
     public UnaryCallSettings.Builder
         getBackendBucketSettings() {
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
index f165c7388301..ac96f1aeff4a 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java
@@ -43,7 +43,8 @@
  * 
  * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
  *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
- *   Operation response = backendServiceClient.deleteBackendService(backendService);
+ *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+ *   Operation response = backendServiceClient.addSignedUrlKeyBackendService(backendService, signedUrlKeyResource);
  * }
  * 
  * 
@@ -152,6 +153,123 @@ public BackendServiceStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   Operation response = backendServiceClient.addSignedUrlKeyBackendService(backendService, signedUrlKeyResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param signedUrlKeyResource Represents a customer-supplied Signing Key used by Cloud CDN Signed + * URLs + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addSignedUrlKeyBackendService( + ProjectGlobalBackendServiceName backendService, SignedUrlKey signedUrlKeyResource) { + + AddSignedUrlKeyBackendServiceHttpRequest request = + AddSignedUrlKeyBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setSignedUrlKeyResource(signedUrlKeyResource) + .build(); + return addSignedUrlKeyBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   Operation response = backendServiceClient.addSignedUrlKeyBackendService(backendService.toString(), signedUrlKeyResource);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param signedUrlKeyResource Represents a customer-supplied Signing Key used by Cloud CDN Signed + * URLs + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addSignedUrlKeyBackendService( + String backendService, SignedUrlKey signedUrlKeyResource) { + + AddSignedUrlKeyBackendServiceHttpRequest request = + AddSignedUrlKeyBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setSignedUrlKeyResource(signedUrlKeyResource) + .build(); + return addSignedUrlKeyBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   AddSignedUrlKeyBackendServiceHttpRequest request = AddSignedUrlKeyBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setSignedUrlKeyResource(signedUrlKeyResource)
+   *     .build();
+   *   Operation response = backendServiceClient.addSignedUrlKeyBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addSignedUrlKeyBackendService( + AddSignedUrlKeyBackendServiceHttpRequest request) { + return addSignedUrlKeyBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build();
+   *   AddSignedUrlKeyBackendServiceHttpRequest request = AddSignedUrlKeyBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setSignedUrlKeyResource(signedUrlKeyResource)
+   *     .build();
+   *   ApiFuture<Operation> future = backendServiceClient.addSignedUrlKeyBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + addSignedUrlKeyBackendServiceCallable() { + return stub.addSignedUrlKeyBackendServiceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Retrieves the list of all BackendService resources, regional and global, available to the @@ -396,6 +514,120 @@ public final Operation deleteBackendService(DeleteBackendServiceHttpRequest requ return stub.deleteBackendServiceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   String keyName = "";
+   *   Operation response = backendServiceClient.deleteSignedUrlKeyBackendService(backendService, keyName);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param keyName The name of the Signed URL Key to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSignedUrlKeyBackendService( + ProjectGlobalBackendServiceName backendService, String keyName) { + + DeleteSignedUrlKeyBackendServiceHttpRequest request = + DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService == null ? null : backendService.toString()) + .setKeyName(keyName) + .build(); + return deleteSignedUrlKeyBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   String keyName = "";
+   *   Operation response = backendServiceClient.deleteSignedUrlKeyBackendService(backendService.toString(), keyName);
+   * }
+   * 
+ * + * @param backendService Name of the BackendService resource to which the Signed URL Key should be + * added. The name should conform to RFC1035. + * @param keyName The name of the Signed URL Key to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSignedUrlKeyBackendService(String backendService, String keyName) { + + DeleteSignedUrlKeyBackendServiceHttpRequest request = + DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder() + .setBackendService(backendService) + .setKeyName(keyName) + .build(); + return deleteSignedUrlKeyBackendService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   String keyName = "";
+   *   DeleteSignedUrlKeyBackendServiceHttpRequest request = DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setKeyName(keyName)
+   *     .build();
+   *   Operation response = backendServiceClient.deleteSignedUrlKeyBackendService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteSignedUrlKeyBackendService( + DeleteSignedUrlKeyBackendServiceHttpRequest request) { + return deleteSignedUrlKeyBackendServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + *

Sample code: + * + *


+   * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
+   *   ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
+   *   String keyName = "";
+   *   DeleteSignedUrlKeyBackendServiceHttpRequest request = DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder()
+   *     .setBackendService(backendService.toString())
+   *     .setKeyName(keyName)
+   *     .build();
+   *   ApiFuture<Operation> future = backendServiceClient.deleteSignedUrlKeyBackendServiceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + deleteSignedUrlKeyBackendServiceCallable() { + return stub.deleteSignedUrlKeyBackendServiceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns the specified BackendService resource. Gets a list of available backend services by diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java index 1f0e872b9cc1..90b65a13c5e2 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceSettings.java @@ -49,13 +49,13 @@ * *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteBackendService to 30 seconds: + * example, to set the total timeout of addSignedUrlKeyBackendService to 30 seconds: * *

  * 
  * BackendServiceSettings.Builder backendServiceSettingsBuilder =
  *     BackendServiceSettings.newBuilder();
- * backendServiceSettingsBuilder.deleteBackendServiceSettings().getRetrySettings().toBuilder()
+ * backendServiceSettingsBuilder.addSignedUrlKeyBackendServiceSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * BackendServiceSettings backendServiceSettings = backendServiceSettingsBuilder.build();
  * 
@@ -64,6 +64,12 @@
 @Generated("by gapic-generator")
 @BetaApi
 public class BackendServiceSettings extends ClientSettings {
+  /** Returns the object with the settings used for calls to addSignedUrlKeyBackendService. */
+  public UnaryCallSettings
+      addSignedUrlKeyBackendServiceSettings() {
+    return ((BackendServiceStubSettings) getStubSettings()).addSignedUrlKeyBackendServiceSettings();
+  }
+
   /** Returns the object with the settings used for calls to aggregatedListBackendServices. */
   public PagedCallSettings<
           AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
@@ -78,6 +84,13 @@ public class BackendServiceSettings extends ClientSettings
+      deleteSignedUrlKeyBackendServiceSettings() {
+    return ((BackendServiceStubSettings) getStubSettings())
+        .deleteSignedUrlKeyBackendServiceSettings();
+  }
+
   /** Returns the object with the settings used for calls to getBackendService. */
   public UnaryCallSettings
       getBackendServiceSettings() {
@@ -217,6 +230,12 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to addSignedUrlKeyBackendService. */
+    public UnaryCallSettings.Builder
+        addSignedUrlKeyBackendServiceSettings() {
+      return getStubSettingsBuilder().addSignedUrlKeyBackendServiceSettings();
+    }
+
     /** Returns the builder for the settings used for calls to aggregatedListBackendServices. */
     public PagedCallSettings.Builder<
             AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
@@ -231,6 +250,12 @@ public Builder applyToAllUnaryMethods(
       return getStubSettingsBuilder().deleteBackendServiceSettings();
     }
 
+    /** Returns the builder for the settings used for calls to deleteSignedUrlKeyBackendService. */
+    public UnaryCallSettings.Builder
+        deleteSignedUrlKeyBackendServiceSettings() {
+      return getStubSettingsBuilder().deleteSignedUrlKeyBackendServiceSettings();
+    }
+
     /** Returns the builder for the settings used for calls to getBackendService. */
     public UnaryCallSettings.Builder
         getBackendServiceSettings() {
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodeGroupHttpRequest.java
new file mode 100644
index 000000000000..8e77760475e5
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodeGroupHttpRequest.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright 2018 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 DeleteNodeGroupHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeGroup;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteNodeGroupHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeGroup = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private DeleteNodeGroupHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeGroup,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeGroup = nodeGroup;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeGroup")) {
+      return nodeGroup;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeGroup() {
+    return nodeGroup;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(DeleteNodeGroupHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteNodeGroupHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final DeleteNodeGroupHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new DeleteNodeGroupHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeGroup;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteNodeGroupHttpRequest other) {
+      if (other == DeleteNodeGroupHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeGroup() != null) {
+        this.nodeGroup = other.nodeGroup;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteNodeGroupHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeGroup = source.nodeGroup;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeGroup() {
+      return nodeGroup;
+    }
+
+    public Builder setNodeGroup(String nodeGroup) {
+      this.nodeGroup = nodeGroup;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public DeleteNodeGroupHttpRequest build() {
+      String missing = "";
+
+      if (nodeGroup == null) {
+        missing += " nodeGroup";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteNodeGroupHttpRequest(
+          access_token,
+          callback,
+          fields,
+          key,
+          nodeGroup,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeGroup(this.nodeGroup);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteNodeGroupHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeGroup="
+        + nodeGroup
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteNodeGroupHttpRequest) {
+      DeleteNodeGroupHttpRequest that = (DeleteNodeGroupHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeGroup, that.getNodeGroup())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token, callback, fields, key, nodeGroup, prettyPrint, quotaUser, requestId, userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodeTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodeTemplateHttpRequest.java
new file mode 100644
index 000000000000..6fad6d6ed887
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodeTemplateHttpRequest.java
@@ -0,0 +1,413 @@
+/*
+ * Copyright 2018 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 DeleteNodeTemplateHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeTemplate;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteNodeTemplateHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeTemplate = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private DeleteNodeTemplateHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeTemplate,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeTemplate = nodeTemplate;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeTemplate")) {
+      return nodeTemplate;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeTemplate() {
+    return nodeTemplate;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(DeleteNodeTemplateHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteNodeTemplateHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final DeleteNodeTemplateHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new DeleteNodeTemplateHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeTemplate;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteNodeTemplateHttpRequest other) {
+      if (other == DeleteNodeTemplateHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeTemplate() != null) {
+        this.nodeTemplate = other.nodeTemplate;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteNodeTemplateHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeTemplate = source.nodeTemplate;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeTemplate() {
+      return nodeTemplate;
+    }
+
+    public Builder setNodeTemplate(String nodeTemplate) {
+      this.nodeTemplate = nodeTemplate;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public DeleteNodeTemplateHttpRequest build() {
+      String missing = "";
+
+      if (nodeTemplate == null) {
+        missing += " nodeTemplate";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteNodeTemplateHttpRequest(
+          access_token,
+          callback,
+          fields,
+          key,
+          nodeTemplate,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeTemplate(this.nodeTemplate);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteNodeTemplateHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeTemplate="
+        + nodeTemplate
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteNodeTemplateHttpRequest) {
+      DeleteNodeTemplateHttpRequest that = (DeleteNodeTemplateHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeTemplate, that.getNodeTemplate())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        key,
+        nodeTemplate,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodesNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodesNodeGroupHttpRequest.java
new file mode 100644
index 000000000000..cbe19576b777
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteNodesNodeGroupHttpRequest.java
@@ -0,0 +1,448 @@
+/*
+ * Copyright 2018 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 DeleteNodesNodeGroupHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeGroup;
+  private final NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteNodesNodeGroupHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeGroup = null;
+    this.nodeGroupsDeleteNodesRequestResource = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private DeleteNodesNodeGroupHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeGroup,
+      NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeGroup = nodeGroup;
+    this.nodeGroupsDeleteNodesRequestResource = nodeGroupsDeleteNodesRequestResource;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeGroup")) {
+      return nodeGroup;
+    }
+    if (fieldName.equals("nodeGroupsDeleteNodesRequestResource")) {
+      return nodeGroupsDeleteNodesRequestResource;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public NodeGroupsDeleteNodesRequest getApiMessageRequestBody() {
+    return nodeGroupsDeleteNodesRequestResource;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeGroup() {
+    return nodeGroup;
+  }
+
+  public NodeGroupsDeleteNodesRequest getNodeGroupsDeleteNodesRequestResource() {
+    return nodeGroupsDeleteNodesRequestResource;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(DeleteNodesNodeGroupHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteNodesNodeGroupHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final DeleteNodesNodeGroupHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new DeleteNodesNodeGroupHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeGroup;
+    private NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteNodesNodeGroupHttpRequest other) {
+      if (other == DeleteNodesNodeGroupHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeGroup() != null) {
+        this.nodeGroup = other.nodeGroup;
+      }
+      if (other.getNodeGroupsDeleteNodesRequestResource() != null) {
+        this.nodeGroupsDeleteNodesRequestResource = other.nodeGroupsDeleteNodesRequestResource;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteNodesNodeGroupHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeGroup = source.nodeGroup;
+      this.nodeGroupsDeleteNodesRequestResource = source.nodeGroupsDeleteNodesRequestResource;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeGroup() {
+      return nodeGroup;
+    }
+
+    public Builder setNodeGroup(String nodeGroup) {
+      this.nodeGroup = nodeGroup;
+      return this;
+    }
+
+    public NodeGroupsDeleteNodesRequest getNodeGroupsDeleteNodesRequestResource() {
+      return nodeGroupsDeleteNodesRequestResource;
+    }
+
+    public Builder setNodeGroupsDeleteNodesRequestResource(
+        NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource) {
+      this.nodeGroupsDeleteNodesRequestResource = nodeGroupsDeleteNodesRequestResource;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public DeleteNodesNodeGroupHttpRequest build() {
+      String missing = "";
+
+      if (nodeGroup == null) {
+        missing += " nodeGroup";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteNodesNodeGroupHttpRequest(
+          access_token,
+          callback,
+          fields,
+          key,
+          nodeGroup,
+          nodeGroupsDeleteNodesRequestResource,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeGroup(this.nodeGroup);
+      newBuilder.setNodeGroupsDeleteNodesRequestResource(this.nodeGroupsDeleteNodesRequestResource);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteNodesNodeGroupHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeGroup="
+        + nodeGroup
+        + ", "
+        + "nodeGroupsDeleteNodesRequestResource="
+        + nodeGroupsDeleteNodesRequestResource
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteNodesNodeGroupHttpRequest) {
+      DeleteNodesNodeGroupHttpRequest that = (DeleteNodesNodeGroupHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeGroup, that.getNodeGroup())
+          && Objects.equals(
+              this.nodeGroupsDeleteNodesRequestResource,
+              that.getNodeGroupsDeleteNodesRequestResource())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        key,
+        nodeGroup,
+        nodeGroupsDeleteNodesRequestResource,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSignedUrlKeyBackendBucketHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSignedUrlKeyBackendBucketHttpRequest.java
new file mode 100644
index 000000000000..2897940b6645
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSignedUrlKeyBackendBucketHttpRequest.java
@@ -0,0 +1,450 @@
+/*
+ * Copyright 2018 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 DeleteSignedUrlKeyBackendBucketHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String backendBucket;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String keyName;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteSignedUrlKeyBackendBucketHttpRequest() {
+    this.access_token = null;
+    this.backendBucket = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.keyName = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private DeleteSignedUrlKeyBackendBucketHttpRequest(
+      String access_token,
+      String backendBucket,
+      String callback,
+      String fields,
+      String key,
+      String keyName,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.backendBucket = backendBucket;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.keyName = keyName;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("backendBucket")) {
+      return backendBucket;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("keyName")) {
+      return keyName;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getBackendBucket() {
+    return backendBucket;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getKeyName() {
+    return keyName;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(DeleteSignedUrlKeyBackendBucketHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteSignedUrlKeyBackendBucketHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final DeleteSignedUrlKeyBackendBucketHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new DeleteSignedUrlKeyBackendBucketHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String backendBucket;
+    private String callback;
+    private String fields;
+    private String key;
+    private String keyName;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteSignedUrlKeyBackendBucketHttpRequest other) {
+      if (other == DeleteSignedUrlKeyBackendBucketHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getBackendBucket() != null) {
+        this.backendBucket = other.backendBucket;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getKeyName() != null) {
+        this.keyName = other.keyName;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteSignedUrlKeyBackendBucketHttpRequest source) {
+      this.access_token = source.access_token;
+      this.backendBucket = source.backendBucket;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.keyName = source.keyName;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getBackendBucket() {
+      return backendBucket;
+    }
+
+    public Builder setBackendBucket(String backendBucket) {
+      this.backendBucket = backendBucket;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getKeyName() {
+      return keyName;
+    }
+
+    public Builder setKeyName(String keyName) {
+      this.keyName = keyName;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public DeleteSignedUrlKeyBackendBucketHttpRequest build() {
+      String missing = "";
+
+      if (backendBucket == null) {
+        missing += " backendBucket";
+      }
+
+      if (keyName == null) {
+        missing += " keyName";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteSignedUrlKeyBackendBucketHttpRequest(
+          access_token,
+          backendBucket,
+          callback,
+          fields,
+          key,
+          keyName,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setBackendBucket(this.backendBucket);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setKeyName(this.keyName);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteSignedUrlKeyBackendBucketHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "backendBucket="
+        + backendBucket
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "keyName="
+        + keyName
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteSignedUrlKeyBackendBucketHttpRequest) {
+      DeleteSignedUrlKeyBackendBucketHttpRequest that =
+          (DeleteSignedUrlKeyBackendBucketHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.backendBucket, that.getBackendBucket())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.keyName, that.getKeyName())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        backendBucket,
+        callback,
+        fields,
+        key,
+        keyName,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSignedUrlKeyBackendServiceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSignedUrlKeyBackendServiceHttpRequest.java
new file mode 100644
index 000000000000..ad269230da49
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DeleteSignedUrlKeyBackendServiceHttpRequest.java
@@ -0,0 +1,450 @@
+/*
+ * Copyright 2018 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 DeleteSignedUrlKeyBackendServiceHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String backendService;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String keyName;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+
+  private DeleteSignedUrlKeyBackendServiceHttpRequest() {
+    this.access_token = null;
+    this.backendService = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.keyName = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private DeleteSignedUrlKeyBackendServiceHttpRequest(
+      String access_token,
+      String backendService,
+      String callback,
+      String fields,
+      String key,
+      String keyName,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.backendService = backendService;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.keyName = keyName;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("backendService")) {
+      return backendService;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("keyName")) {
+      return keyName;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getBackendService() {
+    return backendService;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getKeyName() {
+    return keyName;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(DeleteSignedUrlKeyBackendServiceHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static DeleteSignedUrlKeyBackendServiceHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final DeleteSignedUrlKeyBackendServiceHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new DeleteSignedUrlKeyBackendServiceHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String backendService;
+    private String callback;
+    private String fields;
+    private String key;
+    private String keyName;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(DeleteSignedUrlKeyBackendServiceHttpRequest other) {
+      if (other == DeleteSignedUrlKeyBackendServiceHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getBackendService() != null) {
+        this.backendService = other.backendService;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getKeyName() != null) {
+        this.keyName = other.keyName;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(DeleteSignedUrlKeyBackendServiceHttpRequest source) {
+      this.access_token = source.access_token;
+      this.backendService = source.backendService;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.keyName = source.keyName;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getBackendService() {
+      return backendService;
+    }
+
+    public Builder setBackendService(String backendService) {
+      this.backendService = backendService;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getKeyName() {
+      return keyName;
+    }
+
+    public Builder setKeyName(String keyName) {
+      this.keyName = keyName;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public DeleteSignedUrlKeyBackendServiceHttpRequest build() {
+      String missing = "";
+
+      if (backendService == null) {
+        missing += " backendService";
+      }
+
+      if (keyName == null) {
+        missing += " keyName";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new DeleteSignedUrlKeyBackendServiceHttpRequest(
+          access_token,
+          backendService,
+          callback,
+          fields,
+          key,
+          keyName,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setBackendService(this.backendService);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setKeyName(this.keyName);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "DeleteSignedUrlKeyBackendServiceHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "backendService="
+        + backendService
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "keyName="
+        + keyName
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof DeleteSignedUrlKeyBackendServiceHttpRequest) {
+      DeleteSignedUrlKeyBackendServiceHttpRequest that =
+          (DeleteSignedUrlKeyBackendServiceHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.backendService, that.getBackendService())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.keyName, that.getKeyName())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        backendService,
+        callback,
+        fields,
+        key,
+        keyName,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp);
+  }
+}
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 fdac59a538f9..aabaa7170fe6 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
@@ -37,6 +37,7 @@ public final class ForwardingRule implements ApiMessage {
   private final String loadBalancingScheme;
   private final String name;
   private final String network;
+  private final String networkTier;
   private final String portRange;
   private final List ports;
   private final String region;
@@ -56,6 +57,7 @@ private ForwardingRule() {
     this.loadBalancingScheme = null;
     this.name = null;
     this.network = null;
+    this.networkTier = null;
     this.portRange = null;
     this.ports = null;
     this.region = null;
@@ -76,6 +78,7 @@ private ForwardingRule(
       String loadBalancingScheme,
       String name,
       String network,
+      String networkTier,
       String portRange,
       List ports,
       String region,
@@ -93,6 +96,7 @@ private ForwardingRule(
     this.loadBalancingScheme = loadBalancingScheme;
     this.name = name;
     this.network = network;
+    this.networkTier = networkTier;
     this.portRange = portRange;
     this.ports = ports;
     this.region = region;
@@ -136,6 +140,9 @@ public Object getFieldValue(String fieldName) {
     if (fieldName.equals("network")) {
       return network;
     }
+    if (fieldName.equals("networkTier")) {
+      return networkTier;
+    }
     if (fieldName.equals("portRange")) {
       return portRange;
     }
@@ -213,6 +220,10 @@ public String getNetwork() {
     return network;
   }
 
+  public String getNetworkTier() {
+    return networkTier;
+  }
+
   public String getPortRange() {
     return portRange;
   }
@@ -271,6 +282,7 @@ public static class Builder {
     private String loadBalancingScheme;
     private String name;
     private String network;
+    private String networkTier;
     private String portRange;
     private List ports;
     private String region;
@@ -315,6 +327,9 @@ public Builder mergeFrom(ForwardingRule other) {
       if (other.getNetwork() != null) {
         this.network = other.network;
       }
+      if (other.getNetworkTier() != null) {
+        this.networkTier = other.networkTier;
+      }
       if (other.getPortRange() != null) {
         this.portRange = other.portRange;
       }
@@ -348,6 +363,7 @@ public Builder mergeFrom(ForwardingRule other) {
       this.loadBalancingScheme = source.loadBalancingScheme;
       this.name = source.name;
       this.network = source.network;
+      this.networkTier = source.networkTier;
       this.portRange = source.portRange;
       this.ports = source.ports;
       this.region = source.region;
@@ -455,6 +471,15 @@ public Builder setNetwork(String network) {
       return this;
     }
 
+    public String getNetworkTier() {
+      return networkTier;
+    }
+
+    public Builder setNetworkTier(String networkTier) {
+      this.networkTier = networkTier;
+      return this;
+    }
+
     public String getPortRange() {
       return portRange;
     }
@@ -534,6 +559,7 @@ public ForwardingRule build() {
           loadBalancingScheme,
           name,
           network,
+          networkTier,
           portRange,
           ports,
           region,
@@ -555,6 +581,7 @@ public Builder clone() {
       newBuilder.setLoadBalancingScheme(this.loadBalancingScheme);
       newBuilder.setName(this.name);
       newBuilder.setNetwork(this.network);
+      newBuilder.setNetworkTier(this.networkTier);
       newBuilder.setPortRange(this.portRange);
       newBuilder.addAllPorts(this.ports);
       newBuilder.setRegion(this.region);
@@ -601,6 +628,9 @@ public String toString() {
         + "network="
         + network
         + ", "
+        + "networkTier="
+        + networkTier
+        + ", "
         + "portRange="
         + portRange
         + ", "
@@ -639,6 +669,7 @@ public boolean equals(Object o) {
           && Objects.equals(this.loadBalancingScheme, that.getLoadBalancingScheme())
           && Objects.equals(this.name, that.getName())
           && Objects.equals(this.network, that.getNetwork())
+          && Objects.equals(this.networkTier, that.getNetworkTier())
           && Objects.equals(this.portRange, that.getPortRange())
           && Objects.equals(this.ports, that.getPortsList())
           && Objects.equals(this.region, that.getRegion())
@@ -663,6 +694,7 @@ public int hashCode() {
         loadBalancingScheme,
         name,
         network,
+        networkTier,
         portRange,
         ports,
         region,
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeGroupHttpRequest.java
new file mode 100644
index 000000000000..a1c59cc87164
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeGroupHttpRequest.java
@@ -0,0 +1,367 @@
+/*
+ * Copyright 2018 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 GetNodeGroupHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeGroup;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetNodeGroupHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeGroup = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+  private GetNodeGroupHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeGroup,
+      String prettyPrint,
+      String quotaUser,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeGroup = nodeGroup;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeGroup")) {
+      return nodeGroup;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeGroup() {
+    return nodeGroup;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(GetNodeGroupHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetNodeGroupHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final GetNodeGroupHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new GetNodeGroupHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeGroup;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetNodeGroupHttpRequest other) {
+      if (other == GetNodeGroupHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeGroup() != null) {
+        this.nodeGroup = other.nodeGroup;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetNodeGroupHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeGroup = source.nodeGroup;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeGroup() {
+      return nodeGroup;
+    }
+
+    public Builder setNodeGroup(String nodeGroup) {
+      this.nodeGroup = nodeGroup;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public GetNodeGroupHttpRequest build() {
+      String missing = "";
+
+      if (nodeGroup == null) {
+        missing += " nodeGroup";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetNodeGroupHttpRequest(
+          access_token, callback, fields, key, nodeGroup, prettyPrint, quotaUser, userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeGroup(this.nodeGroup);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetNodeGroupHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeGroup="
+        + nodeGroup
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetNodeGroupHttpRequest) {
+      GetNodeGroupHttpRequest that = (GetNodeGroupHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeGroup, that.getNodeGroup())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token, callback, fields, key, nodeGroup, prettyPrint, quotaUser, userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeTemplateHttpRequest.java
new file mode 100644
index 000000000000..3cc2991d2cb9
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeTemplateHttpRequest.java
@@ -0,0 +1,367 @@
+/*
+ * Copyright 2018 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 GetNodeTemplateHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeTemplate;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetNodeTemplateHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeTemplate = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+  private GetNodeTemplateHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeTemplate,
+      String prettyPrint,
+      String quotaUser,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeTemplate = nodeTemplate;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeTemplate")) {
+      return nodeTemplate;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeTemplate() {
+    return nodeTemplate;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(GetNodeTemplateHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetNodeTemplateHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final GetNodeTemplateHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new GetNodeTemplateHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeTemplate;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetNodeTemplateHttpRequest other) {
+      if (other == GetNodeTemplateHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeTemplate() != null) {
+        this.nodeTemplate = other.nodeTemplate;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetNodeTemplateHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeTemplate = source.nodeTemplate;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeTemplate() {
+      return nodeTemplate;
+    }
+
+    public Builder setNodeTemplate(String nodeTemplate) {
+      this.nodeTemplate = nodeTemplate;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public GetNodeTemplateHttpRequest build() {
+      String missing = "";
+
+      if (nodeTemplate == null) {
+        missing += " nodeTemplate";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetNodeTemplateHttpRequest(
+          access_token, callback, fields, key, nodeTemplate, prettyPrint, quotaUser, userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeTemplate(this.nodeTemplate);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetNodeTemplateHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeTemplate="
+        + nodeTemplate
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetNodeTemplateHttpRequest) {
+      GetNodeTemplateHttpRequest that = (GetNodeTemplateHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeTemplate, that.getNodeTemplate())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token, callback, fields, key, nodeTemplate, prettyPrint, quotaUser, userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeTypeHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeTypeHttpRequest.java
new file mode 100644
index 000000000000..f4388afd78e9
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNodeTypeHttpRequest.java
@@ -0,0 +1,367 @@
+/*
+ * Copyright 2018 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 GetNodeTypeHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final String nodeType;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String userIp;
+
+  private GetNodeTypeHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeType = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.userIp = null;
+  }
+
+  private GetNodeTypeHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      String nodeType,
+      String prettyPrint,
+      String quotaUser,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeType = nodeType;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeType")) {
+      return nodeType;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public ApiMessage getApiMessageRequestBody() {
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public String getNodeType() {
+    return nodeType;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(GetNodeTypeHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static GetNodeTypeHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final GetNodeTypeHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new GetNodeTypeHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private String nodeType;
+    private String prettyPrint;
+    private String quotaUser;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(GetNodeTypeHttpRequest other) {
+      if (other == GetNodeTypeHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeType() != null) {
+        this.nodeType = other.nodeType;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(GetNodeTypeHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeType = source.nodeType;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public String getNodeType() {
+      return nodeType;
+    }
+
+    public Builder setNodeType(String nodeType) {
+      this.nodeType = nodeType;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public GetNodeTypeHttpRequest build() {
+      String missing = "";
+
+      if (nodeType == null) {
+        missing += " nodeType";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new GetNodeTypeHttpRequest(
+          access_token, callback, fields, key, nodeType, prettyPrint, quotaUser, userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeType(this.nodeType);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "GetNodeTypeHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeType="
+        + nodeType
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof GetNodeTypeHttpRequest) {
+      GetNodeTypeHttpRequest that = (GetNodeTypeHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeType, that.getNodeType())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token, callback, fields, key, nodeType, prettyPrint, quotaUser, userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNodeGroupHttpRequest.java
new file mode 100644
index 000000000000..bae7c2901ed1
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNodeGroupHttpRequest.java
@@ -0,0 +1,480 @@
+/*
+ * Copyright 2018 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 InsertNodeGroupHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final Integer initialNodeCount;
+  private final String key;
+  private final NodeGroup nodeGroupResource;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String requestId;
+  private final String userIp;
+  private final String zone;
+
+  private InsertNodeGroupHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.initialNodeCount = null;
+    this.key = null;
+    this.nodeGroupResource = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.requestId = null;
+    this.userIp = null;
+    this.zone = null;
+  }
+
+  private InsertNodeGroupHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      Integer initialNodeCount,
+      String key,
+      NodeGroup nodeGroupResource,
+      String prettyPrint,
+      String quotaUser,
+      String requestId,
+      String userIp,
+      String zone) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.initialNodeCount = initialNodeCount;
+    this.key = key;
+    this.nodeGroupResource = nodeGroupResource;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.requestId = requestId;
+    this.userIp = userIp;
+    this.zone = zone;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("initialNodeCount")) {
+      return initialNodeCount;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeGroupResource")) {
+      return nodeGroupResource;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    if (fieldName.equals("zone")) {
+      return zone;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public NodeGroup getApiMessageRequestBody() {
+    return nodeGroupResource;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public Integer getInitialNodeCount() {
+    return initialNodeCount;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public NodeGroup getNodeGroupResource() {
+    return nodeGroupResource;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public String getZone() {
+    return zone;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(InsertNodeGroupHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static InsertNodeGroupHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final InsertNodeGroupHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new InsertNodeGroupHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private Integer initialNodeCount;
+    private String key;
+    private NodeGroup nodeGroupResource;
+    private String prettyPrint;
+    private String quotaUser;
+    private String requestId;
+    private String userIp;
+    private String zone;
+
+    Builder() {}
+
+    public Builder mergeFrom(InsertNodeGroupHttpRequest other) {
+      if (other == InsertNodeGroupHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getInitialNodeCount() != null) {
+        this.initialNodeCount = other.initialNodeCount;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeGroupResource() != null) {
+        this.nodeGroupResource = other.nodeGroupResource;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      if (other.getZone() != null) {
+        this.zone = other.zone;
+      }
+      return this;
+    }
+
+    Builder(InsertNodeGroupHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.initialNodeCount = source.initialNodeCount;
+      this.key = source.key;
+      this.nodeGroupResource = source.nodeGroupResource;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+      this.zone = source.zone;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public Integer getInitialNodeCount() {
+      return initialNodeCount;
+    }
+
+    public Builder setInitialNodeCount(Integer initialNodeCount) {
+      this.initialNodeCount = initialNodeCount;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public NodeGroup getNodeGroupResource() {
+      return nodeGroupResource;
+    }
+
+    public Builder setNodeGroupResource(NodeGroup nodeGroupResource) {
+      this.nodeGroupResource = nodeGroupResource;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public String getZone() {
+      return zone;
+    }
+
+    public Builder setZone(String zone) {
+      this.zone = zone;
+      return this;
+    }
+
+    public InsertNodeGroupHttpRequest build() {
+      String missing = "";
+
+      if (initialNodeCount == null) {
+        missing += " initialNodeCount";
+      }
+
+      if (zone == null) {
+        missing += " zone";
+      }
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new InsertNodeGroupHttpRequest(
+          access_token,
+          callback,
+          fields,
+          initialNodeCount,
+          key,
+          nodeGroupResource,
+          prettyPrint,
+          quotaUser,
+          requestId,
+          userIp,
+          zone);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setInitialNodeCount(this.initialNodeCount);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeGroupResource(this.nodeGroupResource);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      newBuilder.setZone(this.zone);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "InsertNodeGroupHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "initialNodeCount="
+        + initialNodeCount
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeGroupResource="
+        + nodeGroupResource
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + ", "
+        + "zone="
+        + zone
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof InsertNodeGroupHttpRequest) {
+      InsertNodeGroupHttpRequest that = (InsertNodeGroupHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.initialNodeCount, that.getInitialNodeCount())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeGroupResource, that.getNodeGroupResource())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp())
+          && Objects.equals(this.zone, that.getZone());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        initialNodeCount,
+        key,
+        nodeGroupResource,
+        prettyPrint,
+        quotaUser,
+        requestId,
+        userIp,
+        zone);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNodeTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNodeTemplateHttpRequest.java
new file mode 100644
index 000000000000..4a0446866a32
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertNodeTemplateHttpRequest.java
@@ -0,0 +1,445 @@
+/*
+ * Copyright 2018 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 InsertNodeTemplateHttpRequest implements ApiMessage {
+  private final String access_token;
+  private final String callback;
+  private final String fields;
+  private final String key;
+  private final NodeTemplate nodeTemplateResource;
+  private final String prettyPrint;
+  private final String quotaUser;
+  private final String region;
+  private final String requestId;
+  private final String userIp;
+
+  private InsertNodeTemplateHttpRequest() {
+    this.access_token = null;
+    this.callback = null;
+    this.fields = null;
+    this.key = null;
+    this.nodeTemplateResource = null;
+    this.prettyPrint = null;
+    this.quotaUser = null;
+    this.region = null;
+    this.requestId = null;
+    this.userIp = null;
+  }
+
+  private InsertNodeTemplateHttpRequest(
+      String access_token,
+      String callback,
+      String fields,
+      String key,
+      NodeTemplate nodeTemplateResource,
+      String prettyPrint,
+      String quotaUser,
+      String region,
+      String requestId,
+      String userIp) {
+    this.access_token = access_token;
+    this.callback = callback;
+    this.fields = fields;
+    this.key = key;
+    this.nodeTemplateResource = nodeTemplateResource;
+    this.prettyPrint = prettyPrint;
+    this.quotaUser = quotaUser;
+    this.region = region;
+    this.requestId = requestId;
+    this.userIp = userIp;
+  }
+
+  @Override
+  public Object getFieldValue(String fieldName) {
+    if (fieldName.equals("access_token")) {
+      return access_token;
+    }
+    if (fieldName.equals("callback")) {
+      return callback;
+    }
+    if (fieldName.equals("fields")) {
+      return fields;
+    }
+    if (fieldName.equals("key")) {
+      return key;
+    }
+    if (fieldName.equals("nodeTemplateResource")) {
+      return nodeTemplateResource;
+    }
+    if (fieldName.equals("prettyPrint")) {
+      return prettyPrint;
+    }
+    if (fieldName.equals("quotaUser")) {
+      return quotaUser;
+    }
+    if (fieldName.equals("region")) {
+      return region;
+    }
+    if (fieldName.equals("requestId")) {
+      return requestId;
+    }
+    if (fieldName.equals("userIp")) {
+      return userIp;
+    }
+    return null;
+  }
+
+  @Nullable
+  @Override
+  public NodeTemplate getApiMessageRequestBody() {
+    return nodeTemplateResource;
+  }
+
+  @Nullable
+  @Override
+  public List getFieldMask() {
+    return null;
+  }
+
+  public String getAccessToken() {
+    return access_token;
+  }
+
+  public String getCallback() {
+    return callback;
+  }
+
+  public String getFields() {
+    return fields;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public NodeTemplate getNodeTemplateResource() {
+    return nodeTemplateResource;
+  }
+
+  public String getPrettyPrint() {
+    return prettyPrint;
+  }
+
+  public String getQuotaUser() {
+    return quotaUser;
+  }
+
+  public String getRegion() {
+    return region;
+  }
+
+  public String getRequestId() {
+    return requestId;
+  }
+
+  public String getUserIp() {
+    return userIp;
+  }
+
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+
+  public static Builder newBuilder(InsertNodeTemplateHttpRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  public static InsertNodeTemplateHttpRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final InsertNodeTemplateHttpRequest DEFAULT_INSTANCE;
+
+  static {
+    DEFAULT_INSTANCE = new InsertNodeTemplateHttpRequest();
+  }
+
+  public static class Builder {
+    private String access_token;
+    private String callback;
+    private String fields;
+    private String key;
+    private NodeTemplate nodeTemplateResource;
+    private String prettyPrint;
+    private String quotaUser;
+    private String region;
+    private String requestId;
+    private String userIp;
+
+    Builder() {}
+
+    public Builder mergeFrom(InsertNodeTemplateHttpRequest other) {
+      if (other == InsertNodeTemplateHttpRequest.getDefaultInstance()) return this;
+      if (other.getAccessToken() != null) {
+        this.access_token = other.access_token;
+      }
+      if (other.getCallback() != null) {
+        this.callback = other.callback;
+      }
+      if (other.getFields() != null) {
+        this.fields = other.fields;
+      }
+      if (other.getKey() != null) {
+        this.key = other.key;
+      }
+      if (other.getNodeTemplateResource() != null) {
+        this.nodeTemplateResource = other.nodeTemplateResource;
+      }
+      if (other.getPrettyPrint() != null) {
+        this.prettyPrint = other.prettyPrint;
+      }
+      if (other.getQuotaUser() != null) {
+        this.quotaUser = other.quotaUser;
+      }
+      if (other.getRegion() != null) {
+        this.region = other.region;
+      }
+      if (other.getRequestId() != null) {
+        this.requestId = other.requestId;
+      }
+      if (other.getUserIp() != null) {
+        this.userIp = other.userIp;
+      }
+      return this;
+    }
+
+    Builder(InsertNodeTemplateHttpRequest source) {
+      this.access_token = source.access_token;
+      this.callback = source.callback;
+      this.fields = source.fields;
+      this.key = source.key;
+      this.nodeTemplateResource = source.nodeTemplateResource;
+      this.prettyPrint = source.prettyPrint;
+      this.quotaUser = source.quotaUser;
+      this.region = source.region;
+      this.requestId = source.requestId;
+      this.userIp = source.userIp;
+    }
+
+    public String getAccessToken() {
+      return access_token;
+    }
+
+    public Builder setAccessToken(String access_token) {
+      this.access_token = access_token;
+      return this;
+    }
+
+    public String getCallback() {
+      return callback;
+    }
+
+    public Builder setCallback(String callback) {
+      this.callback = callback;
+      return this;
+    }
+
+    public String getFields() {
+      return fields;
+    }
+
+    public Builder setFields(String fields) {
+      this.fields = fields;
+      return this;
+    }
+
+    public String getKey() {
+      return key;
+    }
+
+    public Builder setKey(String key) {
+      this.key = key;
+      return this;
+    }
+
+    public NodeTemplate getNodeTemplateResource() {
+      return nodeTemplateResource;
+    }
+
+    public Builder setNodeTemplateResource(NodeTemplate nodeTemplateResource) {
+      this.nodeTemplateResource = nodeTemplateResource;
+      return this;
+    }
+
+    public String getPrettyPrint() {
+      return prettyPrint;
+    }
+
+    public Builder setPrettyPrint(String prettyPrint) {
+      this.prettyPrint = prettyPrint;
+      return this;
+    }
+
+    public String getQuotaUser() {
+      return quotaUser;
+    }
+
+    public Builder setQuotaUser(String quotaUser) {
+      this.quotaUser = quotaUser;
+      return this;
+    }
+
+    public String getRegion() {
+      return region;
+    }
+
+    public Builder setRegion(String region) {
+      this.region = region;
+      return this;
+    }
+
+    public String getRequestId() {
+      return requestId;
+    }
+
+    public Builder setRequestId(String requestId) {
+      this.requestId = requestId;
+      return this;
+    }
+
+    public String getUserIp() {
+      return userIp;
+    }
+
+    public Builder setUserIp(String userIp) {
+      this.userIp = userIp;
+      return this;
+    }
+
+    public InsertNodeTemplateHttpRequest build() {
+      String missing = "";
+
+      if (region == null) {
+        missing += " region";
+      }
+
+      if (!missing.isEmpty()) {
+        throw new IllegalStateException("Missing required properties:" + missing);
+      }
+      return new InsertNodeTemplateHttpRequest(
+          access_token,
+          callback,
+          fields,
+          key,
+          nodeTemplateResource,
+          prettyPrint,
+          quotaUser,
+          region,
+          requestId,
+          userIp);
+    }
+
+    public Builder clone() {
+      Builder newBuilder = new Builder();
+      newBuilder.setAccessToken(this.access_token);
+      newBuilder.setCallback(this.callback);
+      newBuilder.setFields(this.fields);
+      newBuilder.setKey(this.key);
+      newBuilder.setNodeTemplateResource(this.nodeTemplateResource);
+      newBuilder.setPrettyPrint(this.prettyPrint);
+      newBuilder.setQuotaUser(this.quotaUser);
+      newBuilder.setRegion(this.region);
+      newBuilder.setRequestId(this.requestId);
+      newBuilder.setUserIp(this.userIp);
+      return newBuilder;
+    }
+  }
+
+  @Override
+  public String toString() {
+    return "InsertNodeTemplateHttpRequest{"
+        + "access_token="
+        + access_token
+        + ", "
+        + "callback="
+        + callback
+        + ", "
+        + "fields="
+        + fields
+        + ", "
+        + "key="
+        + key
+        + ", "
+        + "nodeTemplateResource="
+        + nodeTemplateResource
+        + ", "
+        + "prettyPrint="
+        + prettyPrint
+        + ", "
+        + "quotaUser="
+        + quotaUser
+        + ", "
+        + "region="
+        + region
+        + ", "
+        + "requestId="
+        + requestId
+        + ", "
+        + "userIp="
+        + userIp
+        + "}";
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (o instanceof InsertNodeTemplateHttpRequest) {
+      InsertNodeTemplateHttpRequest that = (InsertNodeTemplateHttpRequest) o;
+      return Objects.equals(this.access_token, that.getAccessToken())
+          && Objects.equals(this.callback, that.getCallback())
+          && Objects.equals(this.fields, that.getFields())
+          && Objects.equals(this.key, that.getKey())
+          && Objects.equals(this.nodeTemplateResource, that.getNodeTemplateResource())
+          && Objects.equals(this.prettyPrint, that.getPrettyPrint())
+          && Objects.equals(this.quotaUser, that.getQuotaUser())
+          && Objects.equals(this.region, that.getRegion())
+          && Objects.equals(this.requestId, that.getRequestId())
+          && Objects.equals(this.userIp, that.getUserIp());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(
+        access_token,
+        callback,
+        fields,
+        key,
+        nodeTemplateResource,
+        prettyPrint,
+        quotaUser,
+        region,
+        requestId,
+        userIp);
+  }
+}
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
index 2db9cbfaad1b..d12996f83038 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentClient.java
@@ -765,6 +765,142 @@ public final ListInterconnectAttachmentsPagedResponse listInterconnectAttachment
     return stub.listInterconnectAttachmentsCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD
+  /**
+   * Updates the specified interconnect attachment with the data included in the request. This
+   * method supports PATCH semantics and uses the JSON merge patch format and processing rules.
+   *
+   * 

Sample code: + * + *


+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   Operation response = interconnectAttachmentClient.patchInterconnectAttachment(interconnectAttachment, interconnectAttachmentResource, fieldMask);
+   * }
+   * 
+ * + * @param interconnectAttachment Name of the interconnect attachment to patch. + * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) + * resource. For more information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) + * @param fieldMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInterconnectAttachment( + ProjectRegionInterconnectAttachmentName interconnectAttachment, + InterconnectAttachment interconnectAttachmentResource, + List fieldMask) { + + PatchInterconnectAttachmentHttpRequest request = + PatchInterconnectAttachmentHttpRequest.newBuilder() + .setInterconnectAttachment( + interconnectAttachment == null ? null : interconnectAttachment.toString()) + .setInterconnectAttachmentResource(interconnectAttachmentResource) + .addAllFieldMask(fieldMask) + .build(); + return patchInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified interconnect attachment with the data included in the request. This + * method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   Operation response = interconnectAttachmentClient.patchInterconnectAttachment(interconnectAttachment.toString(), interconnectAttachmentResource, fieldMask);
+   * }
+   * 
+ * + * @param interconnectAttachment Name of the interconnect attachment to patch. + * @param interconnectAttachmentResource Represents an InterconnectAttachment (VLAN attachment) + * resource. For more information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) + * @param fieldMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInterconnectAttachment( + String interconnectAttachment, + InterconnectAttachment interconnectAttachmentResource, + List fieldMask) { + + PatchInterconnectAttachmentHttpRequest request = + PatchInterconnectAttachmentHttpRequest.newBuilder() + .setInterconnectAttachment(interconnectAttachment) + .setInterconnectAttachmentResource(interconnectAttachmentResource) + .addAllFieldMask(fieldMask) + .build(); + return patchInterconnectAttachment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified interconnect attachment with the data included in the request. This + * method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   PatchInterconnectAttachmentHttpRequest request = PatchInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setInterconnectAttachment(interconnectAttachment.toString())
+   *     .setInterconnectAttachmentResource(interconnectAttachmentResource)
+   *     .addAllFieldMask(fieldMask)
+   *     .build();
+   *   Operation response = interconnectAttachmentClient.patchInterconnectAttachment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInterconnectAttachment( + PatchInterconnectAttachmentHttpRequest request) { + return patchInterconnectAttachmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified interconnect attachment with the data included in the request. This + * method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
+   *   ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
+   *   InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   PatchInterconnectAttachmentHttpRequest request = PatchInterconnectAttachmentHttpRequest.newBuilder()
+   *     .setInterconnectAttachment(interconnectAttachment.toString())
+   *     .setInterconnectAttachmentResource(interconnectAttachmentResource)
+   *     .addAllFieldMask(fieldMask)
+   *     .build();
+   *   ApiFuture<Operation> future = interconnectAttachmentClient.patchInterconnectAttachmentCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + patchInterconnectAttachmentCallable() { + return stub.patchInterconnectAttachmentCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java index e0df5fb63acb..c1c899c03b36 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectAttachmentSettings.java @@ -105,6 +105,13 @@ public class InterconnectAttachmentSettings extends ClientSettings + patchInterconnectAttachmentSettings() { + return ((InterconnectAttachmentStubSettings) getStubSettings()) + .patchInterconnectAttachmentSettings(); + } + public static final InterconnectAttachmentSettings create(InterconnectAttachmentStubSettings stub) throws IOException { return new InterconnectAttachmentSettings.Builder(stub.toBuilder()).build(); @@ -244,6 +251,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().listInterconnectAttachmentsSettings(); } + /** Returns the builder for the settings used for calls to patchInterconnectAttachment. */ + public UnaryCallSettings.Builder + patchInterconnectAttachmentSettings() { + return getStubSettingsBuilder().patchInterconnectAttachmentSettings(); + } + @Override public InterconnectAttachmentSettings build() throws IOException { return new InterconnectAttachmentSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeGroupsHttpRequest.java new file mode 100644 index 000000000000..37215dc35794 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeGroupsHttpRequest.java @@ -0,0 +1,508 @@ +/* + * Copyright 2018 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 ListNodeGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListNodeGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + private ListNodeGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("filter")) { + return filter; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("maxResults")) { + return maxResults; + } + if (fieldName.equals("orderBy")) { + return orderBy; + } + if (fieldName.equals("pageToken")) { + return pageToken; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("userIp")) { + return userIp; + } + if (fieldName.equals("zone")) { + return zone; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListNodeGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListNodeGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListNodeGroupsHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListNodeGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListNodeGroupsHttpRequest other) { + if (other == ListNodeGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListNodeGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + public ListNodeGroupsHttpRequest build() { + String missing = ""; + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListNodeGroupsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListNodeGroupsHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListNodeGroupsHttpRequest) { + ListNodeGroupsHttpRequest that = (ListNodeGroupsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeTemplatesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeTemplatesHttpRequest.java new file mode 100644 index 000000000000..86f1aa183e75 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeTemplatesHttpRequest.java @@ -0,0 +1,509 @@ +/* + * Copyright 2018 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 ListNodeTemplatesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String region; + private final String userIp; + + private ListNodeTemplatesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.region = null; + this.userIp = null; + } + + private ListNodeTemplatesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String region, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.region = region; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("filter")) { + return filter; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("maxResults")) { + return maxResults; + } + if (fieldName.equals("orderBy")) { + return orderBy; + } + if (fieldName.equals("pageToken")) { + return pageToken; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("region")) { + return region; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRegion() { + return region; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListNodeTemplatesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListNodeTemplatesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListNodeTemplatesHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListNodeTemplatesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String region; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListNodeTemplatesHttpRequest other) { + if (other == ListNodeTemplatesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListNodeTemplatesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.region = source.region; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListNodeTemplatesHttpRequest build() { + String missing = ""; + + if (region == null) { + missing += " region"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListNodeTemplatesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRegion(this.region); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListNodeTemplatesHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "region=" + + region + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListNodeTemplatesHttpRequest) { + ListNodeTemplatesHttpRequest that = (ListNodeTemplatesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + region, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeTypesHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeTypesHttpRequest.java new file mode 100644 index 000000000000..b0217771e4cd --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodeTypesHttpRequest.java @@ -0,0 +1,508 @@ +/* + * Copyright 2018 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 ListNodeTypesHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + private final String zone; + + private ListNodeTypesHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + this.zone = null; + } + + private ListNodeTypesHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp, + String zone) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + this.zone = zone; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("filter")) { + return filter; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("maxResults")) { + return maxResults; + } + if (fieldName.equals("orderBy")) { + return orderBy; + } + if (fieldName.equals("pageToken")) { + return pageToken; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("userIp")) { + return userIp; + } + if (fieldName.equals("zone")) { + return zone; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public String getZone() { + return zone; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListNodeTypesHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListNodeTypesHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListNodeTypesHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListNodeTypesHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + private String zone; + + Builder() {} + + public Builder mergeFrom(ListNodeTypesHttpRequest other) { + if (other == ListNodeTypesHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(ListNodeTypesHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + this.zone = source.zone; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + public ListNodeTypesHttpRequest build() { + String missing = ""; + + if (zone == null) { + missing += " zone"; + } + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListNodeTypesHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListNodeTypesHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + ", " + + "zone=" + + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListNodeTypesHttpRequest) { + ListNodeTypesHttpRequest that = (ListNodeTypesHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp, + zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodesNodeGroupsHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodesNodeGroupsHttpRequest.java new file mode 100644 index 000000000000..9a04d4dceee5 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListNodesNodeGroupsHttpRequest.java @@ -0,0 +1,509 @@ +/* + * Copyright 2018 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 ListNodesNodeGroupsHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String nodeGroup; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private ListNodesNodeGroupsHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.nodeGroup = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + private ListNodesNodeGroupsHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String nodeGroup, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.nodeGroup = nodeGroup; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("filter")) { + return filter; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("maxResults")) { + return maxResults; + } + if (fieldName.equals("nodeGroup")) { + return nodeGroup; + } + if (fieldName.equals("orderBy")) { + return orderBy; + } + if (fieldName.equals("pageToken")) { + return pageToken; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getNodeGroup() { + return nodeGroup; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListNodesNodeGroupsHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListNodesNodeGroupsHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListNodesNodeGroupsHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListNodesNodeGroupsHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String nodeGroup; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListNodesNodeGroupsHttpRequest other) { + if (other == ListNodesNodeGroupsHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getNodeGroup() != null) { + this.nodeGroup = other.nodeGroup; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListNodesNodeGroupsHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.nodeGroup = source.nodeGroup; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getNodeGroup() { + return nodeGroup; + } + + public Builder setNodeGroup(String nodeGroup) { + this.nodeGroup = nodeGroup; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListNodesNodeGroupsHttpRequest build() { + String missing = ""; + + if (nodeGroup == null) { + missing += " nodeGroup"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListNodesNodeGroupsHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + nodeGroup, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setNodeGroup(this.nodeGroup); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListNodesNodeGroupsHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "nodeGroup=" + + nodeGroup + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListNodesNodeGroupsHttpRequest) { + ListNodesNodeGroupsHttpRequest that = (ListNodesNodeGroupsHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.nodeGroup, that.getNodeGroup()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + nodeGroup, + orderBy, + pageToken, + prettyPrint, + quotaUser, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUsableSubnetworksHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUsableSubnetworksHttpRequest.java new file mode 100644 index 000000000000..eb980c4009fd --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ListUsableSubnetworksHttpRequest.java @@ -0,0 +1,509 @@ +/* + * Copyright 2018 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 ListUsableSubnetworksHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String filter; + private final String key; + private final Integer maxResults; + private final String orderBy; + private final String pageToken; + private final String prettyPrint; + private final String project; + private final String quotaUser; + private final String userIp; + + private ListUsableSubnetworksHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.filter = null; + this.key = null; + this.maxResults = null; + this.orderBy = null; + this.pageToken = null; + this.prettyPrint = null; + this.project = null; + this.quotaUser = null; + this.userIp = null; + } + + private ListUsableSubnetworksHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String project, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.filter = filter; + this.key = key; + this.maxResults = maxResults; + this.orderBy = orderBy; + this.pageToken = pageToken; + this.prettyPrint = prettyPrint; + this.project = project; + this.quotaUser = quotaUser; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("filter")) { + return filter; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("maxResults")) { + return maxResults; + } + if (fieldName.equals("orderBy")) { + return orderBy; + } + if (fieldName.equals("pageToken")) { + return pageToken; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("project")) { + return project; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getFilter() { + return filter; + } + + public String getKey() { + return key; + } + + public Integer getMaxResults() { + return maxResults; + } + + public String getOrderBy() { + return orderBy; + } + + public String getPageToken() { + return pageToken; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ListUsableSubnetworksHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ListUsableSubnetworksHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ListUsableSubnetworksHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ListUsableSubnetworksHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String filter; + private String key; + private Integer maxResults; + private String orderBy; + private String pageToken; + private String prettyPrint; + private String project; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(ListUsableSubnetworksHttpRequest other) { + if (other == ListUsableSubnetworksHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getFilter() != null) { + this.filter = other.filter; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getMaxResults() != null) { + this.maxResults = other.maxResults; + } + if (other.getOrderBy() != null) { + this.orderBy = other.orderBy; + } + if (other.getPageToken() != null) { + this.pageToken = other.pageToken; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(ListUsableSubnetworksHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.filter = source.filter; + this.key = source.key; + this.maxResults = source.maxResults; + this.orderBy = source.orderBy; + this.pageToken = source.pageToken; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.quotaUser = source.quotaUser; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getFilter() { + return filter; + } + + public Builder setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public Integer getMaxResults() { + return maxResults; + } + + public Builder setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + public String getOrderBy() { + return orderBy; + } + + public Builder setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public Builder setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ListUsableSubnetworksHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new ListUsableSubnetworksHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setFilter(this.filter); + newBuilder.setKey(this.key); + newBuilder.setMaxResults(this.maxResults); + newBuilder.setOrderBy(this.orderBy); + newBuilder.setPageToken(this.pageToken); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "ListUsableSubnetworksHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ListUsableSubnetworksHttpRequest) { + ListUsableSubnetworksHttpRequest that = (ListUsableSubnetworksHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.filter, that.getFilter()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.maxResults, that.getMaxResults()) + && Objects.equals(this.orderBy, that.getOrderBy()) + && Objects.equals(this.pageToken, that.getPageToken()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + project, + quotaUser, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroup.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroup.java new file mode 100644 index 000000000000..026d24640901 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroup.java @@ -0,0 +1,428 @@ +/* + * Copyright 2018 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 NodeGroup implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final String nodeTemplate; + private final String selfLink; + private final Integer size; + private final String status; + private final String zone; + + private NodeGroup() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.nodeTemplate = null; + this.selfLink = null; + this.size = null; + this.status = null; + this.zone = null; + } + + private NodeGroup( + String creationTimestamp, + String description, + String id, + String kind, + String name, + String nodeTemplate, + String selfLink, + Integer size, + String status, + String zone) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.nodeTemplate = nodeTemplate; + this.selfLink = selfLink; + this.size = size; + this.status = status; + this.zone = zone; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return creationTimestamp; + } + if (fieldName.equals("description")) { + return description; + } + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("name")) { + return name; + } + if (fieldName.equals("nodeTemplate")) { + return nodeTemplate; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("size")) { + return size; + } + if (fieldName.equals("status")) { + return status; + } + if (fieldName.equals("zone")) { + return zone; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public String getNodeTemplate() { + return nodeTemplate; + } + + public String getSelfLink() { + return selfLink; + } + + public Integer getSize() { + return size; + } + + public String getStatus() { + return status; + } + + public String getZone() { + return zone; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroup prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroup(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private String nodeTemplate; + private String selfLink; + private Integer size; + private String status; + private String zone; + + Builder() {} + + public Builder mergeFrom(NodeGroup other) { + if (other == NodeGroup.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNodeTemplate() != null) { + this.nodeTemplate = other.nodeTemplate; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getSize() != null) { + this.size = other.size; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(NodeGroup source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.nodeTemplate = source.nodeTemplate; + this.selfLink = source.selfLink; + this.size = source.size; + this.status = source.status; + this.zone = source.zone; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNodeTemplate() { + return nodeTemplate; + } + + public Builder setNodeTemplate(String nodeTemplate) { + this.nodeTemplate = nodeTemplate; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Integer getSize() { + return size; + } + + public Builder setSize(Integer size) { + this.size = size; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + public NodeGroup build() { + + return new NodeGroup( + creationTimestamp, + description, + id, + kind, + name, + nodeTemplate, + selfLink, + size, + status, + zone); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.setNodeTemplate(this.nodeTemplate); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setSize(this.size); + newBuilder.setStatus(this.status); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroup{" + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "nodeTemplate=" + + nodeTemplate + + ", " + + "selfLink=" + + selfLink + + ", " + + "size=" + + size + + ", " + + "status=" + + status + + ", " + + "zone=" + + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroup) { + NodeGroup that = (NodeGroup) o; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.nodeTemplate, that.getNodeTemplate()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.size, that.getSize()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, description, id, kind, name, nodeTemplate, selfLink, size, status, zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupAggregatedList.java new file mode 100644 index 000000000000..2bc5c80cb031 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 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.Map; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeGroupAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeGroupAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeGroupAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupAggregatedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeGroupAggregatedList other) { + if (other == NodeGroupAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeGroupAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeGroupAggregatedList build() { + + return new NodeGroupAggregatedList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupAggregatedList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupAggregatedList) { + NodeGroupAggregatedList that = (NodeGroupAggregatedList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupClient.java new file mode 100644 index 000000000000..2dc7db767ac3 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupClient.java @@ -0,0 +1,1498 @@ +/* + * Copyright 2018 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.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.NodeGroupStub; +import com.google.cloud.compute.v1.stub.NodeGroupStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+ *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+ *   NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
+ *   Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the nodeGroupClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of NodeGroupSettings to create(). + * For example: + * + *

To customize credentials: + * + *

+ * 
+ * NodeGroupSettings nodeGroupSettings =
+ *     NodeGroupSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * NodeGroupClient nodeGroupClient =
+ *     NodeGroupClient.create(nodeGroupSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * NodeGroupSettings nodeGroupSettings =
+ *     NodeGroupSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NodeGroupClient nodeGroupClient =
+ *     NodeGroupClient.create(nodeGroupSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeGroupClient implements BackgroundResource { + private final NodeGroupSettings settings; + private final NodeGroupStub stub; + + /** Constructs an instance of NodeGroupClient with default settings. */ + public static final NodeGroupClient create() throws IOException { + return create(NodeGroupSettings.newBuilder().build()); + } + + /** + * Constructs an instance of NodeGroupClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final NodeGroupClient create(NodeGroupSettings settings) throws IOException { + return new NodeGroupClient(settings); + } + + /** + * Constructs an instance of NodeGroupClient, using the given stub for making calls. This is for + * advanced usage - prefer to use NodeGroupSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final NodeGroupClient create(NodeGroupStub stub) { + return new NodeGroupClient(stub); + } + + /** + * Constructs an instance of NodeGroupClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected NodeGroupClient(NodeGroupSettings settings) throws IOException { + this.settings = settings; + this.stub = ((NodeGroupStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected NodeGroupClient(NodeGroupStub stub) { + this.settings = null; + this.stub = stub; + } + + public final NodeGroupSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NodeGroupStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds specified number of nodes to the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
+   *   Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @param nodeGroupsAddNodesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addNodesNodeGroup( + ProjectZoneNodeGroupName nodeGroup, + NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource) { + + AddNodesNodeGroupHttpRequest request = + AddNodesNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup == null ? null : nodeGroup.toString()) + .setNodeGroupsAddNodesRequestResource(nodeGroupsAddNodesRequestResource) + .build(); + return addNodesNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds specified number of nodes to the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
+   *   Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup.toString(), nodeGroupsAddNodesRequestResource);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @param nodeGroupsAddNodesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addNodesNodeGroup( + String nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource) { + + AddNodesNodeGroupHttpRequest request = + AddNodesNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup) + .setNodeGroupsAddNodesRequestResource(nodeGroupsAddNodesRequestResource) + .build(); + return addNodesNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds specified number of nodes to the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
+   *   AddNodesNodeGroupHttpRequest request = AddNodesNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .setNodeGroupsAddNodesRequestResource(nodeGroupsAddNodesRequestResource)
+   *     .build();
+   *   Operation response = nodeGroupClient.addNodesNodeGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation addNodesNodeGroup(AddNodesNodeGroupHttpRequest request) { + return addNodesNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Adds specified number of nodes to the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
+   *   AddNodesNodeGroupHttpRequest request = AddNodesNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .setNodeGroupsAddNodesRequestResource(nodeGroupsAddNodesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = nodeGroupClient.addNodesNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable addNodesNodeGroupCallable() { + return stub.addNodesNodeGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details + * about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (NodeGroupsScopedList element : nodeGroupClient.aggregatedListNodeGroups(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeGroupsPagedResponse aggregatedListNodeGroups(ProjectName project) { + AggregatedListNodeGroupsHttpRequest request = + AggregatedListNodeGroupsHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListNodeGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details + * about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (NodeGroupsScopedList element : nodeGroupClient.aggregatedListNodeGroups(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeGroupsPagedResponse aggregatedListNodeGroups(String project) { + AggregatedListNodeGroupsHttpRequest request = + AggregatedListNodeGroupsHttpRequest.newBuilder().setProject(project).build(); + return aggregatedListNodeGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details + * about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeGroupsHttpRequest request = AggregatedListNodeGroupsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (NodeGroupsScopedList element : nodeGroupClient.aggregatedListNodeGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeGroupsPagedResponse aggregatedListNodeGroups( + AggregatedListNodeGroupsHttpRequest request) { + return aggregatedListNodeGroupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details + * about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeGroupsHttpRequest request = AggregatedListNodeGroupsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListNodeGroupsPagedResponse> future = nodeGroupClient.aggregatedListNodeGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeGroupsScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable< + AggregatedListNodeGroupsHttpRequest, AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsPagedCallable() { + return stub.aggregatedListNodeGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details + * about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeGroupsHttpRequest request = AggregatedListNodeGroupsHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeGroupAggregatedList response = nodeGroupClient.aggregatedListNodeGroupsCallable().call(request);
+   *     for (NodeGroupsScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + aggregatedListNodeGroupsCallable() { + return stub.aggregatedListNodeGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeGroup resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   Operation response = nodeGroupClient.deleteNodeGroup(nodeGroup);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodeGroup(ProjectZoneNodeGroupName nodeGroup) { + + DeleteNodeGroupHttpRequest request = + DeleteNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup == null ? null : nodeGroup.toString()) + .build(); + return deleteNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeGroup resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   Operation response = nodeGroupClient.deleteNodeGroup(nodeGroup.toString());
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodeGroup(String nodeGroup) { + + DeleteNodeGroupHttpRequest request = + DeleteNodeGroupHttpRequest.newBuilder().setNodeGroup(nodeGroup).build(); + return deleteNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeGroup resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   DeleteNodeGroupHttpRequest request = DeleteNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   Operation response = nodeGroupClient.deleteNodeGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodeGroup(DeleteNodeGroupHttpRequest request) { + return deleteNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeGroup resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   DeleteNodeGroupHttpRequest request = DeleteNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = nodeGroupClient.deleteNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable deleteNodeGroupCallable() { + return stub.deleteNodeGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes specified nodes from the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
+   *   Operation response = nodeGroupClient.deleteNodesNodeGroup(nodeGroup, nodeGroupsDeleteNodesRequestResource);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @param nodeGroupsDeleteNodesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodesNodeGroup( + ProjectZoneNodeGroupName nodeGroup, + NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource) { + + DeleteNodesNodeGroupHttpRequest request = + DeleteNodesNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup == null ? null : nodeGroup.toString()) + .setNodeGroupsDeleteNodesRequestResource(nodeGroupsDeleteNodesRequestResource) + .build(); + return deleteNodesNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes specified nodes from the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
+   *   Operation response = nodeGroupClient.deleteNodesNodeGroup(nodeGroup.toString(), nodeGroupsDeleteNodesRequestResource);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @param nodeGroupsDeleteNodesRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodesNodeGroup( + String nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource) { + + DeleteNodesNodeGroupHttpRequest request = + DeleteNodesNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup) + .setNodeGroupsDeleteNodesRequestResource(nodeGroupsDeleteNodesRequestResource) + .build(); + return deleteNodesNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes specified nodes from the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
+   *   DeleteNodesNodeGroupHttpRequest request = DeleteNodesNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .setNodeGroupsDeleteNodesRequestResource(nodeGroupsDeleteNodesRequestResource)
+   *     .build();
+   *   Operation response = nodeGroupClient.deleteNodesNodeGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodesNodeGroup(DeleteNodesNodeGroupHttpRequest request) { + return deleteNodesNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes specified nodes from the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
+   *   DeleteNodesNodeGroupHttpRequest request = DeleteNodesNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .setNodeGroupsDeleteNodesRequestResource(nodeGroupsDeleteNodesRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = nodeGroupClient.deleteNodesNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + deleteNodesNodeGroupCallable() { + return stub.deleteNodesNodeGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. + * Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroup response = nodeGroupClient.getNodeGroup(nodeGroup);
+   * }
+   * 
+ * + * @param nodeGroup Name of the node group to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeGroup getNodeGroup(ProjectZoneNodeGroupName nodeGroup) { + + GetNodeGroupHttpRequest request = + GetNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup == null ? null : nodeGroup.toString()) + .build(); + return getNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. + * Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroup response = nodeGroupClient.getNodeGroup(nodeGroup.toString());
+   * }
+   * 
+ * + * @param nodeGroup Name of the node group to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeGroup getNodeGroup(String nodeGroup) { + + GetNodeGroupHttpRequest request = + GetNodeGroupHttpRequest.newBuilder().setNodeGroup(nodeGroup).build(); + return getNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. + * Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   GetNodeGroupHttpRequest request = GetNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   NodeGroup response = nodeGroupClient.getNodeGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeGroup getNodeGroup(GetNodeGroupHttpRequest request) { + return getNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. + * Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   GetNodeGroupHttpRequest request = GetNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   ApiFuture<NodeGroup> future = nodeGroupClient.getNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   NodeGroup response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getNodeGroupCallable() { + return stub.getNodeGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   Integer initialNodeCount = 0;
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
+   *   Operation response = nodeGroupClient.insertNodeGroup(initialNodeCount, zone, nodeGroupResource);
+   * }
+   * 
+ * + * @param initialNodeCount Initial count of nodes in the node group. + * @param zone The name of the zone for this request. + * @param nodeGroupResource A NodeGroup resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNodeGroup( + Integer initialNodeCount, ProjectZoneName zone, NodeGroup nodeGroupResource) { + + InsertNodeGroupHttpRequest request = + InsertNodeGroupHttpRequest.newBuilder() + .setInitialNodeCount(initialNodeCount) + .setZone(zone == null ? null : zone.toString()) + .setNodeGroupResource(nodeGroupResource) + .build(); + return insertNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   Integer initialNodeCount = 0;
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
+   *   Operation response = nodeGroupClient.insertNodeGroup(initialNodeCount, zone.toString(), nodeGroupResource);
+   * }
+   * 
+ * + * @param initialNodeCount Initial count of nodes in the node group. + * @param zone The name of the zone for this request. + * @param nodeGroupResource A NodeGroup resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNodeGroup( + Integer initialNodeCount, String zone, NodeGroup nodeGroupResource) { + + InsertNodeGroupHttpRequest request = + InsertNodeGroupHttpRequest.newBuilder() + .setInitialNodeCount(initialNodeCount) + .setZone(zone) + .setNodeGroupResource(nodeGroupResource) + .build(); + return insertNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   Integer initialNodeCount = 0;
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
+   *   InsertNodeGroupHttpRequest request = InsertNodeGroupHttpRequest.newBuilder()
+   *     .setInitialNodeCount(initialNodeCount)
+   *     .setZone(zone.toString())
+   *     .setNodeGroupResource(nodeGroupResource)
+   *     .build();
+   *   Operation response = nodeGroupClient.insertNodeGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNodeGroup(InsertNodeGroupHttpRequest request) { + return insertNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   Integer initialNodeCount = 0;
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
+   *   InsertNodeGroupHttpRequest request = InsertNodeGroupHttpRequest.newBuilder()
+   *     .setInitialNodeCount(initialNodeCount)
+   *     .setZone(zone.toString())
+   *     .setNodeGroupResource(nodeGroupResource)
+   *     .build();
+   *   ApiFuture<Operation> future = nodeGroupClient.insertNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable insertNodeGroupCallable() { + return stub.insertNodeGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node groups available to the specified project. Note: use + * nodeGroups.listNodes for more details about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (NodeGroup element : nodeGroupClient.listNodeGroups(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeGroupsPagedResponse listNodeGroups(ProjectZoneName zone) { + ListNodeGroupsHttpRequest request = + ListNodeGroupsHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listNodeGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node groups available to the specified project. Note: use + * nodeGroups.listNodes for more details about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (NodeGroup element : nodeGroupClient.listNodeGroups(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeGroupsPagedResponse listNodeGroups(String zone) { + ListNodeGroupsHttpRequest request = + ListNodeGroupsHttpRequest.newBuilder().setZone(zone).build(); + return listNodeGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node groups available to the specified project. Note: use + * nodeGroups.listNodes for more details about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListNodeGroupsHttpRequest request = ListNodeGroupsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (NodeGroup element : nodeGroupClient.listNodeGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeGroupsPagedResponse listNodeGroups(ListNodeGroupsHttpRequest request) { + return listNodeGroupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node groups available to the specified project. Note: use + * nodeGroups.listNodes for more details about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListNodeGroupsHttpRequest request = ListNodeGroupsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListNodeGroupsPagedResponse> future = nodeGroupClient.listNodeGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeGroup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listNodeGroupsPagedCallable() { + return stub.listNodeGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node groups available to the specified project. Note: use + * nodeGroups.listNodes for more details about each group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListNodeGroupsHttpRequest request = ListNodeGroupsHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeGroupList response = nodeGroupClient.listNodeGroupsCallable().call(request);
+   *     for (NodeGroup element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listNodeGroupsCallable() { + return stub.listNodeGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists nodes in the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   for (NodeGroupNode element : nodeGroupClient.listNodesNodeGroups(nodeGroup).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource whose nodes you want to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodesNodeGroupsPagedResponse listNodesNodeGroups( + ProjectZoneNodeGroupName nodeGroup) { + ListNodesNodeGroupsHttpRequest request = + ListNodesNodeGroupsHttpRequest.newBuilder() + .setNodeGroup(nodeGroup == null ? null : nodeGroup.toString()) + .build(); + return listNodesNodeGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists nodes in the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   for (NodeGroupNode element : nodeGroupClient.listNodesNodeGroups(nodeGroup.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource whose nodes you want to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodesNodeGroupsPagedResponse listNodesNodeGroups(String nodeGroup) { + ListNodesNodeGroupsHttpRequest request = + ListNodesNodeGroupsHttpRequest.newBuilder().setNodeGroup(nodeGroup).build(); + return listNodesNodeGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists nodes in the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   for (NodeGroupNode element : nodeGroupClient.listNodesNodeGroups(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodesNodeGroupsPagedResponse listNodesNodeGroups( + ListNodesNodeGroupsHttpRequest request) { + return listNodesNodeGroupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists nodes in the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   ApiFuture<ListNodesNodeGroupsPagedResponse> future = nodeGroupClient.listNodesNodeGroupsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeGroupNode element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listNodesNodeGroupsPagedCallable() { + return stub.listNodesNodeGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists nodes in the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeGroupsListNodes response = nodeGroupClient.listNodesNodeGroupsCallable().call(request);
+   *     for (NodeGroupNode element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listNodesNodeGroupsCallable() { + return stub.listNodesNodeGroupsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the node template of the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
+   *   Operation response = nodeGroupClient.setNodeTemplateNodeGroup(nodeGroup, nodeGroupsSetNodeTemplateRequestResource);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @param nodeGroupsSetNodeTemplateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNodeTemplateNodeGroup( + ProjectZoneNodeGroupName nodeGroup, + NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource) { + + SetNodeTemplateNodeGroupHttpRequest request = + SetNodeTemplateNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup == null ? null : nodeGroup.toString()) + .setNodeGroupsSetNodeTemplateRequestResource(nodeGroupsSetNodeTemplateRequestResource) + .build(); + return setNodeTemplateNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the node template of the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
+   *   Operation response = nodeGroupClient.setNodeTemplateNodeGroup(nodeGroup.toString(), nodeGroupsSetNodeTemplateRequestResource);
+   * }
+   * 
+ * + * @param nodeGroup Name of the NodeGroup resource to delete. + * @param nodeGroupsSetNodeTemplateRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNodeTemplateNodeGroup( + String nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource) { + + SetNodeTemplateNodeGroupHttpRequest request = + SetNodeTemplateNodeGroupHttpRequest.newBuilder() + .setNodeGroup(nodeGroup) + .setNodeGroupsSetNodeTemplateRequestResource(nodeGroupsSetNodeTemplateRequestResource) + .build(); + return setNodeTemplateNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the node template of the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
+   *   SetNodeTemplateNodeGroupHttpRequest request = SetNodeTemplateNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .setNodeGroupsSetNodeTemplateRequestResource(nodeGroupsSetNodeTemplateRequestResource)
+   *     .build();
+   *   Operation response = nodeGroupClient.setNodeTemplateNodeGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setNodeTemplateNodeGroup(SetNodeTemplateNodeGroupHttpRequest request) { + return setNodeTemplateNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the node template of the node group. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+   *   NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
+   *   SetNodeTemplateNodeGroupHttpRequest request = SetNodeTemplateNodeGroupHttpRequest.newBuilder()
+   *     .setNodeGroup(nodeGroup.toString())
+   *     .setNodeGroupsSetNodeTemplateRequestResource(nodeGroupsSetNodeTemplateRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = nodeGroupClient.setNodeTemplateNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setNodeTemplateNodeGroupCallable() { + return stub.setNodeTemplateNodeGroupCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListNodeGroupsPagedResponse + extends AbstractPagedListResponse< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList, + AggregatedListNodeGroupsPage, AggregatedListNodeGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListNodeGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListNodeGroupsPagedResponse apply(AggregatedListNodeGroupsPage input) { + return new AggregatedListNodeGroupsPagedResponse(input); + } + }); + } + + private AggregatedListNodeGroupsPagedResponse(AggregatedListNodeGroupsPage page) { + super(page, AggregatedListNodeGroupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class AggregatedListNodeGroupsPage + extends AbstractPage< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList, + AggregatedListNodeGroupsPage> { + + private AggregatedListNodeGroupsPage( + PageContext< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList> + context, + NodeGroupAggregatedList response) { + super(context, response); + } + + private static AggregatedListNodeGroupsPage createEmptyPage() { + return new AggregatedListNodeGroupsPage(null, null); + } + + @Override + protected AggregatedListNodeGroupsPage createPage( + PageContext< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList> + context, + NodeGroupAggregatedList response) { + return new AggregatedListNodeGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class AggregatedListNodeGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList, + AggregatedListNodeGroupsPage, AggregatedListNodeGroupsFixedSizeCollection> { + + private AggregatedListNodeGroupsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListNodeGroupsFixedSizeCollection createEmptyCollection() { + return new AggregatedListNodeGroupsFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListNodeGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListNodeGroupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNodeGroupsPagedResponse + extends AbstractPagedListResponse< + ListNodeGroupsHttpRequest, NodeGroupList, NodeGroup, ListNodeGroupsPage, + ListNodeGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNodeGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNodeGroupsPagedResponse apply(ListNodeGroupsPage input) { + return new ListNodeGroupsPagedResponse(input); + } + }); + } + + private ListNodeGroupsPagedResponse(ListNodeGroupsPage page) { + super(page, ListNodeGroupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNodeGroupsPage + extends AbstractPage< + ListNodeGroupsHttpRequest, NodeGroupList, NodeGroup, ListNodeGroupsPage> { + + private ListNodeGroupsPage( + PageContext context, + NodeGroupList response) { + super(context, response); + } + + private static ListNodeGroupsPage createEmptyPage() { + return new ListNodeGroupsPage(null, null); + } + + @Override + protected ListNodeGroupsPage createPage( + PageContext context, + NodeGroupList response) { + return new ListNodeGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNodeGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNodeGroupsHttpRequest, NodeGroupList, NodeGroup, ListNodeGroupsPage, + ListNodeGroupsFixedSizeCollection> { + + private ListNodeGroupsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNodeGroupsFixedSizeCollection createEmptyCollection() { + return new ListNodeGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListNodeGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNodeGroupsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNodesNodeGroupsPagedResponse + extends AbstractPagedListResponse< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, NodeGroupNode, + ListNodesNodeGroupsPage, ListNodesNodeGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNodesNodeGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNodesNodeGroupsPagedResponse apply(ListNodesNodeGroupsPage input) { + return new ListNodesNodeGroupsPagedResponse(input); + } + }); + } + + private ListNodesNodeGroupsPagedResponse(ListNodesNodeGroupsPage page) { + super(page, ListNodesNodeGroupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNodesNodeGroupsPage + extends AbstractPage< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, NodeGroupNode, + ListNodesNodeGroupsPage> { + + private ListNodesNodeGroupsPage( + PageContext context, + NodeGroupsListNodes response) { + super(context, response); + } + + private static ListNodesNodeGroupsPage createEmptyPage() { + return new ListNodesNodeGroupsPage(null, null); + } + + @Override + protected ListNodesNodeGroupsPage createPage( + PageContext context, + NodeGroupsListNodes response) { + return new ListNodesNodeGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNodesNodeGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, NodeGroupNode, + ListNodesNodeGroupsPage, ListNodesNodeGroupsFixedSizeCollection> { + + private ListNodesNodeGroupsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNodesNodeGroupsFixedSizeCollection createEmptyCollection() { + return new ListNodesNodeGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListNodesNodeGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNodesNodeGroupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupList.java new file mode 100644 index 000000000000..e342b0b0ebb1 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupList.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeGroupList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeGroupList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeGroupList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeGroupList other) { + if (other == NodeGroupList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeGroupList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(NodeGroup items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeGroupList build() { + + return new NodeGroupList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupList) { + NodeGroupList that = (NodeGroupList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupNode.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupNode.java new file mode 100644 index 000000000000..9995f246161b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupNode.java @@ -0,0 +1,245 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeGroupNode implements ApiMessage { + private final List instances; + private final String name; + private final String nodeType; + private final String status; + + private NodeGroupNode() { + this.instances = null; + this.name = null; + this.nodeType = null; + this.status = null; + } + + private NodeGroupNode(List instances, String name, String nodeType, String status) { + this.instances = instances; + this.name = name; + this.nodeType = nodeType; + this.status = status; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("instances")) { + return instances; + } + if (fieldName.equals("name")) { + return name; + } + if (fieldName.equals("nodeType")) { + return nodeType; + } + if (fieldName.equals("status")) { + return status; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public List getInstancesList() { + return instances; + } + + public String getName() { + return name; + } + + public String getNodeType() { + return nodeType; + } + + public String getStatus() { + return status; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupNode prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupNode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupNode DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupNode(); + } + + public static class Builder { + private List instances; + private String name; + private String nodeType; + private String status; + + Builder() {} + + public Builder mergeFrom(NodeGroupNode other) { + if (other == NodeGroupNode.getDefaultInstance()) return this; + if (other.getInstancesList() != null) { + this.instances = other.instances; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNodeType() != null) { + this.nodeType = other.nodeType; + } + if (other.getStatus() != null) { + this.status = other.status; + } + return this; + } + + Builder(NodeGroupNode source) { + this.instances = source.instances; + this.name = source.name; + this.nodeType = source.nodeType; + this.status = source.status; + } + + public List getInstancesList() { + return instances; + } + + public Builder addAllInstances(List instances) { + if (this.instances == null) { + this.instances = new LinkedList<>(); + } + this.instances.addAll(instances); + return this; + } + + public Builder addInstances(String instances) { + if (this.instances == null) { + this.instances = new LinkedList<>(); + } + this.instances.add(instances); + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getNodeType() { + return nodeType; + } + + public Builder setNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public NodeGroupNode build() { + + return new NodeGroupNode(instances, name, nodeType, status); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllInstances(this.instances); + newBuilder.setName(this.name); + newBuilder.setNodeType(this.nodeType); + newBuilder.setStatus(this.status); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupNode{" + + "instances=" + + instances + + ", " + + "name=" + + name + + ", " + + "nodeType=" + + nodeType + + ", " + + "status=" + + status + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupNode) { + NodeGroupNode that = (NodeGroupNode) o; + return Objects.equals(this.instances, that.getInstancesList()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.nodeType, that.getNodeType()) + && Objects.equals(this.status, that.getStatus()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(instances, name, nodeType, status); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupSettings.java new file mode 100644 index 000000000000..2e76d089e277 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupSettings.java @@ -0,0 +1,284 @@ +/* + * Copyright 2018 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 static com.google.cloud.compute.v1.NodeGroupClient.AggregatedListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodesNodeGroupsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.NodeGroupStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NodeGroupClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addNodesNodeGroup to 30 seconds: + * + *

+ * 
+ * NodeGroupSettings.Builder nodeGroupSettingsBuilder =
+ *     NodeGroupSettings.newBuilder();
+ * nodeGroupSettingsBuilder.addNodesNodeGroupSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NodeGroupSettings nodeGroupSettings = nodeGroupSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeGroupSettings extends ClientSettings { + /** Returns the object with the settings used for calls to addNodesNodeGroup. */ + public UnaryCallSettings addNodesNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).addNodesNodeGroupSettings(); + } + + /** Returns the object with the settings used for calls to aggregatedListNodeGroups. */ + public PagedCallSettings< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsSettings() { + return ((NodeGroupStubSettings) getStubSettings()).aggregatedListNodeGroupsSettings(); + } + + /** Returns the object with the settings used for calls to deleteNodeGroup. */ + public UnaryCallSettings deleteNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).deleteNodeGroupSettings(); + } + + /** Returns the object with the settings used for calls to deleteNodesNodeGroup. */ + public UnaryCallSettings + deleteNodesNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).deleteNodesNodeGroupSettings(); + } + + /** Returns the object with the settings used for calls to getNodeGroup. */ + public UnaryCallSettings getNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).getNodeGroupSettings(); + } + + /** Returns the object with the settings used for calls to insertNodeGroup. */ + public UnaryCallSettings insertNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).insertNodeGroupSettings(); + } + + /** Returns the object with the settings used for calls to listNodeGroups. */ + public PagedCallSettings + listNodeGroupsSettings() { + return ((NodeGroupStubSettings) getStubSettings()).listNodeGroupsSettings(); + } + + /** Returns the object with the settings used for calls to listNodesNodeGroups. */ + public PagedCallSettings< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + listNodesNodeGroupsSettings() { + return ((NodeGroupStubSettings) getStubSettings()).listNodesNodeGroupsSettings(); + } + + /** Returns the object with the settings used for calls to setNodeTemplateNodeGroup. */ + public UnaryCallSettings + setNodeTemplateNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).setNodeTemplateNodeGroupSettings(); + } + + public static final NodeGroupSettings create(NodeGroupStubSettings stub) throws IOException { + return new NodeGroupSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return NodeGroupStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return NodeGroupStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return NodeGroupStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return NodeGroupStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return NodeGroupStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return NodeGroupStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return NodeGroupStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NodeGroupStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NodeGroupSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for NodeGroupSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(NodeGroupStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(NodeGroupStubSettings.newBuilder()); + } + + protected Builder(NodeGroupSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(NodeGroupStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public NodeGroupStubSettings.Builder getStubSettingsBuilder() { + return ((NodeGroupStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to addNodesNodeGroup. */ + public UnaryCallSettings.Builder + addNodesNodeGroupSettings() { + return getStubSettingsBuilder().addNodesNodeGroupSettings(); + } + + /** Returns the builder for the settings used for calls to aggregatedListNodeGroups. */ + public PagedCallSettings.Builder< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsSettings() { + return getStubSettingsBuilder().aggregatedListNodeGroupsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNodeGroup. */ + public UnaryCallSettings.Builder + deleteNodeGroupSettings() { + return getStubSettingsBuilder().deleteNodeGroupSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNodesNodeGroup. */ + public UnaryCallSettings.Builder + deleteNodesNodeGroupSettings() { + return getStubSettingsBuilder().deleteNodesNodeGroupSettings(); + } + + /** Returns the builder for the settings used for calls to getNodeGroup. */ + public UnaryCallSettings.Builder getNodeGroupSettings() { + return getStubSettingsBuilder().getNodeGroupSettings(); + } + + /** Returns the builder for the settings used for calls to insertNodeGroup. */ + public UnaryCallSettings.Builder + insertNodeGroupSettings() { + return getStubSettingsBuilder().insertNodeGroupSettings(); + } + + /** Returns the builder for the settings used for calls to listNodeGroups. */ + public PagedCallSettings.Builder< + ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse> + listNodeGroupsSettings() { + return getStubSettingsBuilder().listNodeGroupsSettings(); + } + + /** Returns the builder for the settings used for calls to listNodesNodeGroups. */ + public PagedCallSettings.Builder< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + listNodesNodeGroupsSettings() { + return getStubSettingsBuilder().listNodesNodeGroupsSettings(); + } + + /** Returns the builder for the settings used for calls to setNodeTemplateNodeGroup. */ + public UnaryCallSettings.Builder + setNodeTemplateNodeGroupSettings() { + return getStubSettingsBuilder().setNodeTemplateNodeGroupSettings(); + } + + @Override + public NodeGroupSettings build() throws IOException { + return new NodeGroupSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsAddNodesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsAddNodesRequest.java new file mode 100644 index 000000000000..cd30709cfcf7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsAddNodesRequest.java @@ -0,0 +1,142 @@ +/* + * Copyright 2018 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 NodeGroupsAddNodesRequest implements ApiMessage { + private final Integer additionalNodeCount; + + private NodeGroupsAddNodesRequest() { + this.additionalNodeCount = null; + } + + private NodeGroupsAddNodesRequest(Integer additionalNodeCount) { + this.additionalNodeCount = additionalNodeCount; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("additionalNodeCount")) { + return additionalNodeCount; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public Integer getAdditionalNodeCount() { + return additionalNodeCount; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupsAddNodesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupsAddNodesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupsAddNodesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupsAddNodesRequest(); + } + + public static class Builder { + private Integer additionalNodeCount; + + Builder() {} + + public Builder mergeFrom(NodeGroupsAddNodesRequest other) { + if (other == NodeGroupsAddNodesRequest.getDefaultInstance()) return this; + if (other.getAdditionalNodeCount() != null) { + this.additionalNodeCount = other.additionalNodeCount; + } + return this; + } + + Builder(NodeGroupsAddNodesRequest source) { + this.additionalNodeCount = source.additionalNodeCount; + } + + public Integer getAdditionalNodeCount() { + return additionalNodeCount; + } + + public Builder setAdditionalNodeCount(Integer additionalNodeCount) { + this.additionalNodeCount = additionalNodeCount; + return this; + } + + public NodeGroupsAddNodesRequest build() { + return new NodeGroupsAddNodesRequest(additionalNodeCount); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAdditionalNodeCount(this.additionalNodeCount); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupsAddNodesRequest{" + "additionalNodeCount=" + additionalNodeCount + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupsAddNodesRequest) { + NodeGroupsAddNodesRequest that = (NodeGroupsAddNodesRequest) o; + return Objects.equals(this.additionalNodeCount, that.getAdditionalNodeCount()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(additionalNodeCount); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsDeleteNodesRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsDeleteNodesRequest.java new file mode 100644 index 000000000000..0be377b320ad --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsDeleteNodesRequest.java @@ -0,0 +1,154 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeGroupsDeleteNodesRequest implements ApiMessage { + private final List nodes; + + private NodeGroupsDeleteNodesRequest() { + this.nodes = null; + } + + private NodeGroupsDeleteNodesRequest(List nodes) { + this.nodes = nodes; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("nodes")) { + return nodes; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public List getNodesList() { + return nodes; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupsDeleteNodesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupsDeleteNodesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupsDeleteNodesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupsDeleteNodesRequest(); + } + + public static class Builder { + private List nodes; + + Builder() {} + + public Builder mergeFrom(NodeGroupsDeleteNodesRequest other) { + if (other == NodeGroupsDeleteNodesRequest.getDefaultInstance()) return this; + if (other.getNodesList() != null) { + this.nodes = other.nodes; + } + return this; + } + + Builder(NodeGroupsDeleteNodesRequest source) { + this.nodes = source.nodes; + } + + public List getNodesList() { + return nodes; + } + + public Builder addAllNodes(List nodes) { + if (this.nodes == null) { + this.nodes = new LinkedList<>(); + } + this.nodes.addAll(nodes); + return this; + } + + public Builder addNodes(String nodes) { + if (this.nodes == null) { + this.nodes = new LinkedList<>(); + } + this.nodes.add(nodes); + return this; + } + + public NodeGroupsDeleteNodesRequest build() { + return new NodeGroupsDeleteNodesRequest(nodes); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllNodes(this.nodes); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupsDeleteNodesRequest{" + "nodes=" + nodes + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupsDeleteNodesRequest) { + NodeGroupsDeleteNodesRequest that = (NodeGroupsDeleteNodesRequest) o; + return Objects.equals(this.nodes, that.getNodesList()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodes); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsListNodes.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsListNodes.java new file mode 100644 index 000000000000..634b07ae8f2d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsListNodes.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeGroupsListNodes implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeGroupsListNodes() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeGroupsListNodes( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupsListNodes prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupsListNodes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupsListNodes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupsListNodes(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeGroupsListNodes other) { + if (other == NodeGroupsListNodes.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeGroupsListNodes source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(NodeGroupNode items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeGroupsListNodes build() { + + return new NodeGroupsListNodes(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupsListNodes{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupsListNodes) { + NodeGroupsListNodes that = (NodeGroupsListNodes) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsScopedList.java new file mode 100644 index 000000000000..211cf7180881 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsScopedList.java @@ -0,0 +1,181 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeGroupsScopedList implements ApiMessage { + private final List nodeGroups; + private final Warning warning; + + private NodeGroupsScopedList() { + this.nodeGroups = null; + this.warning = null; + } + + private NodeGroupsScopedList(List nodeGroups, Warning warning) { + this.nodeGroups = nodeGroups; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("nodeGroups")) { + return nodeGroups; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public List getNodeGroupsList() { + return nodeGroups; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupsScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupsScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupsScopedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupsScopedList(); + } + + public static class Builder { + private List nodeGroups; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeGroupsScopedList other) { + if (other == NodeGroupsScopedList.getDefaultInstance()) return this; + if (other.getNodeGroupsList() != null) { + this.nodeGroups = other.nodeGroups; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeGroupsScopedList source) { + this.nodeGroups = source.nodeGroups; + this.warning = source.warning; + } + + public List getNodeGroupsList() { + return nodeGroups; + } + + public Builder addAllNodeGroups(List nodeGroups) { + if (this.nodeGroups == null) { + this.nodeGroups = new LinkedList<>(); + } + this.nodeGroups.addAll(nodeGroups); + return this; + } + + public Builder addNodeGroups(NodeGroup nodeGroups) { + if (this.nodeGroups == null) { + this.nodeGroups = new LinkedList<>(); + } + this.nodeGroups.add(nodeGroups); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeGroupsScopedList build() { + + return new NodeGroupsScopedList(nodeGroups, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllNodeGroups(this.nodeGroups); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupsScopedList{" + "nodeGroups=" + nodeGroups + ", " + "warning=" + warning + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupsScopedList) { + NodeGroupsScopedList that = (NodeGroupsScopedList) o; + return Objects.equals(this.nodeGroups, that.getNodeGroupsList()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeGroups, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsSetNodeTemplateRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsSetNodeTemplateRequest.java new file mode 100644 index 000000000000..23ac44b47122 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeGroupsSetNodeTemplateRequest.java @@ -0,0 +1,142 @@ +/* + * Copyright 2018 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 NodeGroupsSetNodeTemplateRequest implements ApiMessage { + private final String nodeTemplate; + + private NodeGroupsSetNodeTemplateRequest() { + this.nodeTemplate = null; + } + + private NodeGroupsSetNodeTemplateRequest(String nodeTemplate) { + this.nodeTemplate = nodeTemplate; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("nodeTemplate")) { + return nodeTemplate; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getNodeTemplate() { + return nodeTemplate; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeGroupsSetNodeTemplateRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeGroupsSetNodeTemplateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeGroupsSetNodeTemplateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeGroupsSetNodeTemplateRequest(); + } + + public static class Builder { + private String nodeTemplate; + + Builder() {} + + public Builder mergeFrom(NodeGroupsSetNodeTemplateRequest other) { + if (other == NodeGroupsSetNodeTemplateRequest.getDefaultInstance()) return this; + if (other.getNodeTemplate() != null) { + this.nodeTemplate = other.nodeTemplate; + } + return this; + } + + Builder(NodeGroupsSetNodeTemplateRequest source) { + this.nodeTemplate = source.nodeTemplate; + } + + public String getNodeTemplate() { + return nodeTemplate; + } + + public Builder setNodeTemplate(String nodeTemplate) { + this.nodeTemplate = nodeTemplate; + return this; + } + + public NodeGroupsSetNodeTemplateRequest build() { + return new NodeGroupsSetNodeTemplateRequest(nodeTemplate); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setNodeTemplate(this.nodeTemplate); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeGroupsSetNodeTemplateRequest{" + "nodeTemplate=" + nodeTemplate + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeGroupsSetNodeTemplateRequest) { + NodeGroupsSetNodeTemplateRequest that = (NodeGroupsSetNodeTemplateRequest) o; + return Objects.equals(this.nodeTemplate, that.getNodeTemplate()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeTemplate); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplate.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplate.java new file mode 100644 index 000000000000..147d292b9658 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplate.java @@ -0,0 +1,502 @@ +/* + * Copyright 2018 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.Map; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTemplate implements ApiMessage { + private final String creationTimestamp; + private final String description; + private final String id; + private final String kind; + private final String name; + private final Map nodeAffinityLabels; + private final String nodeType; + private final NodeTemplateNodeTypeFlexibility nodeTypeFlexibility; + private final String region; + private final String selfLink; + private final String status; + private final String statusMessage; + + private NodeTemplate() { + this.creationTimestamp = null; + this.description = null; + this.id = null; + this.kind = null; + this.name = null; + this.nodeAffinityLabels = null; + this.nodeType = null; + this.nodeTypeFlexibility = null; + this.region = null; + this.selfLink = null; + this.status = null; + this.statusMessage = null; + } + + private NodeTemplate( + String creationTimestamp, + String description, + String id, + String kind, + String name, + Map nodeAffinityLabels, + String nodeType, + NodeTemplateNodeTypeFlexibility nodeTypeFlexibility, + String region, + String selfLink, + String status, + String statusMessage) { + this.creationTimestamp = creationTimestamp; + this.description = description; + this.id = id; + this.kind = kind; + this.name = name; + this.nodeAffinityLabels = nodeAffinityLabels; + this.nodeType = nodeType; + this.nodeTypeFlexibility = nodeTypeFlexibility; + this.region = region; + this.selfLink = selfLink; + this.status = status; + this.statusMessage = statusMessage; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("creationTimestamp")) { + return creationTimestamp; + } + if (fieldName.equals("description")) { + return description; + } + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("name")) { + return name; + } + if (fieldName.equals("nodeAffinityLabels")) { + return nodeAffinityLabels; + } + if (fieldName.equals("nodeType")) { + return nodeType; + } + if (fieldName.equals("nodeTypeFlexibility")) { + return nodeTypeFlexibility; + } + if (fieldName.equals("region")) { + return region; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("status")) { + return status; + } + if (fieldName.equals("statusMessage")) { + return statusMessage; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public String getDescription() { + return description; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public String getName() { + return name; + } + + public Map getNodeAffinityLabelsMap() { + return nodeAffinityLabels; + } + + public String getNodeType() { + return nodeType; + } + + public NodeTemplateNodeTypeFlexibility getNodeTypeFlexibility() { + return nodeTypeFlexibility; + } + + public String getRegion() { + return region; + } + + public String getSelfLink() { + return selfLink; + } + + public String getStatus() { + return status; + } + + public String getStatusMessage() { + return statusMessage; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTemplate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTemplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTemplate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTemplate(); + } + + public static class Builder { + private String creationTimestamp; + private String description; + private String id; + private String kind; + private String name; + private Map nodeAffinityLabels; + private String nodeType; + private NodeTemplateNodeTypeFlexibility nodeTypeFlexibility; + private String region; + private String selfLink; + private String status; + private String statusMessage; + + Builder() {} + + public Builder mergeFrom(NodeTemplate other) { + if (other == NodeTemplate.getDefaultInstance()) return this; + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getNodeAffinityLabelsMap() != null) { + this.nodeAffinityLabels = other.nodeAffinityLabels; + } + if (other.getNodeType() != null) { + this.nodeType = other.nodeType; + } + if (other.getNodeTypeFlexibility() != null) { + this.nodeTypeFlexibility = other.nodeTypeFlexibility; + } + if (other.getRegion() != null) { + this.region = other.region; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getStatus() != null) { + this.status = other.status; + } + if (other.getStatusMessage() != null) { + this.statusMessage = other.statusMessage; + } + return this; + } + + Builder(NodeTemplate source) { + this.creationTimestamp = source.creationTimestamp; + this.description = source.description; + this.id = source.id; + this.kind = source.kind; + this.name = source.name; + this.nodeAffinityLabels = source.nodeAffinityLabels; + this.nodeType = source.nodeType; + this.nodeTypeFlexibility = source.nodeTypeFlexibility; + this.region = source.region; + this.selfLink = source.selfLink; + this.status = source.status; + this.statusMessage = source.statusMessage; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public Map getNodeAffinityLabelsMap() { + return nodeAffinityLabels; + } + + public Builder putAllNodeAffinityLabels(Map nodeAffinityLabels) { + this.nodeAffinityLabels = nodeAffinityLabels; + return this; + } + + public String getNodeType() { + return nodeType; + } + + public Builder setNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + public NodeTemplateNodeTypeFlexibility getNodeTypeFlexibility() { + return nodeTypeFlexibility; + } + + public Builder setNodeTypeFlexibility(NodeTemplateNodeTypeFlexibility nodeTypeFlexibility) { + this.nodeTypeFlexibility = nodeTypeFlexibility; + return this; + } + + public String getRegion() { + return region; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getStatus() { + return status; + } + + public Builder setStatus(String status) { + this.status = status; + return this; + } + + public String getStatusMessage() { + return statusMessage; + } + + public Builder setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + public NodeTemplate build() { + + return new NodeTemplate( + creationTimestamp, + description, + id, + kind, + name, + nodeAffinityLabels, + nodeType, + nodeTypeFlexibility, + region, + selfLink, + status, + statusMessage); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDescription(this.description); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setName(this.name); + newBuilder.putAllNodeAffinityLabels(this.nodeAffinityLabels); + newBuilder.setNodeType(this.nodeType); + newBuilder.setNodeTypeFlexibility(this.nodeTypeFlexibility); + newBuilder.setRegion(this.region); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setStatus(this.status); + newBuilder.setStatusMessage(this.statusMessage); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTemplate{" + + "creationTimestamp=" + + creationTimestamp + + ", " + + "description=" + + description + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "name=" + + name + + ", " + + "nodeAffinityLabels=" + + nodeAffinityLabels + + ", " + + "nodeType=" + + nodeType + + ", " + + "nodeTypeFlexibility=" + + nodeTypeFlexibility + + ", " + + "region=" + + region + + ", " + + "selfLink=" + + selfLink + + ", " + + "status=" + + status + + ", " + + "statusMessage=" + + statusMessage + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTemplate) { + NodeTemplate that = (NodeTemplate) o; + return Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.nodeAffinityLabels, that.getNodeAffinityLabelsMap()) + && Objects.equals(this.nodeType, that.getNodeType()) + && Objects.equals(this.nodeTypeFlexibility, that.getNodeTypeFlexibility()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.status, that.getStatus()) + && Objects.equals(this.statusMessage, that.getStatusMessage()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + creationTimestamp, + description, + id, + kind, + name, + nodeAffinityLabels, + nodeType, + nodeTypeFlexibility, + region, + selfLink, + status, + statusMessage); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateAggregatedList.java new file mode 100644 index 000000000000..4910879e246b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 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.Map; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTemplateAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeTemplateAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeTemplateAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTemplateAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTemplateAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTemplateAggregatedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTemplateAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeTemplateAggregatedList other) { + if (other == NodeTemplateAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeTemplateAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeTemplateAggregatedList build() { + + return new NodeTemplateAggregatedList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTemplateAggregatedList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTemplateAggregatedList) { + NodeTemplateAggregatedList that = (NodeTemplateAggregatedList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java new file mode 100644 index 000000000000..56a69b07f751 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java @@ -0,0 +1,944 @@ +/* + * Copyright 2018 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.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.NodeTemplateStub; +import com.google.cloud.compute.v1.stub.NodeTemplateStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+ *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+ *   Operation response = nodeTemplateClient.deleteNodeTemplate(nodeTemplate);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the nodeTemplateClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of NodeTemplateSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * NodeTemplateSettings nodeTemplateSettings =
+ *     NodeTemplateSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * NodeTemplateClient nodeTemplateClient =
+ *     NodeTemplateClient.create(nodeTemplateSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * NodeTemplateSettings nodeTemplateSettings =
+ *     NodeTemplateSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NodeTemplateClient nodeTemplateClient =
+ *     NodeTemplateClient.create(nodeTemplateSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeTemplateClient implements BackgroundResource { + private final NodeTemplateSettings settings; + private final NodeTemplateStub stub; + + /** Constructs an instance of NodeTemplateClient with default settings. */ + public static final NodeTemplateClient create() throws IOException { + return create(NodeTemplateSettings.newBuilder().build()); + } + + /** + * Constructs an instance of NodeTemplateClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final NodeTemplateClient create(NodeTemplateSettings settings) throws IOException { + return new NodeTemplateClient(settings); + } + + /** + * Constructs an instance of NodeTemplateClient, using the given stub for making calls. This is + * for advanced usage - prefer to use NodeTemplateSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final NodeTemplateClient create(NodeTemplateStub stub) { + return new NodeTemplateClient(stub); + } + + /** + * Constructs an instance of NodeTemplateClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected NodeTemplateClient(NodeTemplateSettings settings) throws IOException { + this.settings = settings; + this.stub = ((NodeTemplateStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected NodeTemplateClient(NodeTemplateStub stub) { + this.settings = null; + this.stub = stub; + } + + public final NodeTemplateSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NodeTemplateStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node templates. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (NodeTemplatesScopedList element : nodeTemplateClient.aggregatedListNodeTemplates(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeTemplatesPagedResponse aggregatedListNodeTemplates( + ProjectName project) { + AggregatedListNodeTemplatesHttpRequest request = + AggregatedListNodeTemplatesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListNodeTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node templates. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (NodeTemplatesScopedList element : nodeTemplateClient.aggregatedListNodeTemplates(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeTemplatesPagedResponse aggregatedListNodeTemplates( + String project) { + AggregatedListNodeTemplatesHttpRequest request = + AggregatedListNodeTemplatesHttpRequest.newBuilder().setProject(project).build(); + return aggregatedListNodeTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node templates. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeTemplatesHttpRequest request = AggregatedListNodeTemplatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (NodeTemplatesScopedList element : nodeTemplateClient.aggregatedListNodeTemplates(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeTemplatesPagedResponse aggregatedListNodeTemplates( + AggregatedListNodeTemplatesHttpRequest request) { + return aggregatedListNodeTemplatesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node templates. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeTemplatesHttpRequest request = AggregatedListNodeTemplatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListNodeTemplatesPagedResponse> future = nodeTemplateClient.aggregatedListNodeTemplatesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeTemplatesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable< + AggregatedListNodeTemplatesHttpRequest, AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesPagedCallable() { + return stub.aggregatedListNodeTemplatesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node templates. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeTemplatesHttpRequest request = AggregatedListNodeTemplatesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeTemplateAggregatedList response = nodeTemplateClient.aggregatedListNodeTemplatesCallable().call(request);
+   *     for (NodeTemplatesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + aggregatedListNodeTemplatesCallable() { + return stub.aggregatedListNodeTemplatesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeTemplate resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   Operation response = nodeTemplateClient.deleteNodeTemplate(nodeTemplate);
+   * }
+   * 
+ * + * @param nodeTemplate Name of the NodeTemplate resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodeTemplate(ProjectRegionNodeTemplateName nodeTemplate) { + + DeleteNodeTemplateHttpRequest request = + DeleteNodeTemplateHttpRequest.newBuilder() + .setNodeTemplate(nodeTemplate == null ? null : nodeTemplate.toString()) + .build(); + return deleteNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeTemplate resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   Operation response = nodeTemplateClient.deleteNodeTemplate(nodeTemplate.toString());
+   * }
+   * 
+ * + * @param nodeTemplate Name of the NodeTemplate resource to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodeTemplate(String nodeTemplate) { + + DeleteNodeTemplateHttpRequest request = + DeleteNodeTemplateHttpRequest.newBuilder().setNodeTemplate(nodeTemplate).build(); + return deleteNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeTemplate resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   DeleteNodeTemplateHttpRequest request = DeleteNodeTemplateHttpRequest.newBuilder()
+   *     .setNodeTemplate(nodeTemplate.toString())
+   *     .build();
+   *   Operation response = nodeTemplateClient.deleteNodeTemplate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation deleteNodeTemplate(DeleteNodeTemplateHttpRequest request) { + return deleteNodeTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified NodeTemplate resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   DeleteNodeTemplateHttpRequest request = DeleteNodeTemplateHttpRequest.newBuilder()
+   *     .setNodeTemplate(nodeTemplate.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = nodeTemplateClient.deleteNodeTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + deleteNodeTemplateCallable() { + return stub.deleteNodeTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node template. Gets a list of available node templates by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   NodeTemplate response = nodeTemplateClient.getNodeTemplate(nodeTemplate);
+   * }
+   * 
+ * + * @param nodeTemplate Name of the node template to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeTemplate getNodeTemplate(ProjectRegionNodeTemplateName nodeTemplate) { + + GetNodeTemplateHttpRequest request = + GetNodeTemplateHttpRequest.newBuilder() + .setNodeTemplate(nodeTemplate == null ? null : nodeTemplate.toString()) + .build(); + return getNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node template. Gets a list of available node templates by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   NodeTemplate response = nodeTemplateClient.getNodeTemplate(nodeTemplate.toString());
+   * }
+   * 
+ * + * @param nodeTemplate Name of the node template to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeTemplate getNodeTemplate(String nodeTemplate) { + + GetNodeTemplateHttpRequest request = + GetNodeTemplateHttpRequest.newBuilder().setNodeTemplate(nodeTemplate).build(); + return getNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node template. Gets a list of available node templates by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   GetNodeTemplateHttpRequest request = GetNodeTemplateHttpRequest.newBuilder()
+   *     .setNodeTemplate(nodeTemplate.toString())
+   *     .build();
+   *   NodeTemplate response = nodeTemplateClient.getNodeTemplate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeTemplate getNodeTemplate(GetNodeTemplateHttpRequest request) { + return getNodeTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node template. Gets a list of available node templates by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+   *   GetNodeTemplateHttpRequest request = GetNodeTemplateHttpRequest.newBuilder()
+   *     .setNodeTemplate(nodeTemplate.toString())
+   *     .build();
+   *   ApiFuture<NodeTemplate> future = nodeTemplateClient.getNodeTemplateCallable().futureCall(request);
+   *   // Do something
+   *   NodeTemplate response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getNodeTemplateCallable() { + return stub.getNodeTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeTemplate resource in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   NodeTemplate nodeTemplateResource = NodeTemplate.newBuilder().build();
+   *   Operation response = nodeTemplateClient.insertNodeTemplate(region, nodeTemplateResource);
+   * }
+   * 
+ * + * @param region The name of the region for this request. + * @param nodeTemplateResource A Node Template resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNodeTemplate( + ProjectRegionName region, NodeTemplate nodeTemplateResource) { + + InsertNodeTemplateHttpRequest request = + InsertNodeTemplateHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .setNodeTemplateResource(nodeTemplateResource) + .build(); + return insertNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeTemplate resource in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   NodeTemplate nodeTemplateResource = NodeTemplate.newBuilder().build();
+   *   Operation response = nodeTemplateClient.insertNodeTemplate(region.toString(), nodeTemplateResource);
+   * }
+   * 
+ * + * @param region The name of the region for this request. + * @param nodeTemplateResource A Node Template resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNodeTemplate(String region, NodeTemplate nodeTemplateResource) { + + InsertNodeTemplateHttpRequest request = + InsertNodeTemplateHttpRequest.newBuilder() + .setRegion(region) + .setNodeTemplateResource(nodeTemplateResource) + .build(); + return insertNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeTemplate resource in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   NodeTemplate nodeTemplateResource = NodeTemplate.newBuilder().build();
+   *   InsertNodeTemplateHttpRequest request = InsertNodeTemplateHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setNodeTemplateResource(nodeTemplateResource)
+   *     .build();
+   *   Operation response = nodeTemplateClient.insertNodeTemplate(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation insertNodeTemplate(InsertNodeTemplateHttpRequest request) { + return insertNodeTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a NodeTemplate resource in the specified project using the data included in the + * request. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   NodeTemplate nodeTemplateResource = NodeTemplate.newBuilder().build();
+   *   InsertNodeTemplateHttpRequest request = InsertNodeTemplateHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .setNodeTemplateResource(nodeTemplateResource)
+   *     .build();
+   *   ApiFuture<Operation> future = nodeTemplateClient.insertNodeTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + insertNodeTemplateCallable() { + return stub.insertNodeTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node templates available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   for (NodeTemplate element : nodeTemplateClient.listNodeTemplates(region).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region The name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeTemplatesPagedResponse listNodeTemplates(ProjectRegionName region) { + ListNodeTemplatesHttpRequest request = + ListNodeTemplatesHttpRequest.newBuilder() + .setRegion(region == null ? null : region.toString()) + .build(); + return listNodeTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node templates available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   for (NodeTemplate element : nodeTemplateClient.listNodeTemplates(region.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param region The name of the region for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeTemplatesPagedResponse listNodeTemplates(String region) { + ListNodeTemplatesHttpRequest request = + ListNodeTemplatesHttpRequest.newBuilder().setRegion(region).build(); + return listNodeTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node templates available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListNodeTemplatesHttpRequest request = ListNodeTemplatesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   for (NodeTemplate element : nodeTemplateClient.listNodeTemplates(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeTemplatesPagedResponse listNodeTemplates( + ListNodeTemplatesHttpRequest request) { + return listNodeTemplatesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node templates available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListNodeTemplatesHttpRequest request = ListNodeTemplatesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   ApiFuture<ListNodeTemplatesPagedResponse> future = nodeTemplateClient.listNodeTemplatesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeTemplate element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listNodeTemplatesPagedCallable() { + return stub.listNodeTemplatesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node templates available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+   *   ListNodeTemplatesHttpRequest request = ListNodeTemplatesHttpRequest.newBuilder()
+   *     .setRegion(region.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeTemplateList response = nodeTemplateClient.listNodeTemplatesCallable().call(request);
+   *     for (NodeTemplate element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listNodeTemplatesCallable() { + return stub.listNodeTemplatesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListNodeTemplatesPagedResponse + extends AbstractPagedListResponse< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList, AggregatedListNodeTemplatesPage, + AggregatedListNodeTemplatesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListNodeTemplatesPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction< + AggregatedListNodeTemplatesPage, AggregatedListNodeTemplatesPagedResponse>() { + @Override + public AggregatedListNodeTemplatesPagedResponse apply( + AggregatedListNodeTemplatesPage input) { + return new AggregatedListNodeTemplatesPagedResponse(input); + } + }); + } + + private AggregatedListNodeTemplatesPagedResponse(AggregatedListNodeTemplatesPage page) { + super(page, AggregatedListNodeTemplatesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class AggregatedListNodeTemplatesPage + extends AbstractPage< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList, AggregatedListNodeTemplatesPage> { + + private AggregatedListNodeTemplatesPage( + PageContext< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList> + context, + NodeTemplateAggregatedList response) { + super(context, response); + } + + private static AggregatedListNodeTemplatesPage createEmptyPage() { + return new AggregatedListNodeTemplatesPage(null, null); + } + + @Override + protected AggregatedListNodeTemplatesPage createPage( + PageContext< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList> + context, + NodeTemplateAggregatedList response) { + return new AggregatedListNodeTemplatesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class AggregatedListNodeTemplatesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList, AggregatedListNodeTemplatesPage, + AggregatedListNodeTemplatesFixedSizeCollection> { + + private AggregatedListNodeTemplatesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListNodeTemplatesFixedSizeCollection createEmptyCollection() { + return new AggregatedListNodeTemplatesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListNodeTemplatesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListNodeTemplatesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNodeTemplatesPagedResponse + extends AbstractPagedListResponse< + ListNodeTemplatesHttpRequest, NodeTemplateList, NodeTemplate, ListNodeTemplatesPage, + ListNodeTemplatesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNodeTemplatesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNodeTemplatesPagedResponse apply(ListNodeTemplatesPage input) { + return new ListNodeTemplatesPagedResponse(input); + } + }); + } + + private ListNodeTemplatesPagedResponse(ListNodeTemplatesPage page) { + super(page, ListNodeTemplatesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNodeTemplatesPage + extends AbstractPage< + ListNodeTemplatesHttpRequest, NodeTemplateList, NodeTemplate, ListNodeTemplatesPage> { + + private ListNodeTemplatesPage( + PageContext context, + NodeTemplateList response) { + super(context, response); + } + + private static ListNodeTemplatesPage createEmptyPage() { + return new ListNodeTemplatesPage(null, null); + } + + @Override + protected ListNodeTemplatesPage createPage( + PageContext context, + NodeTemplateList response) { + return new ListNodeTemplatesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNodeTemplatesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNodeTemplatesHttpRequest, NodeTemplateList, NodeTemplate, ListNodeTemplatesPage, + ListNodeTemplatesFixedSizeCollection> { + + private ListNodeTemplatesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNodeTemplatesFixedSizeCollection createEmptyCollection() { + return new ListNodeTemplatesFixedSizeCollection(null, 0); + } + + @Override + protected ListNodeTemplatesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNodeTemplatesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateList.java new file mode 100644 index 000000000000..21f93618d15f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateList.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTemplateList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeTemplateList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeTemplateList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTemplateList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTemplateList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTemplateList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTemplateList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeTemplateList other) { + if (other == NodeTemplateList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeTemplateList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(NodeTemplate items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeTemplateList build() { + + return new NodeTemplateList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTemplateList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTemplateList) { + NodeTemplateList that = (NodeTemplateList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateNodeTypeFlexibility.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateNodeTypeFlexibility.java new file mode 100644 index 000000000000..27b2095425c5 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateNodeTypeFlexibility.java @@ -0,0 +1,204 @@ +/* + * Copyright 2018 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 NodeTemplateNodeTypeFlexibility implements ApiMessage { + private final String cpus; + private final String localSsd; + private final String memory; + + private NodeTemplateNodeTypeFlexibility() { + this.cpus = null; + this.localSsd = null; + this.memory = null; + } + + private NodeTemplateNodeTypeFlexibility(String cpus, String localSsd, String memory) { + this.cpus = cpus; + this.localSsd = localSsd; + this.memory = memory; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("cpus")) { + return cpus; + } + if (fieldName.equals("localSsd")) { + return localSsd; + } + if (fieldName.equals("memory")) { + return memory; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getCpus() { + return cpus; + } + + public String getLocalSsd() { + return localSsd; + } + + public String getMemory() { + return memory; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTemplateNodeTypeFlexibility prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTemplateNodeTypeFlexibility getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTemplateNodeTypeFlexibility DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTemplateNodeTypeFlexibility(); + } + + public static class Builder { + private String cpus; + private String localSsd; + private String memory; + + Builder() {} + + public Builder mergeFrom(NodeTemplateNodeTypeFlexibility other) { + if (other == NodeTemplateNodeTypeFlexibility.getDefaultInstance()) return this; + if (other.getCpus() != null) { + this.cpus = other.cpus; + } + if (other.getLocalSsd() != null) { + this.localSsd = other.localSsd; + } + if (other.getMemory() != null) { + this.memory = other.memory; + } + return this; + } + + Builder(NodeTemplateNodeTypeFlexibility source) { + this.cpus = source.cpus; + this.localSsd = source.localSsd; + this.memory = source.memory; + } + + public String getCpus() { + return cpus; + } + + public Builder setCpus(String cpus) { + this.cpus = cpus; + return this; + } + + public String getLocalSsd() { + return localSsd; + } + + public Builder setLocalSsd(String localSsd) { + this.localSsd = localSsd; + return this; + } + + public String getMemory() { + return memory; + } + + public Builder setMemory(String memory) { + this.memory = memory; + return this; + } + + public NodeTemplateNodeTypeFlexibility build() { + + return new NodeTemplateNodeTypeFlexibility(cpus, localSsd, memory); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCpus(this.cpus); + newBuilder.setLocalSsd(this.localSsd); + newBuilder.setMemory(this.memory); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTemplateNodeTypeFlexibility{" + + "cpus=" + + cpus + + ", " + + "localSsd=" + + localSsd + + ", " + + "memory=" + + memory + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTemplateNodeTypeFlexibility) { + NodeTemplateNodeTypeFlexibility that = (NodeTemplateNodeTypeFlexibility) o; + return Objects.equals(this.cpus, that.getCpus()) + && Objects.equals(this.localSsd, that.getLocalSsd()) + && Objects.equals(this.memory, that.getMemory()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(cpus, localSsd, memory); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateSettings.java new file mode 100644 index 000000000000..e3bcbf26d9d5 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateSettings.java @@ -0,0 +1,237 @@ +/* + * Copyright 2018 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 static com.google.cloud.compute.v1.NodeTemplateClient.AggregatedListNodeTemplatesPagedResponse; +import static com.google.cloud.compute.v1.NodeTemplateClient.ListNodeTemplatesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.NodeTemplateStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NodeTemplateClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteNodeTemplate to 30 seconds: + * + *

+ * 
+ * NodeTemplateSettings.Builder nodeTemplateSettingsBuilder =
+ *     NodeTemplateSettings.newBuilder();
+ * nodeTemplateSettingsBuilder.deleteNodeTemplateSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NodeTemplateSettings nodeTemplateSettings = nodeTemplateSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeTemplateSettings extends ClientSettings { + /** Returns the object with the settings used for calls to aggregatedListNodeTemplates. */ + public PagedCallSettings< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).aggregatedListNodeTemplatesSettings(); + } + + /** Returns the object with the settings used for calls to deleteNodeTemplate. */ + public UnaryCallSettings deleteNodeTemplateSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).deleteNodeTemplateSettings(); + } + + /** Returns the object with the settings used for calls to getNodeTemplate. */ + public UnaryCallSettings getNodeTemplateSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).getNodeTemplateSettings(); + } + + /** Returns the object with the settings used for calls to insertNodeTemplate. */ + public UnaryCallSettings insertNodeTemplateSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).insertNodeTemplateSettings(); + } + + /** Returns the object with the settings used for calls to listNodeTemplates. */ + public PagedCallSettings< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + listNodeTemplatesSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).listNodeTemplatesSettings(); + } + + public static final NodeTemplateSettings create(NodeTemplateStubSettings stub) + throws IOException { + return new NodeTemplateSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return NodeTemplateStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return NodeTemplateStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return NodeTemplateStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return NodeTemplateStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return NodeTemplateStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return NodeTemplateStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return NodeTemplateStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NodeTemplateStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NodeTemplateSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for NodeTemplateSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(NodeTemplateStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(NodeTemplateStubSettings.newBuilder()); + } + + protected Builder(NodeTemplateSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(NodeTemplateStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public NodeTemplateStubSettings.Builder getStubSettingsBuilder() { + return ((NodeTemplateStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to aggregatedListNodeTemplates. */ + public PagedCallSettings.Builder< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesSettings() { + return getStubSettingsBuilder().aggregatedListNodeTemplatesSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNodeTemplate. */ + public UnaryCallSettings.Builder + deleteNodeTemplateSettings() { + return getStubSettingsBuilder().deleteNodeTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to getNodeTemplate. */ + public UnaryCallSettings.Builder + getNodeTemplateSettings() { + return getStubSettingsBuilder().getNodeTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to insertNodeTemplate. */ + public UnaryCallSettings.Builder + insertNodeTemplateSettings() { + return getStubSettingsBuilder().insertNodeTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to listNodeTemplates. */ + public PagedCallSettings.Builder< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + listNodeTemplatesSettings() { + return getStubSettingsBuilder().listNodeTemplatesSettings(); + } + + @Override + public NodeTemplateSettings build() throws IOException { + return new NodeTemplateSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplatesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplatesScopedList.java new file mode 100644 index 000000000000..c701dd941a2e --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplatesScopedList.java @@ -0,0 +1,187 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTemplatesScopedList implements ApiMessage { + private final List nodeTemplates; + private final Warning warning; + + private NodeTemplatesScopedList() { + this.nodeTemplates = null; + this.warning = null; + } + + private NodeTemplatesScopedList(List nodeTemplates, Warning warning) { + this.nodeTemplates = nodeTemplates; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("nodeTemplates")) { + return nodeTemplates; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public List getNodeTemplatesList() { + return nodeTemplates; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTemplatesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTemplatesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTemplatesScopedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTemplatesScopedList(); + } + + public static class Builder { + private List nodeTemplates; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeTemplatesScopedList other) { + if (other == NodeTemplatesScopedList.getDefaultInstance()) return this; + if (other.getNodeTemplatesList() != null) { + this.nodeTemplates = other.nodeTemplates; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeTemplatesScopedList source) { + this.nodeTemplates = source.nodeTemplates; + this.warning = source.warning; + } + + public List getNodeTemplatesList() { + return nodeTemplates; + } + + public Builder addAllNodeTemplates(List nodeTemplates) { + if (this.nodeTemplates == null) { + this.nodeTemplates = new LinkedList<>(); + } + this.nodeTemplates.addAll(nodeTemplates); + return this; + } + + public Builder addNodeTemplates(NodeTemplate nodeTemplates) { + if (this.nodeTemplates == null) { + this.nodeTemplates = new LinkedList<>(); + } + this.nodeTemplates.add(nodeTemplates); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeTemplatesScopedList build() { + + return new NodeTemplatesScopedList(nodeTemplates, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllNodeTemplates(this.nodeTemplates); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTemplatesScopedList{" + + "nodeTemplates=" + + nodeTemplates + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTemplatesScopedList) { + NodeTemplatesScopedList that = (NodeTemplatesScopedList) o; + return Objects.equals(this.nodeTemplates, that.getNodeTemplatesList()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeTemplates, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeType.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeType.java new file mode 100644 index 000000000000..0b4af8f65098 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeType.java @@ -0,0 +1,501 @@ +/* + * Copyright 2018 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 NodeType implements ApiMessage { + private final String cpuPlatform; + private final String creationTimestamp; + private final DeprecationStatus deprecated; + private final String description; + private final Integer guestCpus; + private final String id; + private final String kind; + private final Integer localSsdGb; + private final Integer memoryMb; + private final String name; + private final String selfLink; + private final String zone; + + private NodeType() { + this.cpuPlatform = null; + this.creationTimestamp = null; + this.deprecated = null; + this.description = null; + this.guestCpus = null; + this.id = null; + this.kind = null; + this.localSsdGb = null; + this.memoryMb = null; + this.name = null; + this.selfLink = null; + this.zone = null; + } + + private NodeType( + String cpuPlatform, + String creationTimestamp, + DeprecationStatus deprecated, + String description, + Integer guestCpus, + String id, + String kind, + Integer localSsdGb, + Integer memoryMb, + String name, + String selfLink, + String zone) { + this.cpuPlatform = cpuPlatform; + this.creationTimestamp = creationTimestamp; + this.deprecated = deprecated; + this.description = description; + this.guestCpus = guestCpus; + this.id = id; + this.kind = kind; + this.localSsdGb = localSsdGb; + this.memoryMb = memoryMb; + this.name = name; + this.selfLink = selfLink; + this.zone = zone; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("cpuPlatform")) { + return cpuPlatform; + } + if (fieldName.equals("creationTimestamp")) { + return creationTimestamp; + } + if (fieldName.equals("deprecated")) { + return deprecated; + } + if (fieldName.equals("description")) { + return description; + } + if (fieldName.equals("guestCpus")) { + return guestCpus; + } + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("localSsdGb")) { + return localSsdGb; + } + if (fieldName.equals("memoryMb")) { + return memoryMb; + } + if (fieldName.equals("name")) { + return name; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("zone")) { + return zone; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getCpuPlatform() { + return cpuPlatform; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public String getDescription() { + return description; + } + + public Integer getGuestCpus() { + return guestCpus; + } + + public String getId() { + return id; + } + + public String getKind() { + return kind; + } + + public Integer getLocalSsdGb() { + return localSsdGb; + } + + public Integer getMemoryMb() { + return memoryMb; + } + + public String getName() { + return name; + } + + public String getSelfLink() { + return selfLink; + } + + public String getZone() { + return zone; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeType(); + } + + public static class Builder { + private String cpuPlatform; + private String creationTimestamp; + private DeprecationStatus deprecated; + private String description; + private Integer guestCpus; + private String id; + private String kind; + private Integer localSsdGb; + private Integer memoryMb; + private String name; + private String selfLink; + private String zone; + + Builder() {} + + public Builder mergeFrom(NodeType other) { + if (other == NodeType.getDefaultInstance()) return this; + if (other.getCpuPlatform() != null) { + this.cpuPlatform = other.cpuPlatform; + } + if (other.getCreationTimestamp() != null) { + this.creationTimestamp = other.creationTimestamp; + } + if (other.getDeprecated() != null) { + this.deprecated = other.deprecated; + } + if (other.getDescription() != null) { + this.description = other.description; + } + if (other.getGuestCpus() != null) { + this.guestCpus = other.guestCpus; + } + if (other.getId() != null) { + this.id = other.id; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getLocalSsdGb() != null) { + this.localSsdGb = other.localSsdGb; + } + if (other.getMemoryMb() != null) { + this.memoryMb = other.memoryMb; + } + if (other.getName() != null) { + this.name = other.name; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getZone() != null) { + this.zone = other.zone; + } + return this; + } + + Builder(NodeType source) { + this.cpuPlatform = source.cpuPlatform; + this.creationTimestamp = source.creationTimestamp; + this.deprecated = source.deprecated; + this.description = source.description; + this.guestCpus = source.guestCpus; + this.id = source.id; + this.kind = source.kind; + this.localSsdGb = source.localSsdGb; + this.memoryMb = source.memoryMb; + this.name = source.name; + this.selfLink = source.selfLink; + this.zone = source.zone; + } + + public String getCpuPlatform() { + return cpuPlatform; + } + + public Builder setCpuPlatform(String cpuPlatform) { + this.cpuPlatform = cpuPlatform; + return this; + } + + public String getCreationTimestamp() { + return creationTimestamp; + } + + public Builder setCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + public DeprecationStatus getDeprecated() { + return deprecated; + } + + public Builder setDeprecated(DeprecationStatus deprecated) { + this.deprecated = deprecated; + return this; + } + + public String getDescription() { + return description; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Integer getGuestCpus() { + return guestCpus; + } + + public Builder setGuestCpus(Integer guestCpus) { + this.guestCpus = guestCpus; + return this; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public Integer getLocalSsdGb() { + return localSsdGb; + } + + public Builder setLocalSsdGb(Integer localSsdGb) { + this.localSsdGb = localSsdGb; + return this; + } + + public Integer getMemoryMb() { + return memoryMb; + } + + public Builder setMemoryMb(Integer memoryMb) { + this.memoryMb = memoryMb; + return this; + } + + public String getName() { + return name; + } + + public Builder setName(String name) { + this.name = name; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public String getZone() { + return zone; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + public NodeType build() { + + return new NodeType( + cpuPlatform, + creationTimestamp, + deprecated, + description, + guestCpus, + id, + kind, + localSsdGb, + memoryMb, + name, + selfLink, + zone); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setCpuPlatform(this.cpuPlatform); + newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDeprecated(this.deprecated); + newBuilder.setDescription(this.description); + newBuilder.setGuestCpus(this.guestCpus); + newBuilder.setId(this.id); + newBuilder.setKind(this.kind); + newBuilder.setLocalSsdGb(this.localSsdGb); + newBuilder.setMemoryMb(this.memoryMb); + newBuilder.setName(this.name); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setZone(this.zone); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeType{" + + "cpuPlatform=" + + cpuPlatform + + ", " + + "creationTimestamp=" + + creationTimestamp + + ", " + + "deprecated=" + + deprecated + + ", " + + "description=" + + description + + ", " + + "guestCpus=" + + guestCpus + + ", " + + "id=" + + id + + ", " + + "kind=" + + kind + + ", " + + "localSsdGb=" + + localSsdGb + + ", " + + "memoryMb=" + + memoryMb + + ", " + + "name=" + + name + + ", " + + "selfLink=" + + selfLink + + ", " + + "zone=" + + zone + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeType) { + NodeType that = (NodeType) o; + return Objects.equals(this.cpuPlatform, that.getCpuPlatform()) + && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.deprecated, that.getDeprecated()) + && Objects.equals(this.description, that.getDescription()) + && Objects.equals(this.guestCpus, that.getGuestCpus()) + && Objects.equals(this.id, that.getId()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.localSsdGb, that.getLocalSsdGb()) + && Objects.equals(this.memoryMb, that.getMemoryMb()) + && Objects.equals(this.name, that.getName()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + cpuPlatform, + creationTimestamp, + deprecated, + description, + guestCpus, + id, + kind, + localSsdGb, + memoryMb, + name, + selfLink, + zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeAggregatedList.java new file mode 100644 index 000000000000..54ebcd889c93 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeAggregatedList.java @@ -0,0 +1,298 @@ +/* + * Copyright 2018 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.Map; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTypeAggregatedList implements ApiMessage { + private final String id; + private final Map items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeTypeAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeTypeAggregatedList( + String id, + Map items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public Map getItemsMap() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTypeAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTypeAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTypeAggregatedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTypeAggregatedList(); + } + + public static class Builder { + private String id; + private Map items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeTypeAggregatedList other) { + if (other == NodeTypeAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsMap() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeTypeAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public Map getItemsMap() { + return items; + } + + public Builder putAllItems(Map items) { + this.items = items; + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeTypeAggregatedList build() { + + return new NodeTypeAggregatedList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.putAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTypeAggregatedList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTypeAggregatedList) { + NodeTypeAggregatedList that = (NodeTypeAggregatedList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsMap()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeClient.java new file mode 100644 index 000000000000..6199dcccd3f7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeClient.java @@ -0,0 +1,710 @@ +/* + * Copyright 2018 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.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.stub.NodeTypeStub; +import com.google.cloud.compute.v1.stub.NodeTypeStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+ *   ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]");
+ *   NodeType response = nodeTypeClient.getNodeType(nodeType);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the nodeTypeClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of NodeTypeSettings to create(). + * For example: + * + *

To customize credentials: + * + *

+ * 
+ * NodeTypeSettings nodeTypeSettings =
+ *     NodeTypeSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * NodeTypeClient nodeTypeClient =
+ *     NodeTypeClient.create(nodeTypeSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * NodeTypeSettings nodeTypeSettings =
+ *     NodeTypeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NodeTypeClient nodeTypeClient =
+ *     NodeTypeClient.create(nodeTypeSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeTypeClient implements BackgroundResource { + private final NodeTypeSettings settings; + private final NodeTypeStub stub; + + /** Constructs an instance of NodeTypeClient with default settings. */ + public static final NodeTypeClient create() throws IOException { + return create(NodeTypeSettings.newBuilder().build()); + } + + /** + * Constructs an instance of NodeTypeClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final NodeTypeClient create(NodeTypeSettings settings) throws IOException { + return new NodeTypeClient(settings); + } + + /** + * Constructs an instance of NodeTypeClient, using the given stub for making calls. This is for + * advanced usage - prefer to use NodeTypeSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final NodeTypeClient create(NodeTypeStub stub) { + return new NodeTypeClient(stub); + } + + /** + * Constructs an instance of NodeTypeClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected NodeTypeClient(NodeTypeSettings settings) throws IOException { + this.settings = settings; + this.stub = ((NodeTypeStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected NodeTypeClient(NodeTypeStub stub) { + this.settings = null; + this.stub = stub; + } + + public final NodeTypeSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NodeTypeStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node types. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (NodeTypesScopedList element : nodeTypeClient.aggregatedListNodeTypes(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeTypesPagedResponse aggregatedListNodeTypes(ProjectName project) { + AggregatedListNodeTypesHttpRequest request = + AggregatedListNodeTypesHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return aggregatedListNodeTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node types. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (NodeTypesScopedList element : nodeTypeClient.aggregatedListNodeTypes(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeTypesPagedResponse aggregatedListNodeTypes(String project) { + AggregatedListNodeTypesHttpRequest request = + AggregatedListNodeTypesHttpRequest.newBuilder().setProject(project).build(); + return aggregatedListNodeTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node types. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeTypesHttpRequest request = AggregatedListNodeTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (NodeTypesScopedList element : nodeTypeClient.aggregatedListNodeTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final AggregatedListNodeTypesPagedResponse aggregatedListNodeTypes( + AggregatedListNodeTypesHttpRequest request) { + return aggregatedListNodeTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node types. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeTypesHttpRequest request = AggregatedListNodeTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<AggregatedListNodeTypesPagedResponse> future = nodeTypeClient.aggregatedListNodeTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeTypesScopedList element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable< + AggregatedListNodeTypesHttpRequest, AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesPagedCallable() { + return stub.aggregatedListNodeTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of node types. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   AggregatedListNodeTypesHttpRequest request = AggregatedListNodeTypesHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeTypeAggregatedList response = nodeTypeClient.aggregatedListNodeTypesCallable().call(request);
+   *     for (NodeTypesScopedList element : response.getItemsMap()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + aggregatedListNodeTypesCallable() { + return stub.aggregatedListNodeTypesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node type. Gets a list of available node types by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]");
+   *   NodeType response = nodeTypeClient.getNodeType(nodeType);
+   * }
+   * 
+ * + * @param nodeType Name of the node type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeType getNodeType(ProjectZoneNodeTypeName nodeType) { + + GetNodeTypeHttpRequest request = + GetNodeTypeHttpRequest.newBuilder() + .setNodeType(nodeType == null ? null : nodeType.toString()) + .build(); + return getNodeType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node type. Gets a list of available node types by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]");
+   *   NodeType response = nodeTypeClient.getNodeType(nodeType.toString());
+   * }
+   * 
+ * + * @param nodeType Name of the node type to return. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeType getNodeType(String nodeType) { + + GetNodeTypeHttpRequest request = + GetNodeTypeHttpRequest.newBuilder().setNodeType(nodeType).build(); + return getNodeType(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node type. Gets a list of available node types by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]");
+   *   GetNodeTypeHttpRequest request = GetNodeTypeHttpRequest.newBuilder()
+   *     .setNodeType(nodeType.toString())
+   *     .build();
+   *   NodeType response = nodeTypeClient.getNodeType(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final NodeType getNodeType(GetNodeTypeHttpRequest request) { + return getNodeTypeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified node type. Gets a list of available node types by making a list() + * request. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]");
+   *   GetNodeTypeHttpRequest request = GetNodeTypeHttpRequest.newBuilder()
+   *     .setNodeType(nodeType.toString())
+   *     .build();
+   *   ApiFuture<NodeType> future = nodeTypeClient.getNodeTypeCallable().futureCall(request);
+   *   // Do something
+   *   NodeType response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getNodeTypeCallable() { + return stub.getNodeTypeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node types available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (NodeType element : nodeTypeClient.listNodeTypes(zone).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeTypesPagedResponse listNodeTypes(ProjectZoneName zone) { + ListNodeTypesHttpRequest request = + ListNodeTypesHttpRequest.newBuilder() + .setZone(zone == null ? null : zone.toString()) + .build(); + return listNodeTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node types available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   for (NodeType element : nodeTypeClient.listNodeTypes(zone.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param zone The name of the zone for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeTypesPagedResponse listNodeTypes(String zone) { + ListNodeTypesHttpRequest request = ListNodeTypesHttpRequest.newBuilder().setZone(zone).build(); + return listNodeTypes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node types available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListNodeTypesHttpRequest request = ListNodeTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   for (NodeType element : nodeTypeClient.listNodeTypes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListNodeTypesPagedResponse listNodeTypes(ListNodeTypesHttpRequest request) { + return listNodeTypesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node types available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListNodeTypesHttpRequest request = ListNodeTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   ApiFuture<ListNodeTypesPagedResponse> future = nodeTypeClient.listNodeTypesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NodeType element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listNodeTypesPagedCallable() { + return stub.listNodeTypesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves a list of node types available to the specified project. + * + *

Sample code: + * + *


+   * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+   *   ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+   *   ListNodeTypesHttpRequest request = ListNodeTypesHttpRequest.newBuilder()
+   *     .setZone(zone.toString())
+   *     .build();
+   *   while (true) {
+   *     NodeTypeList response = nodeTypeClient.listNodeTypesCallable().call(request);
+   *     for (NodeType element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable listNodeTypesCallable() { + return stub.listNodeTypesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class AggregatedListNodeTypesPagedResponse + extends AbstractPagedListResponse< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, NodeTypesScopedList, + AggregatedListNodeTypesPage, AggregatedListNodeTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + AggregatedListNodeTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public AggregatedListNodeTypesPagedResponse apply(AggregatedListNodeTypesPage input) { + return new AggregatedListNodeTypesPagedResponse(input); + } + }); + } + + private AggregatedListNodeTypesPagedResponse(AggregatedListNodeTypesPage page) { + super(page, AggregatedListNodeTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class AggregatedListNodeTypesPage + extends AbstractPage< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, NodeTypesScopedList, + AggregatedListNodeTypesPage> { + + private AggregatedListNodeTypesPage( + PageContext + context, + NodeTypeAggregatedList response) { + super(context, response); + } + + private static AggregatedListNodeTypesPage createEmptyPage() { + return new AggregatedListNodeTypesPage(null, null); + } + + @Override + protected AggregatedListNodeTypesPage createPage( + PageContext + context, + NodeTypeAggregatedList response) { + return new AggregatedListNodeTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class AggregatedListNodeTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, NodeTypesScopedList, + AggregatedListNodeTypesPage, AggregatedListNodeTypesFixedSizeCollection> { + + private AggregatedListNodeTypesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static AggregatedListNodeTypesFixedSizeCollection createEmptyCollection() { + return new AggregatedListNodeTypesFixedSizeCollection(null, 0); + } + + @Override + protected AggregatedListNodeTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new AggregatedListNodeTypesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNodeTypesPagedResponse + extends AbstractPagedListResponse< + ListNodeTypesHttpRequest, NodeTypeList, NodeType, ListNodeTypesPage, + ListNodeTypesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNodeTypesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNodeTypesPagedResponse apply(ListNodeTypesPage input) { + return new ListNodeTypesPagedResponse(input); + } + }); + } + + private ListNodeTypesPagedResponse(ListNodeTypesPage page) { + super(page, ListNodeTypesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNodeTypesPage + extends AbstractPage { + + private ListNodeTypesPage( + PageContext context, + NodeTypeList response) { + super(context, response); + } + + private static ListNodeTypesPage createEmptyPage() { + return new ListNodeTypesPage(null, null); + } + + @Override + protected ListNodeTypesPage createPage( + PageContext context, + NodeTypeList response) { + return new ListNodeTypesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNodeTypesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNodeTypesHttpRequest, NodeTypeList, NodeType, ListNodeTypesPage, + ListNodeTypesFixedSizeCollection> { + + private ListNodeTypesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNodeTypesFixedSizeCollection createEmptyCollection() { + return new ListNodeTypesFixedSizeCollection(null, 0); + } + + @Override + protected ListNodeTypesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNodeTypesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeList.java new file mode 100644 index 000000000000..fce0b82991a7 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeList.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTypeList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private NodeTypeList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private NodeTypeList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTypeList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTypeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTypeList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTypeList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeTypeList other) { + if (other == NodeTypeList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeTypeList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(NodeType items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeTypeList build() { + + return new NodeTypeList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTypeList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTypeList) { + NodeTypeList that = (NodeTypeList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeSettings.java new file mode 100644 index 000000000000..6a04a8d10b6d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypeSettings.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 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 static com.google.cloud.compute.v1.NodeTypeClient.AggregatedListNodeTypesPagedResponse; +import static com.google.cloud.compute.v1.NodeTypeClient.ListNodeTypesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.compute.v1.stub.NodeTypeStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NodeTypeClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getNodeType to 30 seconds: + * + *

+ * 
+ * NodeTypeSettings.Builder nodeTypeSettingsBuilder =
+ *     NodeTypeSettings.newBuilder();
+ * nodeTypeSettingsBuilder.getNodeTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NodeTypeSettings nodeTypeSettings = nodeTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeTypeSettings extends ClientSettings { + /** Returns the object with the settings used for calls to aggregatedListNodeTypes. */ + public PagedCallSettings< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesSettings() { + return ((NodeTypeStubSettings) getStubSettings()).aggregatedListNodeTypesSettings(); + } + + /** Returns the object with the settings used for calls to getNodeType. */ + public UnaryCallSettings getNodeTypeSettings() { + return ((NodeTypeStubSettings) getStubSettings()).getNodeTypeSettings(); + } + + /** Returns the object with the settings used for calls to listNodeTypes. */ + public PagedCallSettings + listNodeTypesSettings() { + return ((NodeTypeStubSettings) getStubSettings()).listNodeTypesSettings(); + } + + public static final NodeTypeSettings create(NodeTypeStubSettings stub) throws IOException { + return new NodeTypeSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return NodeTypeStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return NodeTypeStubSettings.getDefaultEndpoint(); + } + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return NodeTypeStubSettings.getDefaultServicePort(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return NodeTypeStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return NodeTypeStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return NodeTypeStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return NodeTypeStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return NodeTypeStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NodeTypeSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for NodeTypeSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(NodeTypeStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(NodeTypeStubSettings.newBuilder()); + } + + protected Builder(NodeTypeSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(NodeTypeStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public NodeTypeStubSettings.Builder getStubSettingsBuilder() { + return ((NodeTypeStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to aggregatedListNodeTypes. */ + public PagedCallSettings.Builder< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesSettings() { + return getStubSettingsBuilder().aggregatedListNodeTypesSettings(); + } + + /** Returns the builder for the settings used for calls to getNodeType. */ + public UnaryCallSettings.Builder getNodeTypeSettings() { + return getStubSettingsBuilder().getNodeTypeSettings(); + } + + /** Returns the builder for the settings used for calls to listNodeTypes. */ + public PagedCallSettings.Builder< + ListNodeTypesHttpRequest, NodeTypeList, ListNodeTypesPagedResponse> + listNodeTypesSettings() { + return getStubSettingsBuilder().listNodeTypesSettings(); + } + + @Override + public NodeTypeSettings build() throws IOException { + return new NodeTypeSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypesScopedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypesScopedList.java new file mode 100644 index 000000000000..6b06fd320478 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTypesScopedList.java @@ -0,0 +1,181 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class NodeTypesScopedList implements ApiMessage { + private final List nodeTypes; + private final Warning warning; + + private NodeTypesScopedList() { + this.nodeTypes = null; + this.warning = null; + } + + private NodeTypesScopedList(List nodeTypes, Warning warning) { + this.nodeTypes = nodeTypes; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("nodeTypes")) { + return nodeTypes; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public List getNodeTypesList() { + return nodeTypes; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(NodeTypesScopedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static NodeTypesScopedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final NodeTypesScopedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new NodeTypesScopedList(); + } + + public static class Builder { + private List nodeTypes; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(NodeTypesScopedList other) { + if (other == NodeTypesScopedList.getDefaultInstance()) return this; + if (other.getNodeTypesList() != null) { + this.nodeTypes = other.nodeTypes; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(NodeTypesScopedList source) { + this.nodeTypes = source.nodeTypes; + this.warning = source.warning; + } + + public List getNodeTypesList() { + return nodeTypes; + } + + public Builder addAllNodeTypes(List nodeTypes) { + if (this.nodeTypes == null) { + this.nodeTypes = new LinkedList<>(); + } + this.nodeTypes.addAll(nodeTypes); + return this; + } + + public Builder addNodeTypes(NodeType nodeTypes) { + if (this.nodeTypes == null) { + this.nodeTypes = new LinkedList<>(); + } + this.nodeTypes.add(nodeTypes); + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public NodeTypesScopedList build() { + + return new NodeTypesScopedList(nodeTypes, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.addAllNodeTypes(this.nodeTypes); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "NodeTypesScopedList{" + "nodeTypes=" + nodeTypes + ", " + "warning=" + warning + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NodeTypesScopedList) { + NodeTypesScopedList that = (NodeTypesScopedList) o; + return Objects.equals(this.nodeTypes, that.getNodeTypesList()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeTypes, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectAttachmentHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectAttachmentHttpRequest.java new file mode 100644 index 000000000000..260d91ddf112 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInterconnectAttachmentHttpRequest.java @@ -0,0 +1,489 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class PatchInterconnectAttachmentHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final List fieldMask; + private final String fields; + private final String interconnectAttachment; + private final InterconnectAttachment interconnectAttachmentResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private PatchInterconnectAttachmentHttpRequest() { + this.access_token = null; + this.callback = null; + this.fieldMask = null; + this.fields = null; + this.interconnectAttachment = null; + this.interconnectAttachmentResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private PatchInterconnectAttachmentHttpRequest( + String access_token, + String callback, + List fieldMask, + String fields, + String interconnectAttachment, + InterconnectAttachment interconnectAttachmentResource, + String key, + String prettyPrint, + String quotaUser, + String requestId, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fieldMask = fieldMask; + this.fields = fields; + this.interconnectAttachment = interconnectAttachment; + this.interconnectAttachmentResource = interconnectAttachmentResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fieldMask")) { + return fieldMask; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("interconnectAttachment")) { + return interconnectAttachment; + } + if (fieldName.equals("interconnectAttachmentResource")) { + return interconnectAttachmentResource; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("requestId")) { + return requestId; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public InterconnectAttachment getApiMessageRequestBody() { + return interconnectAttachmentResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public List getFieldMask() { + return fieldMask; + } + + public String getFields() { + return fields; + } + + public String getInterconnectAttachment() { + return interconnectAttachment; + } + + public InterconnectAttachment getInterconnectAttachmentResource() { + return interconnectAttachmentResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(PatchInterconnectAttachmentHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchInterconnectAttachmentHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final PatchInterconnectAttachmentHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new PatchInterconnectAttachmentHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private List fieldMask; + private String fields; + private String interconnectAttachment; + private InterconnectAttachment interconnectAttachmentResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchInterconnectAttachmentHttpRequest other) { + if (other == PatchInterconnectAttachmentHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFieldMask() != null) { + this.fieldMask = other.fieldMask; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getInterconnectAttachment() != null) { + this.interconnectAttachment = other.interconnectAttachment; + } + if (other.getInterconnectAttachmentResource() != null) { + this.interconnectAttachmentResource = other.interconnectAttachmentResource; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(PatchInterconnectAttachmentHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fieldMask = source.fieldMask; + this.fields = source.fields; + this.interconnectAttachment = source.interconnectAttachment; + this.interconnectAttachmentResource = source.interconnectAttachmentResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public List getFieldMask() { + return fieldMask; + } + + public Builder addAllFieldMask(List fieldMask) { + if (this.fieldMask == null) { + this.fieldMask = new LinkedList<>(); + } + this.fieldMask.addAll(fieldMask); + return this; + } + + public Builder addFieldMask(String fieldMask) { + if (this.fieldMask == null) { + this.fieldMask = new LinkedList<>(); + } + this.fieldMask.add(fieldMask); + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getInterconnectAttachment() { + return interconnectAttachment; + } + + public Builder setInterconnectAttachment(String interconnectAttachment) { + this.interconnectAttachment = interconnectAttachment; + return this; + } + + public InterconnectAttachment getInterconnectAttachmentResource() { + return interconnectAttachmentResource; + } + + public Builder setInterconnectAttachmentResource( + InterconnectAttachment interconnectAttachmentResource) { + this.interconnectAttachmentResource = interconnectAttachmentResource; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public PatchInterconnectAttachmentHttpRequest build() { + String missing = ""; + + if (fieldMask == null) { + missing += " fieldMask"; + } + + if (interconnectAttachment == null) { + missing += " interconnectAttachment"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchInterconnectAttachmentHttpRequest( + access_token, + callback, + fieldMask, + fields, + interconnectAttachment, + interconnectAttachmentResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.addAllFieldMask(this.fieldMask); + newBuilder.setFields(this.fields); + newBuilder.setInterconnectAttachment(this.interconnectAttachment); + newBuilder.setInterconnectAttachmentResource(this.interconnectAttachmentResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "PatchInterconnectAttachmentHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fieldMask=" + + fieldMask + + ", " + + "fields=" + + fields + + ", " + + "interconnectAttachment=" + + interconnectAttachment + + ", " + + "interconnectAttachmentResource=" + + interconnectAttachmentResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchInterconnectAttachmentHttpRequest) { + PatchInterconnectAttachmentHttpRequest that = (PatchInterconnectAttachmentHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fieldMask, that.getFieldMask()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnectAttachment, that.getInterconnectAttachment()) + && Objects.equals( + this.interconnectAttachmentResource, that.getInterconnectAttachmentResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fieldMask, + fields, + interconnectAttachment, + interconnectAttachmentResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java index 8e0ce629b1be..fc528b82313a 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Project.java @@ -28,6 +28,7 @@ public final class Project implements ApiMessage { private final Metadata commonInstanceMetadata; private final String creationTimestamp; + private final String defaultNetworkTier; private final String defaultServiceAccount; private final String description; private final List enabledFeatures; @@ -42,6 +43,7 @@ public final class Project implements ApiMessage { private Project() { this.commonInstanceMetadata = null; this.creationTimestamp = null; + this.defaultNetworkTier = null; this.defaultServiceAccount = null; this.description = null; this.enabledFeatures = null; @@ -57,6 +59,7 @@ private Project() { private Project( Metadata commonInstanceMetadata, String creationTimestamp, + String defaultNetworkTier, String defaultServiceAccount, String description, List enabledFeatures, @@ -69,6 +72,7 @@ private Project( String xpnProjectStatus) { this.commonInstanceMetadata = commonInstanceMetadata; this.creationTimestamp = creationTimestamp; + this.defaultNetworkTier = defaultNetworkTier; this.defaultServiceAccount = defaultServiceAccount; this.description = description; this.enabledFeatures = enabledFeatures; @@ -89,6 +93,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("creationTimestamp")) { return creationTimestamp; } + if (fieldName.equals("defaultNetworkTier")) { + return defaultNetworkTier; + } if (fieldName.equals("defaultServiceAccount")) { return defaultServiceAccount; } @@ -142,6 +149,10 @@ public String getCreationTimestamp() { return creationTimestamp; } + public String getDefaultNetworkTier() { + return defaultNetworkTier; + } + public String getDefaultServiceAccount() { return defaultServiceAccount; } @@ -207,6 +218,7 @@ public static Project getDefaultInstance() { public static class Builder { private Metadata commonInstanceMetadata; private String creationTimestamp; + private String defaultNetworkTier; private String defaultServiceAccount; private String description; private List enabledFeatures; @@ -228,6 +240,9 @@ public Builder mergeFrom(Project other) { if (other.getCreationTimestamp() != null) { this.creationTimestamp = other.creationTimestamp; } + if (other.getDefaultNetworkTier() != null) { + this.defaultNetworkTier = other.defaultNetworkTier; + } if (other.getDefaultServiceAccount() != null) { this.defaultServiceAccount = other.defaultServiceAccount; } @@ -264,6 +279,7 @@ public Builder mergeFrom(Project other) { Builder(Project source) { this.commonInstanceMetadata = source.commonInstanceMetadata; this.creationTimestamp = source.creationTimestamp; + this.defaultNetworkTier = source.defaultNetworkTier; this.defaultServiceAccount = source.defaultServiceAccount; this.description = source.description; this.enabledFeatures = source.enabledFeatures; @@ -294,6 +310,15 @@ public Builder setCreationTimestamp(String creationTimestamp) { return this; } + public String getDefaultNetworkTier() { + return defaultNetworkTier; + } + + public Builder setDefaultNetworkTier(String defaultNetworkTier) { + this.defaultNetworkTier = defaultNetworkTier; + return this; + } + public String getDefaultServiceAccount() { return defaultServiceAccount; } @@ -411,6 +436,7 @@ public Project build() { return new Project( commonInstanceMetadata, creationTimestamp, + defaultNetworkTier, defaultServiceAccount, description, enabledFeatures, @@ -427,6 +453,7 @@ public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setCommonInstanceMetadata(this.commonInstanceMetadata); newBuilder.setCreationTimestamp(this.creationTimestamp); + newBuilder.setDefaultNetworkTier(this.defaultNetworkTier); newBuilder.setDefaultServiceAccount(this.defaultServiceAccount); newBuilder.setDescription(this.description); newBuilder.addAllEnabledFeatures(this.enabledFeatures); @@ -450,6 +477,9 @@ public String toString() { + "creationTimestamp=" + creationTimestamp + ", " + + "defaultNetworkTier=" + + defaultNetworkTier + + ", " + "defaultServiceAccount=" + defaultServiceAccount + ", " @@ -491,6 +521,7 @@ public boolean equals(Object o) { Project that = (Project) o; return Objects.equals(this.commonInstanceMetadata, that.getCommonInstanceMetadata()) && Objects.equals(this.creationTimestamp, that.getCreationTimestamp()) + && Objects.equals(this.defaultNetworkTier, that.getDefaultNetworkTier()) && Objects.equals(this.defaultServiceAccount, that.getDefaultServiceAccount()) && Objects.equals(this.description, that.getDescription()) && Objects.equals(this.enabledFeatures, that.getEnabledFeaturesList()) @@ -510,6 +541,7 @@ public int hashCode() { return Objects.hash( commonInstanceMetadata, creationTimestamp, + defaultNetworkTier, defaultServiceAccount, description, enabledFeatures, diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java index 51c5f47b353a..c6d3139c3ab4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectClient.java @@ -1401,6 +1401,127 @@ public final Operation setCommonInstanceMetadataProject( return stub.setCommonInstanceMetadataProjectCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the default network tier of the project. The default network tier is used when an + * address/forwardingRule/instance is created without specifying the network tier field. + * + *

Sample code: + * + *


+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = ProjectsSetDefaultNetworkTierRequest.newBuilder().build();
+   *   Operation response = projectClient.setDefaultNetworkTierProject(project, projectsSetDefaultNetworkTierRequestResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param projectsSetDefaultNetworkTierRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDefaultNetworkTierProject( + ProjectName project, + ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource) { + + SetDefaultNetworkTierProjectHttpRequest request = + SetDefaultNetworkTierProjectHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .setProjectsSetDefaultNetworkTierRequestResource( + projectsSetDefaultNetworkTierRequestResource) + .build(); + return setDefaultNetworkTierProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the default network tier of the project. The default network tier is used when an + * address/forwardingRule/instance is created without specifying the network tier field. + * + *

Sample code: + * + *


+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = ProjectsSetDefaultNetworkTierRequest.newBuilder().build();
+   *   Operation response = projectClient.setDefaultNetworkTierProject(project.toString(), projectsSetDefaultNetworkTierRequestResource);
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @param projectsSetDefaultNetworkTierRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDefaultNetworkTierProject( + String project, + ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource) { + + SetDefaultNetworkTierProjectHttpRequest request = + SetDefaultNetworkTierProjectHttpRequest.newBuilder() + .setProject(project) + .setProjectsSetDefaultNetworkTierRequestResource( + projectsSetDefaultNetworkTierRequestResource) + .build(); + return setDefaultNetworkTierProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the default network tier of the project. The default network tier is used when an + * address/forwardingRule/instance is created without specifying the network tier field. + * + *

Sample code: + * + *


+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = ProjectsSetDefaultNetworkTierRequest.newBuilder().build();
+   *   SetDefaultNetworkTierProjectHttpRequest request = SetDefaultNetworkTierProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setProjectsSetDefaultNetworkTierRequestResource(projectsSetDefaultNetworkTierRequestResource)
+   *     .build();
+   *   Operation response = projectClient.setDefaultNetworkTierProject(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setDefaultNetworkTierProject( + SetDefaultNetworkTierProjectHttpRequest request) { + return setDefaultNetworkTierProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the default network tier of the project. The default network tier is used when an + * address/forwardingRule/instance is created without specifying the network tier field. + * + *

Sample code: + * + *


+   * try (ProjectClient projectClient = ProjectClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = ProjectsSetDefaultNetworkTierRequest.newBuilder().build();
+   *   SetDefaultNetworkTierProjectHttpRequest request = SetDefaultNetworkTierProjectHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .setProjectsSetDefaultNetworkTierRequestResource(projectsSetDefaultNetworkTierRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = projectClient.setDefaultNetworkTierProjectCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setDefaultNetworkTierProjectCallable() { + return stub.setDefaultNetworkTierProjectCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Enables the usage export feature and sets the usage export bucket where reports are stored. If diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateName.java new file mode 100644 index 000000000000..1f97533463fa --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateName.java @@ -0,0 +1,186 @@ +/* + * Copyright 2018 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectRegionNodeTemplateName implements ResourceName { + private final String nodeTemplate; + private final String project; + private final String region; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionNodeTemplateName(Builder builder) { + nodeTemplate = Preconditions.checkNotNull(builder.getNodeTemplate()); + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public static ProjectRegionNodeTemplateName of( + String nodeTemplate, String project, String region) { + return newBuilder().setNodeTemplate(nodeTemplate).setProject(project).setRegion(region).build(); + } + + public static String format(String nodeTemplate, String project, String region) { + return of(nodeTemplate, project, region).toString(); + } + + public String getNodeTemplate() { + return nodeTemplate; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("nodeTemplate", nodeTemplate); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionNodeTemplateName parse(String formattedString) { + return ProjectRegionNodeTemplateName.parse(formattedString); + } + }; + } + + public static ProjectRegionNodeTemplateName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionNodeTemplateName.parse: formattedString not in valid format"); + return of(matchMap.get("nodeTemplate"), matchMap.get("project"), matchMap.get("region")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String nodeTemplate; + private String project; + private String region; + + public String getNodeTemplate() { + return nodeTemplate; + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public Builder setNodeTemplate(String nodeTemplate) { + this.nodeTemplate = nodeTemplate; + return this; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder() {} + + public Builder(ProjectRegionNodeTemplateName projectRegionNodeTemplateName) { + nodeTemplate = projectRegionNodeTemplateName.nodeTemplate; + project = projectRegionNodeTemplateName.project; + region = projectRegionNodeTemplateName.region; + } + + public ProjectRegionNodeTemplateName build() { + return new ProjectRegionNodeTemplateName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "nodeTemplate", nodeTemplate, + "project", project, + "region", region); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionNodeTemplateName) { + ProjectRegionNodeTemplateName that = (ProjectRegionNodeTemplateName) o; + return Objects.equals(this.nodeTemplate, that.getNodeTemplate()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeTemplate, project, region); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java index 6a4ef22a9f2e..3fa5af953878 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectSettings.java @@ -130,6 +130,12 @@ public UnaryCallSettings moveDiskProjectS return ((ProjectStubSettings) getStubSettings()).setCommonInstanceMetadataProjectSettings(); } + /** Returns the object with the settings used for calls to setDefaultNetworkTierProject. */ + public UnaryCallSettings + setDefaultNetworkTierProjectSettings() { + return ((ProjectStubSettings) getStubSettings()).setDefaultNetworkTierProjectSettings(); + } + /** Returns the object with the settings used for calls to setUsageExportBucketProject. */ public UnaryCallSettings setUsageExportBucketProjectSettings() { @@ -305,6 +311,12 @@ public UnaryCallSettings.Builder getProjectSetti return getStubSettingsBuilder().setCommonInstanceMetadataProjectSettings(); } + /** Returns the builder for the settings used for calls to setDefaultNetworkTierProject. */ + public UnaryCallSettings.Builder + setDefaultNetworkTierProjectSettings() { + return getStubSettingsBuilder().setDefaultNetworkTierProjectSettings(); + } + /** Returns the builder for the settings used for calls to setUsageExportBucketProject. */ public UnaryCallSettings.Builder setUsageExportBucketProjectSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupName.java new file mode 100644 index 000000000000..113b4ab5231a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupName.java @@ -0,0 +1,184 @@ +/* + * Copyright 2018 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectZoneNodeGroupName implements ResourceName { + private final String nodeGroup; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectZoneNodeGroupName(Builder builder) { + nodeGroup = Preconditions.checkNotNull(builder.getNodeGroup()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static ProjectZoneNodeGroupName of(String nodeGroup, String project, String zone) { + return newBuilder().setNodeGroup(nodeGroup).setProject(project).setZone(zone).build(); + } + + public static String format(String nodeGroup, String project, String zone) { + return of(nodeGroup, project, zone).toString(); + } + + public String getNodeGroup() { + return nodeGroup; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("nodeGroup", nodeGroup); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectZoneNodeGroupName parse(String formattedString) { + return ProjectZoneNodeGroupName.parse(formattedString); + } + }; + } + + public static ProjectZoneNodeGroupName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneNodeGroupName.parse: formattedString not in valid format"); + return of(matchMap.get("nodeGroup"), matchMap.get("project"), matchMap.get("zone")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String nodeGroup; + private String project; + private String zone; + + public String getNodeGroup() { + return nodeGroup; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + public Builder setNodeGroup(String nodeGroup) { + this.nodeGroup = nodeGroup; + return this; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder(ProjectZoneNodeGroupName projectZoneNodeGroupName) { + nodeGroup = projectZoneNodeGroupName.nodeGroup; + project = projectZoneNodeGroupName.project; + zone = projectZoneNodeGroupName.zone; + } + + public ProjectZoneNodeGroupName build() { + return new ProjectZoneNodeGroupName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "nodeGroup", nodeGroup, + "project", project, + "zone", zone); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectZoneNodeGroupName) { + ProjectZoneNodeGroupName that = (ProjectZoneNodeGroupName) o; + return Objects.equals(this.nodeGroup, that.getNodeGroup()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeGroup, project, zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeTypeName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeTypeName.java new file mode 100644 index 000000000000..64bd450b3d41 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeTypeName.java @@ -0,0 +1,183 @@ +/* + * Copyright 2018 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.api.resourcenames.ResourceNameFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +@Generated("by GAPIC") +@BetaApi +public final class ProjectZoneNodeTypeName implements ResourceName { + private final String nodeType; + private final String project; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/nodeTypes/{nodeType}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectZoneNodeTypeName(Builder builder) { + nodeType = Preconditions.checkNotNull(builder.getNodeType()); + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static ProjectZoneNodeTypeName of(String nodeType, String project, String zone) { + return newBuilder().setNodeType(nodeType).setProject(project).setZone(zone).build(); + } + + public static String format(String nodeType, String project, String zone) { + return of(nodeType, project, zone).toString(); + } + + public String getNodeType() { + return nodeType; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("nodeType", nodeType); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("zone", zone); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectZoneNodeTypeName parse(String formattedString) { + return ProjectZoneNodeTypeName.parse(formattedString); + } + }; + } + + public static ProjectZoneNodeTypeName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectZoneNodeTypeName.parse: formattedString not in valid format"); + return of(matchMap.get("nodeType"), matchMap.get("project"), matchMap.get("zone")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String nodeType; + private String project; + private String zone; + + public String getNodeType() { + return nodeType; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + public Builder setNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder(ProjectZoneNodeTypeName projectZoneNodeTypeName) { + nodeType = projectZoneNodeTypeName.nodeType; + project = projectZoneNodeTypeName.project; + zone = projectZoneNodeTypeName.zone; + } + + public ProjectZoneNodeTypeName build() { + return new ProjectZoneNodeTypeName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "nodeType", nodeType, + "project", project, + "zone", zone); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectZoneNodeTypeName) { + ProjectZoneNodeTypeName that = (ProjectZoneNodeTypeName) o; + return Objects.equals(this.nodeType, that.getNodeType()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(nodeType, project, zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsSetDefaultNetworkTierRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsSetDefaultNetworkTierRequest.java new file mode 100644 index 000000000000..ee8c7ce78cfd --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectsSetDefaultNetworkTierRequest.java @@ -0,0 +1,142 @@ +/* + * Copyright 2018 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 ProjectsSetDefaultNetworkTierRequest implements ApiMessage { + private final String networkTier; + + private ProjectsSetDefaultNetworkTierRequest() { + this.networkTier = null; + } + + private ProjectsSetDefaultNetworkTierRequest(String networkTier) { + this.networkTier = networkTier; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("networkTier")) { + return networkTier; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getNetworkTier() { + return networkTier; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(ProjectsSetDefaultNetworkTierRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static ProjectsSetDefaultNetworkTierRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final ProjectsSetDefaultNetworkTierRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new ProjectsSetDefaultNetworkTierRequest(); + } + + public static class Builder { + private String networkTier; + + Builder() {} + + public Builder mergeFrom(ProjectsSetDefaultNetworkTierRequest other) { + if (other == ProjectsSetDefaultNetworkTierRequest.getDefaultInstance()) return this; + if (other.getNetworkTier() != null) { + this.networkTier = other.networkTier; + } + return this; + } + + Builder(ProjectsSetDefaultNetworkTierRequest source) { + this.networkTier = source.networkTier; + } + + public String getNetworkTier() { + return networkTier; + } + + public Builder setNetworkTier(String networkTier) { + this.networkTier = networkTier; + return this; + } + + public ProjectsSetDefaultNetworkTierRequest build() { + return new ProjectsSetDefaultNetworkTierRequest(networkTier); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setNetworkTier(this.networkTier); + return newBuilder; + } + } + + @Override + public String toString() { + return "ProjectsSetDefaultNetworkTierRequest{" + "networkTier=" + networkTier + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectsSetDefaultNetworkTierRequest) { + ProjectsSetDefaultNetworkTierRequest that = (ProjectsSetDefaultNetworkTierRequest) o; + return Objects.equals(this.networkTier, that.getNetworkTier()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(networkTier); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java index 9b44ee823a01..aaea9369f8bd 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Scheduling.java @@ -17,6 +17,7 @@ import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.ApiMessage; +import java.util.LinkedList; import java.util.List; import java.util.Objects; import javax.annotation.Generated; @@ -26,17 +27,24 @@ @BetaApi public final class Scheduling implements ApiMessage { private final Boolean automaticRestart; + private final List nodeAffinities; private final String onHostMaintenance; private final Boolean preemptible; private Scheduling() { this.automaticRestart = null; + this.nodeAffinities = null; this.onHostMaintenance = null; this.preemptible = null; } - private Scheduling(Boolean automaticRestart, String onHostMaintenance, Boolean preemptible) { + private Scheduling( + Boolean automaticRestart, + List nodeAffinities, + String onHostMaintenance, + Boolean preemptible) { this.automaticRestart = automaticRestart; + this.nodeAffinities = nodeAffinities; this.onHostMaintenance = onHostMaintenance; this.preemptible = preemptible; } @@ -46,6 +54,9 @@ public Object getFieldValue(String fieldName) { if (fieldName.equals("automaticRestart")) { return automaticRestart; } + if (fieldName.equals("nodeAffinities")) { + return nodeAffinities; + } if (fieldName.equals("onHostMaintenance")) { return onHostMaintenance; } @@ -71,6 +82,10 @@ public Boolean getAutomaticRestart() { return automaticRestart; } + public List getNodeAffinitiesList() { + return nodeAffinities; + } + public String getOnHostMaintenance() { return onHostMaintenance; } @@ -103,6 +118,7 @@ public static Scheduling getDefaultInstance() { public static class Builder { private Boolean automaticRestart; + private List nodeAffinities; private String onHostMaintenance; private Boolean preemptible; @@ -113,6 +129,9 @@ public Builder mergeFrom(Scheduling other) { if (other.getAutomaticRestart() != null) { this.automaticRestart = other.automaticRestart; } + if (other.getNodeAffinitiesList() != null) { + this.nodeAffinities = other.nodeAffinities; + } if (other.getOnHostMaintenance() != null) { this.onHostMaintenance = other.onHostMaintenance; } @@ -124,6 +143,7 @@ public Builder mergeFrom(Scheduling other) { Builder(Scheduling source) { this.automaticRestart = source.automaticRestart; + this.nodeAffinities = source.nodeAffinities; this.onHostMaintenance = source.onHostMaintenance; this.preemptible = source.preemptible; } @@ -137,6 +157,26 @@ public Builder setAutomaticRestart(Boolean automaticRestart) { return this; } + public List getNodeAffinitiesList() { + return nodeAffinities; + } + + public Builder addAllNodeAffinities(List nodeAffinities) { + if (this.nodeAffinities == null) { + this.nodeAffinities = new LinkedList<>(); + } + this.nodeAffinities.addAll(nodeAffinities); + return this; + } + + public Builder addNodeAffinities(SchedulingNodeAffinity nodeAffinities) { + if (this.nodeAffinities == null) { + this.nodeAffinities = new LinkedList<>(); + } + this.nodeAffinities.add(nodeAffinities); + return this; + } + public String getOnHostMaintenance() { return onHostMaintenance; } @@ -157,12 +197,13 @@ public Builder setPreemptible(Boolean preemptible) { public Scheduling build() { - return new Scheduling(automaticRestart, onHostMaintenance, preemptible); + return new Scheduling(automaticRestart, nodeAffinities, onHostMaintenance, preemptible); } public Builder clone() { Builder newBuilder = new Builder(); newBuilder.setAutomaticRestart(this.automaticRestart); + newBuilder.addAllNodeAffinities(this.nodeAffinities); newBuilder.setOnHostMaintenance(this.onHostMaintenance); newBuilder.setPreemptible(this.preemptible); return newBuilder; @@ -175,6 +216,9 @@ public String toString() { + "automaticRestart=" + automaticRestart + ", " + + "nodeAffinities=" + + nodeAffinities + + ", " + "onHostMaintenance=" + onHostMaintenance + ", " @@ -191,6 +235,7 @@ public boolean equals(Object o) { if (o instanceof Scheduling) { Scheduling that = (Scheduling) o; return Objects.equals(this.automaticRestart, that.getAutomaticRestart()) + && Objects.equals(this.nodeAffinities, that.getNodeAffinitiesList()) && Objects.equals(this.onHostMaintenance, that.getOnHostMaintenance()) && Objects.equals(this.preemptible, that.getPreemptible()); } @@ -199,6 +244,6 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(automaticRestart, onHostMaintenance, preemptible); + return Objects.hash(automaticRestart, nodeAffinities, onHostMaintenance, preemptible); } } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SchedulingNodeAffinity.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SchedulingNodeAffinity.java new file mode 100644 index 000000000000..cf74117a6f3f --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SchedulingNodeAffinity.java @@ -0,0 +1,216 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class SchedulingNodeAffinity implements ApiMessage { + private final String key; + private final String operator; + private final List values; + + private SchedulingNodeAffinity() { + this.key = null; + this.operator = null; + this.values = null; + } + + private SchedulingNodeAffinity(String key, String operator, List values) { + this.key = key; + this.operator = operator; + this.values = values; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("operator")) { + return operator; + } + if (fieldName.equals("values")) { + return values; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getKey() { + return key; + } + + public String getOperator() { + return operator; + } + + public List getValuesList() { + return values; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SchedulingNodeAffinity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SchedulingNodeAffinity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SchedulingNodeAffinity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SchedulingNodeAffinity(); + } + + public static class Builder { + private String key; + private String operator; + private List values; + + Builder() {} + + public Builder mergeFrom(SchedulingNodeAffinity other) { + if (other == SchedulingNodeAffinity.getDefaultInstance()) return this; + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getOperator() != null) { + this.operator = other.operator; + } + if (other.getValuesList() != null) { + this.values = other.values; + } + return this; + } + + Builder(SchedulingNodeAffinity source) { + this.key = source.key; + this.operator = source.operator; + this.values = source.values; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getOperator() { + return operator; + } + + public Builder setOperator(String operator) { + this.operator = operator; + return this; + } + + public List getValuesList() { + return values; + } + + public Builder addAllValues(List values) { + if (this.values == null) { + this.values = new LinkedList<>(); + } + this.values.addAll(values); + return this; + } + + public Builder addValues(String values) { + if (this.values == null) { + this.values = new LinkedList<>(); + } + this.values.add(values); + return this; + } + + public SchedulingNodeAffinity build() { + + return new SchedulingNodeAffinity(key, operator, values); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setKey(this.key); + newBuilder.setOperator(this.operator); + newBuilder.addAllValues(this.values); + return newBuilder; + } + } + + @Override + public String toString() { + return "SchedulingNodeAffinity{" + + "key=" + + key + + ", " + + "operator=" + + operator + + ", " + + "values=" + + values + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SchedulingNodeAffinity) { + SchedulingNodeAffinity that = (SchedulingNodeAffinity) o; + return Objects.equals(this.key, that.getKey()) + && Objects.equals(this.operator, that.getOperator()) + && Objects.equals(this.values, that.getValuesList()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(key, operator, values); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDefaultNetworkTierProjectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDefaultNetworkTierProjectHttpRequest.java new file mode 100644 index 000000000000..9db020259fec --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetDefaultNetworkTierProjectHttpRequest.java @@ -0,0 +1,453 @@ +/* + * Copyright 2018 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 SetDefaultNetworkTierProjectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String project; + private final ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private SetDefaultNetworkTierProjectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.project = null; + this.projectsSetDefaultNetworkTierRequestResource = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private SetDefaultNetworkTierProjectHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String project, + ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource, + String quotaUser, + String requestId, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.project = project; + this.projectsSetDefaultNetworkTierRequestResource = + projectsSetDefaultNetworkTierRequestResource; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("project")) { + return project; + } + if (fieldName.equals("projectsSetDefaultNetworkTierRequestResource")) { + return projectsSetDefaultNetworkTierRequestResource; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("requestId")) { + return requestId; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public ProjectsSetDefaultNetworkTierRequest getApiMessageRequestBody() { + return projectsSetDefaultNetworkTierRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getProject() { + return project; + } + + public ProjectsSetDefaultNetworkTierRequest getProjectsSetDefaultNetworkTierRequestResource() { + return projectsSetDefaultNetworkTierRequestResource; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetDefaultNetworkTierProjectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetDefaultNetworkTierProjectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetDefaultNetworkTierProjectHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetDefaultNetworkTierProjectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String project; + private ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetDefaultNetworkTierProjectHttpRequest other) { + if (other == SetDefaultNetworkTierProjectHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getProject() != null) { + this.project = other.project; + } + if (other.getProjectsSetDefaultNetworkTierRequestResource() != null) { + this.projectsSetDefaultNetworkTierRequestResource = + other.projectsSetDefaultNetworkTierRequestResource; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetDefaultNetworkTierProjectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.project = source.project; + this.projectsSetDefaultNetworkTierRequestResource = + source.projectsSetDefaultNetworkTierRequestResource; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public ProjectsSetDefaultNetworkTierRequest getProjectsSetDefaultNetworkTierRequestResource() { + return projectsSetDefaultNetworkTierRequestResource; + } + + public Builder setProjectsSetDefaultNetworkTierRequestResource( + ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource) { + this.projectsSetDefaultNetworkTierRequestResource = + projectsSetDefaultNetworkTierRequestResource; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetDefaultNetworkTierProjectHttpRequest build() { + String missing = ""; + + if (project == null) { + missing += " project"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetDefaultNetworkTierProjectHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsSetDefaultNetworkTierRequestResource, + quotaUser, + requestId, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setProject(this.project); + newBuilder.setProjectsSetDefaultNetworkTierRequestResource( + this.projectsSetDefaultNetworkTierRequestResource); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetDefaultNetworkTierProjectHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "project=" + + project + + ", " + + "projectsSetDefaultNetworkTierRequestResource=" + + projectsSetDefaultNetworkTierRequestResource + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetDefaultNetworkTierProjectHttpRequest) { + SetDefaultNetworkTierProjectHttpRequest that = (SetDefaultNetworkTierProjectHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.project, that.getProject()) + && Objects.equals( + this.projectsSetDefaultNetworkTierRequestResource, + that.getProjectsSetDefaultNetworkTierRequestResource()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + project, + projectsSetDefaultNetworkTierRequestResource, + quotaUser, + requestId, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNodeTemplateNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNodeTemplateNodeGroupHttpRequest.java new file mode 100644 index 000000000000..0d9af9412492 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetNodeTemplateNodeGroupHttpRequest.java @@ -0,0 +1,451 @@ +/* + * Copyright 2018 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 SetNodeTemplateNodeGroupHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String nodeGroup; + private final NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private SetNodeTemplateNodeGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.nodeGroup = null; + this.nodeGroupsSetNodeTemplateRequestResource = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private SetNodeTemplateNodeGroupHttpRequest( + String access_token, + String callback, + String fields, + String key, + String nodeGroup, + NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource, + String prettyPrint, + String quotaUser, + String requestId, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.nodeGroup = nodeGroup; + this.nodeGroupsSetNodeTemplateRequestResource = nodeGroupsSetNodeTemplateRequestResource; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("nodeGroup")) { + return nodeGroup; + } + if (fieldName.equals("nodeGroupsSetNodeTemplateRequestResource")) { + return nodeGroupsSetNodeTemplateRequestResource; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("requestId")) { + return requestId; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public NodeGroupsSetNodeTemplateRequest getApiMessageRequestBody() { + return nodeGroupsSetNodeTemplateRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getNodeGroup() { + return nodeGroup; + } + + public NodeGroupsSetNodeTemplateRequest getNodeGroupsSetNodeTemplateRequestResource() { + return nodeGroupsSetNodeTemplateRequestResource; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetNodeTemplateNodeGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetNodeTemplateNodeGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetNodeTemplateNodeGroupHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetNodeTemplateNodeGroupHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String nodeGroup; + private NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetNodeTemplateNodeGroupHttpRequest other) { + if (other == SetNodeTemplateNodeGroupHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getNodeGroup() != null) { + this.nodeGroup = other.nodeGroup; + } + if (other.getNodeGroupsSetNodeTemplateRequestResource() != null) { + this.nodeGroupsSetNodeTemplateRequestResource = + other.nodeGroupsSetNodeTemplateRequestResource; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetNodeTemplateNodeGroupHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.nodeGroup = source.nodeGroup; + this.nodeGroupsSetNodeTemplateRequestResource = + source.nodeGroupsSetNodeTemplateRequestResource; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getNodeGroup() { + return nodeGroup; + } + + public Builder setNodeGroup(String nodeGroup) { + this.nodeGroup = nodeGroup; + return this; + } + + public NodeGroupsSetNodeTemplateRequest getNodeGroupsSetNodeTemplateRequestResource() { + return nodeGroupsSetNodeTemplateRequestResource; + } + + public Builder setNodeGroupsSetNodeTemplateRequestResource( + NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource) { + this.nodeGroupsSetNodeTemplateRequestResource = nodeGroupsSetNodeTemplateRequestResource; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetNodeTemplateNodeGroupHttpRequest build() { + String missing = ""; + + if (nodeGroup == null) { + missing += " nodeGroup"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetNodeTemplateNodeGroupHttpRequest( + access_token, + callback, + fields, + key, + nodeGroup, + nodeGroupsSetNodeTemplateRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setNodeGroup(this.nodeGroup); + newBuilder.setNodeGroupsSetNodeTemplateRequestResource( + this.nodeGroupsSetNodeTemplateRequestResource); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetNodeTemplateNodeGroupHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "nodeGroup=" + + nodeGroup + + ", " + + "nodeGroupsSetNodeTemplateRequestResource=" + + nodeGroupsSetNodeTemplateRequestResource + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetNodeTemplateNodeGroupHttpRequest) { + SetNodeTemplateNodeGroupHttpRequest that = (SetNodeTemplateNodeGroupHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.nodeGroup, that.getNodeGroup()) + && Objects.equals( + this.nodeGroupsSetNodeTemplateRequestResource, + that.getNodeGroupsSetNodeTemplateRequestResource()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + nodeGroup, + nodeGroupsSetNodeTemplateRequestResource, + prettyPrint, + quotaUser, + requestId, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetQuicOverrideTargetHttpsProxyHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetQuicOverrideTargetHttpsProxyHttpRequest.java new file mode 100644 index 000000000000..0ffa00989880 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetQuicOverrideTargetHttpsProxyHttpRequest.java @@ -0,0 +1,458 @@ +/* + * Copyright 2018 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 SetQuicOverrideTargetHttpsProxyHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final TargetHttpsProxiesSetQuicOverrideRequest + targetHttpsProxiesSetQuicOverrideRequestResource; + private final String targetHttpsProxy; + private final String userIp; + + private SetQuicOverrideTargetHttpsProxyHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.targetHttpsProxiesSetQuicOverrideRequestResource = null; + this.targetHttpsProxy = null; + this.userIp = null; + } + + private SetQuicOverrideTargetHttpsProxyHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String requestId, + TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource, + String targetHttpsProxy, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.requestId = requestId; + this.targetHttpsProxiesSetQuicOverrideRequestResource = + targetHttpsProxiesSetQuicOverrideRequestResource; + this.targetHttpsProxy = targetHttpsProxy; + this.userIp = userIp; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("access_token")) { + return access_token; + } + if (fieldName.equals("callback")) { + return callback; + } + if (fieldName.equals("fields")) { + return fields; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("requestId")) { + return requestId; + } + if (fieldName.equals("targetHttpsProxiesSetQuicOverrideRequestResource")) { + return targetHttpsProxiesSetQuicOverrideRequestResource; + } + if (fieldName.equals("targetHttpsProxy")) { + return targetHttpsProxy; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TargetHttpsProxiesSetQuicOverrideRequest getApiMessageRequestBody() { + return targetHttpsProxiesSetQuicOverrideRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getRequestId() { + return requestId; + } + + public TargetHttpsProxiesSetQuicOverrideRequest + getTargetHttpsProxiesSetQuicOverrideRequestResource() { + return targetHttpsProxiesSetQuicOverrideRequestResource; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetQuicOverrideTargetHttpsProxyHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetQuicOverrideTargetHttpsProxyHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetQuicOverrideTargetHttpsProxyHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetQuicOverrideTargetHttpsProxyHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private TargetHttpsProxiesSetQuicOverrideRequest + targetHttpsProxiesSetQuicOverrideRequestResource; + private String targetHttpsProxy; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetQuicOverrideTargetHttpsProxyHttpRequest other) { + if (other == SetQuicOverrideTargetHttpsProxyHttpRequest.getDefaultInstance()) return this; + if (other.getAccessToken() != null) { + this.access_token = other.access_token; + } + if (other.getCallback() != null) { + this.callback = other.callback; + } + if (other.getFields() != null) { + this.fields = other.fields; + } + if (other.getKey() != null) { + this.key = other.key; + } + if (other.getPrettyPrint() != null) { + this.prettyPrint = other.prettyPrint; + } + if (other.getQuotaUser() != null) { + this.quotaUser = other.quotaUser; + } + if (other.getRequestId() != null) { + this.requestId = other.requestId; + } + if (other.getTargetHttpsProxiesSetQuicOverrideRequestResource() != null) { + this.targetHttpsProxiesSetQuicOverrideRequestResource = + other.targetHttpsProxiesSetQuicOverrideRequestResource; + } + if (other.getTargetHttpsProxy() != null) { + this.targetHttpsProxy = other.targetHttpsProxy; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetQuicOverrideTargetHttpsProxyHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.requestId = source.requestId; + this.targetHttpsProxiesSetQuicOverrideRequestResource = + source.targetHttpsProxiesSetQuicOverrideRequestResource; + this.targetHttpsProxy = source.targetHttpsProxy; + this.userIp = source.userIp; + } + + public String getAccessToken() { + return access_token; + } + + public Builder setAccessToken(String access_token) { + this.access_token = access_token; + return this; + } + + public String getCallback() { + return callback; + } + + public Builder setCallback(String callback) { + this.callback = callback; + return this; + } + + public String getFields() { + return fields; + } + + public Builder setFields(String fields) { + this.fields = fields; + return this; + } + + public String getKey() { + return key; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public Builder setPrettyPrint(String prettyPrint) { + this.prettyPrint = prettyPrint; + return this; + } + + public String getQuotaUser() { + return quotaUser; + } + + public Builder setQuotaUser(String quotaUser) { + this.quotaUser = quotaUser; + return this; + } + + public String getRequestId() { + return requestId; + } + + public Builder setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public TargetHttpsProxiesSetQuicOverrideRequest + getTargetHttpsProxiesSetQuicOverrideRequestResource() { + return targetHttpsProxiesSetQuicOverrideRequestResource; + } + + public Builder setTargetHttpsProxiesSetQuicOverrideRequestResource( + TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource) { + this.targetHttpsProxiesSetQuicOverrideRequestResource = + targetHttpsProxiesSetQuicOverrideRequestResource; + return this; + } + + public String getTargetHttpsProxy() { + return targetHttpsProxy; + } + + public Builder setTargetHttpsProxy(String targetHttpsProxy) { + this.targetHttpsProxy = targetHttpsProxy; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetQuicOverrideTargetHttpsProxyHttpRequest build() { + String missing = ""; + + if (targetHttpsProxy == null) { + missing += " targetHttpsProxy"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetQuicOverrideTargetHttpsProxyHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxiesSetQuicOverrideRequestResource, + targetHttpsProxy, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setRequestId(this.requestId); + newBuilder.setTargetHttpsProxiesSetQuicOverrideRequestResource( + this.targetHttpsProxiesSetQuicOverrideRequestResource); + newBuilder.setTargetHttpsProxy(this.targetHttpsProxy); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetQuicOverrideTargetHttpsProxyHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "targetHttpsProxiesSetQuicOverrideRequestResource=" + + targetHttpsProxiesSetQuicOverrideRequestResource + + ", " + + "targetHttpsProxy=" + + targetHttpsProxy + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetQuicOverrideTargetHttpsProxyHttpRequest) { + SetQuicOverrideTargetHttpsProxyHttpRequest that = + (SetQuicOverrideTargetHttpsProxyHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.requestId, that.getRequestId()) + && Objects.equals( + this.targetHttpsProxiesSetQuicOverrideRequestResource, + that.getTargetHttpsProxiesSetQuicOverrideRequestResource()) + && Objects.equals(this.targetHttpsProxy, that.getTargetHttpsProxy()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + requestId, + targetHttpsProxiesSetQuicOverrideRequestResource, + targetHttpsProxy, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java index e6777ad91b55..441725e0ff20 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkClient.java @@ -848,6 +848,144 @@ public final UnaryCallable listSubne return stub.listSubnetworksCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of usable subnetworks. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (UsableSubnetwork element : subnetworkClient.listUsableSubnetworks(project).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListUsableSubnetworksPagedResponse listUsableSubnetworks(ProjectName project) { + ListUsableSubnetworksHttpRequest request = + ListUsableSubnetworksHttpRequest.newBuilder() + .setProject(project == null ? null : project.toString()) + .build(); + return listUsableSubnetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of usable subnetworks. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   for (UsableSubnetwork element : subnetworkClient.listUsableSubnetworks(project.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param project Project ID for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListUsableSubnetworksPagedResponse listUsableSubnetworks(String project) { + ListUsableSubnetworksHttpRequest request = + ListUsableSubnetworksHttpRequest.newBuilder().setProject(project).build(); + return listUsableSubnetworks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of usable subnetworks. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListUsableSubnetworksHttpRequest request = ListUsableSubnetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   for (UsableSubnetwork element : subnetworkClient.listUsableSubnetworks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final ListUsableSubnetworksPagedResponse listUsableSubnetworks( + ListUsableSubnetworksHttpRequest request) { + return listUsableSubnetworksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of usable subnetworks. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListUsableSubnetworksHttpRequest request = ListUsableSubnetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   ApiFuture<ListUsableSubnetworksPagedResponse> future = subnetworkClient.listUsableSubnetworksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (UsableSubnetwork element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listUsableSubnetworksPagedCallable() { + return stub.listUsableSubnetworksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves an aggregated list of usable subnetworks. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectName project = ProjectName.of("[PROJECT]");
+   *   ListUsableSubnetworksHttpRequest request = ListUsableSubnetworksHttpRequest.newBuilder()
+   *     .setProject(project.toString())
+   *     .build();
+   *   while (true) {
+   *     UsableSubnetworksAggregatedList response = subnetworkClient.listUsableSubnetworksCallable().call(request);
+   *     for (UsableSubnetwork element : response.getItemsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + listUsableSubnetworksCallable() { + return stub.listUsableSubnetworksCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Patches the specified subnetwork with the data included in the request. Only the following @@ -1301,4 +1439,88 @@ protected ListSubnetworksFixedSizeCollection createCollection( return new ListSubnetworksFixedSizeCollection(pages, collectionSize); } } + + public static class ListUsableSubnetworksPagedResponse + extends AbstractPagedListResponse< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork, + ListUsableSubnetworksPage, ListUsableSubnetworksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsableSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListUsableSubnetworksPagedResponse apply(ListUsableSubnetworksPage input) { + return new ListUsableSubnetworksPagedResponse(input); + } + }); + } + + private ListUsableSubnetworksPagedResponse(ListUsableSubnetworksPage page) { + super(page, ListUsableSubnetworksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsableSubnetworksPage + extends AbstractPage< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork, + ListUsableSubnetworksPage> { + + private ListUsableSubnetworksPage( + PageContext< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork> + context, + UsableSubnetworksAggregatedList response) { + super(context, response); + } + + private static ListUsableSubnetworksPage createEmptyPage() { + return new ListUsableSubnetworksPage(null, null); + } + + @Override + protected ListUsableSubnetworksPage createPage( + PageContext< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork> + context, + UsableSubnetworksAggregatedList response) { + return new ListUsableSubnetworksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsableSubnetworksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork, + ListUsableSubnetworksPage, ListUsableSubnetworksFixedSizeCollection> { + + private ListUsableSubnetworksFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsableSubnetworksFixedSizeCollection createEmptyCollection() { + return new ListUsableSubnetworksFixedSizeCollection(null, 0); + } + + @Override + protected ListUsableSubnetworksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsableSubnetworksFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java index f3de6c182ebe..f6564a1aced4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SubnetworkSettings.java @@ -17,6 +17,7 @@ import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListUsableSubnetworksPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; @@ -99,6 +100,14 @@ public UnaryCallSettings insertSubnetwor return ((SubnetworkStubSettings) getStubSettings()).listSubnetworksSettings(); } + /** Returns the object with the settings used for calls to listUsableSubnetworks. */ + public PagedCallSettings< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + listUsableSubnetworksSettings() { + return ((SubnetworkStubSettings) getStubSettings()).listUsableSubnetworksSettings(); + } + /** Returns the object with the settings used for calls to patchSubnetwork. */ public UnaryCallSettings patchSubnetworkSettings() { return ((SubnetworkStubSettings) getStubSettings()).patchSubnetworkSettings(); @@ -250,6 +259,14 @@ public UnaryCallSettings.Builder getSubnet return getStubSettingsBuilder().listSubnetworksSettings(); } + /** Returns the builder for the settings used for calls to listUsableSubnetworks. */ + public PagedCallSettings.Builder< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + listUsableSubnetworksSettings() { + return getStubSettingsBuilder().listUsableSubnetworksSettings(); + } + /** Returns the builder for the settings used for calls to patchSubnetwork. */ public UnaryCallSettings.Builder patchSubnetworkSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java index 0c203e55a67f..b2c2ee6437b4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxyClient.java @@ -615,6 +615,125 @@ public final ListTargetHttpsProxiesPagedResponse listTargetHttpsProxies( return stub.listTargetHttpsProxiesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + *

Sample code: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = TargetHttpsProxiesSetQuicOverrideRequest.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setQuicOverrideTargetHttpsProxy(targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy + * for. The name should conform to RFC1035. + * @param targetHttpsProxiesSetQuicOverrideRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setQuicOverrideTargetHttpsProxy( + ProjectGlobalTargetHttpsProxyName targetHttpsProxy, + TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource) { + + SetQuicOverrideTargetHttpsProxyHttpRequest request = + SetQuicOverrideTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy == null ? null : targetHttpsProxy.toString()) + .setTargetHttpsProxiesSetQuicOverrideRequestResource( + targetHttpsProxiesSetQuicOverrideRequestResource) + .build(); + return setQuicOverrideTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + *

Sample code: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = TargetHttpsProxiesSetQuicOverrideRequest.newBuilder().build();
+   *   Operation response = targetHttpsProxyClient.setQuicOverrideTargetHttpsProxy(targetHttpsProxy.toString(), targetHttpsProxiesSetQuicOverrideRequestResource);
+   * }
+   * 
+ * + * @param targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy + * for. The name should conform to RFC1035. + * @param targetHttpsProxiesSetQuicOverrideRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setQuicOverrideTargetHttpsProxy( + String targetHttpsProxy, + TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource) { + + SetQuicOverrideTargetHttpsProxyHttpRequest request = + SetQuicOverrideTargetHttpsProxyHttpRequest.newBuilder() + .setTargetHttpsProxy(targetHttpsProxy) + .setTargetHttpsProxiesSetQuicOverrideRequestResource( + targetHttpsProxiesSetQuicOverrideRequestResource) + .build(); + return setQuicOverrideTargetHttpsProxy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + *

Sample code: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = TargetHttpsProxiesSetQuicOverrideRequest.newBuilder().build();
+   *   SetQuicOverrideTargetHttpsProxyHttpRequest request = SetQuicOverrideTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setTargetHttpsProxiesSetQuicOverrideRequestResource(targetHttpsProxiesSetQuicOverrideRequestResource)
+   *     .build();
+   *   Operation response = targetHttpsProxyClient.setQuicOverrideTargetHttpsProxy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation setQuicOverrideTargetHttpsProxy( + SetQuicOverrideTargetHttpsProxyHttpRequest request) { + return setQuicOverrideTargetHttpsProxyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + *

Sample code: + * + *


+   * try (TargetHttpsProxyClient targetHttpsProxyClient = TargetHttpsProxyClient.create()) {
+   *   ProjectGlobalTargetHttpsProxyName targetHttpsProxy = ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]");
+   *   TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = TargetHttpsProxiesSetQuicOverrideRequest.newBuilder().build();
+   *   SetQuicOverrideTargetHttpsProxyHttpRequest request = SetQuicOverrideTargetHttpsProxyHttpRequest.newBuilder()
+   *     .setTargetHttpsProxy(targetHttpsProxy.toString())
+   *     .setTargetHttpsProxiesSetQuicOverrideRequestResource(targetHttpsProxiesSetQuicOverrideRequestResource)
+   *     .build();
+   *   ApiFuture<Operation> future = targetHttpsProxyClient.setQuicOverrideTargetHttpsProxyCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setQuicOverrideTargetHttpsProxyCallable() { + return stub.setQuicOverrideTargetHttpsProxyCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Replaces SslCertificates for TargetHttpsProxy. diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java index c5a8f57c291d..cec2de98fe47 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetHttpsProxySettings.java @@ -89,6 +89,13 @@ public class TargetHttpsProxySettings extends ClientSettings + setQuicOverrideTargetHttpsProxySettings() { + return ((TargetHttpsProxyStubSettings) getStubSettings()) + .setQuicOverrideTargetHttpsProxySettings(); + } + /** Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy. */ public UnaryCallSettings setSslCertificatesTargetHttpsProxySettings() { @@ -237,6 +244,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().listTargetHttpsProxiesSettings(); } + /** Returns the builder for the settings used for calls to setQuicOverrideTargetHttpsProxy. */ + public UnaryCallSettings.Builder + setQuicOverrideTargetHttpsProxySettings() { + return getStubSettingsBuilder().setQuicOverrideTargetHttpsProxySettings(); + } + /** * Returns the builder for the settings used for calls to setSslCertificatesTargetHttpsProxy. */ diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetwork.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetwork.java new file mode 100644 index 000000000000..df85592f2e7b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetwork.java @@ -0,0 +1,249 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UsableSubnetwork implements ApiMessage { + private final String ipCidrRange; + private final String network; + private final List secondaryIpRanges; + private final String subnetwork; + + private UsableSubnetwork() { + this.ipCidrRange = null; + this.network = null; + this.secondaryIpRanges = null; + this.subnetwork = null; + } + + private UsableSubnetwork( + String ipCidrRange, + String network, + List secondaryIpRanges, + String subnetwork) { + this.ipCidrRange = ipCidrRange; + this.network = network; + this.secondaryIpRanges = secondaryIpRanges; + this.subnetwork = subnetwork; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return ipCidrRange; + } + if (fieldName.equals("network")) { + return network; + } + if (fieldName.equals("secondaryIpRanges")) { + return secondaryIpRanges; + } + if (fieldName.equals("subnetwork")) { + return subnetwork; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public String getNetwork() { + return network; + } + + public List getSecondaryIpRangesList() { + return secondaryIpRanges; + } + + public String getSubnetwork() { + return subnetwork; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(UsableSubnetwork prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static UsableSubnetwork getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final UsableSubnetwork DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new UsableSubnetwork(); + } + + public static class Builder { + private String ipCidrRange; + private String network; + private List secondaryIpRanges; + private String subnetwork; + + Builder() {} + + public Builder mergeFrom(UsableSubnetwork other) { + if (other == UsableSubnetwork.getDefaultInstance()) return this; + if (other.getIpCidrRange() != null) { + this.ipCidrRange = other.ipCidrRange; + } + if (other.getNetwork() != null) { + this.network = other.network; + } + if (other.getSecondaryIpRangesList() != null) { + this.secondaryIpRanges = other.secondaryIpRanges; + } + if (other.getSubnetwork() != null) { + this.subnetwork = other.subnetwork; + } + return this; + } + + Builder(UsableSubnetwork source) { + this.ipCidrRange = source.ipCidrRange; + this.network = source.network; + this.secondaryIpRanges = source.secondaryIpRanges; + this.subnetwork = source.subnetwork; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public Builder setIpCidrRange(String ipCidrRange) { + this.ipCidrRange = ipCidrRange; + return this; + } + + public String getNetwork() { + return network; + } + + public Builder setNetwork(String network) { + this.network = network; + return this; + } + + public List getSecondaryIpRangesList() { + return secondaryIpRanges; + } + + public Builder addAllSecondaryIpRanges(List secondaryIpRanges) { + if (this.secondaryIpRanges == null) { + this.secondaryIpRanges = new LinkedList<>(); + } + this.secondaryIpRanges.addAll(secondaryIpRanges); + return this; + } + + public Builder addSecondaryIpRanges(UsableSubnetworkSecondaryRange secondaryIpRanges) { + if (this.secondaryIpRanges == null) { + this.secondaryIpRanges = new LinkedList<>(); + } + this.secondaryIpRanges.add(secondaryIpRanges); + return this; + } + + public String getSubnetwork() { + return subnetwork; + } + + public Builder setSubnetwork(String subnetwork) { + this.subnetwork = subnetwork; + return this; + } + + public UsableSubnetwork build() { + + return new UsableSubnetwork(ipCidrRange, network, secondaryIpRanges, subnetwork); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIpCidrRange(this.ipCidrRange); + newBuilder.setNetwork(this.network); + newBuilder.addAllSecondaryIpRanges(this.secondaryIpRanges); + newBuilder.setSubnetwork(this.subnetwork); + return newBuilder; + } + } + + @Override + public String toString() { + return "UsableSubnetwork{" + + "ipCidrRange=" + + ipCidrRange + + ", " + + "network=" + + network + + ", " + + "secondaryIpRanges=" + + secondaryIpRanges + + ", " + + "subnetwork=" + + subnetwork + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UsableSubnetwork) { + UsableSubnetwork that = (UsableSubnetwork) o; + return Objects.equals(this.ipCidrRange, that.getIpCidrRange()) + && Objects.equals(this.network, that.getNetwork()) + && Objects.equals(this.secondaryIpRanges, that.getSecondaryIpRangesList()) + && Objects.equals(this.subnetwork, that.getSubnetwork()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(ipCidrRange, network, secondaryIpRanges, subnetwork); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetworkSecondaryRange.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetworkSecondaryRange.java new file mode 100644 index 000000000000..d06cb814782b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetworkSecondaryRange.java @@ -0,0 +1,175 @@ +/* + * Copyright 2018 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 UsableSubnetworkSecondaryRange implements ApiMessage { + private final String ipCidrRange; + private final String rangeName; + + private UsableSubnetworkSecondaryRange() { + this.ipCidrRange = null; + this.rangeName = null; + } + + private UsableSubnetworkSecondaryRange(String ipCidrRange, String rangeName) { + this.ipCidrRange = ipCidrRange; + this.rangeName = rangeName; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("ipCidrRange")) { + return ipCidrRange; + } + if (fieldName.equals("rangeName")) { + return rangeName; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public String getRangeName() { + return rangeName; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(UsableSubnetworkSecondaryRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static UsableSubnetworkSecondaryRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final UsableSubnetworkSecondaryRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new UsableSubnetworkSecondaryRange(); + } + + public static class Builder { + private String ipCidrRange; + private String rangeName; + + Builder() {} + + public Builder mergeFrom(UsableSubnetworkSecondaryRange other) { + if (other == UsableSubnetworkSecondaryRange.getDefaultInstance()) return this; + if (other.getIpCidrRange() != null) { + this.ipCidrRange = other.ipCidrRange; + } + if (other.getRangeName() != null) { + this.rangeName = other.rangeName; + } + return this; + } + + Builder(UsableSubnetworkSecondaryRange source) { + this.ipCidrRange = source.ipCidrRange; + this.rangeName = source.rangeName; + } + + public String getIpCidrRange() { + return ipCidrRange; + } + + public Builder setIpCidrRange(String ipCidrRange) { + this.ipCidrRange = ipCidrRange; + return this; + } + + public String getRangeName() { + return rangeName; + } + + public Builder setRangeName(String rangeName) { + this.rangeName = rangeName; + return this; + } + + public UsableSubnetworkSecondaryRange build() { + + return new UsableSubnetworkSecondaryRange(ipCidrRange, rangeName); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setIpCidrRange(this.ipCidrRange); + newBuilder.setRangeName(this.rangeName); + return newBuilder; + } + } + + @Override + public String toString() { + return "UsableSubnetworkSecondaryRange{" + + "ipCidrRange=" + + ipCidrRange + + ", " + + "rangeName=" + + rangeName + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UsableSubnetworkSecondaryRange) { + UsableSubnetworkSecondaryRange that = (UsableSubnetworkSecondaryRange) o; + return Objects.equals(this.ipCidrRange, that.getIpCidrRange()) + && Objects.equals(this.rangeName, that.getRangeName()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(ipCidrRange, rangeName); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetworksAggregatedList.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetworksAggregatedList.java new file mode 100644 index 000000000000..da3f6a42b326 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/UsableSubnetworksAggregatedList.java @@ -0,0 +1,309 @@ +/* + * Copyright 2018 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.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.Generated; +import javax.annotation.Nullable; + +@Generated("by GAPIC") +@BetaApi +public final class UsableSubnetworksAggregatedList implements ApiMessage { + private final String id; + private final List items; + private final String kind; + private final String nextPageToken; + private final String selfLink; + private final Warning warning; + + private UsableSubnetworksAggregatedList() { + this.id = null; + this.items = null; + this.kind = null; + this.nextPageToken = null; + this.selfLink = null; + this.warning = null; + } + + private UsableSubnetworksAggregatedList( + String id, + List items, + String kind, + String nextPageToken, + String selfLink, + Warning warning) { + this.id = id; + this.items = items; + this.kind = kind; + this.nextPageToken = nextPageToken; + this.selfLink = selfLink; + this.warning = warning; + } + + @Override + public Object getFieldValue(String fieldName) { + if (fieldName.equals("id")) { + return id; + } + if (fieldName.equals("items")) { + return items; + } + if (fieldName.equals("kind")) { + return kind; + } + if (fieldName.equals("nextPageToken")) { + return nextPageToken; + } + if (fieldName.equals("selfLink")) { + return selfLink; + } + if (fieldName.equals("warning")) { + return warning; + } + return null; + } + + @Nullable + @Override + public ApiMessage getApiMessageRequestBody() { + return null; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getId() { + return id; + } + + public List getItemsList() { + return items; + } + + public String getKind() { + return kind; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public String getSelfLink() { + return selfLink; + } + + public Warning getWarning() { + return warning; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(UsableSubnetworksAggregatedList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static UsableSubnetworksAggregatedList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final UsableSubnetworksAggregatedList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new UsableSubnetworksAggregatedList(); + } + + public static class Builder { + private String id; + private List items; + private String kind; + private String nextPageToken; + private String selfLink; + private Warning warning; + + Builder() {} + + public Builder mergeFrom(UsableSubnetworksAggregatedList other) { + if (other == UsableSubnetworksAggregatedList.getDefaultInstance()) return this; + if (other.getId() != null) { + this.id = other.id; + } + if (other.getItemsList() != null) { + this.items = other.items; + } + if (other.getKind() != null) { + this.kind = other.kind; + } + if (other.getNextPageToken() != null) { + this.nextPageToken = other.nextPageToken; + } + if (other.getSelfLink() != null) { + this.selfLink = other.selfLink; + } + if (other.getWarning() != null) { + this.warning = other.warning; + } + return this; + } + + Builder(UsableSubnetworksAggregatedList source) { + this.id = source.id; + this.items = source.items; + this.kind = source.kind; + this.nextPageToken = source.nextPageToken; + this.selfLink = source.selfLink; + this.warning = source.warning; + } + + public String getId() { + return id; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public List getItemsList() { + return items; + } + + public Builder addAllItems(List items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.addAll(items); + return this; + } + + public Builder addItems(UsableSubnetwork items) { + if (this.items == null) { + this.items = new LinkedList<>(); + } + this.items.add(items); + return this; + } + + public String getKind() { + return kind; + } + + public Builder setKind(String kind) { + this.kind = kind; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public Builder setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getSelfLink() { + return selfLink; + } + + public Builder setSelfLink(String selfLink) { + this.selfLink = selfLink; + return this; + } + + public Warning getWarning() { + return warning; + } + + public Builder setWarning(Warning warning) { + this.warning = warning; + return this; + } + + public UsableSubnetworksAggregatedList build() { + + return new UsableSubnetworksAggregatedList(id, items, kind, nextPageToken, selfLink, warning); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setId(this.id); + newBuilder.addAllItems(this.items); + newBuilder.setKind(this.kind); + newBuilder.setNextPageToken(this.nextPageToken); + newBuilder.setSelfLink(this.selfLink); + newBuilder.setWarning(this.warning); + return newBuilder; + } + } + + @Override + public String toString() { + return "UsableSubnetworksAggregatedList{" + + "id=" + + id + + ", " + + "items=" + + items + + ", " + + "kind=" + + kind + + ", " + + "nextPageToken=" + + nextPageToken + + ", " + + "selfLink=" + + selfLink + + ", " + + "warning=" + + warning + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UsableSubnetworksAggregatedList) { + UsableSubnetworksAggregatedList that = (UsableSubnetworksAggregatedList) o; + return Objects.equals(this.id, that.getId()) + && Objects.equals(this.items, that.getItemsList()) + && Objects.equals(this.kind, that.getKind()) + && Objects.equals(this.nextPageToken, that.getNextPageToken()) + && Objects.equals(this.selfLink, that.getSelfLink()) + && Objects.equals(this.warning, that.getWarning()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(id, items, kind, nextPageToken, selfLink, warning); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java index cedd68dfe55b..526f573a0b71 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/package-info.java @@ -74,7 +74,8 @@ * * try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) { * ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); - * Operation response = backendBucketClient.deleteBackendBucket(backendBucket); + * SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); + * Operation response = backendBucketClient.addSignedUrlKeyBackendBucket(backendBucket, signedUrlKeyResource); * } * *
@@ -89,7 +90,8 @@ * * try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) { * ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); - * Operation response = backendServiceClient.deleteBackendService(backendService); + * SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); + * Operation response = backendServiceClient.addSignedUrlKeyBackendService(backendService, signedUrlKeyResource); * } * *
@@ -431,6 +433,52 @@ * *
* + * =============== NodeGroupClient =============== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for NodeGroupClient: + * + *

+ * 
+ * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+ *   ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
+ *   NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
+ *   Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource);
+ * }
+ * 
+ * 
+ * + * ================== NodeTemplateClient ================== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for NodeTemplateClient: + * + *

+ * 
+ * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+ *   ProjectRegionNodeTemplateName nodeTemplate = ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]");
+ *   Operation response = nodeTemplateClient.deleteNodeTemplate(nodeTemplate);
+ * }
+ * 
+ * 
+ * + * ============== NodeTypeClient ============== + * + *

Service Description: Creates and runs virtual machines on Google Cloud Platform. + * + *

Sample for NodeTypeClient: + * + *

+ * 
+ * try (NodeTypeClient nodeTypeClient = NodeTypeClient.create()) {
+ *   ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]");
+ *   NodeType response = nodeTypeClient.getNodeType(nodeType);
+ * }
+ * 
+ * 
+ * * ============= ProjectClient ============= * *

Service Description: Creates and runs virtual machines on Google Cloud Platform. diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java index 589bc03b6725..022d99aaa476 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStub.java @@ -20,9 +20,11 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketHttpRequest; import com.google.cloud.compute.v1.BackendBucket; import com.google.cloud.compute.v1.BackendBucketList; import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; +import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketHttpRequest; import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; @@ -41,11 +43,25 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class BackendBucketStub implements BackgroundResource { + @BetaApi + public UnaryCallable + addSignedUrlKeyBackendBucketCallable() { + throw new UnsupportedOperationException( + "Not implemented: addSignedUrlKeyBackendBucketCallable()"); + } + @BetaApi public UnaryCallable deleteBackendBucketCallable() { throw new UnsupportedOperationException("Not implemented: deleteBackendBucketCallable()"); } + @BetaApi + public UnaryCallable + deleteSignedUrlKeyBackendBucketCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteSignedUrlKeyBackendBucketCallable()"); + } + @BetaApi public UnaryCallable getBackendBucketCallable() { throw new UnsupportedOperationException("Not implemented: getBackendBucketCallable()"); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java index 7933614ffc9c..81d6c7ee2e92 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendBucketStubSettings.java @@ -39,9 +39,11 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketHttpRequest; import com.google.cloud.compute.v1.BackendBucket; import com.google.cloud.compute.v1.BackendBucketList; import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest; +import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketHttpRequest; import com.google.cloud.compute.v1.GetBackendBucketHttpRequest; import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest; import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest; @@ -72,13 +74,13 @@ * *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteBackendBucket to 30 seconds: + * example, to set the total timeout of addSignedUrlKeyBackendBucket to 30 seconds: * *

  * 
  * BackendBucketStubSettings.Builder backendBucketSettingsBuilder =
  *     BackendBucketStubSettings.newBuilder();
- * backendBucketSettingsBuilder.deleteBackendBucketSettings().getRetrySettings().toBuilder()
+ * backendBucketSettingsBuilder.addSignedUrlKeyBackendBucketSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * BackendBucketStubSettings backendBucketSettings = backendBucketSettingsBuilder.build();
  * 
@@ -98,8 +100,12 @@ public class BackendBucketStubSettings extends StubSettings
+      addSignedUrlKeyBackendBucketSettings;
   private final UnaryCallSettings
       deleteBackendBucketSettings;
+  private final UnaryCallSettings
+      deleteSignedUrlKeyBackendBucketSettings;
   private final UnaryCallSettings
       getBackendBucketSettings;
   private final UnaryCallSettings
@@ -112,12 +118,24 @@ public class BackendBucketStubSettings extends StubSettings
       updateBackendBucketSettings;
 
+  /** Returns the object with the settings used for calls to addSignedUrlKeyBackendBucket. */
+  public UnaryCallSettings
+      addSignedUrlKeyBackendBucketSettings() {
+    return addSignedUrlKeyBackendBucketSettings;
+  }
+
   /** Returns the object with the settings used for calls to deleteBackendBucket. */
   public UnaryCallSettings
       deleteBackendBucketSettings() {
     return deleteBackendBucketSettings;
   }
 
+  /** Returns the object with the settings used for calls to deleteSignedUrlKeyBackendBucket. */
+  public UnaryCallSettings
+      deleteSignedUrlKeyBackendBucketSettings() {
+    return deleteSignedUrlKeyBackendBucketSettings;
+  }
+
   /** Returns the object with the settings used for calls to getBackendBucket. */
   public UnaryCallSettings getBackendBucketSettings() {
     return getBackendBucketSettings;
@@ -222,7 +240,11 @@ public Builder toBuilder() {
   protected BackendBucketStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    addSignedUrlKeyBackendBucketSettings =
+        settingsBuilder.addSignedUrlKeyBackendBucketSettings().build();
     deleteBackendBucketSettings = settingsBuilder.deleteBackendBucketSettings().build();
+    deleteSignedUrlKeyBackendBucketSettings =
+        settingsBuilder.deleteSignedUrlKeyBackendBucketSettings().build();
     getBackendBucketSettings = settingsBuilder.getBackendBucketSettings().build();
     insertBackendBucketSettings = settingsBuilder.insertBackendBucketSettings().build();
     listBackendBucketsSettings = settingsBuilder.listBackendBucketsSettings().build();
@@ -293,8 +315,12 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        addSignedUrlKeyBackendBucketSettings;
     private final UnaryCallSettings.Builder
         deleteBackendBucketSettings;
+    private final UnaryCallSettings.Builder
+        deleteSignedUrlKeyBackendBucketSettings;
     private final UnaryCallSettings.Builder
         getBackendBucketSettings;
     private final UnaryCallSettings.Builder
@@ -348,8 +374,12 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      addSignedUrlKeyBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       deleteBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
+      deleteSignedUrlKeyBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       getBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       insertBackendBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -362,7 +392,9 @@ protected Builder(ClientContext clientContext) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              addSignedUrlKeyBackendBucketSettings,
               deleteBackendBucketSettings,
+              deleteSignedUrlKeyBackendBucketSettings,
               getBackendBucketSettings,
               insertBackendBucketSettings,
               listBackendBucketsSettings,
@@ -383,11 +415,21 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .addSignedUrlKeyBackendBucketSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .deleteBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder
+          .deleteSignedUrlKeyBackendBucketSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .getBackendBucketSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
@@ -419,7 +461,11 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(BackendBucketStubSettings settings) {
       super(settings);
 
+      addSignedUrlKeyBackendBucketSettings =
+          settings.addSignedUrlKeyBackendBucketSettings.toBuilder();
       deleteBackendBucketSettings = settings.deleteBackendBucketSettings.toBuilder();
+      deleteSignedUrlKeyBackendBucketSettings =
+          settings.deleteSignedUrlKeyBackendBucketSettings.toBuilder();
       getBackendBucketSettings = settings.getBackendBucketSettings.toBuilder();
       insertBackendBucketSettings = settings.insertBackendBucketSettings.toBuilder();
       listBackendBucketsSettings = settings.listBackendBucketsSettings.toBuilder();
@@ -428,7 +474,9 @@ protected Builder(BackendBucketStubSettings settings) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              addSignedUrlKeyBackendBucketSettings,
               deleteBackendBucketSettings,
+              deleteSignedUrlKeyBackendBucketSettings,
               getBackendBucketSettings,
               insertBackendBucketSettings,
               listBackendBucketsSettings,
@@ -452,12 +500,24 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to addSignedUrlKeyBackendBucket. */
+    public UnaryCallSettings.Builder
+        addSignedUrlKeyBackendBucketSettings() {
+      return addSignedUrlKeyBackendBucketSettings;
+    }
+
     /** Returns the builder for the settings used for calls to deleteBackendBucket. */
     public UnaryCallSettings.Builder
         deleteBackendBucketSettings() {
       return deleteBackendBucketSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteSignedUrlKeyBackendBucket. */
+    public UnaryCallSettings.Builder
+        deleteSignedUrlKeyBackendBucketSettings() {
+      return deleteSignedUrlKeyBackendBucketSettings;
+    }
+
     /** Returns the builder for the settings used for calls to getBackendBucket. */
     public UnaryCallSettings.Builder
         getBackendBucketSettings() {
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java
index fd60cc3a4a8d..8671c0461a2d 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStub.java
@@ -21,12 +21,14 @@
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.BackgroundResource;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest;
 import com.google.cloud.compute.v1.BackendService;
 import com.google.cloud.compute.v1.BackendServiceAggregatedList;
 import com.google.cloud.compute.v1.BackendServiceGroupHealth;
 import com.google.cloud.compute.v1.BackendServiceList;
 import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest;
@@ -46,6 +48,13 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public abstract class BackendServiceStub implements BackgroundResource {
 
+  @BetaApi
+  public UnaryCallable
+      addSignedUrlKeyBackendServiceCallable() {
+    throw new UnsupportedOperationException(
+        "Not implemented: addSignedUrlKeyBackendServiceCallable()");
+  }
+
   @BetaApi
   public UnaryCallable<
           AggregatedListBackendServicesHttpRequest, AggregatedListBackendServicesPagedResponse>
@@ -66,6 +75,13 @@ public UnaryCallable deleteBackendSe
     throw new UnsupportedOperationException("Not implemented: deleteBackendServiceCallable()");
   }
 
+  @BetaApi
+  public UnaryCallable
+      deleteSignedUrlKeyBackendServiceCallable() {
+    throw new UnsupportedOperationException(
+        "Not implemented: deleteSignedUrlKeyBackendServiceCallable()");
+  }
+
   @BetaApi
   public UnaryCallable getBackendServiceCallable() {
     throw new UnsupportedOperationException("Not implemented: getBackendServiceCallable()");
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java
index e479c4723140..64a41e5d7711 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/BackendServiceStubSettings.java
@@ -40,6 +40,7 @@
 import com.google.api.gax.rpc.TransportChannelProvider;
 import com.google.api.gax.rpc.UnaryCallSettings;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest;
 import com.google.cloud.compute.v1.BackendService;
 import com.google.cloud.compute.v1.BackendServiceAggregatedList;
@@ -47,6 +48,7 @@
 import com.google.cloud.compute.v1.BackendServiceList;
 import com.google.cloud.compute.v1.BackendServicesScopedList;
 import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest;
@@ -78,13 +80,13 @@
  *
  * 

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. For - * example, to set the total timeout of deleteBackendService to 30 seconds: + * example, to set the total timeout of addSignedUrlKeyBackendService to 30 seconds: * *

  * 
  * BackendServiceStubSettings.Builder backendServiceSettingsBuilder =
  *     BackendServiceStubSettings.newBuilder();
- * backendServiceSettingsBuilder.deleteBackendServiceSettings().getRetrySettings().toBuilder()
+ * backendServiceSettingsBuilder.addSignedUrlKeyBackendServiceSettings().getRetrySettings().toBuilder()
  *     .setTotalTimeout(Duration.ofSeconds(30));
  * BackendServiceStubSettings backendServiceSettings = backendServiceSettingsBuilder.build();
  * 
@@ -104,12 +106,16 @@ public class BackendServiceStubSettings extends StubSettings
+      addSignedUrlKeyBackendServiceSettings;
   private final PagedCallSettings<
           AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
           AggregatedListBackendServicesPagedResponse>
       aggregatedListBackendServicesSettings;
   private final UnaryCallSettings
       deleteBackendServiceSettings;
+  private final UnaryCallSettings
+      deleteSignedUrlKeyBackendServiceSettings;
   private final UnaryCallSettings
       getBackendServiceSettings;
   private final UnaryCallSettings
@@ -124,6 +130,12 @@ public class BackendServiceStubSettings extends StubSettings
       updateBackendServiceSettings;
 
+  /** Returns the object with the settings used for calls to addSignedUrlKeyBackendService. */
+  public UnaryCallSettings
+      addSignedUrlKeyBackendServiceSettings() {
+    return addSignedUrlKeyBackendServiceSettings;
+  }
+
   /** Returns the object with the settings used for calls to aggregatedListBackendServices. */
   public PagedCallSettings<
           AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
@@ -138,6 +150,12 @@ public class BackendServiceStubSettings extends StubSettings
+      deleteSignedUrlKeyBackendServiceSettings() {
+    return deleteSignedUrlKeyBackendServiceSettings;
+  }
+
   /** Returns the object with the settings used for calls to getBackendService. */
   public UnaryCallSettings
       getBackendServiceSettings() {
@@ -250,9 +268,13 @@ public Builder toBuilder() {
   protected BackendServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    addSignedUrlKeyBackendServiceSettings =
+        settingsBuilder.addSignedUrlKeyBackendServiceSettings().build();
     aggregatedListBackendServicesSettings =
         settingsBuilder.aggregatedListBackendServicesSettings().build();
     deleteBackendServiceSettings = settingsBuilder.deleteBackendServiceSettings().build();
+    deleteSignedUrlKeyBackendServiceSettings =
+        settingsBuilder.deleteSignedUrlKeyBackendServiceSettings().build();
     getBackendServiceSettings = settingsBuilder.getBackendServiceSettings().build();
     getHealthBackendServiceSettings = settingsBuilder.getHealthBackendServiceSettings().build();
     insertBackendServiceSettings = settingsBuilder.insertBackendServiceSettings().build();
@@ -399,12 +421,16 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        addSignedUrlKeyBackendServiceSettings;
     private final PagedCallSettings.Builder<
             AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
             AggregatedListBackendServicesPagedResponse>
         aggregatedListBackendServicesSettings;
     private final UnaryCallSettings.Builder
         deleteBackendServiceSettings;
+    private final UnaryCallSettings.Builder
+        deleteSignedUrlKeyBackendServiceSettings;
     private final UnaryCallSettings.Builder
         getBackendServiceSettings;
     private final UnaryCallSettings.Builder<
@@ -461,11 +487,15 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      addSignedUrlKeyBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       aggregatedListBackendServicesSettings =
           PagedCallSettings.newBuilder(AGGREGATED_LIST_BACKEND_SERVICES_PAGE_STR_FACT);
 
       deleteBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
+      deleteSignedUrlKeyBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       getBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getHealthBackendServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -481,8 +511,10 @@ protected Builder(ClientContext clientContext) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              addSignedUrlKeyBackendServiceSettings,
               aggregatedListBackendServicesSettings,
               deleteBackendServiceSettings,
+              deleteSignedUrlKeyBackendServiceSettings,
               getBackendServiceSettings,
               getHealthBackendServiceSettings,
               insertBackendServiceSettings,
@@ -504,6 +536,11 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .addSignedUrlKeyBackendServiceSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .aggregatedListBackendServicesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
@@ -514,6 +551,11 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
+      builder
+          .deleteSignedUrlKeyBackendServiceSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .getBackendServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
@@ -550,9 +592,13 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(BackendServiceStubSettings settings) {
       super(settings);
 
+      addSignedUrlKeyBackendServiceSettings =
+          settings.addSignedUrlKeyBackendServiceSettings.toBuilder();
       aggregatedListBackendServicesSettings =
           settings.aggregatedListBackendServicesSettings.toBuilder();
       deleteBackendServiceSettings = settings.deleteBackendServiceSettings.toBuilder();
+      deleteSignedUrlKeyBackendServiceSettings =
+          settings.deleteSignedUrlKeyBackendServiceSettings.toBuilder();
       getBackendServiceSettings = settings.getBackendServiceSettings.toBuilder();
       getHealthBackendServiceSettings = settings.getHealthBackendServiceSettings.toBuilder();
       insertBackendServiceSettings = settings.insertBackendServiceSettings.toBuilder();
@@ -562,8 +608,10 @@ protected Builder(BackendServiceStubSettings settings) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              addSignedUrlKeyBackendServiceSettings,
               aggregatedListBackendServicesSettings,
               deleteBackendServiceSettings,
+              deleteSignedUrlKeyBackendServiceSettings,
               getBackendServiceSettings,
               getHealthBackendServiceSettings,
               insertBackendServiceSettings,
@@ -588,6 +636,12 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to addSignedUrlKeyBackendService. */
+    public UnaryCallSettings.Builder
+        addSignedUrlKeyBackendServiceSettings() {
+      return addSignedUrlKeyBackendServiceSettings;
+    }
+
     /** Returns the builder for the settings used for calls to aggregatedListBackendServices. */
     public PagedCallSettings.Builder<
             AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList,
@@ -602,6 +656,12 @@ public Builder applyToAllUnaryMethods(
       return deleteBackendServiceSettings;
     }
 
+    /** Returns the builder for the settings used for calls to deleteSignedUrlKeyBackendService. */
+    public UnaryCallSettings.Builder
+        deleteSignedUrlKeyBackendServiceSettings() {
+      return deleteSignedUrlKeyBackendServiceSettings;
+    }
+
     /** Returns the builder for the settings used for calls to getBackendService. */
     public UnaryCallSettings.Builder
         getBackendServiceSettings() {
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java
index e293e0781306..a5b31c2f5fb0 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendBucketStub.java
@@ -30,9 +30,11 @@
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.UnaryCallable;
 import com.google.api.pathtemplate.PathTemplate;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.BackendBucket;
 import com.google.cloud.compute.v1.BackendBucketList;
 import com.google.cloud.compute.v1.DeleteBackendBucketHttpRequest;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.GetBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.InsertBackendBucketHttpRequest;
 import com.google.cloud.compute.v1.ListBackendBucketsHttpRequest;
@@ -55,6 +57,28 @@
 @Generated("by gapic-generator")
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class HttpJsonBackendBucketStub extends BackendBucketStub {
+  @InternalApi
+  public static final ApiMethodDescriptor
+      addSignedUrlKeyBackendBucketMethodDescriptor =
+          ApiMethodDescriptor.newBuilder()
+              .setFullMethodName("compute.backendBuckets.addSignedUrlKey")
+              .setHttpMethod(HttpMethods.POST)
+              .setRequestFormatter(
+                  ApiMessageHttpRequestFormatter
+                      .newBuilder()
+                      .setPathTemplate(
+                          PathTemplate.create(
+                              "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey"))
+                      .setQueryParams(Sets.newHashSet("requestId"))
+                      .setResourceNameFactory(ProjectGlobalBackendBucketName.newFactory())
+                      .setResourceNameField("backendBucket")
+                      .build())
+              .setResponseParser(
+                  ApiMessageHttpResponseParser.newBuilder()
+                      .setResponseInstance(Operation.getDefaultInstance())
+                      .build())
+              .build();
+
   @InternalApi
   public static final ApiMethodDescriptor
       deleteBackendBucketMethodDescriptor =
@@ -75,6 +99,28 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub {
                       .build())
               .build();
 
+  @InternalApi
+  public static final ApiMethodDescriptor
+      deleteSignedUrlKeyBackendBucketMethodDescriptor =
+          ApiMethodDescriptor.newBuilder()
+              .setFullMethodName("compute.backendBuckets.deleteSignedUrlKey")
+              .setHttpMethod(HttpMethods.POST)
+              .setRequestFormatter(
+                  ApiMessageHttpRequestFormatter
+                      .newBuilder()
+                      .setPathTemplate(
+                          PathTemplate.create(
+                              "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey"))
+                      .setQueryParams(Sets.newHashSet("keyName", "requestId"))
+                      .setResourceNameFactory(ProjectGlobalBackendBucketName.newFactory())
+                      .setResourceNameField("backendBucket")
+                      .build())
+              .setResponseParser(
+                  ApiMessageHttpResponseParser.newBuilder()
+                      .setResponseInstance(Operation.getDefaultInstance())
+                      .build())
+              .build();
+
   @InternalApi
   public static final ApiMethodDescriptor
       getBackendBucketMethodDescriptor =
@@ -176,8 +222,12 @@ public class HttpJsonBackendBucketStub extends BackendBucketStub {
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable
+      addSignedUrlKeyBackendBucketCallable;
   private final UnaryCallable
       deleteBackendBucketCallable;
+  private final UnaryCallable
+      deleteSignedUrlKeyBackendBucketCallable;
   private final UnaryCallable getBackendBucketCallable;
   private final UnaryCallable
       insertBackendBucketCallable;
@@ -230,11 +280,21 @@ protected HttpJsonBackendBucketStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    HttpJsonCallSettings
+        addSignedUrlKeyBackendBucketTransportSettings =
+            HttpJsonCallSettings.newBuilder()
+                .setMethodDescriptor(addSignedUrlKeyBackendBucketMethodDescriptor)
+                .build();
     HttpJsonCallSettings
         deleteBackendBucketTransportSettings =
             HttpJsonCallSettings.newBuilder()
                 .setMethodDescriptor(deleteBackendBucketMethodDescriptor)
                 .build();
+    HttpJsonCallSettings
+        deleteSignedUrlKeyBackendBucketTransportSettings =
+            HttpJsonCallSettings.newBuilder()
+                .setMethodDescriptor(deleteSignedUrlKeyBackendBucketMethodDescriptor)
+                .build();
     HttpJsonCallSettings
         getBackendBucketTransportSettings =
             HttpJsonCallSettings.newBuilder()
@@ -261,11 +321,21 @@ protected HttpJsonBackendBucketStub(
                 .setMethodDescriptor(updateBackendBucketMethodDescriptor)
                 .build();
 
+    this.addSignedUrlKeyBackendBucketCallable =
+        callableFactory.createUnaryCallable(
+            addSignedUrlKeyBackendBucketTransportSettings,
+            settings.addSignedUrlKeyBackendBucketSettings(),
+            clientContext);
     this.deleteBackendBucketCallable =
         callableFactory.createUnaryCallable(
             deleteBackendBucketTransportSettings,
             settings.deleteBackendBucketSettings(),
             clientContext);
+    this.deleteSignedUrlKeyBackendBucketCallable =
+        callableFactory.createUnaryCallable(
+            deleteSignedUrlKeyBackendBucketTransportSettings,
+            settings.deleteSignedUrlKeyBackendBucketSettings(),
+            clientContext);
     this.getBackendBucketCallable =
         callableFactory.createUnaryCallable(
             getBackendBucketTransportSettings, settings.getBackendBucketSettings(), clientContext);
@@ -298,11 +368,23 @@ protected HttpJsonBackendBucketStub(
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  @BetaApi
+  public UnaryCallable
+      addSignedUrlKeyBackendBucketCallable() {
+    return addSignedUrlKeyBackendBucketCallable;
+  }
+
   @BetaApi
   public UnaryCallable deleteBackendBucketCallable() {
     return deleteBackendBucketCallable;
   }
 
+  @BetaApi
+  public UnaryCallable
+      deleteSignedUrlKeyBackendBucketCallable() {
+    return deleteSignedUrlKeyBackendBucketCallable;
+  }
+
   @BetaApi
   public UnaryCallable getBackendBucketCallable() {
     return getBackendBucketCallable;
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java
index 707e2defa242..3b6660bcac9f 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonBackendServiceStub.java
@@ -31,12 +31,14 @@
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.UnaryCallable;
 import com.google.api.pathtemplate.PathTemplate;
+import com.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.AggregatedListBackendServicesHttpRequest;
 import com.google.cloud.compute.v1.BackendService;
 import com.google.cloud.compute.v1.BackendServiceAggregatedList;
 import com.google.cloud.compute.v1.BackendServiceGroupHealth;
 import com.google.cloud.compute.v1.BackendServiceList;
 import com.google.cloud.compute.v1.DeleteBackendServiceHttpRequest;
+import com.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.GetHealthBackendServiceHttpRequest;
 import com.google.cloud.compute.v1.InsertBackendServiceHttpRequest;
@@ -60,6 +62,28 @@
 @Generated("by gapic-generator")
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class HttpJsonBackendServiceStub extends BackendServiceStub {
+  @InternalApi
+  public static final ApiMethodDescriptor
+      addSignedUrlKeyBackendServiceMethodDescriptor =
+          ApiMethodDescriptor.newBuilder()
+              .setFullMethodName("compute.backendServices.addSignedUrlKey")
+              .setHttpMethod(HttpMethods.POST)
+              .setRequestFormatter(
+                  ApiMessageHttpRequestFormatter
+                      .newBuilder()
+                      .setPathTemplate(
+                          PathTemplate.create(
+                              "{project}/global/backendServices/{backendService}/addSignedUrlKey"))
+                      .setQueryParams(Sets.newHashSet("requestId"))
+                      .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory())
+                      .setResourceNameField("backendService")
+                      .build())
+              .setResponseParser(
+                  ApiMessageHttpResponseParser.newBuilder()
+                      .setResponseInstance(Operation.getDefaultInstance())
+                      .build())
+              .build();
+
   @InternalApi
   public static final ApiMethodDescriptor<
           AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList>
@@ -103,6 +127,28 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
                       .build())
               .build();
 
+  @InternalApi
+  public static final ApiMethodDescriptor
+      deleteSignedUrlKeyBackendServiceMethodDescriptor =
+          ApiMethodDescriptor.newBuilder()
+              .setFullMethodName("compute.backendServices.deleteSignedUrlKey")
+              .setHttpMethod(HttpMethods.POST)
+              .setRequestFormatter(
+                  ApiMessageHttpRequestFormatter
+                      .newBuilder()
+                      .setPathTemplate(
+                          PathTemplate.create(
+                              "{project}/global/backendServices/{backendService}/deleteSignedUrlKey"))
+                      .setQueryParams(Sets.newHashSet("keyName", "requestId"))
+                      .setResourceNameFactory(ProjectGlobalBackendServiceName.newFactory())
+                      .setResourceNameField("backendService")
+                      .build())
+              .setResponseParser(
+                  ApiMessageHttpResponseParser.newBuilder()
+                      .setResponseInstance(Operation.getDefaultInstance())
+                      .build())
+              .build();
+
   @InternalApi
   public static final ApiMethodDescriptor
       getBackendServiceMethodDescriptor =
@@ -227,6 +273,8 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable
+      addSignedUrlKeyBackendServiceCallable;
   private final UnaryCallable<
           AggregatedListBackendServicesHttpRequest, BackendServiceAggregatedList>
       aggregatedListBackendServicesCallable;
@@ -235,6 +283,8 @@ public class HttpJsonBackendServiceStub extends BackendServiceStub {
       aggregatedListBackendServicesPagedCallable;
   private final UnaryCallable
       deleteBackendServiceCallable;
+  private final UnaryCallable
+      deleteSignedUrlKeyBackendServiceCallable;
   private final UnaryCallable
       getBackendServiceCallable;
   private final UnaryCallable
@@ -291,6 +341,11 @@ protected HttpJsonBackendServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    HttpJsonCallSettings
+        addSignedUrlKeyBackendServiceTransportSettings =
+            HttpJsonCallSettings.newBuilder()
+                .setMethodDescriptor(addSignedUrlKeyBackendServiceMethodDescriptor)
+                .build();
     HttpJsonCallSettings
         aggregatedListBackendServicesTransportSettings =
             HttpJsonCallSettings
@@ -303,6 +358,12 @@ protected HttpJsonBackendServiceStub(
             HttpJsonCallSettings.newBuilder()
                 .setMethodDescriptor(deleteBackendServiceMethodDescriptor)
                 .build();
+    HttpJsonCallSettings
+        deleteSignedUrlKeyBackendServiceTransportSettings =
+            HttpJsonCallSettings
+                .newBuilder()
+                .setMethodDescriptor(deleteSignedUrlKeyBackendServiceMethodDescriptor)
+                .build();
     HttpJsonCallSettings
         getBackendServiceTransportSettings =
             HttpJsonCallSettings.newBuilder()
@@ -335,6 +396,11 @@ protected HttpJsonBackendServiceStub(
                 .setMethodDescriptor(updateBackendServiceMethodDescriptor)
                 .build();
 
+    this.addSignedUrlKeyBackendServiceCallable =
+        callableFactory.createUnaryCallable(
+            addSignedUrlKeyBackendServiceTransportSettings,
+            settings.addSignedUrlKeyBackendServiceSettings(),
+            clientContext);
     this.aggregatedListBackendServicesCallable =
         callableFactory.createUnaryCallable(
             aggregatedListBackendServicesTransportSettings,
@@ -350,6 +416,11 @@ protected HttpJsonBackendServiceStub(
             deleteBackendServiceTransportSettings,
             settings.deleteBackendServiceSettings(),
             clientContext);
+    this.deleteSignedUrlKeyBackendServiceCallable =
+        callableFactory.createUnaryCallable(
+            deleteSignedUrlKeyBackendServiceTransportSettings,
+            settings.deleteSignedUrlKeyBackendServiceSettings(),
+            clientContext);
     this.getBackendServiceCallable =
         callableFactory.createUnaryCallable(
             getBackendServiceTransportSettings,
@@ -389,6 +460,12 @@ protected HttpJsonBackendServiceStub(
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  @BetaApi
+  public UnaryCallable
+      addSignedUrlKeyBackendServiceCallable() {
+    return addSignedUrlKeyBackendServiceCallable;
+  }
+
   @BetaApi
   public UnaryCallable<
           AggregatedListBackendServicesHttpRequest, AggregatedListBackendServicesPagedResponse>
@@ -407,6 +484,12 @@ public UnaryCallable deleteBackendSe
     return deleteBackendServiceCallable;
   }
 
+  @BetaApi
+  public UnaryCallable
+      deleteSignedUrlKeyBackendServiceCallable() {
+    return deleteSignedUrlKeyBackendServiceCallable;
+  }
+
   @BetaApi
   public UnaryCallable getBackendServiceCallable() {
     return getBackendServiceCallable;
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java
index b6878ea5897b..75d2bc61be28 100644
--- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectAttachmentStub.java
@@ -40,6 +40,7 @@
 import com.google.cloud.compute.v1.InterconnectAttachmentList;
 import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest;
 import com.google.cloud.compute.v1.Operation;
+import com.google.cloud.compute.v1.PatchInterconnectAttachmentHttpRequest;
 import com.google.cloud.compute.v1.ProjectName;
 import com.google.cloud.compute.v1.ProjectRegionInterconnectAttachmentName;
 import com.google.cloud.compute.v1.ProjectRegionName;
@@ -174,6 +175,28 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt
                       .build())
               .build();
 
+  @InternalApi
+  public static final ApiMethodDescriptor
+      patchInterconnectAttachmentMethodDescriptor =
+          ApiMethodDescriptor.newBuilder()
+              .setFullMethodName("compute.interconnectAttachments.patch")
+              .setHttpMethod(HttpMethods.PATCH)
+              .setRequestFormatter(
+                  ApiMessageHttpRequestFormatter
+                      .newBuilder()
+                      .setPathTemplate(
+                          PathTemplate.create(
+                              "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}"))
+                      .setQueryParams(Sets.newHashSet("requestId"))
+                      .setResourceNameFactory(ProjectRegionInterconnectAttachmentName.newFactory())
+                      .setResourceNameField("interconnectAttachment")
+                      .build())
+              .setResponseParser(
+                  ApiMessageHttpResponseParser.newBuilder()
+                      .setResponseInstance(Operation.getDefaultInstance())
+                      .build())
+              .build();
+
   private final BackgroundResource backgroundResources;
 
   private final UnaryCallable<
@@ -194,6 +217,8 @@ public class HttpJsonInterconnectAttachmentStub extends InterconnectAttachmentSt
   private final UnaryCallable<
           ListInterconnectAttachmentsHttpRequest, ListInterconnectAttachmentsPagedResponse>
       listInterconnectAttachmentsPagedCallable;
+  private final UnaryCallable
+      patchInterconnectAttachmentCallable;
 
   private final HttpJsonStubCallableFactory callableFactory;
 
@@ -267,6 +292,11 @@ protected HttpJsonInterconnectAttachmentStub(
                 .newBuilder()
                 .setMethodDescriptor(listInterconnectAttachmentsMethodDescriptor)
                 .build();
+    HttpJsonCallSettings
+        patchInterconnectAttachmentTransportSettings =
+            HttpJsonCallSettings.newBuilder()
+                .setMethodDescriptor(patchInterconnectAttachmentMethodDescriptor)
+                .build();
 
     this.aggregatedListInterconnectAttachmentsCallable =
         callableFactory.createUnaryCallable(
@@ -303,6 +333,11 @@ protected HttpJsonInterconnectAttachmentStub(
             listInterconnectAttachmentsTransportSettings,
             settings.listInterconnectAttachmentsSettings(),
             clientContext);
+    this.patchInterconnectAttachmentCallable =
+        callableFactory.createUnaryCallable(
+            patchInterconnectAttachmentTransportSettings,
+            settings.patchInterconnectAttachmentSettings(),
+            clientContext);
 
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
@@ -353,6 +388,12 @@ protected HttpJsonInterconnectAttachmentStub(
     return listInterconnectAttachmentsCallable;
   }
 
+  @BetaApi
+  public UnaryCallable
+      patchInterconnectAttachmentCallable() {
+    return patchInterconnectAttachmentCallable;
+  }
+
   @Override
   public final void close() {
     shutdown();
diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeGroupCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeGroupCallableFactory.java
new file mode 100644
index 000000000000..804cb153875f
--- /dev/null
+++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeGroupCallableFactory.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2018 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.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * HTTP callable factory implementation for compute.
+ *
+ * 

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonNodeGroupCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeGroupStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeGroupStub.java new file mode 100644 index 000000000000..031497a24be9 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeGroupStub.java @@ -0,0 +1,506 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeGroupClient.AggregatedListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodesNodeGroupsPagedResponse; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AddNodesNodeGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteNodeGroupHttpRequest; +import com.google.cloud.compute.v1.DeleteNodesNodeGroupHttpRequest; +import com.google.cloud.compute.v1.GetNodeGroupHttpRequest; +import com.google.cloud.compute.v1.InsertNodeGroupHttpRequest; +import com.google.cloud.compute.v1.ListNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.ListNodesNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.NodeGroup; +import com.google.cloud.compute.v1.NodeGroupAggregatedList; +import com.google.cloud.compute.v1.NodeGroupList; +import com.google.cloud.compute.v1.NodeGroupsListNodes; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectZoneName; +import com.google.cloud.compute.v1.ProjectZoneNodeGroupName; +import com.google.cloud.compute.v1.SetNodeTemplateNodeGroupHttpRequest; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonNodeGroupStub extends NodeGroupStub { + @InternalApi + public static final ApiMethodDescriptor + addNodesNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.addNodes") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneNodeGroupName.newFactory()) + .setResourceNameField("nodeGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList> + aggregatedListNodeGroupsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.nodeGroups.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate(PathTemplate.create("{project}/aggregated/nodeGroups")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeGroupAggregatedList.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + deleteNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/nodeGroups/{nodeGroup}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneNodeGroupName.newFactory()) + .setResourceNameField("nodeGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + deleteNodesNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.deleteNodes") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneNodeGroupName.newFactory()) + .setResourceNameField("nodeGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + getNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/nodeGroups/{nodeGroup}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneNodeGroupName.newFactory()) + .setResourceNameField("nodeGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeGroup.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + insertNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/nodeGroups")) + .setQueryParams(Sets.newHashSet("initialNodeCount", "requestId")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listNodeGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/nodeGroups")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeGroupList.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listNodesNodeGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.listNodes") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneNodeGroupName.newFactory()) + .setResourceNameField("nodeGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeGroupsListNodes.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + setNodeTemplateNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.setNodeTemplate") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneNodeGroupName.newFactory()) + .setResourceNameField("nodeGroup") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable addNodesNodeGroupCallable; + private final UnaryCallable + aggregatedListNodeGroupsCallable; + private final UnaryCallable< + AggregatedListNodeGroupsHttpRequest, AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsPagedCallable; + private final UnaryCallable deleteNodeGroupCallable; + private final UnaryCallable + deleteNodesNodeGroupCallable; + private final UnaryCallable getNodeGroupCallable; + private final UnaryCallable insertNodeGroupCallable; + private final UnaryCallable listNodeGroupsCallable; + private final UnaryCallable + listNodeGroupsPagedCallable; + private final UnaryCallable + listNodesNodeGroupsCallable; + private final UnaryCallable + listNodesNodeGroupsPagedCallable; + private final UnaryCallable + setNodeTemplateNodeGroupCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonNodeGroupStub create(NodeGroupStubSettings settings) + throws IOException { + return new HttpJsonNodeGroupStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonNodeGroupStub create(ClientContext clientContext) throws IOException { + return new HttpJsonNodeGroupStub(NodeGroupStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonNodeGroupStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNodeGroupStub( + NodeGroupStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonNodeGroupStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonNodeGroupStub(NodeGroupStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonNodeGroupCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonNodeGroupStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonNodeGroupStub( + NodeGroupStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + addNodesNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(addNodesNodeGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + aggregatedListNodeGroupsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListNodeGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings deleteNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteNodeGroupMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteNodesNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteNodesNodeGroupMethodDescriptor) + .build(); + HttpJsonCallSettings getNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getNodeGroupMethodDescriptor) + .build(); + HttpJsonCallSettings insertNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertNodeGroupMethodDescriptor) + .build(); + HttpJsonCallSettings listNodeGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listNodeGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings + listNodesNodeGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listNodesNodeGroupsMethodDescriptor) + .build(); + HttpJsonCallSettings + setNodeTemplateNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setNodeTemplateNodeGroupMethodDescriptor) + .build(); + + this.addNodesNodeGroupCallable = + callableFactory.createUnaryCallable( + addNodesNodeGroupTransportSettings, + settings.addNodesNodeGroupSettings(), + clientContext); + this.aggregatedListNodeGroupsCallable = + callableFactory.createUnaryCallable( + aggregatedListNodeGroupsTransportSettings, + settings.aggregatedListNodeGroupsSettings(), + clientContext); + this.aggregatedListNodeGroupsPagedCallable = + callableFactory.createPagedCallable( + aggregatedListNodeGroupsTransportSettings, + settings.aggregatedListNodeGroupsSettings(), + clientContext); + this.deleteNodeGroupCallable = + callableFactory.createUnaryCallable( + deleteNodeGroupTransportSettings, settings.deleteNodeGroupSettings(), clientContext); + this.deleteNodesNodeGroupCallable = + callableFactory.createUnaryCallable( + deleteNodesNodeGroupTransportSettings, + settings.deleteNodesNodeGroupSettings(), + clientContext); + this.getNodeGroupCallable = + callableFactory.createUnaryCallable( + getNodeGroupTransportSettings, settings.getNodeGroupSettings(), clientContext); + this.insertNodeGroupCallable = + callableFactory.createUnaryCallable( + insertNodeGroupTransportSettings, settings.insertNodeGroupSettings(), clientContext); + this.listNodeGroupsCallable = + callableFactory.createUnaryCallable( + listNodeGroupsTransportSettings, settings.listNodeGroupsSettings(), clientContext); + this.listNodeGroupsPagedCallable = + callableFactory.createPagedCallable( + listNodeGroupsTransportSettings, settings.listNodeGroupsSettings(), clientContext); + this.listNodesNodeGroupsCallable = + callableFactory.createUnaryCallable( + listNodesNodeGroupsTransportSettings, + settings.listNodesNodeGroupsSettings(), + clientContext); + this.listNodesNodeGroupsPagedCallable = + callableFactory.createPagedCallable( + listNodesNodeGroupsTransportSettings, + settings.listNodesNodeGroupsSettings(), + clientContext); + this.setNodeTemplateNodeGroupCallable = + callableFactory.createUnaryCallable( + setNodeTemplateNodeGroupTransportSettings, + settings.setNodeTemplateNodeGroupSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable addNodesNodeGroupCallable() { + return addNodesNodeGroupCallable; + } + + @BetaApi + public UnaryCallable + aggregatedListNodeGroupsPagedCallable() { + return aggregatedListNodeGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable + aggregatedListNodeGroupsCallable() { + return aggregatedListNodeGroupsCallable; + } + + @BetaApi + public UnaryCallable deleteNodeGroupCallable() { + return deleteNodeGroupCallable; + } + + @BetaApi + public UnaryCallable deleteNodesNodeGroupCallable() { + return deleteNodesNodeGroupCallable; + } + + @BetaApi + public UnaryCallable getNodeGroupCallable() { + return getNodeGroupCallable; + } + + @BetaApi + public UnaryCallable insertNodeGroupCallable() { + return insertNodeGroupCallable; + } + + @BetaApi + public UnaryCallable + listNodeGroupsPagedCallable() { + return listNodeGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable listNodeGroupsCallable() { + return listNodeGroupsCallable; + } + + @BetaApi + public UnaryCallable + listNodesNodeGroupsPagedCallable() { + return listNodesNodeGroupsPagedCallable; + } + + @BetaApi + public UnaryCallable + listNodesNodeGroupsCallable() { + return listNodesNodeGroupsCallable; + } + + @BetaApi + public UnaryCallable + setNodeTemplateNodeGroupCallable() { + return setNodeTemplateNodeGroupCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTemplateCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTemplateCallableFactory.java new file mode 100644 index 000000000000..7b7a640fb586 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTemplateCallableFactory.java @@ -0,0 +1,65 @@ +/* + * Copyright 2018 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonNodeTemplateCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTemplateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTemplateStub.java new file mode 100644 index 000000000000..0027f80e1a79 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTemplateStub.java @@ -0,0 +1,354 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeTemplateClient.AggregatedListNodeTemplatesPagedResponse; +import static com.google.cloud.compute.v1.NodeTemplateClient.ListNodeTemplatesPagedResponse; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListNodeTemplatesHttpRequest; +import com.google.cloud.compute.v1.DeleteNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.GetNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.ListNodeTemplatesHttpRequest; +import com.google.cloud.compute.v1.NodeTemplate; +import com.google.cloud.compute.v1.NodeTemplateAggregatedList; +import com.google.cloud.compute.v1.NodeTemplateList; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectRegionName; +import com.google.cloud.compute.v1.ProjectRegionNodeTemplateName; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonNodeTemplateStub extends NodeTemplateStub { + @InternalApi + public static final ApiMethodDescriptor< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList> + aggregatedListNodeTemplatesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.nodeTemplates.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate(PathTemplate.create("{project}/aggregated/nodeTemplates")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeTemplateAggregatedList.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + deleteNodeTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTemplates.delete") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionNodeTemplateName.newFactory()) + .setResourceNameField("nodeTemplate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + getNodeTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTemplates.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionNodeTemplateName.newFactory()) + .setResourceNameField("nodeTemplate") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeTemplate.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + insertNodeTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTemplates.insert") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/nodeTemplates")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listNodeTemplatesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTemplates.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/regions/{region}/nodeTemplates")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionName.newFactory()) + .setResourceNameField("region") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeTemplateList.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + aggregatedListNodeTemplatesCallable; + private final UnaryCallable< + AggregatedListNodeTemplatesHttpRequest, AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesPagedCallable; + private final UnaryCallable deleteNodeTemplateCallable; + private final UnaryCallable getNodeTemplateCallable; + private final UnaryCallable insertNodeTemplateCallable; + private final UnaryCallable + listNodeTemplatesCallable; + private final UnaryCallable + listNodeTemplatesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonNodeTemplateStub create(NodeTemplateStubSettings settings) + throws IOException { + return new HttpJsonNodeTemplateStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonNodeTemplateStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonNodeTemplateStub( + NodeTemplateStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonNodeTemplateStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNodeTemplateStub( + NodeTemplateStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonNodeTemplateStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonNodeTemplateStub(NodeTemplateStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonNodeTemplateCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonNodeTemplateStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonNodeTemplateStub( + NodeTemplateStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + aggregatedListNodeTemplatesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListNodeTemplatesMethodDescriptor) + .build(); + HttpJsonCallSettings + deleteNodeTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteNodeTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + getNodeTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getNodeTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + insertNodeTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertNodeTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + listNodeTemplatesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listNodeTemplatesMethodDescriptor) + .build(); + + this.aggregatedListNodeTemplatesCallable = + callableFactory.createUnaryCallable( + aggregatedListNodeTemplatesTransportSettings, + settings.aggregatedListNodeTemplatesSettings(), + clientContext); + this.aggregatedListNodeTemplatesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListNodeTemplatesTransportSettings, + settings.aggregatedListNodeTemplatesSettings(), + clientContext); + this.deleteNodeTemplateCallable = + callableFactory.createUnaryCallable( + deleteNodeTemplateTransportSettings, + settings.deleteNodeTemplateSettings(), + clientContext); + this.getNodeTemplateCallable = + callableFactory.createUnaryCallable( + getNodeTemplateTransportSettings, settings.getNodeTemplateSettings(), clientContext); + this.insertNodeTemplateCallable = + callableFactory.createUnaryCallable( + insertNodeTemplateTransportSettings, + settings.insertNodeTemplateSettings(), + clientContext); + this.listNodeTemplatesCallable = + callableFactory.createUnaryCallable( + listNodeTemplatesTransportSettings, + settings.listNodeTemplatesSettings(), + clientContext); + this.listNodeTemplatesPagedCallable = + callableFactory.createPagedCallable( + listNodeTemplatesTransportSettings, + settings.listNodeTemplatesSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable< + AggregatedListNodeTemplatesHttpRequest, AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesPagedCallable() { + return aggregatedListNodeTemplatesPagedCallable; + } + + @BetaApi + public UnaryCallable + aggregatedListNodeTemplatesCallable() { + return aggregatedListNodeTemplatesCallable; + } + + @BetaApi + public UnaryCallable deleteNodeTemplateCallable() { + return deleteNodeTemplateCallable; + } + + @BetaApi + public UnaryCallable getNodeTemplateCallable() { + return getNodeTemplateCallable; + } + + @BetaApi + public UnaryCallable insertNodeTemplateCallable() { + return insertNodeTemplateCallable; + } + + @BetaApi + public UnaryCallable + listNodeTemplatesPagedCallable() { + return listNodeTemplatesPagedCallable; + } + + @BetaApi + public UnaryCallable listNodeTemplatesCallable() { + return listNodeTemplatesCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTypeCallableFactory.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTypeCallableFactory.java new file mode 100644 index 000000000000..9c48a3455a42 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTypeCallableFactory.java @@ -0,0 +1,65 @@ +/* + * Copyright 2018 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP callable factory implementation for compute. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class HttpJsonNodeTypeCallableFactory implements HttpJsonStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, batchingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTypeStub.java new file mode 100644 index 000000000000..04aaa41fdc04 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonNodeTypeStub.java @@ -0,0 +1,265 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeTypeClient.AggregatedListNodeTypesPagedResponse; +import static com.google.cloud.compute.v1.NodeTypeClient.ListNodeTypesPagedResponse; + +import com.google.api.client.http.HttpMethods; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMessageHttpRequestFormatter; +import com.google.api.gax.httpjson.ApiMessageHttpResponseParser; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.compute.v1.AggregatedListNodeTypesHttpRequest; +import com.google.cloud.compute.v1.GetNodeTypeHttpRequest; +import com.google.cloud.compute.v1.ListNodeTypesHttpRequest; +import com.google.cloud.compute.v1.NodeType; +import com.google.cloud.compute.v1.NodeTypeAggregatedList; +import com.google.cloud.compute.v1.NodeTypeList; +import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.ProjectZoneName; +import com.google.cloud.compute.v1.ProjectZoneNodeTypeName; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * HTTP stub implementation for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class HttpJsonNodeTypeStub extends NodeTypeStub { + @InternalApi + public static final ApiMethodDescriptor< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList> + aggregatedListNodeTypesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.nodeTypes.aggregatedList") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate(PathTemplate.create("{project}/aggregated/nodeTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeTypeAggregatedList.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + getNodeTypeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTypes.get") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/zones/{zone}/nodeTypes/{nodeType}")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneNodeTypeName.newFactory()) + .setResourceNameField("nodeType") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeType.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor + listNodeTypesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTypes.list") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate(PathTemplate.create("{project}/zones/{zone}/nodeTypes")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectZoneName.newFactory()) + .setResourceNameField("zone") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(NodeTypeList.getDefaultInstance()) + .build()) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable + aggregatedListNodeTypesCallable; + private final UnaryCallable< + AggregatedListNodeTypesHttpRequest, AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesPagedCallable; + private final UnaryCallable getNodeTypeCallable; + private final UnaryCallable listNodeTypesCallable; + private final UnaryCallable + listNodeTypesPagedCallable; + + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonNodeTypeStub create(NodeTypeStubSettings settings) + throws IOException { + return new HttpJsonNodeTypeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonNodeTypeStub create(ClientContext clientContext) throws IOException { + return new HttpJsonNodeTypeStub(NodeTypeStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonNodeTypeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonNodeTypeStub( + NodeTypeStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonNodeTypeStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonNodeTypeStub(NodeTypeStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonNodeTypeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonNodeTypeStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonNodeTypeStub( + NodeTypeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + aggregatedListNodeTypesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(aggregatedListNodeTypesMethodDescriptor) + .build(); + HttpJsonCallSettings getNodeTypeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getNodeTypeMethodDescriptor) + .build(); + HttpJsonCallSettings listNodeTypesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listNodeTypesMethodDescriptor) + .build(); + + this.aggregatedListNodeTypesCallable = + callableFactory.createUnaryCallable( + aggregatedListNodeTypesTransportSettings, + settings.aggregatedListNodeTypesSettings(), + clientContext); + this.aggregatedListNodeTypesPagedCallable = + callableFactory.createPagedCallable( + aggregatedListNodeTypesTransportSettings, + settings.aggregatedListNodeTypesSettings(), + clientContext); + this.getNodeTypeCallable = + callableFactory.createUnaryCallable( + getNodeTypeTransportSettings, settings.getNodeTypeSettings(), clientContext); + this.listNodeTypesCallable = + callableFactory.createUnaryCallable( + listNodeTypesTransportSettings, settings.listNodeTypesSettings(), clientContext); + this.listNodeTypesPagedCallable = + callableFactory.createPagedCallable( + listNodeTypesTransportSettings, settings.listNodeTypesSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi + public UnaryCallable + aggregatedListNodeTypesPagedCallable() { + return aggregatedListNodeTypesPagedCallable; + } + + @BetaApi + public UnaryCallable + aggregatedListNodeTypesCallable() { + return aggregatedListNodeTypesCallable; + } + + @BetaApi + public UnaryCallable getNodeTypeCallable() { + return getNodeTypeCallable; + } + + @BetaApi + public UnaryCallable + listNodeTypesPagedCallable() { + return listNodeTypesPagedCallable; + } + + @BetaApi + public UnaryCallable listNodeTypesCallable() { + return listNodeTypesCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java index e85bff516d78..756ce5f85529 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonProjectStub.java @@ -46,6 +46,7 @@ import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectsGetXpnResources; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetDefaultNetworkTierProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; import com.google.cloud.compute.v1.XpnHostList; import com.google.common.collect.Sets; @@ -276,6 +277,26 @@ public class HttpJsonProjectStub extends ProjectStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setDefaultNetworkTierProjectMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.projects.setDefaultNetworkTier") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate(PathTemplate.create("{project}/setDefaultNetworkTier")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setUsageExportBucketProjectMethodDescriptor = @@ -322,6 +343,8 @@ public class HttpJsonProjectStub extends ProjectStub { moveInstanceProjectCallable; private final UnaryCallable setCommonInstanceMetadataProjectCallable; + private final UnaryCallable + setDefaultNetworkTierProjectCallable; private final UnaryCallable setUsageExportBucketProjectCallable; @@ -417,6 +440,11 @@ protected HttpJsonProjectStub( .newBuilder() .setMethodDescriptor(setCommonInstanceMetadataProjectMethodDescriptor) .build(); + HttpJsonCallSettings + setDefaultNetworkTierProjectTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setDefaultNetworkTierProjectMethodDescriptor) + .build(); HttpJsonCallSettings setUsageExportBucketProjectTransportSettings = HttpJsonCallSettings.newBuilder() @@ -484,6 +512,11 @@ protected HttpJsonProjectStub( setCommonInstanceMetadataProjectTransportSettings, settings.setCommonInstanceMetadataProjectSettings(), clientContext); + this.setDefaultNetworkTierProjectCallable = + callableFactory.createUnaryCallable( + setDefaultNetworkTierProjectTransportSettings, + settings.setDefaultNetworkTierProjectSettings(), + clientContext); this.setUsageExportBucketProjectCallable = callableFactory.createUnaryCallable( setUsageExportBucketProjectTransportSettings, @@ -566,6 +599,12 @@ public UnaryCallable moveInstanceProj return setCommonInstanceMetadataProjectCallable; } + @BetaApi + public UnaryCallable + setDefaultNetworkTierProjectCallable() { + return setDefaultNetworkTierProjectCallable; + } + @BetaApi public UnaryCallable setUsageExportBucketProjectCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java index c49c72f72b9b..4f2a8ee380e4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSubnetworkStub.java @@ -17,6 +17,7 @@ import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListUsableSubnetworksPagedResponse; import com.google.api.client.http.HttpMethods; import com.google.api.core.BetaApi; @@ -37,6 +38,7 @@ import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.ListUsableSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; import com.google.cloud.compute.v1.ProjectName; @@ -46,6 +48,7 @@ import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; import com.google.cloud.compute.v1.SubnetworkList; +import com.google.cloud.compute.v1.UsableSubnetworksAggregatedList; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -187,6 +190,29 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList> + listUsableSubnetworksMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.subnetworks.listUsable") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/aggregated/subnetworks/listUsable")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectName.newFactory()) + .setResourceNameField("project") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(UsableSubnetworksAggregatedList.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor patchSubnetworkMethodDescriptor = @@ -245,6 +271,10 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { private final UnaryCallable listSubnetworksCallable; private final UnaryCallable listSubnetworksPagedCallable; + private final UnaryCallable + listUsableSubnetworksCallable; + private final UnaryCallable + listUsableSubnetworksPagedCallable; private final UnaryCallable patchSubnetworkCallable; private final UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable; @@ -317,6 +347,12 @@ protected HttpJsonSubnetworkStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSubnetworksMethodDescriptor) .build(); + HttpJsonCallSettings + listUsableSubnetworksTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listUsableSubnetworksMethodDescriptor) + .build(); HttpJsonCallSettings patchSubnetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchSubnetworkMethodDescriptor) @@ -358,6 +394,16 @@ protected HttpJsonSubnetworkStub( this.listSubnetworksPagedCallable = callableFactory.createPagedCallable( listSubnetworksTransportSettings, settings.listSubnetworksSettings(), clientContext); + this.listUsableSubnetworksCallable = + callableFactory.createUnaryCallable( + listUsableSubnetworksTransportSettings, + settings.listUsableSubnetworksSettings(), + clientContext); + this.listUsableSubnetworksPagedCallable = + callableFactory.createPagedCallable( + listUsableSubnetworksTransportSettings, + settings.listUsableSubnetworksSettings(), + clientContext); this.patchSubnetworkCallable = callableFactory.createUnaryCallable( patchSubnetworkTransportSettings, settings.patchSubnetworkSettings(), clientContext); @@ -414,6 +460,18 @@ public UnaryCallable listSubnetworks return listSubnetworksCallable; } + @BetaApi + public UnaryCallable + listUsableSubnetworksPagedCallable() { + return listUsableSubnetworksPagedCallable; + } + + @BetaApi + public UnaryCallable + listUsableSubnetworksCallable() { + return listUsableSubnetworksCallable; + } + @BetaApi public UnaryCallable patchSubnetworkCallable() { return patchSubnetworkCallable; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java index 1e017d23839e..019cd7079deb 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonTargetHttpsProxyStub.java @@ -38,6 +38,7 @@ import com.google.cloud.compute.v1.ProjectGlobalTargetHttpsProxyName; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectTargetHttpsProxyName; +import com.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; @@ -138,6 +139,28 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setQuicOverrideTargetHttpsProxyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.targetHttpsProxies.setQuicOverride") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectGlobalTargetHttpsProxyName.newFactory()) + .setResourceNameField("targetHttpsProxy") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setSslCertificatesTargetHttpsProxyMethodDescriptor = @@ -216,6 +239,8 @@ public class HttpJsonTargetHttpsProxyStub extends TargetHttpsProxyStub { private final UnaryCallable< ListTargetHttpsProxiesHttpRequest, ListTargetHttpsProxiesPagedResponse> listTargetHttpsProxiesPagedCallable; + private final UnaryCallable + setQuicOverrideTargetHttpsProxyCallable; private final UnaryCallable setSslCertificatesTargetHttpsProxyCallable; private final UnaryCallable @@ -285,6 +310,11 @@ protected HttpJsonTargetHttpsProxyStub( .newBuilder() .setMethodDescriptor(listTargetHttpsProxiesMethodDescriptor) .build(); + HttpJsonCallSettings + setQuicOverrideTargetHttpsProxyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setQuicOverrideTargetHttpsProxyMethodDescriptor) + .build(); HttpJsonCallSettings setSslCertificatesTargetHttpsProxyTransportSettings = HttpJsonCallSettings @@ -327,6 +357,11 @@ protected HttpJsonTargetHttpsProxyStub( listTargetHttpsProxiesTransportSettings, settings.listTargetHttpsProxiesSettings(), clientContext); + this.setQuicOverrideTargetHttpsProxyCallable = + callableFactory.createUnaryCallable( + setQuicOverrideTargetHttpsProxyTransportSettings, + settings.setQuicOverrideTargetHttpsProxySettings(), + clientContext); this.setSslCertificatesTargetHttpsProxyCallable = callableFactory.createUnaryCallable( setSslCertificatesTargetHttpsProxyTransportSettings, @@ -376,6 +411,12 @@ protected HttpJsonTargetHttpsProxyStub( return listTargetHttpsProxiesCallable; } + @BetaApi + public UnaryCallable + setQuicOverrideTargetHttpsProxyCallable() { + return setQuicOverrideTargetHttpsProxyCallable; + } + @BetaApi public UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java index 0fb2191c1496..fa2a25772671 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStub.java @@ -30,6 +30,7 @@ import com.google.cloud.compute.v1.InterconnectAttachmentList; import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInterconnectAttachmentHttpRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -94,6 +95,13 @@ public abstract class InterconnectAttachmentStub implements BackgroundResource { "Not implemented: listInterconnectAttachmentsCallable()"); } + @BetaApi + public UnaryCallable + patchInterconnectAttachmentCallable() { + throw new UnsupportedOperationException( + "Not implemented: patchInterconnectAttachmentCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java index 0a8846d6c5e6..8721864b995e 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectAttachmentStubSettings.java @@ -50,6 +50,7 @@ import com.google.cloud.compute.v1.InterconnectAttachmentsScopedList; import com.google.cloud.compute.v1.ListInterconnectAttachmentsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInterconnectAttachmentHttpRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -115,6 +116,8 @@ public class InterconnectAttachmentStubSettings ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, ListInterconnectAttachmentsPagedResponse> listInterconnectAttachmentsSettings; + private final UnaryCallSettings + patchInterconnectAttachmentSettings; /** * Returns the object with the settings used for calls to aggregatedListInterconnectAttachments. @@ -152,6 +155,12 @@ public class InterconnectAttachmentStubSettings return listInterconnectAttachmentsSettings; } + /** Returns the object with the settings used for calls to patchInterconnectAttachment. */ + public UnaryCallSettings + patchInterconnectAttachmentSettings() { + return patchInterconnectAttachmentSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public InterconnectAttachmentStub createStub() throws IOException { if (getTransportChannelProvider() @@ -236,6 +245,8 @@ protected InterconnectAttachmentStubSettings(Builder settingsBuilder) throws IOE settingsBuilder.insertInterconnectAttachmentSettings().build(); listInterconnectAttachmentsSettings = settingsBuilder.listInterconnectAttachmentsSettings().build(); + patchInterconnectAttachmentSettings = + settingsBuilder.patchInterconnectAttachmentSettings().build(); } private static final PagedListDescriptor< @@ -406,6 +417,8 @@ public static class Builder ListInterconnectAttachmentsHttpRequest, InterconnectAttachmentList, ListInterconnectAttachmentsPagedResponse> listInterconnectAttachmentsSettings; + private final UnaryCallSettings.Builder + patchInterconnectAttachmentSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -460,13 +473,16 @@ protected Builder(ClientContext clientContext) { listInterconnectAttachmentsSettings = PagedCallSettings.newBuilder(LIST_INTERCONNECT_ATTACHMENTS_PAGE_STR_FACT); + patchInterconnectAttachmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListInterconnectAttachmentsSettings, deleteInterconnectAttachmentSettings, getInterconnectAttachmentSettings, insertInterconnectAttachmentSettings, - listInterconnectAttachmentsSettings); + listInterconnectAttachmentsSettings, + patchInterconnectAttachmentSettings); initDefaults(this); } @@ -507,6 +523,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .patchInterconnectAttachmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -522,6 +543,8 @@ protected Builder(InterconnectAttachmentStubSettings settings) { settings.insertInterconnectAttachmentSettings.toBuilder(); listInterconnectAttachmentsSettings = settings.listInterconnectAttachmentsSettings.toBuilder(); + patchInterconnectAttachmentSettings = + settings.patchInterconnectAttachmentSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -529,7 +552,8 @@ protected Builder(InterconnectAttachmentStubSettings settings) { deleteInterconnectAttachmentSettings, getInterconnectAttachmentSettings, insertInterconnectAttachmentSettings, - listInterconnectAttachmentsSettings); + listInterconnectAttachmentsSettings, + patchInterconnectAttachmentSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -584,6 +608,12 @@ public Builder applyToAllUnaryMethods( return listInterconnectAttachmentsSettings; } + /** Returns the builder for the settings used for calls to patchInterconnectAttachment. */ + public UnaryCallSettings.Builder + patchInterconnectAttachmentSettings() { + return patchInterconnectAttachmentSettings; + } + @Override public InterconnectAttachmentStubSettings build() throws IOException { return new InterconnectAttachmentStubSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeGroupStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeGroupStub.java new file mode 100644 index 000000000000..91b1d7549b67 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeGroupStub.java @@ -0,0 +1,120 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeGroupClient.AggregatedListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodesNodeGroupsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddNodesNodeGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteNodeGroupHttpRequest; +import com.google.cloud.compute.v1.DeleteNodesNodeGroupHttpRequest; +import com.google.cloud.compute.v1.GetNodeGroupHttpRequest; +import com.google.cloud.compute.v1.InsertNodeGroupHttpRequest; +import com.google.cloud.compute.v1.ListNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.ListNodesNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.NodeGroup; +import com.google.cloud.compute.v1.NodeGroupAggregatedList; +import com.google.cloud.compute.v1.NodeGroupList; +import com.google.cloud.compute.v1.NodeGroupsListNodes; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetNodeTemplateNodeGroupHttpRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class NodeGroupStub implements BackgroundResource { + + @BetaApi + public UnaryCallable addNodesNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: addNodesNodeGroupCallable()"); + } + + @BetaApi + public UnaryCallable + aggregatedListNodeGroupsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListNodeGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable + aggregatedListNodeGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListNodeGroupsCallable()"); + } + + @BetaApi + public UnaryCallable deleteNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodeGroupCallable()"); + } + + @BetaApi + public UnaryCallable deleteNodesNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodesNodeGroupCallable()"); + } + + @BetaApi + public UnaryCallable getNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: getNodeGroupCallable()"); + } + + @BetaApi + public UnaryCallable insertNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: insertNodeGroupCallable()"); + } + + @BetaApi + public UnaryCallable + listNodeGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNodeGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable listNodeGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listNodeGroupsCallable()"); + } + + @BetaApi + public UnaryCallable + listNodesNodeGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNodesNodeGroupsPagedCallable()"); + } + + @BetaApi + public UnaryCallable + listNodesNodeGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listNodesNodeGroupsCallable()"); + } + + @BetaApi + public UnaryCallable + setNodeTemplateNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: setNodeTemplateNodeGroupCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeGroupStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeGroupStubSettings.java new file mode 100644 index 000000000000..552a430f9178 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeGroupStubSettings.java @@ -0,0 +1,715 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeGroupClient.AggregatedListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodesNodeGroupsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AddNodesNodeGroupHttpRequest; +import com.google.cloud.compute.v1.AggregatedListNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.DeleteNodeGroupHttpRequest; +import com.google.cloud.compute.v1.DeleteNodesNodeGroupHttpRequest; +import com.google.cloud.compute.v1.GetNodeGroupHttpRequest; +import com.google.cloud.compute.v1.InsertNodeGroupHttpRequest; +import com.google.cloud.compute.v1.ListNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.ListNodesNodeGroupsHttpRequest; +import com.google.cloud.compute.v1.NodeGroup; +import com.google.cloud.compute.v1.NodeGroupAggregatedList; +import com.google.cloud.compute.v1.NodeGroupList; +import com.google.cloud.compute.v1.NodeGroupNode; +import com.google.cloud.compute.v1.NodeGroupsListNodes; +import com.google.cloud.compute.v1.NodeGroupsScopedList; +import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetNodeTemplateNodeGroupHttpRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NodeGroupStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of addNodesNodeGroup to 30 seconds: + * + *

+ * 
+ * NodeGroupStubSettings.Builder nodeGroupSettingsBuilder =
+ *     NodeGroupStubSettings.newBuilder();
+ * nodeGroupSettingsBuilder.addNodesNodeGroupSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NodeGroupStubSettings nodeGroupSettings = nodeGroupSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeGroupStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings + addNodesNodeGroupSettings; + private final PagedCallSettings< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsSettings; + private final UnaryCallSettings deleteNodeGroupSettings; + private final UnaryCallSettings + deleteNodesNodeGroupSettings; + private final UnaryCallSettings getNodeGroupSettings; + private final UnaryCallSettings insertNodeGroupSettings; + private final PagedCallSettings< + ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse> + listNodeGroupsSettings; + private final PagedCallSettings< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + listNodesNodeGroupsSettings; + private final UnaryCallSettings + setNodeTemplateNodeGroupSettings; + + /** Returns the object with the settings used for calls to addNodesNodeGroup. */ + public UnaryCallSettings addNodesNodeGroupSettings() { + return addNodesNodeGroupSettings; + } + + /** Returns the object with the settings used for calls to aggregatedListNodeGroups. */ + public PagedCallSettings< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsSettings() { + return aggregatedListNodeGroupsSettings; + } + + /** Returns the object with the settings used for calls to deleteNodeGroup. */ + public UnaryCallSettings deleteNodeGroupSettings() { + return deleteNodeGroupSettings; + } + + /** Returns the object with the settings used for calls to deleteNodesNodeGroup. */ + public UnaryCallSettings + deleteNodesNodeGroupSettings() { + return deleteNodesNodeGroupSettings; + } + + /** Returns the object with the settings used for calls to getNodeGroup. */ + public UnaryCallSettings getNodeGroupSettings() { + return getNodeGroupSettings; + } + + /** Returns the object with the settings used for calls to insertNodeGroup. */ + public UnaryCallSettings insertNodeGroupSettings() { + return insertNodeGroupSettings; + } + + /** Returns the object with the settings used for calls to listNodeGroups. */ + public PagedCallSettings + listNodeGroupsSettings() { + return listNodeGroupsSettings; + } + + /** Returns the object with the settings used for calls to listNodesNodeGroups. */ + public PagedCallSettings< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + listNodesNodeGroupsSettings() { + return listNodesNodeGroupsSettings; + } + + /** Returns the object with the settings used for calls to setNodeTemplateNodeGroup. */ + public UnaryCallSettings + setNodeTemplateNodeGroupSettings() { + return setNodeTemplateNodeGroupSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NodeGroupStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonNodeGroupStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(NodeGroupStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NodeGroupStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + addNodesNodeGroupSettings = settingsBuilder.addNodesNodeGroupSettings().build(); + aggregatedListNodeGroupsSettings = settingsBuilder.aggregatedListNodeGroupsSettings().build(); + deleteNodeGroupSettings = settingsBuilder.deleteNodeGroupSettings().build(); + deleteNodesNodeGroupSettings = settingsBuilder.deleteNodesNodeGroupSettings().build(); + getNodeGroupSettings = settingsBuilder.getNodeGroupSettings().build(); + insertNodeGroupSettings = settingsBuilder.insertNodeGroupSettings().build(); + listNodeGroupsSettings = settingsBuilder.listNodeGroupsSettings().build(); + listNodesNodeGroupsSettings = settingsBuilder.listNodesNodeGroupsSettings().build(); + setNodeTemplateNodeGroupSettings = settingsBuilder.setNodeTemplateNodeGroupSettings().build(); + } + + private static final PagedListDescriptor< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, NodeGroupsScopedList> + AGGREGATED_LIST_NODE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + NodeGroupsScopedList>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public AggregatedListNodeGroupsHttpRequest injectToken( + AggregatedListNodeGroupsHttpRequest payload, String token) { + return AggregatedListNodeGroupsHttpRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public AggregatedListNodeGroupsHttpRequest injectPageSize( + AggregatedListNodeGroupsHttpRequest payload, int pageSize) { + return AggregatedListNodeGroupsHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(AggregatedListNodeGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeGroupAggregatedList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + NodeGroupAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor + LIST_NODE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNodeGroupsHttpRequest injectToken( + ListNodeGroupsHttpRequest payload, String token) { + return ListNodeGroupsHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNodeGroupsHttpRequest injectPageSize( + ListNodeGroupsHttpRequest payload, int pageSize) { + return ListNodeGroupsHttpRequest.newBuilder(payload).setMaxResults(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNodeGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeGroupList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(NodeGroupList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListDescriptor< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, NodeGroupNode> + LIST_NODES_NODE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, NodeGroupNode>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNodesNodeGroupsHttpRequest injectToken( + ListNodesNodeGroupsHttpRequest payload, String token) { + return ListNodesNodeGroupsHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNodesNodeGroupsHttpRequest injectPageSize( + ListNodesNodeGroupsHttpRequest payload, int pageSize) { + return ListNodesNodeGroupsHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListNodesNodeGroupsHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeGroupsListNodes payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(NodeGroupsListNodes payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + AGGREGATED_LIST_NODE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + AggregatedListNodeGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + NodeGroupsScopedList> + pageContext = + PageContext.create( + callable, AGGREGATED_LIST_NODE_GROUPS_PAGE_STR_DESC, request, context); + return AggregatedListNodeGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse> + LIST_NODE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNodeGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NODE_GROUPS_PAGE_STR_DESC, request, context); + return ListNodeGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + LIST_NODES_NODE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, + ListNodesNodeGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNodesNodeGroupsHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_NODES_NODE_GROUPS_PAGE_STR_DESC, request, context); + return ListNodesNodeGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for NodeGroupStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + addNodesNodeGroupSettings; + private final PagedCallSettings.Builder< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsSettings; + private final UnaryCallSettings.Builder + deleteNodeGroupSettings; + private final UnaryCallSettings.Builder + deleteNodesNodeGroupSettings; + private final UnaryCallSettings.Builder + getNodeGroupSettings; + private final UnaryCallSettings.Builder + insertNodeGroupSettings; + private final PagedCallSettings.Builder< + ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse> + listNodeGroupsSettings; + private final PagedCallSettings.Builder< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + listNodesNodeGroupsSettings; + private final UnaryCallSettings.Builder + setNodeTemplateNodeGroupSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + addNodesNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + aggregatedListNodeGroupsSettings = + PagedCallSettings.newBuilder(AGGREGATED_LIST_NODE_GROUPS_PAGE_STR_FACT); + + deleteNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteNodesNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNodeGroupsSettings = PagedCallSettings.newBuilder(LIST_NODE_GROUPS_PAGE_STR_FACT); + + listNodesNodeGroupsSettings = + PagedCallSettings.newBuilder(LIST_NODES_NODE_GROUPS_PAGE_STR_FACT); + + setNodeTemplateNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + addNodesNodeGroupSettings, + aggregatedListNodeGroupsSettings, + deleteNodeGroupSettings, + deleteNodesNodeGroupSettings, + getNodeGroupSettings, + insertNodeGroupSettings, + listNodeGroupsSettings, + listNodesNodeGroupsSettings, + setNodeTemplateNodeGroupSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .addNodesNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .aggregatedListNodeGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteNodesNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .insertNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNodeGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNodesNodeGroupsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setNodeTemplateNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(NodeGroupStubSettings settings) { + super(settings); + + addNodesNodeGroupSettings = settings.addNodesNodeGroupSettings.toBuilder(); + aggregatedListNodeGroupsSettings = settings.aggregatedListNodeGroupsSettings.toBuilder(); + deleteNodeGroupSettings = settings.deleteNodeGroupSettings.toBuilder(); + deleteNodesNodeGroupSettings = settings.deleteNodesNodeGroupSettings.toBuilder(); + getNodeGroupSettings = settings.getNodeGroupSettings.toBuilder(); + insertNodeGroupSettings = settings.insertNodeGroupSettings.toBuilder(); + listNodeGroupsSettings = settings.listNodeGroupsSettings.toBuilder(); + listNodesNodeGroupsSettings = settings.listNodesNodeGroupsSettings.toBuilder(); + setNodeTemplateNodeGroupSettings = settings.setNodeTemplateNodeGroupSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + addNodesNodeGroupSettings, + aggregatedListNodeGroupsSettings, + deleteNodeGroupSettings, + deleteNodesNodeGroupSettings, + getNodeGroupSettings, + insertNodeGroupSettings, + listNodeGroupsSettings, + listNodesNodeGroupsSettings, + setNodeTemplateNodeGroupSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to addNodesNodeGroup. */ + public UnaryCallSettings.Builder + addNodesNodeGroupSettings() { + return addNodesNodeGroupSettings; + } + + /** Returns the builder for the settings used for calls to aggregatedListNodeGroups. */ + public PagedCallSettings.Builder< + AggregatedListNodeGroupsHttpRequest, NodeGroupAggregatedList, + AggregatedListNodeGroupsPagedResponse> + aggregatedListNodeGroupsSettings() { + return aggregatedListNodeGroupsSettings; + } + + /** Returns the builder for the settings used for calls to deleteNodeGroup. */ + public UnaryCallSettings.Builder + deleteNodeGroupSettings() { + return deleteNodeGroupSettings; + } + + /** Returns the builder for the settings used for calls to deleteNodesNodeGroup. */ + public UnaryCallSettings.Builder + deleteNodesNodeGroupSettings() { + return deleteNodesNodeGroupSettings; + } + + /** Returns the builder for the settings used for calls to getNodeGroup. */ + public UnaryCallSettings.Builder getNodeGroupSettings() { + return getNodeGroupSettings; + } + + /** Returns the builder for the settings used for calls to insertNodeGroup. */ + public UnaryCallSettings.Builder + insertNodeGroupSettings() { + return insertNodeGroupSettings; + } + + /** Returns the builder for the settings used for calls to listNodeGroups. */ + public PagedCallSettings.Builder< + ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse> + listNodeGroupsSettings() { + return listNodeGroupsSettings; + } + + /** Returns the builder for the settings used for calls to listNodesNodeGroups. */ + public PagedCallSettings.Builder< + ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> + listNodesNodeGroupsSettings() { + return listNodesNodeGroupsSettings; + } + + /** Returns the builder for the settings used for calls to setNodeTemplateNodeGroup. */ + public UnaryCallSettings.Builder + setNodeTemplateNodeGroupSettings() { + return setNodeTemplateNodeGroupSettings; + } + + @Override + public NodeGroupStubSettings build() throws IOException { + return new NodeGroupStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTemplateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTemplateStub.java new file mode 100644 index 000000000000..c5d4087b6508 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTemplateStub.java @@ -0,0 +1,88 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeTemplateClient.AggregatedListNodeTemplatesPagedResponse; +import static com.google.cloud.compute.v1.NodeTemplateClient.ListNodeTemplatesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListNodeTemplatesHttpRequest; +import com.google.cloud.compute.v1.DeleteNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.GetNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.ListNodeTemplatesHttpRequest; +import com.google.cloud.compute.v1.NodeTemplate; +import com.google.cloud.compute.v1.NodeTemplateAggregatedList; +import com.google.cloud.compute.v1.NodeTemplateList; +import com.google.cloud.compute.v1.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class NodeTemplateStub implements BackgroundResource { + + @BetaApi + public UnaryCallable< + AggregatedListNodeTemplatesHttpRequest, AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListNodeTemplatesPagedCallable()"); + } + + @BetaApi + public UnaryCallable + aggregatedListNodeTemplatesCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListNodeTemplatesCallable()"); + } + + @BetaApi + public UnaryCallable deleteNodeTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNodeTemplateCallable()"); + } + + @BetaApi + public UnaryCallable getNodeTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: getNodeTemplateCallable()"); + } + + @BetaApi + public UnaryCallable insertNodeTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: insertNodeTemplateCallable()"); + } + + @BetaApi + public UnaryCallable + listNodeTemplatesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNodeTemplatesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listNodeTemplatesCallable() { + throw new UnsupportedOperationException("Not implemented: listNodeTemplatesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTemplateStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTemplateStubSettings.java new file mode 100644 index 000000000000..61b0a8f3999a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTemplateStubSettings.java @@ -0,0 +1,550 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeTemplateClient.AggregatedListNodeTemplatesPagedResponse; +import static com.google.cloud.compute.v1.NodeTemplateClient.ListNodeTemplatesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListNodeTemplatesHttpRequest; +import com.google.cloud.compute.v1.DeleteNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.GetNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.InsertNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.ListNodeTemplatesHttpRequest; +import com.google.cloud.compute.v1.NodeTemplate; +import com.google.cloud.compute.v1.NodeTemplateAggregatedList; +import com.google.cloud.compute.v1.NodeTemplateList; +import com.google.cloud.compute.v1.NodeTemplatesScopedList; +import com.google.cloud.compute.v1.Operation; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NodeTemplateStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteNodeTemplate to 30 seconds: + * + *

+ * 
+ * NodeTemplateStubSettings.Builder nodeTemplateSettingsBuilder =
+ *     NodeTemplateStubSettings.newBuilder();
+ * nodeTemplateSettingsBuilder.deleteNodeTemplateSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NodeTemplateStubSettings nodeTemplateSettings = nodeTemplateSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeTemplateStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesSettings; + private final UnaryCallSettings + deleteNodeTemplateSettings; + private final UnaryCallSettings getNodeTemplateSettings; + private final UnaryCallSettings + insertNodeTemplateSettings; + private final PagedCallSettings< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + listNodeTemplatesSettings; + + /** Returns the object with the settings used for calls to aggregatedListNodeTemplates. */ + public PagedCallSettings< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesSettings() { + return aggregatedListNodeTemplatesSettings; + } + + /** Returns the object with the settings used for calls to deleteNodeTemplate. */ + public UnaryCallSettings deleteNodeTemplateSettings() { + return deleteNodeTemplateSettings; + } + + /** Returns the object with the settings used for calls to getNodeTemplate. */ + public UnaryCallSettings getNodeTemplateSettings() { + return getNodeTemplateSettings; + } + + /** Returns the object with the settings used for calls to insertNodeTemplate. */ + public UnaryCallSettings insertNodeTemplateSettings() { + return insertNodeTemplateSettings; + } + + /** Returns the object with the settings used for calls to listNodeTemplates. */ + public PagedCallSettings< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + listNodeTemplatesSettings() { + return listNodeTemplatesSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NodeTemplateStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonNodeTemplateStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(NodeTemplateStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NodeTemplateStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListNodeTemplatesSettings = + settingsBuilder.aggregatedListNodeTemplatesSettings().build(); + deleteNodeTemplateSettings = settingsBuilder.deleteNodeTemplateSettings().build(); + getNodeTemplateSettings = settingsBuilder.getNodeTemplateSettings().build(); + insertNodeTemplateSettings = settingsBuilder.insertNodeTemplateSettings().build(); + listNodeTemplatesSettings = settingsBuilder.listNodeTemplatesSettings().build(); + } + + private static final PagedListDescriptor< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList> + AGGREGATED_LIST_NODE_TEMPLATES_PAGE_STR_DESC = + new PagedListDescriptor< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public AggregatedListNodeTemplatesHttpRequest injectToken( + AggregatedListNodeTemplatesHttpRequest payload, String token) { + return AggregatedListNodeTemplatesHttpRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public AggregatedListNodeTemplatesHttpRequest injectPageSize( + AggregatedListNodeTemplatesHttpRequest payload, int pageSize) { + return AggregatedListNodeTemplatesHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(AggregatedListNodeTemplatesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeTemplateAggregatedList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + NodeTemplateAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor< + ListNodeTemplatesHttpRequest, NodeTemplateList, NodeTemplate> + LIST_NODE_TEMPLATES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNodeTemplatesHttpRequest injectToken( + ListNodeTemplatesHttpRequest payload, String token) { + return ListNodeTemplatesHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNodeTemplatesHttpRequest injectPageSize( + ListNodeTemplatesHttpRequest payload, int pageSize) { + return ListNodeTemplatesHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListNodeTemplatesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeTemplateList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(NodeTemplateList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + AGGREGATED_LIST_NODE_TEMPLATES_PAGE_STR_FACT = + new PagedListResponseFactory< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + AggregatedListNodeTemplatesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + NodeTemplatesScopedList> + pageContext = + PageContext.create( + callable, AGGREGATED_LIST_NODE_TEMPLATES_PAGE_STR_DESC, request, context); + return AggregatedListNodeTemplatesPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + LIST_NODE_TEMPLATES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNodeTemplatesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_NODE_TEMPLATES_PAGE_STR_DESC, request, context); + return ListNodeTemplatesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for NodeTemplateStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesSettings; + private final UnaryCallSettings.Builder + deleteNodeTemplateSettings; + private final UnaryCallSettings.Builder + getNodeTemplateSettings; + private final UnaryCallSettings.Builder + insertNodeTemplateSettings; + private final PagedCallSettings.Builder< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + listNodeTemplatesSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListNodeTemplatesSettings = + PagedCallSettings.newBuilder(AGGREGATED_LIST_NODE_TEMPLATES_PAGE_STR_FACT); + + deleteNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + insertNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNodeTemplatesSettings = PagedCallSettings.newBuilder(LIST_NODE_TEMPLATES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + aggregatedListNodeTemplatesSettings, + deleteNodeTemplateSettings, + getNodeTemplateSettings, + insertNodeTemplateSettings, + listNodeTemplatesSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .aggregatedListNodeTemplatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteNodeTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getNodeTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .insertNodeTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNodeTemplatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(NodeTemplateStubSettings settings) { + super(settings); + + aggregatedListNodeTemplatesSettings = + settings.aggregatedListNodeTemplatesSettings.toBuilder(); + deleteNodeTemplateSettings = settings.deleteNodeTemplateSettings.toBuilder(); + getNodeTemplateSettings = settings.getNodeTemplateSettings.toBuilder(); + insertNodeTemplateSettings = settings.insertNodeTemplateSettings.toBuilder(); + listNodeTemplatesSettings = settings.listNodeTemplatesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + aggregatedListNodeTemplatesSettings, + deleteNodeTemplateSettings, + getNodeTemplateSettings, + insertNodeTemplateSettings, + listNodeTemplatesSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to aggregatedListNodeTemplates. */ + public PagedCallSettings.Builder< + AggregatedListNodeTemplatesHttpRequest, NodeTemplateAggregatedList, + AggregatedListNodeTemplatesPagedResponse> + aggregatedListNodeTemplatesSettings() { + return aggregatedListNodeTemplatesSettings; + } + + /** Returns the builder for the settings used for calls to deleteNodeTemplate. */ + public UnaryCallSettings.Builder + deleteNodeTemplateSettings() { + return deleteNodeTemplateSettings; + } + + /** Returns the builder for the settings used for calls to getNodeTemplate. */ + public UnaryCallSettings.Builder + getNodeTemplateSettings() { + return getNodeTemplateSettings; + } + + /** Returns the builder for the settings used for calls to insertNodeTemplate. */ + public UnaryCallSettings.Builder + insertNodeTemplateSettings() { + return insertNodeTemplateSettings; + } + + /** Returns the builder for the settings used for calls to listNodeTemplates. */ + public PagedCallSettings.Builder< + ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> + listNodeTemplatesSettings() { + return listNodeTemplatesSettings; + } + + @Override + public NodeTemplateStubSettings build() throws IOException { + return new NodeTemplateStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTypeStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTypeStub.java new file mode 100644 index 000000000000..70bc6a0de1aa --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTypeStub.java @@ -0,0 +1,73 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeTypeClient.AggregatedListNodeTypesPagedResponse; +import static com.google.cloud.compute.v1.NodeTypeClient.ListNodeTypesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListNodeTypesHttpRequest; +import com.google.cloud.compute.v1.GetNodeTypeHttpRequest; +import com.google.cloud.compute.v1.ListNodeTypesHttpRequest; +import com.google.cloud.compute.v1.NodeType; +import com.google.cloud.compute.v1.NodeTypeAggregatedList; +import com.google.cloud.compute.v1.NodeTypeList; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for compute. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class NodeTypeStub implements BackgroundResource { + + @BetaApi + public UnaryCallable + aggregatedListNodeTypesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: aggregatedListNodeTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable + aggregatedListNodeTypesCallable() { + throw new UnsupportedOperationException("Not implemented: aggregatedListNodeTypesCallable()"); + } + + @BetaApi + public UnaryCallable getNodeTypeCallable() { + throw new UnsupportedOperationException("Not implemented: getNodeTypeCallable()"); + } + + @BetaApi + public UnaryCallable + listNodeTypesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNodeTypesPagedCallable()"); + } + + @BetaApi + public UnaryCallable listNodeTypesCallable() { + throw new UnsupportedOperationException("Not implemented: listNodeTypesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTypeStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTypeStubSettings.java new file mode 100644 index 000000000000..bb7f94471a27 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/NodeTypeStubSettings.java @@ -0,0 +1,475 @@ +/* + * Copyright 2018 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.stub; + +import static com.google.cloud.compute.v1.NodeTypeClient.AggregatedListNodeTypesPagedResponse; +import static com.google.cloud.compute.v1.NodeTypeClient.ListNodeTypesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.compute.v1.AggregatedListNodeTypesHttpRequest; +import com.google.cloud.compute.v1.GetNodeTypeHttpRequest; +import com.google.cloud.compute.v1.ListNodeTypesHttpRequest; +import com.google.cloud.compute.v1.NodeType; +import com.google.cloud.compute.v1.NodeTypeAggregatedList; +import com.google.cloud.compute.v1.NodeTypeList; +import com.google.cloud.compute.v1.NodeTypesScopedList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link NodeTypeStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (https://www.googleapis.com/compute/v1/projects/) and default + * port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getNodeType to 30 seconds: + * + *

+ * 
+ * NodeTypeStubSettings.Builder nodeTypeSettingsBuilder =
+ *     NodeTypeStubSettings.newBuilder();
+ * nodeTypeSettingsBuilder.getNodeTypeSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * NodeTypeStubSettings nodeTypeSettings = nodeTypeSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class NodeTypeStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/compute") + .add("https://www.googleapis.com/auth/compute.readonly") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final PagedCallSettings< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesSettings; + private final UnaryCallSettings getNodeTypeSettings; + private final PagedCallSettings< + ListNodeTypesHttpRequest, NodeTypeList, ListNodeTypesPagedResponse> + listNodeTypesSettings; + + /** Returns the object with the settings used for calls to aggregatedListNodeTypes. */ + public PagedCallSettings< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesSettings() { + return aggregatedListNodeTypesSettings; + } + + /** Returns the object with the settings used for calls to getNodeType. */ + public UnaryCallSettings getNodeTypeSettings() { + return getNodeTypeSettings; + } + + /** Returns the object with the settings used for calls to listNodeTypes. */ + public PagedCallSettings + listNodeTypesSettings() { + return listNodeTypesSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public NodeTypeStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonNodeTypeStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "https://www.googleapis.com/compute/v1/projects/"; + } + + /** Returns the default service port. */ + public static int getDefaultServicePort() { + return 443; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(NodeTypeStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected NodeTypeStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + aggregatedListNodeTypesSettings = settingsBuilder.aggregatedListNodeTypesSettings().build(); + getNodeTypeSettings = settingsBuilder.getNodeTypeSettings().build(); + listNodeTypesSettings = settingsBuilder.listNodeTypesSettings().build(); + } + + private static final PagedListDescriptor< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, NodeTypesScopedList> + AGGREGATED_LIST_NODE_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, NodeTypesScopedList>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public AggregatedListNodeTypesHttpRequest injectToken( + AggregatedListNodeTypesHttpRequest payload, String token) { + return AggregatedListNodeTypesHttpRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public AggregatedListNodeTypesHttpRequest injectPageSize( + AggregatedListNodeTypesHttpRequest payload, int pageSize) { + return AggregatedListNodeTypesHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(AggregatedListNodeTypesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeTypeAggregatedList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(NodeTypeAggregatedList payload) { + return payload.getItemsMap().values(); + } + }; + + private static final PagedListDescriptor + LIST_NODE_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNodeTypesHttpRequest injectToken( + ListNodeTypesHttpRequest payload, String token) { + return ListNodeTypesHttpRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNodeTypesHttpRequest injectPageSize( + ListNodeTypesHttpRequest payload, int pageSize) { + return ListNodeTypesHttpRequest.newBuilder(payload).setMaxResults(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNodeTypesHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(NodeTypeList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(NodeTypeList payload) { + return payload.getItemsList(); + } + }; + + private static final PagedListResponseFactory< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + AGGREGATED_LIST_NODE_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + AggregatedListNodeTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + NodeTypesScopedList> + pageContext = + PageContext.create( + callable, AGGREGATED_LIST_NODE_TYPES_PAGE_STR_DESC, request, context); + return AggregatedListNodeTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNodeTypesHttpRequest, NodeTypeList, ListNodeTypesPagedResponse> + LIST_NODE_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNodeTypesHttpRequest, NodeTypeList, ListNodeTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNodeTypesHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NODE_TYPES_PAGE_STR_DESC, request, context); + return ListNodeTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for NodeTypeStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesSettings; + private final UnaryCallSettings.Builder getNodeTypeSettings; + private final PagedCallSettings.Builder< + ListNodeTypesHttpRequest, NodeTypeList, ListNodeTypesPagedResponse> + listNodeTypesSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + aggregatedListNodeTypesSettings = + PagedCallSettings.newBuilder(AGGREGATED_LIST_NODE_TYPES_PAGE_STR_FACT); + + getNodeTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNodeTypesSettings = PagedCallSettings.newBuilder(LIST_NODE_TYPES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + aggregatedListNodeTypesSettings, getNodeTypeSettings, listNodeTypesSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .aggregatedListNodeTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getNodeTypeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNodeTypesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(NodeTypeStubSettings settings) { + super(settings); + + aggregatedListNodeTypesSettings = settings.aggregatedListNodeTypesSettings.toBuilder(); + getNodeTypeSettings = settings.getNodeTypeSettings.toBuilder(); + listNodeTypesSettings = settings.listNodeTypesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + aggregatedListNodeTypesSettings, getNodeTypeSettings, listNodeTypesSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to aggregatedListNodeTypes. */ + public PagedCallSettings.Builder< + AggregatedListNodeTypesHttpRequest, NodeTypeAggregatedList, + AggregatedListNodeTypesPagedResponse> + aggregatedListNodeTypesSettings() { + return aggregatedListNodeTypesSettings; + } + + /** Returns the builder for the settings used for calls to getNodeType. */ + public UnaryCallSettings.Builder getNodeTypeSettings() { + return getNodeTypeSettings; + } + + /** Returns the builder for the settings used for calls to listNodeTypes. */ + public PagedCallSettings.Builder< + ListNodeTypesHttpRequest, NodeTypeList, ListNodeTypesPagedResponse> + listNodeTypesSettings() { + return listNodeTypesSettings; + } + + @Override + public NodeTypeStubSettings build() throws IOException { + return new NodeTypeStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java index 9b4c006575de..e72422cf47cf 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStub.java @@ -35,6 +35,7 @@ import com.google.cloud.compute.v1.Project; import com.google.cloud.compute.v1.ProjectsGetXpnResources; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetDefaultNetworkTierProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; import com.google.cloud.compute.v1.XpnHostList; import javax.annotation.Generated; @@ -124,6 +125,13 @@ public UnaryCallable moveInstanceProj "Not implemented: setCommonInstanceMetadataProjectCallable()"); } + @BetaApi + public UnaryCallable + setDefaultNetworkTierProjectCallable() { + throw new UnsupportedOperationException( + "Not implemented: setDefaultNetworkTierProjectCallable()"); + } + @BetaApi public UnaryCallable setUsageExportBucketProjectCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java index a73d61425054..f5e5a246ddc6 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ProjectStubSettings.java @@ -54,6 +54,7 @@ import com.google.cloud.compute.v1.Project; import com.google.cloud.compute.v1.ProjectsGetXpnResources; import com.google.cloud.compute.v1.SetCommonInstanceMetadataProjectHttpRequest; +import com.google.cloud.compute.v1.SetDefaultNetworkTierProjectHttpRequest; import com.google.cloud.compute.v1.SetUsageExportBucketProjectHttpRequest; import com.google.cloud.compute.v1.XpnHostList; import com.google.cloud.compute.v1.XpnResourceId; @@ -129,6 +130,8 @@ public class ProjectStubSettings extends StubSettings { moveInstanceProjectSettings; private final UnaryCallSettings setCommonInstanceMetadataProjectSettings; + private final UnaryCallSettings + setDefaultNetworkTierProjectSettings; private final UnaryCallSettings setUsageExportBucketProjectSettings; @@ -198,6 +201,12 @@ public UnaryCallSettings moveDiskProjectS return setCommonInstanceMetadataProjectSettings; } + /** Returns the object with the settings used for calls to setDefaultNetworkTierProject. */ + public UnaryCallSettings + setDefaultNetworkTierProjectSettings() { + return setDefaultNetworkTierProjectSettings; + } + /** Returns the object with the settings used for calls to setUsageExportBucketProject. */ public UnaryCallSettings setUsageExportBucketProjectSettings() { @@ -290,6 +299,8 @@ protected ProjectStubSettings(Builder settingsBuilder) throws IOException { moveInstanceProjectSettings = settingsBuilder.moveInstanceProjectSettings().build(); setCommonInstanceMetadataProjectSettings = settingsBuilder.setCommonInstanceMetadataProjectSettings().build(); + setDefaultNetworkTierProjectSettings = + settingsBuilder.setDefaultNetworkTierProjectSettings().build(); setUsageExportBucketProjectSettings = settingsBuilder.setUsageExportBucketProjectSettings().build(); } @@ -444,6 +455,8 @@ public static class Builder extends StubSettings.Builder setCommonInstanceMetadataProjectSettings; + private final UnaryCallSettings.Builder + setDefaultNetworkTierProjectSettings; private final UnaryCallSettings.Builder setUsageExportBucketProjectSettings; @@ -512,6 +525,8 @@ protected Builder(ClientContext clientContext) { setCommonInstanceMetadataProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setDefaultNetworkTierProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setUsageExportBucketProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -527,6 +542,7 @@ protected Builder(ClientContext clientContext) { moveDiskProjectSettings, moveInstanceProjectSettings, setCommonInstanceMetadataProjectSettings, + setDefaultNetworkTierProjectSettings, setUsageExportBucketProjectSettings); initDefaults(this); @@ -598,6 +614,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setDefaultNetworkTierProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setUsageExportBucketProjectSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -621,6 +642,8 @@ protected Builder(ProjectStubSettings settings) { moveInstanceProjectSettings = settings.moveInstanceProjectSettings.toBuilder(); setCommonInstanceMetadataProjectSettings = settings.setCommonInstanceMetadataProjectSettings.toBuilder(); + setDefaultNetworkTierProjectSettings = + settings.setDefaultNetworkTierProjectSettings.toBuilder(); setUsageExportBucketProjectSettings = settings.setUsageExportBucketProjectSettings.toBuilder(); @@ -637,6 +660,7 @@ protected Builder(ProjectStubSettings settings) { moveDiskProjectSettings, moveInstanceProjectSettings, setCommonInstanceMetadataProjectSettings, + setDefaultNetworkTierProjectSettings, setUsageExportBucketProjectSettings); } @@ -724,6 +748,12 @@ public UnaryCallSettings.Builder getProjectSetti return setCommonInstanceMetadataProjectSettings; } + /** Returns the builder for the settings used for calls to setDefaultNetworkTierProject. */ + public UnaryCallSettings.Builder + setDefaultNetworkTierProjectSettings() { + return setDefaultNetworkTierProjectSettings; + } + /** Returns the builder for the settings used for calls to setUsageExportBucketProject. */ public UnaryCallSettings.Builder setUsageExportBucketProjectSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java index 2f42ed4f54e4..997f196b7220 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStub.java @@ -17,6 +17,7 @@ import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListUsableSubnetworksPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -27,12 +28,14 @@ import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.ListUsableSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; import com.google.cloud.compute.v1.Subnetwork; import com.google.cloud.compute.v1.SubnetworkAggregatedList; import com.google.cloud.compute.v1.SubnetworkList; +import com.google.cloud.compute.v1.UsableSubnetworksAggregatedList; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -91,6 +94,19 @@ public UnaryCallable listSubnetworks throw new UnsupportedOperationException("Not implemented: listSubnetworksCallable()"); } + @BetaApi + public UnaryCallable + listUsableSubnetworksPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listUsableSubnetworksPagedCallable()"); + } + + @BetaApi + public UnaryCallable + listUsableSubnetworksCallable() { + throw new UnsupportedOperationException("Not implemented: listUsableSubnetworksCallable()"); + } + @BetaApi public UnaryCallable patchSubnetworkCallable() { throw new UnsupportedOperationException("Not implemented: patchSubnetworkCallable()"); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java index fc76af86aa9c..3a57b4df4fa9 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SubnetworkStubSettings.java @@ -17,6 +17,7 @@ import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListUsableSubnetworksPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -46,6 +47,7 @@ import com.google.cloud.compute.v1.GetSubnetworkHttpRequest; import com.google.cloud.compute.v1.InsertSubnetworkHttpRequest; import com.google.cloud.compute.v1.ListSubnetworksHttpRequest; +import com.google.cloud.compute.v1.ListUsableSubnetworksHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchSubnetworkHttpRequest; import com.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkHttpRequest; @@ -53,6 +55,8 @@ import com.google.cloud.compute.v1.SubnetworkAggregatedList; import com.google.cloud.compute.v1.SubnetworkList; import com.google.cloud.compute.v1.SubnetworksScopedList; +import com.google.cloud.compute.v1.UsableSubnetwork; +import com.google.cloud.compute.v1.UsableSubnetworksAggregatedList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -115,6 +119,10 @@ public class SubnetworkStubSettings extends StubSettings private final PagedCallSettings< ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse> listSubnetworksSettings; + private final PagedCallSettings< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + listUsableSubnetworksSettings; private final UnaryCallSettings patchSubnetworkSettings; private final UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings; @@ -154,6 +162,14 @@ public UnaryCallSettings insertSubnetwor return listSubnetworksSettings; } + /** Returns the object with the settings used for calls to listUsableSubnetworks. */ + public PagedCallSettings< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + listUsableSubnetworksSettings() { + return listUsableSubnetworksSettings; + } + /** Returns the object with the settings used for calls to patchSubnetwork. */ public UnaryCallSettings patchSubnetworkSettings() { return patchSubnetworkSettings; @@ -247,6 +263,7 @@ protected SubnetworkStubSettings(Builder settingsBuilder) throws IOException { getSubnetworkSettings = settingsBuilder.getSubnetworkSettings().build(); insertSubnetworkSettings = settingsBuilder.insertSubnetworkSettings().build(); listSubnetworksSettings = settingsBuilder.listSubnetworksSettings().build(); + listUsableSubnetworksSettings = settingsBuilder.listUsableSubnetworksSettings().build(); patchSubnetworkSettings = settingsBuilder.patchSubnetworkSettings().build(); setPrivateIpGoogleAccessSubnetworkSettings = settingsBuilder.setPrivateIpGoogleAccessSubnetworkSettings().build(); @@ -332,6 +349,50 @@ public Iterable extractResources(SubnetworkList payload) { } }; + private static final PagedListDescriptor< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, UsableSubnetwork> + LIST_USABLE_SUBNETWORKS_PAGE_STR_DESC = + new PagedListDescriptor< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + UsableSubnetwork>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsableSubnetworksHttpRequest injectToken( + ListUsableSubnetworksHttpRequest payload, String token) { + return ListUsableSubnetworksHttpRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListUsableSubnetworksHttpRequest injectPageSize( + ListUsableSubnetworksHttpRequest payload, int pageSize) { + return ListUsableSubnetworksHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListUsableSubnetworksHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(UsableSubnetworksAggregatedList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + UsableSubnetworksAggregatedList payload) { + return payload.getItemsList(); + } + }; + private static final PagedListResponseFactory< AggregatedListSubnetworksHttpRequest, SubnetworkAggregatedList, AggregatedListSubnetworksPagedResponse> @@ -374,6 +435,30 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + LIST_USABLE_SUBNETWORKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListUsableSubnetworksHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + UsableSubnetwork> + pageContext = + PageContext.create( + callable, LIST_USABLE_SUBNETWORKS_PAGE_STR_DESC, request, context); + return ListUsableSubnetworksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Builder for SubnetworkStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -393,6 +478,10 @@ public static class Builder extends StubSettings.Builder listSubnetworksSettings; + private final PagedCallSettings.Builder< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + listUsableSubnetworksSettings; private final UnaryCallSettings.Builder patchSubnetworkSettings; private final UnaryCallSettings.Builder< @@ -453,6 +542,9 @@ protected Builder(ClientContext clientContext) { listSubnetworksSettings = PagedCallSettings.newBuilder(LIST_SUBNETWORKS_PAGE_STR_FACT); + listUsableSubnetworksSettings = + PagedCallSettings.newBuilder(LIST_USABLE_SUBNETWORKS_PAGE_STR_FACT); + patchSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setPrivateIpGoogleAccessSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -465,6 +557,7 @@ protected Builder(ClientContext clientContext) { getSubnetworkSettings, insertSubnetworkSettings, listSubnetworksSettings, + listUsableSubnetworksSettings, patchSubnetworkSettings, setPrivateIpGoogleAccessSubnetworkSettings); @@ -512,6 +605,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .listUsableSubnetworksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .patchSubnetworkSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -535,6 +633,7 @@ protected Builder(SubnetworkStubSettings settings) { getSubnetworkSettings = settings.getSubnetworkSettings.toBuilder(); insertSubnetworkSettings = settings.insertSubnetworkSettings.toBuilder(); listSubnetworksSettings = settings.listSubnetworksSettings.toBuilder(); + listUsableSubnetworksSettings = settings.listUsableSubnetworksSettings.toBuilder(); patchSubnetworkSettings = settings.patchSubnetworkSettings.toBuilder(); setPrivateIpGoogleAccessSubnetworkSettings = settings.setPrivateIpGoogleAccessSubnetworkSettings.toBuilder(); @@ -547,6 +646,7 @@ protected Builder(SubnetworkStubSettings settings) { getSubnetworkSettings, insertSubnetworkSettings, listSubnetworksSettings, + listUsableSubnetworksSettings, patchSubnetworkSettings, setPrivateIpGoogleAccessSubnetworkSettings); } @@ -605,6 +705,14 @@ public UnaryCallSettings.Builder getSubnet return listSubnetworksSettings; } + /** Returns the builder for the settings used for calls to listUsableSubnetworks. */ + public PagedCallSettings.Builder< + ListUsableSubnetworksHttpRequest, UsableSubnetworksAggregatedList, + ListUsableSubnetworksPagedResponse> + listUsableSubnetworksSettings() { + return listUsableSubnetworksSettings; + } + /** Returns the builder for the settings used for calls to patchSubnetwork. */ public UnaryCallSettings.Builder patchSubnetworkSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java index 343f601b5e60..7a22014425f9 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStub.java @@ -25,6 +25,7 @@ import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; @@ -73,6 +74,13 @@ public abstract class TargetHttpsProxyStub implements BackgroundResource { throw new UnsupportedOperationException("Not implemented: listTargetHttpsProxiesCallable()"); } + @BetaApi + public UnaryCallable + setQuicOverrideTargetHttpsProxyCallable() { + throw new UnsupportedOperationException( + "Not implemented: setQuicOverrideTargetHttpsProxyCallable()"); + } + @BetaApi public UnaryCallable setSslCertificatesTargetHttpsProxyCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java index fc3650a47ac5..c006b8b28df4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/TargetHttpsProxyStubSettings.java @@ -44,6 +44,7 @@ import com.google.cloud.compute.v1.InsertTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.ListTargetHttpsProxiesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyHttpRequest; import com.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyHttpRequest; @@ -109,6 +110,8 @@ public class TargetHttpsProxyStubSettings extends StubSettings listTargetHttpsProxiesSettings; + private final UnaryCallSettings + setQuicOverrideTargetHttpsProxySettings; private final UnaryCallSettings setSslCertificatesTargetHttpsProxySettings; private final UnaryCallSettings @@ -142,6 +145,12 @@ public class TargetHttpsProxyStubSettings extends StubSettings + setQuicOverrideTargetHttpsProxySettings() { + return setQuicOverrideTargetHttpsProxySettings; + } + /** Returns the object with the settings used for calls to setSslCertificatesTargetHttpsProxy. */ public UnaryCallSettings setSslCertificatesTargetHttpsProxySettings() { @@ -239,6 +248,8 @@ protected TargetHttpsProxyStubSettings(Builder settingsBuilder) throws IOExcepti getTargetHttpsProxySettings = settingsBuilder.getTargetHttpsProxySettings().build(); insertTargetHttpsProxySettings = settingsBuilder.insertTargetHttpsProxySettings().build(); listTargetHttpsProxiesSettings = settingsBuilder.listTargetHttpsProxiesSettings().build(); + setQuicOverrideTargetHttpsProxySettings = + settingsBuilder.setQuicOverrideTargetHttpsProxySettings().build(); setSslCertificatesTargetHttpsProxySettings = settingsBuilder.setSslCertificatesTargetHttpsProxySettings().build(); setSslPolicyTargetHttpsProxySettings = @@ -323,6 +334,8 @@ public static class Builder extends StubSettings.Builder listTargetHttpsProxiesSettings; + private final UnaryCallSettings.Builder + setQuicOverrideTargetHttpsProxySettings; private final UnaryCallSettings.Builder< SetSslCertificatesTargetHttpsProxyHttpRequest, Operation> setSslCertificatesTargetHttpsProxySettings; @@ -381,6 +394,8 @@ protected Builder(ClientContext clientContext) { listTargetHttpsProxiesSettings = PagedCallSettings.newBuilder(LIST_TARGET_HTTPS_PROXIES_PAGE_STR_FACT); + setQuicOverrideTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setSslCertificatesTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setSslPolicyTargetHttpsProxySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -393,6 +408,7 @@ protected Builder(ClientContext clientContext) { getTargetHttpsProxySettings, insertTargetHttpsProxySettings, listTargetHttpsProxiesSettings, + setQuicOverrideTargetHttpsProxySettings, setSslCertificatesTargetHttpsProxySettings, setSslPolicyTargetHttpsProxySettings, setUrlMapTargetHttpsProxySettings); @@ -431,6 +447,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setQuicOverrideTargetHttpsProxySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setSslCertificatesTargetHttpsProxySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -456,6 +477,8 @@ protected Builder(TargetHttpsProxyStubSettings settings) { getTargetHttpsProxySettings = settings.getTargetHttpsProxySettings.toBuilder(); insertTargetHttpsProxySettings = settings.insertTargetHttpsProxySettings.toBuilder(); listTargetHttpsProxiesSettings = settings.listTargetHttpsProxiesSettings.toBuilder(); + setQuicOverrideTargetHttpsProxySettings = + settings.setQuicOverrideTargetHttpsProxySettings.toBuilder(); setSslCertificatesTargetHttpsProxySettings = settings.setSslCertificatesTargetHttpsProxySettings.toBuilder(); setSslPolicyTargetHttpsProxySettings = @@ -468,6 +491,7 @@ protected Builder(TargetHttpsProxyStubSettings settings) { getTargetHttpsProxySettings, insertTargetHttpsProxySettings, listTargetHttpsProxiesSettings, + setQuicOverrideTargetHttpsProxySettings, setSslCertificatesTargetHttpsProxySettings, setSslPolicyTargetHttpsProxySettings, setUrlMapTargetHttpsProxySettings); @@ -515,6 +539,12 @@ public Builder applyToAllUnaryMethods( return listTargetHttpsProxiesSettings; } + /** Returns the builder for the settings used for calls to setQuicOverrideTargetHttpsProxy. */ + public UnaryCallSettings.Builder + setQuicOverrideTargetHttpsProxySettings() { + return setQuicOverrideTargetHttpsProxySettings; + } + /** * Returns the builder for the settings used for calls to setSslCertificatesTargetHttpsProxy. */ diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java index 14bade32a966..ce95a4016a28 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/AddressClientTest.java @@ -244,6 +244,7 @@ public void deleteAddressExceptionTest() throws Exception { @SuppressWarnings("all") public void getAddressTest() { ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); + String networkTier = "networkTier-19473069"; String addressType = "addressType264307877"; String kind = "kind3292052"; String description = "description-1724546052"; @@ -259,6 +260,7 @@ public void getAddressTest() { Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) + .setNetworkTier(networkTier) .setAddressType(addressType) .setKind(kind) .setDescription(description) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java index 522a9f67e862..00f4f30a1a0d 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendBucketClientTest.java @@ -16,7 +16,9 @@ package com.google.cloud.compute.v1; import static com.google.cloud.compute.v1.BackendBucketClient.ListBackendBucketsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.addSignedUrlKeyBackendBucketMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.deleteBackendBucketMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.deleteSignedUrlKeyBackendBucketMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.getBackendBucketMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.insertBackendBucketMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendBucketStub.listBackendBucketsMethodDescriptor; @@ -52,7 +54,9 @@ public class BackendBucketClientTest { private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( Lists.newArrayList( + addSignedUrlKeyBackendBucketMethodDescriptor, deleteBackendBucketMethodDescriptor, + deleteSignedUrlKeyBackendBucketMethodDescriptor, getBackendBucketMethodDescriptor, insertBackendBucketMethodDescriptor, listBackendBucketsMethodDescriptor, @@ -87,6 +91,99 @@ public static void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void addSignedUrlKeyBackendBucketTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); + + Operation actualResponse = + client.addSignedUrlKeyBackendBucket(backendBucket, signedUrlKeyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void addSignedUrlKeyBackendBucketExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); + + client.addSignedUrlKeyBackendBucket(backendBucket, signedUrlKeyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void deleteBackendBucketTest() { @@ -177,6 +274,98 @@ public void deleteBackendBucketExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void deleteSignedUrlKeyBackendBucketTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String keyName = "keyName500938859"; + + Operation actualResponse = client.deleteSignedUrlKeyBackendBucket(backendBucket, keyName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteSignedUrlKeyBackendBucketExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalBackendBucketName backendBucket = + ProjectGlobalBackendBucketName.of("[PROJECT]", "[BACKEND_BUCKET]"); + String keyName = "keyName500938859"; + + client.deleteSignedUrlKeyBackendBucket(backendBucket, keyName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void getBackendBucketTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java index 8718545e40c4..3f6422644555 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/BackendServiceClientTest.java @@ -17,8 +17,10 @@ import static com.google.cloud.compute.v1.BackendServiceClient.AggregatedListBackendServicesPagedResponse; import static com.google.cloud.compute.v1.BackendServiceClient.ListBackendServicesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.addSignedUrlKeyBackendServiceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.aggregatedListBackendServicesMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.deleteBackendServiceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.deleteSignedUrlKeyBackendServiceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getBackendServiceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.getHealthBackendServiceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonBackendServiceStub.insertBackendServiceMethodDescriptor; @@ -57,8 +59,10 @@ public class BackendServiceClientTest { private static final List METHOD_DESCRIPTORS = ImmutableList.copyOf( Lists.newArrayList( + addSignedUrlKeyBackendServiceMethodDescriptor, aggregatedListBackendServicesMethodDescriptor, deleteBackendServiceMethodDescriptor, + deleteSignedUrlKeyBackendServiceMethodDescriptor, getBackendServiceMethodDescriptor, getHealthBackendServiceMethodDescriptor, insertBackendServiceMethodDescriptor, @@ -94,6 +98,99 @@ public static void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void addSignedUrlKeyBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); + + Operation actualResponse = + client.addSignedUrlKeyBackendService(backendService, signedUrlKeyResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void addSignedUrlKeyBackendServiceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); + + client.addSignedUrlKeyBackendService(backendService, signedUrlKeyResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void aggregatedListBackendServicesTest() { @@ -247,6 +344,98 @@ public void deleteBackendServiceExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void deleteSignedUrlKeyBackendServiceTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + String keyName = "keyName500938859"; + + Operation actualResponse = client.deleteSignedUrlKeyBackendService(backendService, keyName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteSignedUrlKeyBackendServiceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalBackendServiceName backendService = + ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]"); + String keyName = "keyName500938859"; + + client.deleteSignedUrlKeyBackendService(backendService, keyName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void getBackendServiceTest() { 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 d6c94aead3a6..4b5c89ffd300 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 @@ -246,6 +246,7 @@ public void deleteForwardingRuleExceptionTest() throws Exception { @SuppressWarnings("all") public void getForwardingRuleTest() { String portRange = "portRange217518079"; + String networkTier = "networkTier-19473069"; String kind = "kind3292052"; String iPProtocol = "iPProtocol323774237"; ProjectGlobalBackendServiceName backendService = @@ -266,6 +267,7 @@ public void getForwardingRuleTest() { ForwardingRule expectedResponse = ForwardingRule.newBuilder() .setPortRange(portRange) + .setNetworkTier(networkTier) .setKind(kind) .setIPProtocol(iPProtocol) .setBackendService(backendService.toString()) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java index d73efe4dd9e7..4705d177dc84 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/GlobalAddressClientTest.java @@ -174,6 +174,7 @@ public void deleteGlobalAddressExceptionTest() throws Exception { @SuppressWarnings("all") public void getGlobalAddressTest() { ProjectGlobalAddressName address2 = ProjectGlobalAddressName.of("[PROJECT]", "[ADDRESS]"); + String networkTier = "networkTier-19473069"; String addressType = "addressType264307877"; String kind = "kind3292052"; String description = "description-1724546052"; @@ -189,6 +190,7 @@ public void getGlobalAddressTest() { Address expectedResponse = Address.newBuilder() .setAddress(address2.toString()) + .setNetworkTier(networkTier) .setAddressType(addressType) .setKind(kind) .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 671bffee4e82..7b17029f6f8a 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 @@ -179,6 +179,7 @@ public void deleteGlobalForwardingRuleExceptionTest() throws Exception { @SuppressWarnings("all") public void getGlobalForwardingRuleTest() { String portRange = "portRange217518079"; + String networkTier = "networkTier-19473069"; String kind = "kind3292052"; String iPProtocol = "iPProtocol323774237"; ProjectGlobalBackendServiceName backendService = @@ -199,6 +200,7 @@ public void getGlobalForwardingRuleTest() { ForwardingRule expectedResponse = ForwardingRule.newBuilder() .setPortRange(portRange) + .setNetworkTier(networkTier) .setKind(kind) .setIPProtocol(iPProtocol) .setBackendService(backendService.toString()) diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java index a846885c405b..b92a93cb9042 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectAttachmentClientTest.java @@ -22,6 +22,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.getInterconnectAttachmentMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.insertInterconnectAttachmentMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.listInterconnectAttachmentsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectAttachmentStub.patchInterconnectAttachmentMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -37,6 +38,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -57,7 +59,8 @@ public class InterconnectAttachmentClientTest { deleteInterconnectAttachmentMethodDescriptor, getInterconnectAttachmentMethodDescriptor, insertInterconnectAttachmentMethodDescriptor, - listInterconnectAttachmentsMethodDescriptor)); + listInterconnectAttachmentsMethodDescriptor, + patchInterconnectAttachmentMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService( METHOD_DESCRIPTORS, InterconnectAttachmentStubSettings.getDefaultEndpoint()); @@ -493,4 +496,105 @@ public void listInterconnectAttachmentsExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void patchInterconnectAttachmentTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionInterconnectAttachmentName interconnectAttachment = + ProjectRegionInterconnectAttachmentName.of( + "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + InterconnectAttachment interconnectAttachmentResource = + InterconnectAttachment.newBuilder().build(); + List fieldMask = new ArrayList<>(); + + Operation actualResponse = + client.patchInterconnectAttachment( + interconnectAttachment, interconnectAttachmentResource, fieldMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void patchInterconnectAttachmentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInterconnectAttachmentName interconnectAttachment = + ProjectRegionInterconnectAttachmentName.of( + "[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]"); + InterconnectAttachment interconnectAttachmentResource = + InterconnectAttachment.newBuilder().build(); + List fieldMask = new ArrayList<>(); + + client.patchInterconnectAttachment( + interconnectAttachment, interconnectAttachmentResource, fieldMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } } diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeGroupClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeGroupClientTest.java new file mode 100644 index 000000000000..5ffa0fdf9b72 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeGroupClientTest.java @@ -0,0 +1,819 @@ +/* + * Copyright 2018 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 static com.google.cloud.compute.v1.NodeGroupClient.AggregatedListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.NodeGroupClient.ListNodesNodeGroupsPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.addNodesNodeGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.aggregatedListNodeGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.deleteNodeGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.deleteNodesNodeGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.getNodeGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.insertNodeGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.listNodeGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.listNodesNodeGroupsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.setNodeTemplateNodeGroupMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.NodeGroupStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class NodeGroupClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + addNodesNodeGroupMethodDescriptor, + aggregatedListNodeGroupsMethodDescriptor, + deleteNodeGroupMethodDescriptor, + deleteNodesNodeGroupMethodDescriptor, + getNodeGroupMethodDescriptor, + insertNodeGroupMethodDescriptor, + listNodeGroupsMethodDescriptor, + listNodesNodeGroupsMethodDescriptor, + setNodeTemplateNodeGroupMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, NodeGroupStubSettings.getDefaultEndpoint()); + + private static NodeGroupClient client; + private static NodeGroupSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + NodeGroupSettings.newBuilder() + .setTransportChannelProvider( + NodeGroupSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NodeGroupClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void addNodesNodeGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = + NodeGroupsAddNodesRequest.newBuilder().build(); + + Operation actualResponse = + client.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void addNodesNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = + NodeGroupsAddNodesRequest.newBuilder().build(); + + client.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void aggregatedListNodeGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeGroupsScopedList itemsItem = NodeGroupsScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + NodeGroupAggregatedList expectedResponse = + NodeGroupAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListNodeGroupsPagedResponse pagedListResponse = + client.aggregatedListNodeGroups(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListNodeGroupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListNodeGroups(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteNodeGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + + Operation actualResponse = client.deleteNodeGroup(nodeGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + + client.deleteNodeGroup(nodeGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteNodesNodeGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = + NodeGroupsDeleteNodesRequest.newBuilder().build(); + + Operation actualResponse = + client.deleteNodesNodeGroup(nodeGroup, nodeGroupsDeleteNodesRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteNodesNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = + NodeGroupsDeleteNodesRequest.newBuilder().build(); + + client.deleteNodesNodeGroup(nodeGroup, nodeGroupsDeleteNodesRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNodeGroupTest() { + Integer size = 3530753; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + ProjectRegionNodeTemplateName nodeTemplate = + ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]"); + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + NodeGroup expectedResponse = + NodeGroup.newBuilder() + .setSize(size) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setNodeTemplate(nodeTemplate.toString()) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + + NodeGroup actualResponse = client.getNodeGroup(nodeGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + + client.getNodeGroup(nodeGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertNodeGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone2 = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone2.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + Integer initialNodeCount = 1682564205; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + NodeGroup nodeGroupResource = NodeGroup.newBuilder().build(); + + Operation actualResponse = client.insertNodeGroup(initialNodeCount, zone, nodeGroupResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void insertNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Integer initialNodeCount = 1682564205; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + NodeGroup nodeGroupResource = NodeGroup.newBuilder().build(); + + client.insertNodeGroup(initialNodeCount, zone, nodeGroupResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNodeGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeGroup itemsElement = NodeGroup.newBuilder().build(); + List items = Arrays.asList(itemsElement); + NodeGroupList expectedResponse = + NodeGroupList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + + ListNodeGroupsPagedResponse pagedListResponse = client.listNodeGroups(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listNodeGroupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + + client.listNodeGroups(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNodesNodeGroupsTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeGroupNode itemsElement = NodeGroupNode.newBuilder().build(); + List items = Arrays.asList(itemsElement); + NodeGroupsListNodes expectedResponse = + NodeGroupsListNodes.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + + ListNodesNodeGroupsPagedResponse pagedListResponse = client.listNodesNodeGroups(nodeGroup); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listNodesNodeGroupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + + client.listNodesNodeGroups(nodeGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setNodeTemplateNodeGroupTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = + NodeGroupsSetNodeTemplateRequest.newBuilder().build(); + + Operation actualResponse = + client.setNodeTemplateNodeGroup(nodeGroup, nodeGroupsSetNodeTemplateRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void setNodeTemplateNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupName nodeGroup = + ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]"); + NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = + NodeGroupsSetNodeTemplateRequest.newBuilder().build(); + + client.setNodeTemplateNodeGroup(nodeGroup, nodeGroupsSetNodeTemplateRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeTemplateClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeTemplateClientTest.java new file mode 100644 index 000000000000..ad1df142f477 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeTemplateClientTest.java @@ -0,0 +1,461 @@ +/* + * Copyright 2018 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 static com.google.cloud.compute.v1.NodeTemplateClient.AggregatedListNodeTemplatesPagedResponse; +import static com.google.cloud.compute.v1.NodeTemplateClient.ListNodeTemplatesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.aggregatedListNodeTemplatesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.deleteNodeTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.getNodeTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.insertNodeTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.listNodeTemplatesMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.NodeTemplateStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class NodeTemplateClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListNodeTemplatesMethodDescriptor, + deleteNodeTemplateMethodDescriptor, + getNodeTemplateMethodDescriptor, + insertNodeTemplateMethodDescriptor, + listNodeTemplatesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, NodeTemplateStubSettings.getDefaultEndpoint()); + + private static NodeTemplateClient client; + private static NodeTemplateSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + NodeTemplateSettings.newBuilder() + .setTransportChannelProvider( + NodeTemplateSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NodeTemplateClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListNodeTemplatesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeTemplatesScopedList itemsItem = NodeTemplatesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + NodeTemplateAggregatedList expectedResponse = + NodeTemplateAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListNodeTemplatesPagedResponse pagedListResponse = + client.aggregatedListNodeTemplates(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListNodeTemplatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListNodeTemplates(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteNodeTemplateTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionNodeTemplateName nodeTemplate = + ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]"); + + Operation actualResponse = client.deleteNodeTemplate(nodeTemplate); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void deleteNodeTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionNodeTemplateName nodeTemplate = + ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]"); + + client.deleteNodeTemplate(nodeTemplate); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNodeTemplateTest() { + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String id = "id3355"; + ProjectZoneNodeTypeName nodeType = + ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]"); + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String status = "status-892481550"; + NodeTemplate expectedResponse = + NodeTemplate.newBuilder() + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setId(id) + .setNodeType(nodeType.toString()) + .setRegion(region.toString()) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionNodeTemplateName nodeTemplate = + ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]"); + + NodeTemplate actualResponse = client.getNodeTemplate(nodeTemplate); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getNodeTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionNodeTemplateName nodeTemplate = + ProjectRegionNodeTemplateName.of("[PROJECT]", "[REGION]", "[NODE_TEMPLATE]"); + + client.getNodeTemplate(nodeTemplate); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void insertNodeTemplateTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region2 = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region2.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + NodeTemplate nodeTemplateResource = NodeTemplate.newBuilder().build(); + + Operation actualResponse = client.insertNodeTemplate(region, nodeTemplateResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void insertNodeTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + NodeTemplate nodeTemplateResource = NodeTemplate.newBuilder().build(); + + client.insertNodeTemplate(region, nodeTemplateResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNodeTemplatesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeTemplate itemsElement = NodeTemplate.newBuilder().build(); + List items = Arrays.asList(itemsElement); + NodeTemplateList expectedResponse = + NodeTemplateList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + + ListNodeTemplatesPagedResponse pagedListResponse = client.listNodeTemplates(region); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listNodeTemplatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + + client.listNodeTemplates(region); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeTypeClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeTypeClientTest.java new file mode 100644 index 000000000000..ec2e4fe3fe63 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/NodeTypeClientTest.java @@ -0,0 +1,278 @@ +/* + * Copyright 2018 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 static com.google.cloud.compute.v1.NodeTypeClient.AggregatedListNodeTypesPagedResponse; +import static com.google.cloud.compute.v1.NodeTypeClient.ListNodeTypesPagedResponse; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTypeStub.aggregatedListNodeTypesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTypeStub.getNodeTypeMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTypeStub.listNodeTypesMethodDescriptor; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.compute.v1.stub.NodeTypeStubSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class NodeTypeClientTest { + + private static final List METHOD_DESCRIPTORS = + ImmutableList.copyOf( + Lists.newArrayList( + aggregatedListNodeTypesMethodDescriptor, + getNodeTypeMethodDescriptor, + listNodeTypesMethodDescriptor)); + private static final MockHttpService mockService = + new MockHttpService(METHOD_DESCRIPTORS, NodeTypeStubSettings.getDefaultEndpoint()); + + private static NodeTypeClient client; + private static NodeTypeSettings clientSettings; + + @BeforeClass + public static void setUp() throws IOException { + clientSettings = + NodeTypeSettings.newBuilder() + .setTransportChannelProvider( + NodeTypeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = NodeTypeClient.create(clientSettings); + } + + @After + public void cleanUp() { + mockService.reset(); + } + + @AfterClass + public static void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListNodeTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeTypesScopedList itemsItem = NodeTypesScopedList.newBuilder().build(); + Map items = new HashMap<>(); + items.put("items", itemsItem); + NodeTypeAggregatedList expectedResponse = + NodeTypeAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .putAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + AggregatedListNodeTypesPagedResponse pagedListResponse = + client.aggregatedListNodeTypes(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getItemsMap().values().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void aggregatedListNodeTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.aggregatedListNodeTypes(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNodeTypeTest() { + Integer memoryMb = 1726613907; + Integer guestCpus = 1754126894; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String kind = "kind3292052"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String description = "description-1724546052"; + String cpuPlatform = "cpuPlatform947156266"; + String id = "id3355"; + Integer localSsdGb = 1281375158; + String selfLink = "selfLink-1691268851"; + NodeType expectedResponse = + NodeType.newBuilder() + .setMemoryMb(memoryMb) + .setGuestCpus(guestCpus) + .setZone(zone.toString()) + .setKind(kind) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setDescription(description) + .setCpuPlatform(cpuPlatform) + .setId(id) + .setLocalSsdGb(localSsdGb) + .setSelfLink(selfLink) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeTypeName nodeType = + ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]"); + + NodeType actualResponse = client.getNodeType(nodeType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void getNodeTypeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeTypeName nodeType = + ProjectZoneNodeTypeName.of("[PROJECT]", "[ZONE]", "[NODE_TYPE]"); + + client.getNodeType(nodeType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNodeTypesTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + NodeType itemsElement = NodeType.newBuilder().build(); + List items = Arrays.asList(itemsElement); + NodeTypeList expectedResponse = + NodeTypeList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + + ListNodeTypesPagedResponse pagedListResponse = client.listNodeTypes(zone); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listNodeTypesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + + client.listNodeTypes(zone); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java index 61824ef3222b..f0e27074b080 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ProjectClientTest.java @@ -28,6 +28,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveDiskProjectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.moveInstanceProjectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setCommonInstanceMetadataProjectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setDefaultNetworkTierProjectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonProjectStub.setUsageExportBucketProjectMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; @@ -69,6 +70,7 @@ public class ProjectClientTest { moveDiskProjectMethodDescriptor, moveInstanceProjectMethodDescriptor, setCommonInstanceMetadataProjectMethodDescriptor, + setDefaultNetworkTierProjectMethodDescriptor, setUsageExportBucketProjectMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, ProjectStubSettings.getDefaultEndpoint()); @@ -464,24 +466,26 @@ public void enableXpnResourceProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getProjectTest() { - String xpnProjectStatus = "xpnProjectStatus-308451647"; String kind = "kind3292052"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; - String id = "id3355"; + String defaultNetworkTier = "defaultNetworkTier1545495185"; String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; + String xpnProjectStatus = "xpnProjectStatus-308451647"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; Project expectedResponse = Project.newBuilder() - .setXpnProjectStatus(xpnProjectStatus) .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) - .setId(id) + .setDefaultNetworkTier(defaultNetworkTier) .setDefaultServiceAccount(defaultServiceAccount) .setSelfLink(selfLink) + .setXpnProjectStatus(xpnProjectStatus) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) .build(); mockService.addResponse(expectedResponse); @@ -526,24 +530,26 @@ public void getProjectExceptionTest() throws Exception { @Test @SuppressWarnings("all") public void getXpnHostProjectTest() { - String xpnProjectStatus = "xpnProjectStatus-308451647"; String kind = "kind3292052"; - String creationTimestamp = "creationTimestamp567396278"; - String name = "name3373707"; String description = "description-1724546052"; - String id = "id3355"; + String defaultNetworkTier = "defaultNetworkTier1545495185"; String defaultServiceAccount = "defaultServiceAccount-1848771419"; String selfLink = "selfLink-1691268851"; + String xpnProjectStatus = "xpnProjectStatus-308451647"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + String id = "id3355"; Project expectedResponse = Project.newBuilder() - .setXpnProjectStatus(xpnProjectStatus) .setKind(kind) - .setCreationTimestamp(creationTimestamp) - .setName(name) .setDescription(description) - .setId(id) + .setDefaultNetworkTier(defaultNetworkTier) .setDefaultServiceAccount(defaultServiceAccount) .setSelfLink(selfLink) + .setXpnProjectStatus(xpnProjectStatus) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setId(id) .build(); mockService.addResponse(expectedResponse); @@ -977,6 +983,99 @@ public void setCommonInstanceMetadataProjectExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setDefaultNetworkTierProjectTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = + ProjectsSetDefaultNetworkTierRequest.newBuilder().build(); + + Operation actualResponse = + client.setDefaultNetworkTierProject(project, projectsSetDefaultNetworkTierRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void setDefaultNetworkTierProjectExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource = + ProjectsSetDefaultNetworkTierRequest.newBuilder().build(); + + client.setDefaultNetworkTierProject(project, projectsSetDefaultNetworkTierRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setUsageExportBucketProjectTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 150fc4f5ba82..78a6ab222ce9 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java @@ -17,12 +17,14 @@ import static com.google.cloud.compute.v1.SubnetworkClient.AggregatedListSubnetworksPagedResponse; import static com.google.cloud.compute.v1.SubnetworkClient.ListSubnetworksPagedResponse; +import static com.google.cloud.compute.v1.SubnetworkClient.ListUsableSubnetworksPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.aggregatedListSubnetworksMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.deleteSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.expandIpCidrRangeSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.getSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.insertSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.listSubnetworksMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.listUsableSubnetworksMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.patchSubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.setPrivateIpGoogleAccessSubnetworkMethodDescriptor; @@ -63,6 +65,7 @@ public class SubnetworkClientTest { getSubnetworkMethodDescriptor, insertSubnetworkMethodDescriptor, listSubnetworksMethodDescriptor, + listUsableSubnetworksMethodDescriptor, patchSubnetworkMethodDescriptor, setPrivateIpGoogleAccessSubnetworkMethodDescriptor)); private static final MockHttpService mockService = @@ -566,6 +569,66 @@ public void listSubnetworksExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void listUsableSubnetworksTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + UsableSubnetwork itemsElement = UsableSubnetwork.newBuilder().build(); + List items = Arrays.asList(itemsElement); + UsableSubnetworksAggregatedList expectedResponse = + UsableSubnetworksAggregatedList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllItems(items) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName project = ProjectName.of("[PROJECT]"); + + ListUsableSubnetworksPagedResponse pagedListResponse = client.listUsableSubnetworks(project); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getItemsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void listUsableSubnetworksExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName project = ProjectName.of("[PROJECT]"); + + client.listUsableSubnetworks(project); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void patchSubnetworkTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java index 27d57ca2abc8..98da0003ecd5 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/TargetHttpsProxyClientTest.java @@ -20,6 +20,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.getTargetHttpsProxyMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.insertTargetHttpsProxyMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.listTargetHttpsProxiesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setQuicOverrideTargetHttpsProxyMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslCertificatesTargetHttpsProxyMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setSslPolicyTargetHttpsProxyMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonTargetHttpsProxyStub.setUrlMapTargetHttpsProxyMethodDescriptor; @@ -56,6 +57,7 @@ public class TargetHttpsProxyClientTest { getTargetHttpsProxyMethodDescriptor, insertTargetHttpsProxyMethodDescriptor, listTargetHttpsProxiesMethodDescriptor, + setQuicOverrideTargetHttpsProxyMethodDescriptor, setSslCertificatesTargetHttpsProxyMethodDescriptor, setSslPolicyTargetHttpsProxyMethodDescriptor, setUrlMapTargetHttpsProxyMethodDescriptor)); @@ -395,6 +397,103 @@ public void listTargetHttpsProxiesExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setQuicOverrideTargetHttpsProxyTest() { + String httpErrorMessage = "httpErrorMessage1276263769"; + String targetId = "targetId-815576439"; + String kind = "kind3292052"; + String description = "description-1724546052"; + String statusMessage = "statusMessage-239442758"; + String selfLink = "selfLink-1691268851"; + String insertTime = "insertTime-103148397"; + Integer httpErrorStatusCode = 1386087020; + ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); + String targetLink = "targetLink-2084812312"; + String creationTimestamp = "creationTimestamp567396278"; + String name = "name3373707"; + Integer progress = 1001078227; + String operationType = "operationType-1432962286"; + String startTime = "startTime-1573145462"; + String endTime = "endTime1725551537"; + String id = "id3355"; + ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]"); + String clientOperationId = "clientOperationId-239630617"; + String user = "user3599307"; + String status = "status-892481550"; + Operation expectedResponse = + Operation.newBuilder() + .setHttpErrorMessage(httpErrorMessage) + .setTargetId(targetId) + .setKind(kind) + .setDescription(description) + .setStatusMessage(statusMessage) + .setSelfLink(selfLink) + .setInsertTime(insertTime) + .setHttpErrorStatusCode(httpErrorStatusCode) + .setZone(zone.toString()) + .setTargetLink(targetLink) + .setCreationTimestamp(creationTimestamp) + .setName(name) + .setProgress(progress) + .setOperationType(operationType) + .setStartTime(startTime) + .setEndTime(endTime) + .setId(id) + .setRegion(region.toString()) + .setClientOperationId(clientOperationId) + .setUser(user) + .setStatus(status) + .build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = + TargetHttpsProxiesSetQuicOverrideRequest.newBuilder().build(); + + Operation actualResponse = + client.setQuicOverrideTargetHttpsProxy( + targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + @SuppressWarnings("all") + public void setQuicOverrideTargetHttpsProxyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalTargetHttpsProxyName targetHttpsProxy = + ProjectGlobalTargetHttpsProxyName.of("[PROJECT]", "[TARGET_HTTPS_PROXY]"); + TargetHttpsProxiesSetQuicOverrideRequest targetHttpsProxiesSetQuicOverrideRequestResource = + TargetHttpsProxiesSetQuicOverrideRequest.newBuilder().build(); + + client.setQuicOverrideTargetHttpsProxy( + targetHttpsProxy, targetHttpsProxiesSetQuicOverrideRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setSslCertificatesTargetHttpsProxyTest() { diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java index fb324fff3426..36eac47a77c8 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java @@ -543,6 +543,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .batchGetDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming")); + builder .beginTransactionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -558,6 +563,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .runQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .listCollectionIdsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java index 901b5971a468..6cf3c210e11f 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java @@ -480,11 +480,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .executeStreamingSqlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .readSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .streamingReadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .beginTransactionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))