From 1f9f900b32ca6e0966669f8430c8070900e68824 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Tue, 11 Dec 2018 00:36:45 -0800 Subject: [PATCH] Regenerate compute client --- .../google/cloud/compute/v1/DiskClient.java | 325 +++++++++++ .../google/cloud/compute/v1/DiskSettings.java | 34 ++ ...GetDiagnosticsInterconnectHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicyDiskHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicyImageHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicyInstanceHttpRequest.java | 367 +++++++++++++ ...tIamPolicyInstanceTemplateHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicyLicenseHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicyNodeGroupHttpRequest.java | 367 +++++++++++++ .../GetIamPolicyNodeTemplateHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicySnapshotHttpRequest.java | 367 +++++++++++++ .../v1/GetIamPolicySubnetworkHttpRequest.java | 367 +++++++++++++ .../GetNatMappingInfoRoutersHttpRequest.java | 509 ++++++++++++++++++ .../google/cloud/compute/v1/ImageClient.java | 327 +++++++++++ .../cloud/compute/v1/ImageSettings.java | 34 ++ .../cloud/compute/v1/InstanceClient.java | 328 +++++++++++ .../v1/InstanceGroupManagerClient.java | 149 +++++ .../v1/InstanceGroupManagerSettings.java | 13 + .../cloud/compute/v1/InstanceSettings.java | 34 ++ .../compute/v1/InstanceTemplateClient.java | 332 ++++++++++++ .../compute/v1/InstanceTemplateSettings.java | 42 ++ .../cloud/compute/v1/InterconnectClient.java | 101 ++++ .../compute/v1/InterconnectSettings.java | 14 + .../cloud/compute/v1/LicenseClient.java | 213 ++++++++ .../cloud/compute/v1/LicenseSettings.java | 22 + .../cloud/compute/v1/NodeGroupClient.java | 329 +++++++++++ .../cloud/compute/v1/NodeGroupSettings.java | 37 ++ .../cloud/compute/v1/NodeTemplateClient.java | 329 +++++++++++ .../compute/v1/NodeTemplateSettings.java | 37 ++ .../PatchInstanceGroupManagerHttpRequest.java | 489 +++++++++++++++++ ...RegionInstanceGroupManagerHttpRequest.java | 490 +++++++++++++++++ ...ectGlobalInstanceTemplateResourceName.java | 167 ++++++ ...ProjectRegionNodeTemplateResourceName.java | 186 +++++++ .../ProjectRegionSubnetworkResourceName.java | 186 +++++++ .../v1/ProjectZoneNodeGroupResourceName.java | 185 +++++++ .../v1/RegionInstanceGroupManagerClient.java | 150 ++++++ .../RegionInstanceGroupManagerSettings.java | 13 + .../google/cloud/compute/v1/RouterClient.java | 240 +++++++++ .../cloud/compute/v1/RouterSettings.java | 19 + .../v1/SetIamPolicyDiskHttpRequest.java | 415 ++++++++++++++ .../v1/SetIamPolicyImageHttpRequest.java | 415 ++++++++++++++ .../v1/SetIamPolicyInstanceHttpRequest.java | 415 ++++++++++++++ ...tIamPolicyInstanceTemplateHttpRequest.java | 415 ++++++++++++++ .../v1/SetIamPolicyLicenseHttpRequest.java | 415 ++++++++++++++ .../v1/SetIamPolicyNodeGroupHttpRequest.java | 415 ++++++++++++++ .../SetIamPolicyNodeTemplateHttpRequest.java | 415 ++++++++++++++ .../v1/SetIamPolicySnapshotHttpRequest.java | 415 ++++++++++++++ .../v1/SetIamPolicySubnetworkHttpRequest.java | 415 ++++++++++++++ .../cloud/compute/v1/SnapshotClient.java | 329 +++++++++++ .../cloud/compute/v1/SnapshotSettings.java | 34 ++ .../cloud/compute/v1/SubnetworkClient.java | 329 +++++++++++ .../cloud/compute/v1/SubnetworkSettings.java | 37 ++ .../v1/TestIamPermissionsDiskHttpRequest.java | 415 ++++++++++++++ .../TestIamPermissionsImageHttpRequest.java | 415 ++++++++++++++ ...TestIamPermissionsInstanceHttpRequest.java | 415 ++++++++++++++ ...ermissionsInstanceTemplateHttpRequest.java | 416 ++++++++++++++ ...estIamPermissionsNodeGroupHttpRequest.java | 415 ++++++++++++++ ...IamPermissionsNodeTemplateHttpRequest.java | 416 ++++++++++++++ ...TestIamPermissionsSnapshotHttpRequest.java | 415 ++++++++++++++ ...stIamPermissionsSubnetworkHttpRequest.java | 415 ++++++++++++++ .../cloud/compute/v1/stub/DiskStub.java | 21 + .../compute/v1/stub/DiskStubSettings.java | 87 ++- .../compute/v1/stub/HttpJsonDiskStub.java | 115 ++++ .../compute/v1/stub/HttpJsonImageStub.java | 117 ++++ .../HttpJsonInstanceGroupManagerStub.java | 40 ++ .../compute/v1/stub/HttpJsonInstanceStub.java | 121 +++++ .../v1/stub/HttpJsonInstanceTemplateStub.java | 134 +++++ .../v1/stub/HttpJsonInterconnectStub.java | 47 ++ .../compute/v1/stub/HttpJsonLicenseStub.java | 75 +++ .../v1/stub/HttpJsonNodeGroupStub.java | 125 +++++ .../v1/stub/HttpJsonNodeTemplateStub.java | 127 +++++ ...ttpJsonRegionInstanceGroupManagerStub.java | 41 ++ .../compute/v1/stub/HttpJsonRouterStub.java | 60 +++ .../compute/v1/stub/HttpJsonSnapshotStub.java | 119 ++++ .../v1/stub/HttpJsonSubnetworkStub.java | 125 +++++ .../cloud/compute/v1/stub/ImageStub.java | 21 + .../compute/v1/stub/ImageStubSettings.java | 87 ++- .../v1/stub/InstanceGroupManagerStub.java | 7 + .../InstanceGroupManagerStubSettings.java | 28 + .../cloud/compute/v1/stub/InstanceStub.java | 22 + .../compute/v1/stub/InstanceStubSettings.java | 86 +++ .../compute/v1/stub/InstanceTemplateStub.java | 26 + .../v1/stub/InstanceTemplateStubSettings.java | 101 +++- .../compute/v1/stub/InterconnectStub.java | 9 + .../v1/stub/InterconnectStubSettings.java | 34 ++ .../cloud/compute/v1/stub/LicenseStub.java | 13 + .../compute/v1/stub/LicenseStubSettings.java | 55 ++ .../cloud/compute/v1/stub/NodeGroupStub.java | 22 + .../v1/stub/NodeGroupStubSettings.java | 94 +++- .../compute/v1/stub/NodeTemplateStub.java | 24 + .../v1/stub/NodeTemplateStubSettings.java | 95 +++- .../stub/RegionInstanceGroupManagerStub.java | 8 + ...egionInstanceGroupManagerStubSettings.java | 30 ++ .../cloud/compute/v1/stub/RouterStub.java | 16 + .../compute/v1/stub/RouterStubSettings.java | 118 ++++ .../cloud/compute/v1/stub/SnapshotStub.java | 22 + .../compute/v1/stub/SnapshotStubSettings.java | 90 +++- .../cloud/compute/v1/stub/SubnetworkStub.java | 22 + .../v1/stub/SubnetworkStubSettings.java | 94 +++- .../cloud/compute/v1/DiskClientTest.java | 161 +++++- .../cloud/compute/v1/ImageClientTest.java | 163 +++++- .../cloud/compute/v1/InstanceClientTest.java | 159 ++++++ .../v1/InstanceGroupManagerClientTest.java | 100 ++++ .../v1/InstanceTemplateClientTest.java | 164 +++++- .../compute/v1/InterconnectClientTest.java | 50 ++ .../cloud/compute/v1/LicenseClientTest.java | 108 ++++ .../cloud/compute/v1/NodeGroupClientTest.java | 161 +++++- .../compute/v1/NodeTemplateClientTest.java | 164 +++++- .../RegionInstanceGroupManagerClientTest.java | 102 ++++ .../cloud/compute/v1/RouterClientTest.java | 66 +++ .../cloud/compute/v1/SnapshotClientTest.java | 163 +++++- .../compute/v1/SubnetworkClientTest.java | 163 +++++- .../google-cloud-compute/synth.metadata | 4 +- 113 files changed, 20973 insertions(+), 23 deletions(-) create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiagnosticsInterconnectHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyDiskHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyImageHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceTemplateHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyLicenseHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeGroupHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeTemplateHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySnapshotHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySubnetworkHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNatMappingInfoRoutersHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionInstanceGroupManagerHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateResourceName.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateResourceName.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkResourceName.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupResourceName.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyDiskHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyImageHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceTemplateHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyLicenseHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeGroupHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeTemplateHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySnapshotHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySubnetworkHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsDiskHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsImageHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceTemplateHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeGroupHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeTemplateHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSnapshotHttpRequest.java create mode 100644 google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSubnetworkHttpRequest.java diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java index ac38b4fb00bc..7c2247cb95b7 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java @@ -614,6 +614,107 @@ public final UnaryCallable getDiskCallable() { return stub.getDiskCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   Policy response = diskClient.getIamPolicyDisk(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyDisk(ProjectZoneDiskResourceName resource) { + + GetIamPolicyDiskHttpRequest request = + GetIamPolicyDiskHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   Policy response = diskClient.getIamPolicyDisk(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyDisk(String resource) { + + GetIamPolicyDiskHttpRequest request = + GetIamPolicyDiskHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   GetIamPolicyDiskHttpRequest request = GetIamPolicyDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = diskClient.getIamPolicyDisk(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 Policy getIamPolicyDisk(GetIamPolicyDiskHttpRequest request) { + return getIamPolicyDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   GetIamPolicyDiskHttpRequest request = GetIamPolicyDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = diskClient.getIamPolicyDiskCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getIamPolicyDiskCallable() { + return stub.getIamPolicyDiskCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a persistent disk in the specified project using the data in the request. You can @@ -977,6 +1078,117 @@ public final UnaryCallable resizeDiskCallable( return stub.resizeDiskCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   Policy response = diskClient.setIamPolicyDisk(resource, zoneSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param zoneSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyDisk( + ProjectZoneDiskResourceName resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + + SetIamPolicyDiskHttpRequest request = + SetIamPolicyDiskHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource) + .build(); + return setIamPolicyDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   Policy response = diskClient.setIamPolicyDisk(resource.toString(), zoneSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param zoneSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyDisk( + String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + + SetIamPolicyDiskHttpRequest request = + SetIamPolicyDiskHttpRequest.newBuilder() + .setResource(resource) + .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource) + .build(); + return setIamPolicyDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyDiskHttpRequest request = SetIamPolicyDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = diskClient.setIamPolicyDisk(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 Policy setIamPolicyDisk(SetIamPolicyDiskHttpRequest request) { + return setIamPolicyDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyDiskHttpRequest request = SetIamPolicyDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = diskClient.setIamPolicyDiskCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setIamPolicyDiskCallable() { + return stub.setIamPolicyDiskCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Sets the labels on a disk. To learn more about labels, read the Labeling Resources @@ -1092,6 +1304,119 @@ public final UnaryCallable setLabelsDiskCal return stub.setLabelsDiskCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = diskClient.testIamPermissionsDisk(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsDisk( + ProjectZoneDiskResourceName resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsDiskHttpRequest request = + TestIamPermissionsDiskHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = diskClient.testIamPermissionsDisk(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsDisk( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsDiskHttpRequest request = + TestIamPermissionsDiskHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsDisk(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsDiskHttpRequest request = TestIamPermissionsDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = diskClient.testIamPermissionsDisk(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 TestPermissionsResponse testIamPermissionsDisk( + TestIamPermissionsDiskHttpRequest request) { + return testIamPermissionsDiskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (DiskClient diskClient = DiskClient.create()) {
+   *   ProjectZoneDiskResourceName resource = ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsDiskHttpRequest request = TestIamPermissionsDiskHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = diskClient.testIamPermissionsDiskCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsDiskCallable() { + return stub.testIamPermissionsDiskCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java index a01a30f18678..f387db537c73 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskSettings.java @@ -86,6 +86,11 @@ public UnaryCallSettings getDiskSettings() { return ((DiskStubSettings) getStubSettings()).getDiskSettings(); } + /** Returns the object with the settings used for calls to getIamPolicyDisk. */ + public UnaryCallSettings getIamPolicyDiskSettings() { + return ((DiskStubSettings) getStubSettings()).getIamPolicyDiskSettings(); + } + /** Returns the object with the settings used for calls to insertDisk. */ public UnaryCallSettings insertDiskSettings() { return ((DiskStubSettings) getStubSettings()).insertDiskSettings(); @@ -102,11 +107,22 @@ public UnaryCallSettings resizeDiskSettings() return ((DiskStubSettings) getStubSettings()).resizeDiskSettings(); } + /** Returns the object with the settings used for calls to setIamPolicyDisk. */ + public UnaryCallSettings setIamPolicyDiskSettings() { + return ((DiskStubSettings) getStubSettings()).setIamPolicyDiskSettings(); + } + /** Returns the object with the settings used for calls to setLabelsDisk. */ public UnaryCallSettings setLabelsDiskSettings() { return ((DiskStubSettings) getStubSettings()).setLabelsDiskSettings(); } + /** Returns the object with the settings used for calls to testIamPermissionsDisk. */ + public UnaryCallSettings + testIamPermissionsDiskSettings() { + return ((DiskStubSettings) getStubSettings()).testIamPermissionsDiskSettings(); + } + public static final DiskSettings create(DiskStubSettings stub) throws IOException { return new DiskSettings.Builder(stub.toBuilder()).build(); } @@ -231,6 +247,12 @@ public UnaryCallSettings.Builder getDiskSettings() { return getStubSettingsBuilder().getDiskSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyDisk. */ + public UnaryCallSettings.Builder + getIamPolicyDiskSettings() { + return getStubSettingsBuilder().getIamPolicyDiskSettings(); + } + /** Returns the builder for the settings used for calls to insertDisk. */ public UnaryCallSettings.Builder insertDiskSettings() { return getStubSettingsBuilder().insertDiskSettings(); @@ -247,11 +269,23 @@ public UnaryCallSettings.Builder resizeDiskSet return getStubSettingsBuilder().resizeDiskSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyDisk. */ + public UnaryCallSettings.Builder + setIamPolicyDiskSettings() { + return getStubSettingsBuilder().setIamPolicyDiskSettings(); + } + /** Returns the builder for the settings used for calls to setLabelsDisk. */ public UnaryCallSettings.Builder setLabelsDiskSettings() { return getStubSettingsBuilder().setLabelsDiskSettings(); } + /** Returns the builder for the settings used for calls to testIamPermissionsDisk. */ + public UnaryCallSettings.Builder + testIamPermissionsDiskSettings() { + return getStubSettingsBuilder().testIamPermissionsDiskSettings(); + } + @Override public DiskSettings build() throws IOException { return new DiskSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiagnosticsInterconnectHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiagnosticsInterconnectHttpRequest.java new file mode 100644 index 000000000000..d670e419bce6 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetDiagnosticsInterconnectHttpRequest.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 GetDiagnosticsInterconnectHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final String interconnect; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String userIp; + + private GetDiagnosticsInterconnectHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.interconnect = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.userIp = null; + } + + private GetDiagnosticsInterconnectHttpRequest( + String access_token, + String callback, + String fields, + String interconnect, + String key, + String prettyPrint, + String quotaUser, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.interconnect = interconnect; + this.key = key; + 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("interconnect")) { + return interconnect; + } + if (fieldName.equals("key")) { + return key; + } + 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 getInterconnect() { + return interconnect; + } + + public String getKey() { + return key; + } + + 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(GetDiagnosticsInterconnectHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetDiagnosticsInterconnectHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetDiagnosticsInterconnectHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetDiagnosticsInterconnectHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String interconnect; + private String key; + private String prettyPrint; + private String quotaUser; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetDiagnosticsInterconnectHttpRequest other) { + if (other == GetDiagnosticsInterconnectHttpRequest.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.getInterconnect() != null) { + this.interconnect = other.interconnect; + } + 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.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetDiagnosticsInterconnectHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.interconnect = source.interconnect; + this.key = source.key; + 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 getInterconnect() { + return interconnect; + } + + public Builder setInterconnect(String interconnect) { + this.interconnect = interconnect; + 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 getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetDiagnosticsInterconnectHttpRequest build() { + String missing = ""; + + if (interconnect == null) { + missing += " interconnect"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetDiagnosticsInterconnectHttpRequest( + access_token, callback, fields, interconnect, key, prettyPrint, quotaUser, userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setInterconnect(this.interconnect); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetDiagnosticsInterconnectHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "interconnect=" + + interconnect + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetDiagnosticsInterconnectHttpRequest) { + GetDiagnosticsInterconnectHttpRequest that = (GetDiagnosticsInterconnectHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals(this.interconnect, that.getInterconnect()) + && Objects.equals(this.key, that.getKey()) + && 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, interconnect, key, prettyPrint, quotaUser, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyDiskHttpRequest.java new file mode 100644 index 000000000000..ea5c11c9686e --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyDiskHttpRequest.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 GetIamPolicyDiskHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyDiskHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyDiskHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyDiskHttpRequest other) { + if (other == GetIamPolicyDiskHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyDiskHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyDiskHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyDiskHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyDiskHttpRequest) { + GetIamPolicyDiskHttpRequest that = (GetIamPolicyDiskHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyImageHttpRequest.java new file mode 100644 index 000000000000..2d2947c91ab6 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyImageHttpRequest.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 GetIamPolicyImageHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyImageHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyImageHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyImageHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyImageHttpRequest other) { + if (other == GetIamPolicyImageHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyImageHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyImageHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyImageHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyImageHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyImageHttpRequest) { + GetIamPolicyImageHttpRequest that = (GetIamPolicyImageHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceHttpRequest.java new file mode 100644 index 000000000000..97a5060c04aa --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceHttpRequest.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 GetIamPolicyInstanceHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyInstanceHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyInstanceHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyInstanceHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyInstanceHttpRequest other) { + if (other == GetIamPolicyInstanceHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyInstanceHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyInstanceHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyInstanceHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyInstanceHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyInstanceHttpRequest) { + GetIamPolicyInstanceHttpRequest that = (GetIamPolicyInstanceHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceTemplateHttpRequest.java new file mode 100644 index 000000000000..b98f9537863c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyInstanceTemplateHttpRequest.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 GetIamPolicyInstanceTemplateHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyInstanceTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyInstanceTemplateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyInstanceTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyInstanceTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyInstanceTemplateHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyInstanceTemplateHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyInstanceTemplateHttpRequest other) { + if (other == GetIamPolicyInstanceTemplateHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyInstanceTemplateHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyInstanceTemplateHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyInstanceTemplateHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyInstanceTemplateHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyInstanceTemplateHttpRequest) { + GetIamPolicyInstanceTemplateHttpRequest that = (GetIamPolicyInstanceTemplateHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyLicenseHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyLicenseHttpRequest.java new file mode 100644 index 000000000000..07ab87f88007 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyLicenseHttpRequest.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 GetIamPolicyLicenseHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyLicenseHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyLicenseHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyLicenseHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyLicenseHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyLicenseHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyLicenseHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyLicenseHttpRequest other) { + if (other == GetIamPolicyLicenseHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyLicenseHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyLicenseHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyLicenseHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyLicenseHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyLicenseHttpRequest) { + GetIamPolicyLicenseHttpRequest that = (GetIamPolicyLicenseHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeGroupHttpRequest.java new file mode 100644 index 000000000000..c443e0e37ac9 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeGroupHttpRequest.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 GetIamPolicyNodeGroupHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyNodeGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyNodeGroupHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyNodeGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyNodeGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyNodeGroupHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyNodeGroupHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyNodeGroupHttpRequest other) { + if (other == GetIamPolicyNodeGroupHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyNodeGroupHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyNodeGroupHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyNodeGroupHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyNodeGroupHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyNodeGroupHttpRequest) { + GetIamPolicyNodeGroupHttpRequest that = (GetIamPolicyNodeGroupHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeTemplateHttpRequest.java new file mode 100644 index 000000000000..6b446669ef27 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicyNodeTemplateHttpRequest.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 GetIamPolicyNodeTemplateHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicyNodeTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicyNodeTemplateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicyNodeTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicyNodeTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicyNodeTemplateHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicyNodeTemplateHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicyNodeTemplateHttpRequest other) { + if (other == GetIamPolicyNodeTemplateHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicyNodeTemplateHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicyNodeTemplateHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicyNodeTemplateHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicyNodeTemplateHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicyNodeTemplateHttpRequest) { + GetIamPolicyNodeTemplateHttpRequest that = (GetIamPolicyNodeTemplateHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySnapshotHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySnapshotHttpRequest.java new file mode 100644 index 000000000000..30c87d17c91c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySnapshotHttpRequest.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 GetIamPolicySnapshotHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicySnapshotHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicySnapshotHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicySnapshotHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicySnapshotHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicySnapshotHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicySnapshotHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicySnapshotHttpRequest other) { + if (other == GetIamPolicySnapshotHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicySnapshotHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicySnapshotHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicySnapshotHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicySnapshotHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicySnapshotHttpRequest) { + GetIamPolicySnapshotHttpRequest that = (GetIamPolicySnapshotHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySubnetworkHttpRequest.java new file mode 100644 index 000000000000..53219277b576 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetIamPolicySubnetworkHttpRequest.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 GetIamPolicySubnetworkHttpRequest 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 resource; + private final String userIp; + + private GetIamPolicySubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private GetIamPolicySubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("resource")) { + return resource; + } + 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 getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetIamPolicySubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetIamPolicySubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetIamPolicySubnetworkHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetIamPolicySubnetworkHttpRequest(); + } + + 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 resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetIamPolicySubnetworkHttpRequest other) { + if (other == GetIamPolicySubnetworkHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetIamPolicySubnetworkHttpRequest 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.resource = source.resource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetIamPolicySubnetworkHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetIamPolicySubnetworkHttpRequest( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetIamPolicySubnetworkHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetIamPolicySubnetworkHttpRequest) { + GetIamPolicySubnetworkHttpRequest that = (GetIamPolicySubnetworkHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, callback, fields, key, prettyPrint, quotaUser, resource, userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNatMappingInfoRoutersHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNatMappingInfoRoutersHttpRequest.java new file mode 100644 index 000000000000..221a45d082f5 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GetNatMappingInfoRoutersHttpRequest.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 GetNatMappingInfoRoutersHttpRequest 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 router; + private final String userIp; + + private GetNatMappingInfoRoutersHttpRequest() { + 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.router = null; + this.userIp = null; + } + + private GetNatMappingInfoRoutersHttpRequest( + String access_token, + String callback, + String fields, + String filter, + String key, + Integer maxResults, + String orderBy, + String pageToken, + String prettyPrint, + String quotaUser, + String router, + 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.router = router; + 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("router")) { + return router; + } + 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 getRouter() { + return router; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(GetNatMappingInfoRoutersHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static GetNatMappingInfoRoutersHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final GetNatMappingInfoRoutersHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new GetNatMappingInfoRoutersHttpRequest(); + } + + 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 router; + private String userIp; + + Builder() {} + + public Builder mergeFrom(GetNatMappingInfoRoutersHttpRequest other) { + if (other == GetNatMappingInfoRoutersHttpRequest.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.getRouter() != null) { + this.router = other.router; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(GetNatMappingInfoRoutersHttpRequest 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.router = source.router; + 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 getRouter() { + return router; + } + + public Builder setRouter(String router) { + this.router = router; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public GetNatMappingInfoRoutersHttpRequest build() { + String missing = ""; + + if (router == null) { + missing += " router"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new GetNatMappingInfoRoutersHttpRequest( + access_token, + callback, + fields, + filter, + key, + maxResults, + orderBy, + pageToken, + prettyPrint, + quotaUser, + router, + 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.setRouter(this.router); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "GetNatMappingInfoRoutersHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "filter=" + + filter + + ", " + + "key=" + + key + + ", " + + "maxResults=" + + maxResults + + ", " + + "orderBy=" + + orderBy + + ", " + + "pageToken=" + + pageToken + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "router=" + + router + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof GetNatMappingInfoRoutersHttpRequest) { + GetNatMappingInfoRoutersHttpRequest that = (GetNatMappingInfoRoutersHttpRequest) 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.router, that.getRouter()) + && 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, + router, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java index b2483291c5fc..1c32b7ea0f87 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java @@ -555,6 +555,107 @@ public final UnaryCallable getFromFamilyIm return stub.getFromFamilyImageCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = imageClient.getIamPolicyImage(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyImage(ProjectGlobalImageResourceName resource) { + + GetIamPolicyImageHttpRequest request = + GetIamPolicyImageHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = imageClient.getIamPolicyImage(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyImage(String resource) { + + GetIamPolicyImageHttpRequest request = + GetIamPolicyImageHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicyImageHttpRequest request = GetIamPolicyImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = imageClient.getIamPolicyImage(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 Policy getIamPolicyImage(GetIamPolicyImageHttpRequest request) { + return getIamPolicyImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicyImageHttpRequest request = GetIamPolicyImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = imageClient.getIamPolicyImageCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getIamPolicyImageCallable() { + return stub.getIamPolicyImageCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates an image in the specified project using the data included in the request. @@ -832,6 +933,118 @@ public final UnaryCallable listImagesCallable( return stub.listImagesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = imageClient.setIamPolicyImage(resource, globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyImage( + ProjectGlobalImageResourceName resource, + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicyImageHttpRequest request = + SetIamPolicyImageHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicyImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = imageClient.setIamPolicyImage(resource.toString(), globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyImage( + String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicyImageHttpRequest request = + SetIamPolicyImageHttpRequest.newBuilder() + .setResource(resource) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicyImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyImageHttpRequest request = SetIamPolicyImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = imageClient.setIamPolicyImage(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 Policy setIamPolicyImage(SetIamPolicyImageHttpRequest request) { + return setIamPolicyImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyImageHttpRequest request = SetIamPolicyImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = imageClient.setIamPolicyImageCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setIamPolicyImageCallable() { + return stub.setIamPolicyImageCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Sets the labels on an image. To learn more about labels, read the Labeling Resources @@ -948,6 +1161,120 @@ public final UnaryCallable setLabelsImageC return stub.setLabelsImageCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = imageClient.testIamPermissionsImage(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsImage( + ProjectGlobalImageResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsImageHttpRequest request = + TestIamPermissionsImageHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = imageClient.testIamPermissionsImage(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsImage( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsImageHttpRequest request = + TestIamPermissionsImageHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsImage(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsImageHttpRequest request = TestIamPermissionsImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = imageClient.testIamPermissionsImage(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 TestPermissionsResponse testIamPermissionsImage( + TestIamPermissionsImageHttpRequest request) { + return testIamPermissionsImageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (ImageClient imageClient = ImageClient.create()) {
+   *   ProjectGlobalImageResourceName resource = ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsImageHttpRequest request = TestIamPermissionsImageHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = imageClient.testIamPermissionsImageCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsImageCallable() { + return stub.testIamPermissionsImageCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java index 559d3f1cdfc3..b6f98f554857 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageSettings.java @@ -83,6 +83,11 @@ public UnaryCallSettings getFromFamilyImag return ((ImageStubSettings) getStubSettings()).getFromFamilyImageSettings(); } + /** Returns the object with the settings used for calls to getIamPolicyImage. */ + public UnaryCallSettings getIamPolicyImageSettings() { + return ((ImageStubSettings) getStubSettings()).getIamPolicyImageSettings(); + } + /** Returns the object with the settings used for calls to insertImage. */ public UnaryCallSettings insertImageSettings() { return ((ImageStubSettings) getStubSettings()).insertImageSettings(); @@ -94,11 +99,22 @@ public UnaryCallSettings insertImageSettings( return ((ImageStubSettings) getStubSettings()).listImagesSettings(); } + /** Returns the object with the settings used for calls to setIamPolicyImage. */ + public UnaryCallSettings setIamPolicyImageSettings() { + return ((ImageStubSettings) getStubSettings()).setIamPolicyImageSettings(); + } + /** Returns the object with the settings used for calls to setLabelsImage. */ public UnaryCallSettings setLabelsImageSettings() { return ((ImageStubSettings) getStubSettings()).setLabelsImageSettings(); } + /** Returns the object with the settings used for calls to testIamPermissionsImage. */ + public UnaryCallSettings + testIamPermissionsImageSettings() { + return ((ImageStubSettings) getStubSettings()).testIamPermissionsImageSettings(); + } + public static final ImageSettings create(ImageStubSettings stub) throws IOException { return new ImageSettings.Builder(stub.toBuilder()).build(); } @@ -222,6 +238,12 @@ public UnaryCallSettings.Builder getImageSettings() return getStubSettingsBuilder().getFromFamilyImageSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyImage. */ + public UnaryCallSettings.Builder + getIamPolicyImageSettings() { + return getStubSettingsBuilder().getIamPolicyImageSettings(); + } + /** Returns the builder for the settings used for calls to insertImage. */ public UnaryCallSettings.Builder insertImageSettings() { return getStubSettingsBuilder().insertImageSettings(); @@ -233,12 +255,24 @@ public UnaryCallSettings.Builder insertImageS return getStubSettingsBuilder().listImagesSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyImage. */ + public UnaryCallSettings.Builder + setIamPolicyImageSettings() { + return getStubSettingsBuilder().setIamPolicyImageSettings(); + } + /** Returns the builder for the settings used for calls to setLabelsImage. */ public UnaryCallSettings.Builder setLabelsImageSettings() { return getStubSettingsBuilder().setLabelsImageSettings(); } + /** Returns the builder for the settings used for calls to testIamPermissionsImage. */ + public UnaryCallSettings.Builder + testIamPermissionsImageSettings() { + return getStubSettingsBuilder().testIamPermissionsImageSettings(); + } + @Override public ImageSettings build() throws IOException { return new ImageSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java index a48260379507..f124c328c9da 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceClient.java @@ -985,6 +985,108 @@ public final UnaryCallable getInstanceCallable return stub.getInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   Policy response = instanceClient.getIamPolicyInstance(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyInstance(ProjectZoneInstanceResourceName resource) { + + GetIamPolicyInstanceHttpRequest request = + GetIamPolicyInstanceHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   Policy response = instanceClient.getIamPolicyInstance(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyInstance(String resource) { + + GetIamPolicyInstanceHttpRequest request = + GetIamPolicyInstanceHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   GetIamPolicyInstanceHttpRequest request = GetIamPolicyInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = instanceClient.getIamPolicyInstance(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 Policy getIamPolicyInstance(GetIamPolicyInstanceHttpRequest request) { + return getIamPolicyInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   GetIamPolicyInstanceHttpRequest request = GetIamPolicyInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = instanceClient.getIamPolicyInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getIamPolicyInstanceCallable() { + return stub.getIamPolicyInstanceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns the last 1 MB of serial port output from the specified instance. @@ -1840,6 +1942,118 @@ public final Operation setDiskAutoDeleteInstance(SetDiskAutoDeleteInstanceHttpRe return stub.setDiskAutoDeleteInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   Policy response = instanceClient.setIamPolicyInstance(resource, zoneSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param zoneSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyInstance( + ProjectZoneInstanceResourceName resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + + SetIamPolicyInstanceHttpRequest request = + SetIamPolicyInstanceHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource) + .build(); + return setIamPolicyInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   Policy response = instanceClient.setIamPolicyInstance(resource.toString(), zoneSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param zoneSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyInstance( + String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + + SetIamPolicyInstanceHttpRequest request = + SetIamPolicyInstanceHttpRequest.newBuilder() + .setResource(resource) + .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource) + .build(); + return setIamPolicyInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyInstanceHttpRequest request = SetIamPolicyInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = instanceClient.setIamPolicyInstance(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 Policy setIamPolicyInstance(SetIamPolicyInstanceHttpRequest request) { + return setIamPolicyInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyInstanceHttpRequest request = SetIamPolicyInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = instanceClient.setIamPolicyInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setIamPolicyInstanceCallable() { + return stub.setIamPolicyInstanceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Sets labels on an instance. To learn more about labels, read the Labeling Resources @@ -3187,6 +3401,120 @@ public final UnaryCallable stopInstanceCalla return stub.stopInstanceCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = instanceClient.testIamPermissionsInstance(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsInstance( + ProjectZoneInstanceResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsInstanceHttpRequest request = + TestIamPermissionsInstanceHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = instanceClient.testIamPermissionsInstance(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsInstance( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsInstanceHttpRequest request = + TestIamPermissionsInstanceHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsInstanceHttpRequest request = TestIamPermissionsInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = instanceClient.testIamPermissionsInstance(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 TestPermissionsResponse testIamPermissionsInstance( + TestIamPermissionsInstanceHttpRequest request) { + return testIamPermissionsInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceClient instanceClient = InstanceClient.create()) {
+   *   ProjectZoneInstanceResourceName resource = ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsInstanceHttpRequest request = TestIamPermissionsInstanceHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = instanceClient.testIamPermissionsInstanceCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsInstanceCallable() { + return stub.testIamPermissionsInstanceCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Updates the specified access config from an instance's network interface with the data included diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java index 9a2dadcf29a8..0217c7f8dfb6 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java @@ -1257,6 +1257,155 @@ public final ListInstanceGroupManagersPagedResponse listInstanceGroupManagers( return stub.listManagedInstancesInstanceGroupManagersCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listManagedInstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   Operation response = instanceGroupManagerClient.patchInstanceGroupManager(instanceGroupManager, instanceGroupManagerResource, fieldMask);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the instance group manager. + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + * @param fieldMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInstanceGroupManager( + ProjectZoneInstanceGroupManagerName instanceGroupManager, + InstanceGroupManager instanceGroupManagerResource, + List fieldMask) { + + PatchInstanceGroupManagerHttpRequest request = + PatchInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .addAllFieldMask(fieldMask) + .build(); + return patchInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listManagedInstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   Operation response = instanceGroupManagerClient.patchInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagerResource, fieldMask);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the instance group manager. + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + * @param fieldMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchInstanceGroupManager( + String instanceGroupManager, + InstanceGroupManager instanceGroupManagerResource, + List fieldMask) { + + PatchInstanceGroupManagerHttpRequest request = + PatchInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .addAllFieldMask(fieldMask) + .build(); + return patchInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listManagedInstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   PatchInstanceGroupManagerHttpRequest request = PatchInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .addAllFieldMask(fieldMask)
+   *     .build();
+   *   Operation response = instanceGroupManagerClient.patchInstanceGroupManager(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 patchInstanceGroupManager(PatchInstanceGroupManagerHttpRequest request) { + return patchInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listManagedInstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (InstanceGroupManagerClient instanceGroupManagerClient = InstanceGroupManagerClient.create()) {
+   *   ProjectZoneInstanceGroupManagerName instanceGroupManager = ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   PatchInstanceGroupManagerHttpRequest request = PatchInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .addAllFieldMask(fieldMask)
+   *     .build();
+   *   ApiFuture<Operation> future = instanceGroupManagerClient.patchInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + patchInstanceGroupManagerCallable() { + return stub.patchInstanceGroupManagerCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Flags the specified instances in the managed instance group to be immediately recreated. The diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java index 50f49ca16f4b..7dd79f24d336 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerSettings.java @@ -132,6 +132,13 @@ public class InstanceGroupManagerSettings extends ClientSettings + patchInstanceGroupManagerSettings() { + return ((InstanceGroupManagerStubSettings) getStubSettings()) + .patchInstanceGroupManagerSettings(); + } + /** * Returns the object with the settings used for calls to recreateInstancesInstanceGroupManager. */ @@ -332,6 +339,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().listManagedInstancesInstanceGroupManagersSettings(); } + /** Returns the builder for the settings used for calls to patchInstanceGroupManager. */ + public UnaryCallSettings.Builder + patchInstanceGroupManagerSettings() { + return getStubSettingsBuilder().patchInstanceGroupManagerSettings(); + } + /** * Returns the builder for the settings used for calls to recreateInstancesInstanceGroupManager. */ diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java index 3efe5e733a44..4b97344f305f 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceSettings.java @@ -106,6 +106,11 @@ public UnaryCallSettings getInstanceSettings() return ((InstanceStubSettings) getStubSettings()).getInstanceSettings(); } + /** Returns the object with the settings used for calls to getIamPolicyInstance. */ + public UnaryCallSettings getIamPolicyInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).getIamPolicyInstanceSettings(); + } + /** Returns the object with the settings used for calls to getSerialPortOutputInstance. */ public UnaryCallSettings getSerialPortOutputInstanceSettings() { @@ -149,6 +154,11 @@ public UnaryCallSettings resetInstanceSetti return ((InstanceStubSettings) getStubSettings()).setDiskAutoDeleteInstanceSettings(); } + /** Returns the object with the settings used for calls to setIamPolicyInstance. */ + public UnaryCallSettings setIamPolicyInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).setIamPolicyInstanceSettings(); + } + /** Returns the object with the settings used for calls to setLabelsInstance. */ public UnaryCallSettings setLabelsInstanceSettings() { return ((InstanceStubSettings) getStubSettings()).setLabelsInstanceSettings(); @@ -217,6 +227,12 @@ public UnaryCallSettings stopInstanceSetting return ((InstanceStubSettings) getStubSettings()).stopInstanceSettings(); } + /** Returns the object with the settings used for calls to testIamPermissionsInstance. */ + public UnaryCallSettings + testIamPermissionsInstanceSettings() { + return ((InstanceStubSettings) getStubSettings()).testIamPermissionsInstanceSettings(); + } + /** Returns the object with the settings used for calls to updateAccessConfigInstance. */ public UnaryCallSettings updateAccessConfigInstanceSettings() { @@ -374,6 +390,12 @@ public UnaryCallSettings.Builder getInstanceSe return getStubSettingsBuilder().getInstanceSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyInstance. */ + public UnaryCallSettings.Builder + getIamPolicyInstanceSettings() { + return getStubSettingsBuilder().getIamPolicyInstanceSettings(); + } + /** Returns the builder for the settings used for calls to getSerialPortOutputInstance. */ public UnaryCallSettings.Builder getSerialPortOutputInstanceSettings() { @@ -419,6 +441,12 @@ public UnaryCallSettings.Builder resetInsta return getStubSettingsBuilder().setDiskAutoDeleteInstanceSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyInstance. */ + public UnaryCallSettings.Builder + setIamPolicyInstanceSettings() { + return getStubSettingsBuilder().setIamPolicyInstanceSettings(); + } + /** Returns the builder for the settings used for calls to setLabelsInstance. */ public UnaryCallSettings.Builder setLabelsInstanceSettings() { @@ -489,6 +517,12 @@ public UnaryCallSettings.Builder stopInstanc return getStubSettingsBuilder().stopInstanceSettings(); } + /** Returns the builder for the settings used for calls to testIamPermissionsInstance. */ + public UnaryCallSettings.Builder + testIamPermissionsInstanceSettings() { + return getStubSettingsBuilder().testIamPermissionsInstanceSettings(); + } + /** Returns the builder for the settings used for calls to updateAccessConfigInstance. */ public UnaryCallSettings.Builder updateAccessConfigInstanceSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java index cf9526f548a8..3f85bf192fcb 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateClient.java @@ -361,6 +361,110 @@ public final InstanceTemplate getInstanceTemplate(GetInstanceTemplateHttpRequest return stub.getInstanceTemplateCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = instanceTemplateClient.getIamPolicyInstanceTemplate(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyInstanceTemplate( + ProjectGlobalInstanceTemplateResourceName resource) { + + GetIamPolicyInstanceTemplateHttpRequest request = + GetIamPolicyInstanceTemplateHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = instanceTemplateClient.getIamPolicyInstanceTemplate(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyInstanceTemplate(String resource) { + + GetIamPolicyInstanceTemplateHttpRequest request = + GetIamPolicyInstanceTemplateHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicyInstanceTemplateHttpRequest request = GetIamPolicyInstanceTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = instanceTemplateClient.getIamPolicyInstanceTemplate(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 Policy getIamPolicyInstanceTemplate( + GetIamPolicyInstanceTemplateHttpRequest request) { + return getIamPolicyInstanceTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicyInstanceTemplateHttpRequest request = GetIamPolicyInstanceTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = instanceTemplateClient.getIamPolicyInstanceTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getIamPolicyInstanceTemplateCallable() { + return stub.getIamPolicyInstanceTemplateCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates an instance template in the specified project using the data that is included in the @@ -630,6 +734,234 @@ public final ListInstanceTemplatesPagedResponse listInstanceTemplates( return stub.listInstanceTemplatesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = instanceTemplateClient.setIamPolicyInstanceTemplate(resource, globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyInstanceTemplate( + ProjectGlobalInstanceTemplateResourceName resource, + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicyInstanceTemplateHttpRequest request = + SetIamPolicyInstanceTemplateHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicyInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = instanceTemplateClient.setIamPolicyInstanceTemplate(resource.toString(), globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyInstanceTemplate( + String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicyInstanceTemplateHttpRequest request = + SetIamPolicyInstanceTemplateHttpRequest.newBuilder() + .setResource(resource) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicyInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyInstanceTemplateHttpRequest request = SetIamPolicyInstanceTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = instanceTemplateClient.setIamPolicyInstanceTemplate(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 Policy setIamPolicyInstanceTemplate( + SetIamPolicyInstanceTemplateHttpRequest request) { + return setIamPolicyInstanceTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyInstanceTemplateHttpRequest request = SetIamPolicyInstanceTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = instanceTemplateClient.setIamPolicyInstanceTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setIamPolicyInstanceTemplateCallable() { + return stub.setIamPolicyInstanceTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = instanceTemplateClient.testIamPermissionsInstanceTemplate(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsInstanceTemplate( + ProjectGlobalInstanceTemplateResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsInstanceTemplateHttpRequest request = + TestIamPermissionsInstanceTemplateHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = instanceTemplateClient.testIamPermissionsInstanceTemplate(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsInstanceTemplate( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsInstanceTemplateHttpRequest request = + TestIamPermissionsInstanceTemplateHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsInstanceTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsInstanceTemplateHttpRequest request = TestIamPermissionsInstanceTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = instanceTemplateClient.testIamPermissionsInstanceTemplate(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 TestPermissionsResponse testIamPermissionsInstanceTemplate( + TestIamPermissionsInstanceTemplateHttpRequest request) { + return testIamPermissionsInstanceTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient.create()) {
+   *   ProjectGlobalInstanceTemplateResourceName resource = ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsInstanceTemplateHttpRequest request = TestIamPermissionsInstanceTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = instanceTemplateClient.testIamPermissionsInstanceTemplateCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsInstanceTemplateCallable() { + return stub.testIamPermissionsInstanceTemplateCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java index 64cf1e22e0c8..8669dcb98da0 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceTemplateSettings.java @@ -75,6 +75,13 @@ public class InstanceTemplateSettings extends ClientSettings + getIamPolicyInstanceTemplateSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()) + .getIamPolicyInstanceTemplateSettings(); + } + /** Returns the object with the settings used for calls to insertInstanceTemplate. */ public UnaryCallSettings insertInstanceTemplateSettings() { @@ -90,6 +97,20 @@ public class InstanceTemplateSettings extends ClientSettings + setIamPolicyInstanceTemplateSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()) + .setIamPolicyInstanceTemplateSettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissionsInstanceTemplate. */ + public UnaryCallSettings + testIamPermissionsInstanceTemplateSettings() { + return ((InstanceTemplateStubSettings) getStubSettings()) + .testIamPermissionsInstanceTemplateSettings(); + } + public static final InstanceTemplateSettings create(InstanceTemplateStubSettings stub) throws IOException { return new InstanceTemplateSettings.Builder(stub.toBuilder()).build(); @@ -204,6 +225,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().getInstanceTemplateSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyInstanceTemplate. */ + public UnaryCallSettings.Builder + getIamPolicyInstanceTemplateSettings() { + return getStubSettingsBuilder().getIamPolicyInstanceTemplateSettings(); + } + /** Returns the builder for the settings used for calls to insertInstanceTemplate. */ public UnaryCallSettings.Builder insertInstanceTemplateSettings() { @@ -219,6 +246,21 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().listInstanceTemplatesSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyInstanceTemplate. */ + public UnaryCallSettings.Builder + setIamPolicyInstanceTemplateSettings() { + return getStubSettingsBuilder().setIamPolicyInstanceTemplateSettings(); + } + + /** + * Returns the builder for the settings used for calls to testIamPermissionsInstanceTemplate. + */ + public UnaryCallSettings.Builder< + TestIamPermissionsInstanceTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceTemplateSettings() { + return getStubSettingsBuilder().testIamPermissionsInstanceTemplateSettings(); + } + @Override public InstanceTemplateSettings build() throws IOException { return new InstanceTemplateSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java index d9ca299dd70b..e93cf99bca07 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectClient.java @@ -350,6 +350,107 @@ public final UnaryCallable getIntercon return stub.getInterconnectCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the interconnectDiagnostics for the specified interconnect. + * + *

Sample code: + * + *


+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   InterconnectsGetDiagnosticsResponse response = interconnectClient.getDiagnosticsInterconnect(interconnect);
+   * }
+   * 
+ * + * @param interconnect Name of the interconnect resource to query. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectsGetDiagnosticsResponse getDiagnosticsInterconnect( + ProjectGlobalInterconnectName interconnect) { + + GetDiagnosticsInterconnectHttpRequest request = + GetDiagnosticsInterconnectHttpRequest.newBuilder() + .setInterconnect(interconnect == null ? null : interconnect.toString()) + .build(); + return getDiagnosticsInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the interconnectDiagnostics for the specified interconnect. + * + *

Sample code: + * + *


+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   InterconnectsGetDiagnosticsResponse response = interconnectClient.getDiagnosticsInterconnect(interconnect.toString());
+   * }
+   * 
+ * + * @param interconnect Name of the interconnect resource to query. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final InterconnectsGetDiagnosticsResponse getDiagnosticsInterconnect(String interconnect) { + + GetDiagnosticsInterconnectHttpRequest request = + GetDiagnosticsInterconnectHttpRequest.newBuilder().setInterconnect(interconnect).build(); + return getDiagnosticsInterconnect(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the interconnectDiagnostics for the specified interconnect. + * + *

Sample code: + * + *


+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   GetDiagnosticsInterconnectHttpRequest request = GetDiagnosticsInterconnectHttpRequest.newBuilder()
+   *     .setInterconnect(interconnect.toString())
+   *     .build();
+   *   InterconnectsGetDiagnosticsResponse response = interconnectClient.getDiagnosticsInterconnect(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 InterconnectsGetDiagnosticsResponse getDiagnosticsInterconnect( + GetDiagnosticsInterconnectHttpRequest request) { + return getDiagnosticsInterconnectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the interconnectDiagnostics for the specified interconnect. + * + *

Sample code: + * + *


+   * try (InterconnectClient interconnectClient = InterconnectClient.create()) {
+   *   ProjectGlobalInterconnectName interconnect = ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]");
+   *   GetDiagnosticsInterconnectHttpRequest request = GetDiagnosticsInterconnectHttpRequest.newBuilder()
+   *     .setInterconnect(interconnect.toString())
+   *     .build();
+   *   ApiFuture<InterconnectsGetDiagnosticsResponse> future = interconnectClient.getDiagnosticsInterconnectCallable().futureCall(request);
+   *   // Do something
+   *   InterconnectsGetDiagnosticsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectCallable() { + return stub.getDiagnosticsInterconnectCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a Interconnect in the specified project using the data included in the request. diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java index b7c6e6ed7291..7e7446e1bab6 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InterconnectSettings.java @@ -73,6 +73,13 @@ public UnaryCallSettings getInterconne return ((InterconnectStubSettings) getStubSettings()).getInterconnectSettings(); } + /** Returns the object with the settings used for calls to getDiagnosticsInterconnect. */ + public UnaryCallSettings< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectSettings() { + return ((InterconnectStubSettings) getStubSettings()).getDiagnosticsInterconnectSettings(); + } + /** Returns the object with the settings used for calls to insertInterconnect. */ public UnaryCallSettings insertInterconnectSettings() { return ((InterconnectStubSettings) getStubSettings()).insertInterconnectSettings(); @@ -204,6 +211,13 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().getInterconnectSettings(); } + /** Returns the builder for the settings used for calls to getDiagnosticsInterconnect. */ + public UnaryCallSettings.Builder< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectSettings() { + return getStubSettingsBuilder().getDiagnosticsInterconnectSettings(); + } + /** Returns the builder for the settings used for calls to insertInterconnect. */ public UnaryCallSettings.Builder insertInterconnectSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java index 5b4aa0900bdc..99af80d7fe57 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java @@ -343,6 +343,107 @@ public final UnaryCallable getLicenseCallable() return stub.getLicenseCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = licenseClient.getIamPolicyLicense(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyLicense(ProjectGlobalLicenseResourceName resource) { + + GetIamPolicyLicenseHttpRequest request = + GetIamPolicyLicenseHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = licenseClient.getIamPolicyLicense(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyLicense(String resource) { + + GetIamPolicyLicenseHttpRequest request = + GetIamPolicyLicenseHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicyLicenseHttpRequest request = GetIamPolicyLicenseHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = licenseClient.getIamPolicyLicense(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 Policy getIamPolicyLicense(GetIamPolicyLicenseHttpRequest request) { + return getIamPolicyLicenseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicyLicenseHttpRequest request = GetIamPolicyLicenseHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = licenseClient.getIamPolicyLicenseCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable getIamPolicyLicenseCallable() { + return stub.getIamPolicyLicenseCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Create a License resource in the specified project. @@ -608,6 +709,118 @@ public final UnaryCallable listLi return stub.listLicensesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = licenseClient.setIamPolicyLicense(resource, globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyLicense( + ProjectGlobalLicenseResourceName resource, + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicyLicenseHttpRequest request = + SetIamPolicyLicenseHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicyLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = licenseClient.setIamPolicyLicense(resource.toString(), globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyLicense( + String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicyLicenseHttpRequest request = + SetIamPolicyLicenseHttpRequest.newBuilder() + .setResource(resource) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicyLicense(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyLicenseHttpRequest request = SetIamPolicyLicenseHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = licenseClient.setIamPolicyLicense(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 Policy setIamPolicyLicense(SetIamPolicyLicenseHttpRequest request) { + return setIamPolicyLicenseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (LicenseClient licenseClient = LicenseClient.create()) {
+   *   ProjectGlobalLicenseResourceName resource = ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyLicenseHttpRequest request = SetIamPolicyLicenseHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = licenseClient.setIamPolicyLicenseCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable setIamPolicyLicenseCallable() { + return stub.setIamPolicyLicenseCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns permissions that a caller has on the specified resource. diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java index 532b4a4e2024..52d5f6f53082 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseSettings.java @@ -73,6 +73,11 @@ public UnaryCallSettings getLicenseSettings() { return ((LicenseStubSettings) getStubSettings()).getLicenseSettings(); } + /** Returns the object with the settings used for calls to getIamPolicyLicense. */ + public UnaryCallSettings getIamPolicyLicenseSettings() { + return ((LicenseStubSettings) getStubSettings()).getIamPolicyLicenseSettings(); + } + /** Returns the object with the settings used for calls to insertLicense. */ public UnaryCallSettings insertLicenseSettings() { return ((LicenseStubSettings) getStubSettings()).insertLicenseSettings(); @@ -84,6 +89,11 @@ public UnaryCallSettings insertLicenseSetti return ((LicenseStubSettings) getStubSettings()).listLicensesSettings(); } + /** Returns the object with the settings used for calls to setIamPolicyLicense. */ + public UnaryCallSettings setIamPolicyLicenseSettings() { + return ((LicenseStubSettings) getStubSettings()).setIamPolicyLicenseSettings(); + } + /** Returns the object with the settings used for calls to testIamPermissionsLicense. */ public UnaryCallSettings testIamPermissionsLicenseSettings() { @@ -201,6 +211,12 @@ public UnaryCallSettings.Builder getLicenseSetti return getStubSettingsBuilder().getLicenseSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyLicense. */ + public UnaryCallSettings.Builder + getIamPolicyLicenseSettings() { + return getStubSettingsBuilder().getIamPolicyLicenseSettings(); + } + /** Returns the builder for the settings used for calls to insertLicense. */ public UnaryCallSettings.Builder insertLicenseSettings() { return getStubSettingsBuilder().insertLicenseSettings(); @@ -213,6 +229,12 @@ public UnaryCallSettings.Builder insertLice return getStubSettingsBuilder().listLicensesSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyLicense. */ + public UnaryCallSettings.Builder + setIamPolicyLicenseSettings() { + return getStubSettingsBuilder().setIamPolicyLicenseSettings(); + } + /** Returns the builder for the settings used for calls to testIamPermissionsLicense. */ public UnaryCallSettings.Builder testIamPermissionsLicenseSettings() { 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 index d73060145454..832217d070fb 100644 --- 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 @@ -718,6 +718,108 @@ public final UnaryCallable getNodeGroupCalla return stub.getNodeGroupCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   Policy response = nodeGroupClient.getIamPolicyNodeGroup(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyNodeGroup(ProjectZoneNodeGroupResourceName resource) { + + GetIamPolicyNodeGroupHttpRequest request = + GetIamPolicyNodeGroupHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   Policy response = nodeGroupClient.getIamPolicyNodeGroup(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyNodeGroup(String resource) { + + GetIamPolicyNodeGroupHttpRequest request = + GetIamPolicyNodeGroupHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   GetIamPolicyNodeGroupHttpRequest request = GetIamPolicyNodeGroupHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = nodeGroupClient.getIamPolicyNodeGroup(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 Policy getIamPolicyNodeGroup(GetIamPolicyNodeGroupHttpRequest request) { + return getIamPolicyNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   GetIamPolicyNodeGroupHttpRequest request = GetIamPolicyNodeGroupHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = nodeGroupClient.getIamPolicyNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getIamPolicyNodeGroupCallable() { + return stub.getIamPolicyNodeGroupCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a NodeGroup resource in the specified project using the data included in the request. @@ -1119,6 +1221,119 @@ public final ListNodesNodeGroupsPagedResponse listNodesNodeGroups( return stub.listNodesNodeGroupsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   Policy response = nodeGroupClient.setIamPolicyNodeGroup(resource, zoneSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param zoneSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyNodeGroup( + ProjectZoneNodeGroupResourceName resource, + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + + SetIamPolicyNodeGroupHttpRequest request = + SetIamPolicyNodeGroupHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource) + .build(); + return setIamPolicyNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   Policy response = nodeGroupClient.setIamPolicyNodeGroup(resource.toString(), zoneSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param zoneSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyNodeGroup( + String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + + SetIamPolicyNodeGroupHttpRequest request = + SetIamPolicyNodeGroupHttpRequest.newBuilder() + .setResource(resource) + .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource) + .build(); + return setIamPolicyNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyNodeGroupHttpRequest request = SetIamPolicyNodeGroupHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = nodeGroupClient.setIamPolicyNodeGroup(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 Policy setIamPolicyNodeGroup(SetIamPolicyNodeGroupHttpRequest request) { + return setIamPolicyNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyNodeGroupHttpRequest request = SetIamPolicyNodeGroupHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = nodeGroupClient.setIamPolicyNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setIamPolicyNodeGroupCallable() { + return stub.setIamPolicyNodeGroupCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Updates the node template of the node group. @@ -1232,6 +1447,120 @@ public final Operation setNodeTemplateNodeGroup(SetNodeTemplateNodeGroupHttpRequ return stub.setNodeTemplateNodeGroupCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = nodeGroupClient.testIamPermissionsNodeGroup(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsNodeGroup( + ProjectZoneNodeGroupResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsNodeGroupHttpRequest request = + TestIamPermissionsNodeGroupHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = nodeGroupClient.testIamPermissionsNodeGroup(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsNodeGroup( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsNodeGroupHttpRequest request = + TestIamPermissionsNodeGroupHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsNodeGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsNodeGroupHttpRequest request = TestIamPermissionsNodeGroupHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = nodeGroupClient.testIamPermissionsNodeGroup(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 TestPermissionsResponse testIamPermissionsNodeGroup( + TestIamPermissionsNodeGroupHttpRequest request) { + return testIamPermissionsNodeGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
+   *   ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsNodeGroupHttpRequest request = TestIamPermissionsNodeGroupHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = nodeGroupClient.testIamPermissionsNodeGroupCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsNodeGroupCallable() { + return stub.testIamPermissionsNodeGroupCallable(); + } + @Override public final void close() { stub.close(); 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 index c20a27483650..88c8abf2d5e5 100644 --- 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 @@ -95,6 +95,12 @@ public UnaryCallSettings getNodeGroupSetting return ((NodeGroupStubSettings) getStubSettings()).getNodeGroupSettings(); } + /** Returns the object with the settings used for calls to getIamPolicyNodeGroup. */ + public UnaryCallSettings + getIamPolicyNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).getIamPolicyNodeGroupSettings(); + } + /** Returns the object with the settings used for calls to insertNodeGroup. */ public UnaryCallSettings insertNodeGroupSettings() { return ((NodeGroupStubSettings) getStubSettings()).insertNodeGroupSettings(); @@ -113,12 +119,24 @@ public UnaryCallSettings insertNodeGroupS return ((NodeGroupStubSettings) getStubSettings()).listNodesNodeGroupsSettings(); } + /** Returns the object with the settings used for calls to setIamPolicyNodeGroup. */ + public UnaryCallSettings + setIamPolicyNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).setIamPolicyNodeGroupSettings(); + } + /** Returns the object with the settings used for calls to setNodeTemplateNodeGroup. */ public UnaryCallSettings setNodeTemplateNodeGroupSettings() { return ((NodeGroupStubSettings) getStubSettings()).setNodeTemplateNodeGroupSettings(); } + /** Returns the object with the settings used for calls to testIamPermissionsNodeGroup. */ + public UnaryCallSettings + testIamPermissionsNodeGroupSettings() { + return ((NodeGroupStubSettings) getStubSettings()).testIamPermissionsNodeGroupSettings(); + } + public static final NodeGroupSettings create(NodeGroupStubSettings stub) throws IOException { return new NodeGroupSettings.Builder(stub.toBuilder()).build(); } @@ -252,6 +270,12 @@ public UnaryCallSettings.Builder getNodeGrou return getStubSettingsBuilder().getNodeGroupSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyNodeGroup. */ + public UnaryCallSettings.Builder + getIamPolicyNodeGroupSettings() { + return getStubSettingsBuilder().getIamPolicyNodeGroupSettings(); + } + /** Returns the builder for the settings used for calls to insertNodeGroup. */ public UnaryCallSettings.Builder insertNodeGroupSettings() { @@ -272,12 +296,25 @@ public UnaryCallSettings.Builder getNodeGrou return getStubSettingsBuilder().listNodesNodeGroupsSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyNodeGroup. */ + public UnaryCallSettings.Builder + setIamPolicyNodeGroupSettings() { + return getStubSettingsBuilder().setIamPolicyNodeGroupSettings(); + } + /** Returns the builder for the settings used for calls to setNodeTemplateNodeGroup. */ public UnaryCallSettings.Builder setNodeTemplateNodeGroupSettings() { return getStubSettingsBuilder().setNodeTemplateNodeGroupSettings(); } + /** Returns the builder for the settings used for calls to testIamPermissionsNodeGroup. */ + public UnaryCallSettings.Builder< + TestIamPermissionsNodeGroupHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeGroupSettings() { + return getStubSettingsBuilder().testIamPermissionsNodeGroupSettings(); + } + @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/NodeTemplateClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java index 26ef8b48c871..1d511200ce88 100644 --- 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 @@ -491,6 +491,108 @@ public final UnaryCallable getNodeTemp return stub.getNodeTemplateCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   Policy response = nodeTemplateClient.getIamPolicyNodeTemplate(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyNodeTemplate(ProjectRegionNodeTemplateResourceName resource) { + + GetIamPolicyNodeTemplateHttpRequest request = + GetIamPolicyNodeTemplateHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicyNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   Policy response = nodeTemplateClient.getIamPolicyNodeTemplate(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicyNodeTemplate(String resource) { + + GetIamPolicyNodeTemplateHttpRequest request = + GetIamPolicyNodeTemplateHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicyNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   GetIamPolicyNodeTemplateHttpRequest request = GetIamPolicyNodeTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = nodeTemplateClient.getIamPolicyNodeTemplate(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 Policy getIamPolicyNodeTemplate(GetIamPolicyNodeTemplateHttpRequest request) { + return getIamPolicyNodeTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   GetIamPolicyNodeTemplateHttpRequest request = GetIamPolicyNodeTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = nodeTemplateClient.getIamPolicyNodeTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getIamPolicyNodeTemplateCallable() { + return stub.getIamPolicyNodeTemplateCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a NodeTemplate resource in the specified project using the data included in the @@ -744,6 +846,233 @@ public final ListNodeTemplatesPagedResponse listNodeTemplates( return stub.listNodeTemplatesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   Policy response = nodeTemplateClient.setIamPolicyNodeTemplate(resource, regionSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param regionSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyNodeTemplate( + ProjectRegionNodeTemplateResourceName resource, + RegionSetPolicyRequest regionSetPolicyRequestResource) { + + SetIamPolicyNodeTemplateHttpRequest request = + SetIamPolicyNodeTemplateHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource) + .build(); + return setIamPolicyNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   Policy response = nodeTemplateClient.setIamPolicyNodeTemplate(resource.toString(), regionSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param regionSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicyNodeTemplate( + String resource, RegionSetPolicyRequest regionSetPolicyRequestResource) { + + SetIamPolicyNodeTemplateHttpRequest request = + SetIamPolicyNodeTemplateHttpRequest.newBuilder() + .setResource(resource) + .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource) + .build(); + return setIamPolicyNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyNodeTemplateHttpRequest request = SetIamPolicyNodeTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = nodeTemplateClient.setIamPolicyNodeTemplate(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 Policy setIamPolicyNodeTemplate(SetIamPolicyNodeTemplateHttpRequest request) { + return setIamPolicyNodeTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicyNodeTemplateHttpRequest request = SetIamPolicyNodeTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = nodeTemplateClient.setIamPolicyNodeTemplateCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setIamPolicyNodeTemplateCallable() { + return stub.setIamPolicyNodeTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = nodeTemplateClient.testIamPermissionsNodeTemplate(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsNodeTemplate( + ProjectRegionNodeTemplateResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsNodeTemplateHttpRequest request = + TestIamPermissionsNodeTemplateHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = nodeTemplateClient.testIamPermissionsNodeTemplate(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsNodeTemplate( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsNodeTemplateHttpRequest request = + TestIamPermissionsNodeTemplateHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsNodeTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsNodeTemplateHttpRequest request = TestIamPermissionsNodeTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = nodeTemplateClient.testIamPermissionsNodeTemplate(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 TestPermissionsResponse testIamPermissionsNodeTemplate( + TestIamPermissionsNodeTemplateHttpRequest request) { + return testIamPermissionsNodeTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
+   *   ProjectRegionNodeTemplateResourceName resource = ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsNodeTemplateHttpRequest request = TestIamPermissionsNodeTemplateHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = nodeTemplateClient.testIamPermissionsNodeTemplateCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsNodeTemplateCallable() { + return stub.testIamPermissionsNodeTemplateCallable(); + } + @Override public final void close() { stub.close(); 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 index 82aaaf940d3f..15bbb3efcf5f 100644 --- 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 @@ -83,6 +83,12 @@ public UnaryCallSettings getNodeTempla return ((NodeTemplateStubSettings) getStubSettings()).getNodeTemplateSettings(); } + /** Returns the object with the settings used for calls to getIamPolicyNodeTemplate. */ + public UnaryCallSettings + getIamPolicyNodeTemplateSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).getIamPolicyNodeTemplateSettings(); + } + /** Returns the object with the settings used for calls to insertNodeTemplate. */ public UnaryCallSettings insertNodeTemplateSettings() { return ((NodeTemplateStubSettings) getStubSettings()).insertNodeTemplateSettings(); @@ -95,6 +101,18 @@ public UnaryCallSettings insertNodeTem return ((NodeTemplateStubSettings) getStubSettings()).listNodeTemplatesSettings(); } + /** Returns the object with the settings used for calls to setIamPolicyNodeTemplate. */ + public UnaryCallSettings + setIamPolicyNodeTemplateSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).setIamPolicyNodeTemplateSettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissionsNodeTemplate. */ + public UnaryCallSettings + testIamPermissionsNodeTemplateSettings() { + return ((NodeTemplateStubSettings) getStubSettings()).testIamPermissionsNodeTemplateSettings(); + } + public static final NodeTemplateSettings create(NodeTemplateStubSettings stub) throws IOException { return new NodeTemplateSettings.Builder(stub.toBuilder()).build(); @@ -218,6 +236,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().getNodeTemplateSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicyNodeTemplate. */ + public UnaryCallSettings.Builder + getIamPolicyNodeTemplateSettings() { + return getStubSettingsBuilder().getIamPolicyNodeTemplateSettings(); + } + /** Returns the builder for the settings used for calls to insertNodeTemplate. */ public UnaryCallSettings.Builder insertNodeTemplateSettings() { @@ -231,6 +255,19 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().listNodeTemplatesSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicyNodeTemplate. */ + public UnaryCallSettings.Builder + setIamPolicyNodeTemplateSettings() { + return getStubSettingsBuilder().setIamPolicyNodeTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissionsNodeTemplate. */ + public UnaryCallSettings.Builder< + TestIamPermissionsNodeTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeTemplateSettings() { + return getStubSettingsBuilder().testIamPermissionsNodeTemplateSettings(); + } + @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/PatchInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..ef33175c2ec1 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchInstanceGroupManagerHttpRequest.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 PatchInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final List fieldMask; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManager instanceGroupManagerResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private PatchInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fieldMask = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagerResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private PatchInstanceGroupManagerHttpRequest( + String access_token, + String callback, + List fieldMask, + String fields, + String instanceGroupManager, + InstanceGroupManager instanceGroupManagerResource, + 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.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagerResource = instanceGroupManagerResource; + 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("instanceGroupManager")) { + return instanceGroupManager; + } + if (fieldName.equals("instanceGroupManagerResource")) { + return instanceGroupManagerResource; + } + 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 InstanceGroupManager getApiMessageRequestBody() { + return instanceGroupManagerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public List getFieldMask() { + return fieldMask; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + 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(PatchInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final PatchInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new PatchInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private List fieldMask; + private String fields; + private String instanceGroupManager; + private InstanceGroupManager instanceGroupManagerResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchInstanceGroupManagerHttpRequest other) { + if (other == PatchInstanceGroupManagerHttpRequest.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.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagerResource() != null) { + this.instanceGroupManagerResource = other.instanceGroupManagerResource; + } + 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(PatchInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fieldMask = source.fieldMask; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagerResource = source.instanceGroupManagerResource; + 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 getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + public Builder setInstanceGroupManagerResource( + InstanceGroupManager instanceGroupManagerResource) { + this.instanceGroupManagerResource = instanceGroupManagerResource; + 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 PatchInstanceGroupManagerHttpRequest build() { + String missing = ""; + + if (fieldMask == null) { + missing += " fieldMask"; + } + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchInstanceGroupManagerHttpRequest( + access_token, + callback, + fieldMask, + fields, + instanceGroupManager, + instanceGroupManagerResource, + 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.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagerResource(this.instanceGroupManagerResource); + 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 "PatchInstanceGroupManagerHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fieldMask=" + + fieldMask + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagerResource=" + + instanceGroupManagerResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchInstanceGroupManagerHttpRequest) { + PatchInstanceGroupManagerHttpRequest that = (PatchInstanceGroupManagerHttpRequest) 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.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) + && 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, + instanceGroupManager, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionInstanceGroupManagerHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionInstanceGroupManagerHttpRequest.java new file mode 100644 index 000000000000..1639520cefe4 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/PatchRegionInstanceGroupManagerHttpRequest.java @@ -0,0 +1,490 @@ +/* + * 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 PatchRegionInstanceGroupManagerHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final List fieldMask; + private final String fields; + private final String instanceGroupManager; + private final InstanceGroupManager instanceGroupManagerResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String requestId; + private final String userIp; + + private PatchRegionInstanceGroupManagerHttpRequest() { + this.access_token = null; + this.callback = null; + this.fieldMask = null; + this.fields = null; + this.instanceGroupManager = null; + this.instanceGroupManagerResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.requestId = null; + this.userIp = null; + } + + private PatchRegionInstanceGroupManagerHttpRequest( + String access_token, + String callback, + List fieldMask, + String fields, + String instanceGroupManager, + InstanceGroupManager instanceGroupManagerResource, + 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.instanceGroupManager = instanceGroupManager; + this.instanceGroupManagerResource = instanceGroupManagerResource; + 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("instanceGroupManager")) { + return instanceGroupManager; + } + if (fieldName.equals("instanceGroupManagerResource")) { + return instanceGroupManagerResource; + } + 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 InstanceGroupManager getApiMessageRequestBody() { + return instanceGroupManagerResource; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public List getFieldMask() { + return fieldMask; + } + + public String getFields() { + return fields; + } + + public String getInstanceGroupManager() { + return instanceGroupManager; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + 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(PatchRegionInstanceGroupManagerHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static PatchRegionInstanceGroupManagerHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final PatchRegionInstanceGroupManagerHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new PatchRegionInstanceGroupManagerHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private List fieldMask; + private String fields; + private String instanceGroupManager; + private InstanceGroupManager instanceGroupManagerResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String requestId; + private String userIp; + + Builder() {} + + public Builder mergeFrom(PatchRegionInstanceGroupManagerHttpRequest other) { + if (other == PatchRegionInstanceGroupManagerHttpRequest.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.getInstanceGroupManager() != null) { + this.instanceGroupManager = other.instanceGroupManager; + } + if (other.getInstanceGroupManagerResource() != null) { + this.instanceGroupManagerResource = other.instanceGroupManagerResource; + } + 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(PatchRegionInstanceGroupManagerHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fieldMask = source.fieldMask; + this.fields = source.fields; + this.instanceGroupManager = source.instanceGroupManager; + this.instanceGroupManagerResource = source.instanceGroupManagerResource; + 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 getInstanceGroupManager() { + return instanceGroupManager; + } + + public Builder setInstanceGroupManager(String instanceGroupManager) { + this.instanceGroupManager = instanceGroupManager; + return this; + } + + public InstanceGroupManager getInstanceGroupManagerResource() { + return instanceGroupManagerResource; + } + + public Builder setInstanceGroupManagerResource( + InstanceGroupManager instanceGroupManagerResource) { + this.instanceGroupManagerResource = instanceGroupManagerResource; + 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 PatchRegionInstanceGroupManagerHttpRequest build() { + String missing = ""; + + if (fieldMask == null) { + missing += " fieldMask"; + } + + if (instanceGroupManager == null) { + missing += " instanceGroupManager"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new PatchRegionInstanceGroupManagerHttpRequest( + access_token, + callback, + fieldMask, + fields, + instanceGroupManager, + instanceGroupManagerResource, + 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.setInstanceGroupManager(this.instanceGroupManager); + newBuilder.setInstanceGroupManagerResource(this.instanceGroupManagerResource); + 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 "PatchRegionInstanceGroupManagerHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fieldMask=" + + fieldMask + + ", " + + "fields=" + + fields + + ", " + + "instanceGroupManager=" + + instanceGroupManager + + ", " + + "instanceGroupManagerResource=" + + instanceGroupManagerResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "requestId=" + + requestId + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof PatchRegionInstanceGroupManagerHttpRequest) { + PatchRegionInstanceGroupManagerHttpRequest that = + (PatchRegionInstanceGroupManagerHttpRequest) 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.instanceGroupManager, that.getInstanceGroupManager()) + && Objects.equals( + this.instanceGroupManagerResource, that.getInstanceGroupManagerResource()) + && 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, + instanceGroupManager, + instanceGroupManagerResource, + key, + prettyPrint, + quotaUser, + requestId, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateResourceName.java new file mode 100644 index 000000000000..5823a3f772b3 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectGlobalInstanceTemplateResourceName.java @@ -0,0 +1,167 @@ +/* + * 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 ProjectGlobalInstanceTemplateResourceName implements ResourceName { + private final String project; + private final String resource; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/global/instanceTemplates/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectGlobalInstanceTemplateResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public static ProjectGlobalInstanceTemplateResourceName of(String project, String resource) { + return newBuilder().setProject(project).setResource(resource).build(); + } + + public static String format(String project, String resource) { + return of(project, resource).toString(); + } + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("resource", resource); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectGlobalInstanceTemplateResourceName parse(String formattedString) { + return ProjectGlobalInstanceTemplateResourceName.parse(formattedString); + } + }; + } + + public static ProjectGlobalInstanceTemplateResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectGlobalInstanceTemplateResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String resource; + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder() {} + + public Builder( + ProjectGlobalInstanceTemplateResourceName projectGlobalInstanceTemplateResourceName) { + project = projectGlobalInstanceTemplateResourceName.project; + resource = projectGlobalInstanceTemplateResourceName.resource; + } + + public ProjectGlobalInstanceTemplateResourceName build() { + return new ProjectGlobalInstanceTemplateResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "resource", resource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectGlobalInstanceTemplateResourceName) { + ProjectGlobalInstanceTemplateResourceName that = + (ProjectGlobalInstanceTemplateResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, resource); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateResourceName.java new file mode 100644 index 000000000000..7c9dfd5064e8 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionNodeTemplateResourceName.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 ProjectRegionNodeTemplateResourceName implements ResourceName { + private final String project; + private final String region; + private final String resource; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/nodeTemplates/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionNodeTemplateResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public static ProjectRegionNodeTemplateResourceName of( + String project, String region, String resource) { + return newBuilder().setProject(project).setRegion(region).setResource(resource).build(); + } + + public static String format(String project, String region, String resource) { + return of(project, region, resource).toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResource() { + return resource; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("resource", resource); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionNodeTemplateResourceName parse(String formattedString) { + return ProjectRegionNodeTemplateResourceName.parse(formattedString); + } + }; + } + + public static ProjectRegionNodeTemplateResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionNodeTemplateResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String resource; + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder() {} + + public Builder(ProjectRegionNodeTemplateResourceName projectRegionNodeTemplateResourceName) { + project = projectRegionNodeTemplateResourceName.project; + region = projectRegionNodeTemplateResourceName.region; + resource = projectRegionNodeTemplateResourceName.resource; + } + + public ProjectRegionNodeTemplateResourceName build() { + return new ProjectRegionNodeTemplateResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "resource", resource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionNodeTemplateResourceName) { + ProjectRegionNodeTemplateResourceName that = (ProjectRegionNodeTemplateResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.resource, that.getResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, region, resource); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkResourceName.java new file mode 100644 index 000000000000..b3b187c14eea --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectRegionSubnetworkResourceName.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 ProjectRegionSubnetworkResourceName implements ResourceName { + private final String project; + private final String region; + private final String resource; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/regions/{region}/subnetworks/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectRegionSubnetworkResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + region = Preconditions.checkNotNull(builder.getRegion()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public static ProjectRegionSubnetworkResourceName of( + String project, String region, String resource) { + return newBuilder().setProject(project).setRegion(region).setResource(resource).build(); + } + + public static String format(String project, String region, String resource) { + return of(project, region, resource).toString(); + } + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResource() { + return resource; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("region", region); + fieldMapBuilder.put("resource", resource); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + public static ResourceNameFactory newFactory() { + return new ResourceNameFactory() { + public ProjectRegionSubnetworkResourceName parse(String formattedString) { + return ProjectRegionSubnetworkResourceName.parse(formattedString); + } + }; + } + + public static ProjectRegionSubnetworkResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectRegionSubnetworkResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("region"), matchMap.get("resource")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String region; + private String resource; + + public String getProject() { + return project; + } + + public String getRegion() { + return region; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder() {} + + public Builder(ProjectRegionSubnetworkResourceName projectRegionSubnetworkResourceName) { + project = projectRegionSubnetworkResourceName.project; + region = projectRegionSubnetworkResourceName.region; + resource = projectRegionSubnetworkResourceName.resource; + } + + public ProjectRegionSubnetworkResourceName build() { + return new ProjectRegionSubnetworkResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "region", region, + "resource", resource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectRegionSubnetworkResourceName) { + ProjectRegionSubnetworkResourceName that = (ProjectRegionSubnetworkResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.region, that.getRegion()) + && Objects.equals(this.resource, that.getResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, region, resource); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupResourceName.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupResourceName.java new file mode 100644 index 000000000000..f8e99064acf1 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ProjectZoneNodeGroupResourceName.java @@ -0,0 +1,185 @@ +/* + * 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 ProjectZoneNodeGroupResourceName implements ResourceName { + private final String project; + private final String resource; + private final String zone; + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/zones/{zone}/nodeGroups/{resource}"); + + private volatile Map fieldValuesMap; + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectZoneNodeGroupResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + resource = Preconditions.checkNotNull(builder.getResource()); + zone = Preconditions.checkNotNull(builder.getZone()); + } + + public static ProjectZoneNodeGroupResourceName of(String project, String resource, String zone) { + return newBuilder().setProject(project).setResource(resource).setZone(zone).build(); + } + + public static String format(String project, String resource, String zone) { + return of(project, resource, zone).toString(); + } + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + public String getZone() { + return zone; + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("resource", resource); + 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 ProjectZoneNodeGroupResourceName parse(String formattedString) { + return ProjectZoneNodeGroupResourceName.parse(formattedString); + } + }; + } + + public static ProjectZoneNodeGroupResourceName parse(String formattedString) { + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, + "ProjectZoneNodeGroupResourceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("resource"), matchMap.get("zone")); + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public static class Builder { + private String project; + private String resource; + private String zone; + + public String getProject() { + return project; + } + + public String getResource() { + return resource; + } + + public String getZone() { + return zone; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + private Builder() {} + + public Builder(ProjectZoneNodeGroupResourceName projectZoneNodeGroupResourceName) { + project = projectZoneNodeGroupResourceName.project; + resource = projectZoneNodeGroupResourceName.resource; + zone = projectZoneNodeGroupResourceName.zone; + } + + public ProjectZoneNodeGroupResourceName build() { + return new ProjectZoneNodeGroupResourceName(this); + } + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, + "resource", resource, + "zone", zone); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectZoneNodeGroupResourceName) { + ProjectZoneNodeGroupResourceName that = (ProjectZoneNodeGroupResourceName) o; + return Objects.equals(this.project, that.getProject()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.zone, that.getZone()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(project, resource, zone); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java index e097edc4fd7d..3667817a8bb5 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClient.java @@ -1091,6 +1091,156 @@ public final ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGrou return stub.listManagedInstancesRegionInstanceGroupManagersCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listmanagedinstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   Operation response = regionInstanceGroupManagerClient.patchRegionInstanceGroupManager(instanceGroupManager, instanceGroupManagerResource, fieldMask);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the instance group manager. + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + * @param fieldMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionInstanceGroupManager( + ProjectRegionInstanceGroupManagerName instanceGroupManager, + InstanceGroupManager instanceGroupManagerResource, + List fieldMask) { + + PatchRegionInstanceGroupManagerHttpRequest request = + PatchRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager( + instanceGroupManager == null ? null : instanceGroupManager.toString()) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .addAllFieldMask(fieldMask) + .build(); + return patchRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listmanagedinstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   Operation response = regionInstanceGroupManagerClient.patchRegionInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagerResource, fieldMask);
+   * }
+   * 
+ * + * @param instanceGroupManager The name of the instance group manager. + * @param instanceGroupManagerResource An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== + * resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + * @param fieldMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Operation patchRegionInstanceGroupManager( + String instanceGroupManager, + InstanceGroupManager instanceGroupManagerResource, + List fieldMask) { + + PatchRegionInstanceGroupManagerHttpRequest request = + PatchRegionInstanceGroupManagerHttpRequest.newBuilder() + .setInstanceGroupManager(instanceGroupManager) + .setInstanceGroupManagerResource(instanceGroupManagerResource) + .addAllFieldMask(fieldMask) + .build(); + return patchRegionInstanceGroupManager(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listmanagedinstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   PatchRegionInstanceGroupManagerHttpRequest request = PatchRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .addAllFieldMask(fieldMask)
+   *     .build();
+   *   Operation response = regionInstanceGroupManagerClient.patchRegionInstanceGroupManager(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 patchRegionInstanceGroupManager( + PatchRegionInstanceGroupManagerHttpRequest request) { + return patchRegionInstanceGroupManagerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a managed instance group using the information that you specify in the request. This + * operation is marked as DONE when the group is patched even if the instances in the group are + * still in the process of being patched. You must separately verify the status of the individual + * instances with the listmanagedinstances method. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * + *

Sample code: + * + *


+   * try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
+   *   ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
+   *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
+   *   List<String> fieldMask = new ArrayList<>();
+   *   PatchRegionInstanceGroupManagerHttpRequest request = PatchRegionInstanceGroupManagerHttpRequest.newBuilder()
+   *     .setInstanceGroupManager(instanceGroupManager.toString())
+   *     .setInstanceGroupManagerResource(instanceGroupManagerResource)
+   *     .addAllFieldMask(fieldMask)
+   *     .build();
+   *   ApiFuture<Operation> future = regionInstanceGroupManagerClient.patchRegionInstanceGroupManagerCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + patchRegionInstanceGroupManagerCallable() { + return stub.patchRegionInstanceGroupManagerCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Flags the specified instances in the managed instance group to be immediately recreated. The diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java index 7785e7bca780..2d36e19845b6 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerSettings.java @@ -127,6 +127,13 @@ public class RegionInstanceGroupManagerSettings .listManagedInstancesRegionInstanceGroupManagersSettings(); } + /** Returns the object with the settings used for calls to patchRegionInstanceGroupManager. */ + public UnaryCallSettings + patchRegionInstanceGroupManagerSettings() { + return ((RegionInstanceGroupManagerStubSettings) getStubSettings()) + .patchRegionInstanceGroupManagerSettings(); + } + /** * Returns the object with the settings used for calls to * recreateInstancesRegionInstanceGroupManager. @@ -325,6 +332,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().listManagedInstancesRegionInstanceGroupManagersSettings(); } + /** Returns the builder for the settings used for calls to patchRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + patchRegionInstanceGroupManagerSettings() { + return getStubSettingsBuilder().patchRegionInstanceGroupManagerSettings(); + } + /** * Returns the builder for the settings used for calls to * recreateInstancesRegionInstanceGroupManager. diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java index 8acfbaa6bf27..04b9e47db07b 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterClient.java @@ -485,6 +485,146 @@ public final UnaryCallable getRouterCallable() { return stub.getRouterCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + *

Sample code: + * + *


+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   for (VmEndpointNatMappings element : routerClient.getNatMappingInfoRouters(router).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param router Name of the Router resource to query for Nat Mapping information of VM endpoints. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final GetNatMappingInfoRoutersPagedResponse getNatMappingInfoRouters( + ProjectRegionRouterName router) { + GetNatMappingInfoRoutersHttpRequest request = + GetNatMappingInfoRoutersHttpRequest.newBuilder() + .setRouter(router == null ? null : router.toString()) + .build(); + return getNatMappingInfoRouters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + *

Sample code: + * + *


+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   for (VmEndpointNatMappings element : routerClient.getNatMappingInfoRouters(router.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param router Name of the Router resource to query for Nat Mapping information of VM endpoints. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final GetNatMappingInfoRoutersPagedResponse getNatMappingInfoRouters(String router) { + GetNatMappingInfoRoutersHttpRequest request = + GetNatMappingInfoRoutersHttpRequest.newBuilder().setRouter(router).build(); + return getNatMappingInfoRouters(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + *

Sample code: + * + *


+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetNatMappingInfoRoutersHttpRequest request = GetNatMappingInfoRoutersHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   for (VmEndpointNatMappings element : routerClient.getNatMappingInfoRouters(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 GetNatMappingInfoRoutersPagedResponse getNatMappingInfoRouters( + GetNatMappingInfoRoutersHttpRequest request) { + return getNatMappingInfoRoutersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + *

Sample code: + * + *


+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetNatMappingInfoRoutersHttpRequest request = GetNatMappingInfoRoutersHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   ApiFuture<GetNatMappingInfoRoutersPagedResponse> future = routerClient.getNatMappingInfoRoutersPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (VmEndpointNatMappings element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable< + GetNatMappingInfoRoutersHttpRequest, GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersPagedCallable() { + return stub.getNatMappingInfoRoutersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + *

Sample code: + * + *


+   * try (RouterClient routerClient = RouterClient.create()) {
+   *   ProjectRegionRouterName router = ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]");
+   *   GetNatMappingInfoRoutersHttpRequest request = GetNatMappingInfoRoutersHttpRequest.newBuilder()
+   *     .setRouter(router.toString())
+   *     .build();
+   *   while (true) {
+   *     VmEndpointNatMappingsList response = routerClient.getNatMappingInfoRoutersCallable().call(request);
+   *     for (VmEndpointNatMappings element : response.getResultList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getNatMappingInfoRoutersCallable() { + return stub.getNatMappingInfoRoutersCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Retrieves runtime information of the specified router. @@ -1310,6 +1450,106 @@ protected AggregatedListRoutersFixedSizeCollection createCollection( } } + public static class GetNatMappingInfoRoutersPagedResponse + extends AbstractPagedListResponse< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings, + GetNatMappingInfoRoutersPage, + GetNatMappingInfoRoutersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + GetNatMappingInfoRoutersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public GetNatMappingInfoRoutersPagedResponse apply(GetNatMappingInfoRoutersPage input) { + return new GetNatMappingInfoRoutersPagedResponse(input); + } + }); + } + + private GetNatMappingInfoRoutersPagedResponse(GetNatMappingInfoRoutersPage page) { + super(page, GetNatMappingInfoRoutersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class GetNatMappingInfoRoutersPage + extends AbstractPage< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings, + GetNatMappingInfoRoutersPage> { + + private GetNatMappingInfoRoutersPage( + PageContext< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings> + context, + VmEndpointNatMappingsList response) { + super(context, response); + } + + private static GetNatMappingInfoRoutersPage createEmptyPage() { + return new GetNatMappingInfoRoutersPage(null, null); + } + + @Override + protected GetNatMappingInfoRoutersPage createPage( + PageContext< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings> + context, + VmEndpointNatMappingsList response) { + return new GetNatMappingInfoRoutersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class GetNatMappingInfoRoutersFixedSizeCollection + extends AbstractFixedSizeCollection< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings, + GetNatMappingInfoRoutersPage, + GetNatMappingInfoRoutersFixedSizeCollection> { + + private GetNatMappingInfoRoutersFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static GetNatMappingInfoRoutersFixedSizeCollection createEmptyCollection() { + return new GetNatMappingInfoRoutersFixedSizeCollection(null, 0); + } + + @Override + protected GetNatMappingInfoRoutersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new GetNatMappingInfoRoutersFixedSizeCollection(pages, collectionSize); + } + } + public static class ListRoutersPagedResponse extends AbstractPagedListResponse< ListRoutersHttpRequest, diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java index f062c94db846..5683f0663da9 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RouterSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.compute.v1; import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.GetNatMappingInfoRoutersPagedResponse; import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.api.core.ApiFunction; @@ -83,6 +84,15 @@ public UnaryCallSettings getRouterSettings() { return ((RouterStubSettings) getStubSettings()).getRouterSettings(); } + /** Returns the object with the settings used for calls to getNatMappingInfoRouters. */ + public PagedCallSettings< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersSettings() { + return ((RouterStubSettings) getStubSettings()).getNatMappingInfoRoutersSettings(); + } + /** Returns the object with the settings used for calls to getRouterStatusRouter. */ public UnaryCallSettings getRouterStatusRouterSettings() { @@ -236,6 +246,15 @@ public UnaryCallSettings.Builder getRouterSettings return getStubSettingsBuilder().getRouterSettings(); } + /** Returns the builder for the settings used for calls to getNatMappingInfoRouters. */ + public PagedCallSettings.Builder< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersSettings() { + return getStubSettingsBuilder().getNatMappingInfoRoutersSettings(); + } + /** Returns the builder for the settings used for calls to getRouterStatusRouter. */ public UnaryCallSettings.Builder getRouterStatusRouterSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyDiskHttpRequest.java new file mode 100644 index 000000000000..389def9aa79b --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyDiskHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyDiskHttpRequest 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 resource; + private final String userIp; + private final ZoneSetPolicyRequest zoneSetPolicyRequestResource; + + private SetIamPolicyDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + this.zoneSetPolicyRequestResource = null; + } + + private SetIamPolicyDiskHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp, + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.userIp = userIp; + this.zoneSetPolicyRequestResource = zoneSetPolicyRequestResource; + } + + @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("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + if (fieldName.equals("zoneSetPolicyRequestResource")) { + return zoneSetPolicyRequestResource; + } + return null; + } + + @Nullable + @Override + public ZoneSetPolicyRequest getApiMessageRequestBody() { + return zoneSetPolicyRequestResource; + } + + @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 getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public ZoneSetPolicyRequest getZoneSetPolicyRequestResource() { + return zoneSetPolicyRequestResource; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyDiskHttpRequest(); + } + + 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 resource; + private String userIp; + private ZoneSetPolicyRequest zoneSetPolicyRequestResource; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyDiskHttpRequest other) { + if (other == SetIamPolicyDiskHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZoneSetPolicyRequestResource() != null) { + this.zoneSetPolicyRequestResource = other.zoneSetPolicyRequestResource; + } + return this; + } + + Builder(SetIamPolicyDiskHttpRequest 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.resource = source.resource; + this.userIp = source.userIp; + this.zoneSetPolicyRequestResource = source.zoneSetPolicyRequestResource; + } + + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ZoneSetPolicyRequest getZoneSetPolicyRequestResource() { + return zoneSetPolicyRequestResource; + } + + public Builder setZoneSetPolicyRequestResource( + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + this.zoneSetPolicyRequestResource = zoneSetPolicyRequestResource; + return this; + } + + public SetIamPolicyDiskHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyDiskHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + userIp, + zoneSetPolicyRequestResource); + } + + 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + newBuilder.setZoneSetPolicyRequestResource(this.zoneSetPolicyRequestResource); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + ", " + + "zoneSetPolicyRequestResource=" + + zoneSetPolicyRequestResource + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyDiskHttpRequest) { + SetIamPolicyDiskHttpRequest that = (SetIamPolicyDiskHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals( + this.zoneSetPolicyRequestResource, that.getZoneSetPolicyRequestResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + userIp, + zoneSetPolicyRequestResource); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyImageHttpRequest.java new file mode 100644 index 000000000000..f7f557ef676a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyImageHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyImageHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final GlobalSetPolicyRequest globalSetPolicyRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final String userIp; + + private SetIamPolicyImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.globalSetPolicyRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private SetIamPolicyImageHttpRequest( + String access_token, + String callback, + String fields, + GlobalSetPolicyRequest globalSetPolicyRequestResource, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("globalSetPolicyRequestResource")) { + return globalSetPolicyRequestResource; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public GlobalSetPolicyRequest getApiMessageRequestBody() { + return globalSetPolicyRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyImageHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyImageHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private GlobalSetPolicyRequest globalSetPolicyRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyImageHttpRequest other) { + if (other == SetIamPolicyImageHttpRequest.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.getGlobalSetPolicyRequestResource() != null) { + this.globalSetPolicyRequestResource = other.globalSetPolicyRequestResource; + } + 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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetIamPolicyImageHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.globalSetPolicyRequestResource = source.globalSetPolicyRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + 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 GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public Builder setGlobalSetPolicyRequestResource( + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetIamPolicyImageHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyImageHttpRequest( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setGlobalSetPolicyRequestResource(this.globalSetPolicyRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyImageHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "globalSetPolicyRequestResource=" + + globalSetPolicyRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyImageHttpRequest) { + SetIamPolicyImageHttpRequest that = (SetIamPolicyImageHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.globalSetPolicyRequestResource, that.getGlobalSetPolicyRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceHttpRequest.java new file mode 100644 index 000000000000..4aff23508dd4 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyInstanceHttpRequest 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 resource; + private final String userIp; + private final ZoneSetPolicyRequest zoneSetPolicyRequestResource; + + private SetIamPolicyInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + this.zoneSetPolicyRequestResource = null; + } + + private SetIamPolicyInstanceHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp, + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.userIp = userIp; + this.zoneSetPolicyRequestResource = zoneSetPolicyRequestResource; + } + + @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("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + if (fieldName.equals("zoneSetPolicyRequestResource")) { + return zoneSetPolicyRequestResource; + } + return null; + } + + @Nullable + @Override + public ZoneSetPolicyRequest getApiMessageRequestBody() { + return zoneSetPolicyRequestResource; + } + + @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 getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public ZoneSetPolicyRequest getZoneSetPolicyRequestResource() { + return zoneSetPolicyRequestResource; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyInstanceHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyInstanceHttpRequest(); + } + + 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 resource; + private String userIp; + private ZoneSetPolicyRequest zoneSetPolicyRequestResource; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyInstanceHttpRequest other) { + if (other == SetIamPolicyInstanceHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZoneSetPolicyRequestResource() != null) { + this.zoneSetPolicyRequestResource = other.zoneSetPolicyRequestResource; + } + return this; + } + + Builder(SetIamPolicyInstanceHttpRequest 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.resource = source.resource; + this.userIp = source.userIp; + this.zoneSetPolicyRequestResource = source.zoneSetPolicyRequestResource; + } + + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ZoneSetPolicyRequest getZoneSetPolicyRequestResource() { + return zoneSetPolicyRequestResource; + } + + public Builder setZoneSetPolicyRequestResource( + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + this.zoneSetPolicyRequestResource = zoneSetPolicyRequestResource; + return this; + } + + public SetIamPolicyInstanceHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyInstanceHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + userIp, + zoneSetPolicyRequestResource); + } + + 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + newBuilder.setZoneSetPolicyRequestResource(this.zoneSetPolicyRequestResource); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyInstanceHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + ", " + + "zoneSetPolicyRequestResource=" + + zoneSetPolicyRequestResource + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyInstanceHttpRequest) { + SetIamPolicyInstanceHttpRequest that = (SetIamPolicyInstanceHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals( + this.zoneSetPolicyRequestResource, that.getZoneSetPolicyRequestResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + userIp, + zoneSetPolicyRequestResource); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceTemplateHttpRequest.java new file mode 100644 index 000000000000..49fbf6e4d6aa --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyInstanceTemplateHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyInstanceTemplateHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final GlobalSetPolicyRequest globalSetPolicyRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final String userIp; + + private SetIamPolicyInstanceTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.globalSetPolicyRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private SetIamPolicyInstanceTemplateHttpRequest( + String access_token, + String callback, + String fields, + GlobalSetPolicyRequest globalSetPolicyRequestResource, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("globalSetPolicyRequestResource")) { + return globalSetPolicyRequestResource; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public GlobalSetPolicyRequest getApiMessageRequestBody() { + return globalSetPolicyRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyInstanceTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyInstanceTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyInstanceTemplateHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyInstanceTemplateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private GlobalSetPolicyRequest globalSetPolicyRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyInstanceTemplateHttpRequest other) { + if (other == SetIamPolicyInstanceTemplateHttpRequest.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.getGlobalSetPolicyRequestResource() != null) { + this.globalSetPolicyRequestResource = other.globalSetPolicyRequestResource; + } + 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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetIamPolicyInstanceTemplateHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.globalSetPolicyRequestResource = source.globalSetPolicyRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + 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 GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public Builder setGlobalSetPolicyRequestResource( + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetIamPolicyInstanceTemplateHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyInstanceTemplateHttpRequest( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setGlobalSetPolicyRequestResource(this.globalSetPolicyRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyInstanceTemplateHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "globalSetPolicyRequestResource=" + + globalSetPolicyRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyInstanceTemplateHttpRequest) { + SetIamPolicyInstanceTemplateHttpRequest that = (SetIamPolicyInstanceTemplateHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.globalSetPolicyRequestResource, that.getGlobalSetPolicyRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyLicenseHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyLicenseHttpRequest.java new file mode 100644 index 000000000000..e13806209ef0 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyLicenseHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyLicenseHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final GlobalSetPolicyRequest globalSetPolicyRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final String userIp; + + private SetIamPolicyLicenseHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.globalSetPolicyRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private SetIamPolicyLicenseHttpRequest( + String access_token, + String callback, + String fields, + GlobalSetPolicyRequest globalSetPolicyRequestResource, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("globalSetPolicyRequestResource")) { + return globalSetPolicyRequestResource; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public GlobalSetPolicyRequest getApiMessageRequestBody() { + return globalSetPolicyRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyLicenseHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyLicenseHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyLicenseHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyLicenseHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private GlobalSetPolicyRequest globalSetPolicyRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyLicenseHttpRequest other) { + if (other == SetIamPolicyLicenseHttpRequest.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.getGlobalSetPolicyRequestResource() != null) { + this.globalSetPolicyRequestResource = other.globalSetPolicyRequestResource; + } + 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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetIamPolicyLicenseHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.globalSetPolicyRequestResource = source.globalSetPolicyRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + 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 GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public Builder setGlobalSetPolicyRequestResource( + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetIamPolicyLicenseHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyLicenseHttpRequest( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setGlobalSetPolicyRequestResource(this.globalSetPolicyRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyLicenseHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "globalSetPolicyRequestResource=" + + globalSetPolicyRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyLicenseHttpRequest) { + SetIamPolicyLicenseHttpRequest that = (SetIamPolicyLicenseHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.globalSetPolicyRequestResource, that.getGlobalSetPolicyRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeGroupHttpRequest.java new file mode 100644 index 000000000000..273485b10c8c --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeGroupHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyNodeGroupHttpRequest 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 resource; + private final String userIp; + private final ZoneSetPolicyRequest zoneSetPolicyRequestResource; + + private SetIamPolicyNodeGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + this.zoneSetPolicyRequestResource = null; + } + + private SetIamPolicyNodeGroupHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp, + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.userIp = userIp; + this.zoneSetPolicyRequestResource = zoneSetPolicyRequestResource; + } + + @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("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + if (fieldName.equals("zoneSetPolicyRequestResource")) { + return zoneSetPolicyRequestResource; + } + return null; + } + + @Nullable + @Override + public ZoneSetPolicyRequest getApiMessageRequestBody() { + return zoneSetPolicyRequestResource; + } + + @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 getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public ZoneSetPolicyRequest getZoneSetPolicyRequestResource() { + return zoneSetPolicyRequestResource; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyNodeGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyNodeGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyNodeGroupHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyNodeGroupHttpRequest(); + } + + 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 resource; + private String userIp; + private ZoneSetPolicyRequest zoneSetPolicyRequestResource; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyNodeGroupHttpRequest other) { + if (other == SetIamPolicyNodeGroupHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + if (other.getZoneSetPolicyRequestResource() != null) { + this.zoneSetPolicyRequestResource = other.zoneSetPolicyRequestResource; + } + return this; + } + + Builder(SetIamPolicyNodeGroupHttpRequest 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.resource = source.resource; + this.userIp = source.userIp; + this.zoneSetPolicyRequestResource = source.zoneSetPolicyRequestResource; + } + + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public ZoneSetPolicyRequest getZoneSetPolicyRequestResource() { + return zoneSetPolicyRequestResource; + } + + public Builder setZoneSetPolicyRequestResource( + ZoneSetPolicyRequest zoneSetPolicyRequestResource) { + this.zoneSetPolicyRequestResource = zoneSetPolicyRequestResource; + return this; + } + + public SetIamPolicyNodeGroupHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyNodeGroupHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + userIp, + zoneSetPolicyRequestResource); + } + + 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.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + newBuilder.setZoneSetPolicyRequestResource(this.zoneSetPolicyRequestResource); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyNodeGroupHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + ", " + + "zoneSetPolicyRequestResource=" + + zoneSetPolicyRequestResource + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyNodeGroupHttpRequest) { + SetIamPolicyNodeGroupHttpRequest that = (SetIamPolicyNodeGroupHttpRequest) 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.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()) + && Objects.equals( + this.zoneSetPolicyRequestResource, that.getZoneSetPolicyRequestResource()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + userIp, + zoneSetPolicyRequestResource); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeTemplateHttpRequest.java new file mode 100644 index 000000000000..95908ad38da4 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicyNodeTemplateHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicyNodeTemplateHttpRequest 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 RegionSetPolicyRequest regionSetPolicyRequestResource; + private final String resource; + private final String userIp; + + private SetIamPolicyNodeTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionSetPolicyRequestResource = null; + this.resource = null; + this.userIp = null; + } + + private SetIamPolicyNodeTemplateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + RegionSetPolicyRequest regionSetPolicyRequestResource, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionSetPolicyRequestResource = regionSetPolicyRequestResource; + this.resource = resource; + 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("regionSetPolicyRequestResource")) { + return regionSetPolicyRequestResource; + } + if (fieldName.equals("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public RegionSetPolicyRequest getApiMessageRequestBody() { + return regionSetPolicyRequestResource; + } + + @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 RegionSetPolicyRequest getRegionSetPolicyRequestResource() { + return regionSetPolicyRequestResource; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicyNodeTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicyNodeTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicyNodeTemplateHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicyNodeTemplateHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionSetPolicyRequest regionSetPolicyRequestResource; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetIamPolicyNodeTemplateHttpRequest other) { + if (other == SetIamPolicyNodeTemplateHttpRequest.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.getRegionSetPolicyRequestResource() != null) { + this.regionSetPolicyRequestResource = other.regionSetPolicyRequestResource; + } + if (other.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetIamPolicyNodeTemplateHttpRequest 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.regionSetPolicyRequestResource = source.regionSetPolicyRequestResource; + this.resource = source.resource; + 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 RegionSetPolicyRequest getRegionSetPolicyRequestResource() { + return regionSetPolicyRequestResource; + } + + public Builder setRegionSetPolicyRequestResource( + RegionSetPolicyRequest regionSetPolicyRequestResource) { + this.regionSetPolicyRequestResource = regionSetPolicyRequestResource; + return this; + } + + public String getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetIamPolicyNodeTemplateHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicyNodeTemplateHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + regionSetPolicyRequestResource, + resource, + 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.setRegionSetPolicyRequestResource(this.regionSetPolicyRequestResource); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicyNodeTemplateHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionSetPolicyRequestResource=" + + regionSetPolicyRequestResource + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicyNodeTemplateHttpRequest) { + SetIamPolicyNodeTemplateHttpRequest that = (SetIamPolicyNodeTemplateHttpRequest) 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.regionSetPolicyRequestResource, that.getRegionSetPolicyRequestResource()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + regionSetPolicyRequestResource, + resource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySnapshotHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySnapshotHttpRequest.java new file mode 100644 index 000000000000..2fa5e5e4e011 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySnapshotHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicySnapshotHttpRequest implements ApiMessage { + private final String access_token; + private final String callback; + private final String fields; + private final GlobalSetPolicyRequest globalSetPolicyRequestResource; + private final String key; + private final String prettyPrint; + private final String quotaUser; + private final String resource; + private final String userIp; + + private SetIamPolicySnapshotHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.globalSetPolicyRequestResource = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.userIp = null; + } + + private SetIamPolicySnapshotHttpRequest( + String access_token, + String callback, + String fields, + GlobalSetPolicyRequest globalSetPolicyRequestResource, + String key, + String prettyPrint, + String quotaUser, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + 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("globalSetPolicyRequestResource")) { + return globalSetPolicyRequestResource; + } + if (fieldName.equals("key")) { + return key; + } + if (fieldName.equals("prettyPrint")) { + return prettyPrint; + } + if (fieldName.equals("quotaUser")) { + return quotaUser; + } + if (fieldName.equals("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public GlobalSetPolicyRequest getApiMessageRequestBody() { + return globalSetPolicyRequestResource; + } + + @Nullable + @Override + public List getFieldMask() { + return null; + } + + public String getAccessToken() { + return access_token; + } + + public String getCallback() { + return callback; + } + + public String getFields() { + return fields; + } + + public GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public String getKey() { + return key; + } + + public String getPrettyPrint() { + return prettyPrint; + } + + public String getQuotaUser() { + return quotaUser; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicySnapshotHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicySnapshotHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicySnapshotHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicySnapshotHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private GlobalSetPolicyRequest globalSetPolicyRequestResource; + private String key; + private String prettyPrint; + private String quotaUser; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetIamPolicySnapshotHttpRequest other) { + if (other == SetIamPolicySnapshotHttpRequest.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.getGlobalSetPolicyRequestResource() != null) { + this.globalSetPolicyRequestResource = other.globalSetPolicyRequestResource; + } + 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.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetIamPolicySnapshotHttpRequest source) { + this.access_token = source.access_token; + this.callback = source.callback; + this.fields = source.fields; + this.globalSetPolicyRequestResource = source.globalSetPolicyRequestResource; + this.key = source.key; + this.prettyPrint = source.prettyPrint; + this.quotaUser = source.quotaUser; + this.resource = source.resource; + 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 GlobalSetPolicyRequest getGlobalSetPolicyRequestResource() { + return globalSetPolicyRequestResource; + } + + public Builder setGlobalSetPolicyRequestResource( + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + this.globalSetPolicyRequestResource = globalSetPolicyRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetIamPolicySnapshotHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicySnapshotHttpRequest( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } + + public Builder clone() { + Builder newBuilder = new Builder(); + newBuilder.setAccessToken(this.access_token); + newBuilder.setCallback(this.callback); + newBuilder.setFields(this.fields); + newBuilder.setGlobalSetPolicyRequestResource(this.globalSetPolicyRequestResource); + newBuilder.setKey(this.key); + newBuilder.setPrettyPrint(this.prettyPrint); + newBuilder.setQuotaUser(this.quotaUser); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicySnapshotHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "globalSetPolicyRequestResource=" + + globalSetPolicyRequestResource + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicySnapshotHttpRequest) { + SetIamPolicySnapshotHttpRequest that = (SetIamPolicySnapshotHttpRequest) o; + return Objects.equals(this.access_token, that.getAccessToken()) + && Objects.equals(this.callback, that.getCallback()) + && Objects.equals(this.fields, that.getFields()) + && Objects.equals( + this.globalSetPolicyRequestResource, that.getGlobalSetPolicyRequestResource()) + && Objects.equals(this.key, that.getKey()) + && Objects.equals(this.prettyPrint, that.getPrettyPrint()) + && Objects.equals(this.quotaUser, that.getQuotaUser()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + globalSetPolicyRequestResource, + key, + prettyPrint, + quotaUser, + resource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySubnetworkHttpRequest.java new file mode 100644 index 000000000000..e3550ff4978a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SetIamPolicySubnetworkHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 SetIamPolicySubnetworkHttpRequest 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 RegionSetPolicyRequest regionSetPolicyRequestResource; + private final String resource; + private final String userIp; + + private SetIamPolicySubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.regionSetPolicyRequestResource = null; + this.resource = null; + this.userIp = null; + } + + private SetIamPolicySubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + RegionSetPolicyRequest regionSetPolicyRequestResource, + String resource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.regionSetPolicyRequestResource = regionSetPolicyRequestResource; + this.resource = resource; + 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("regionSetPolicyRequestResource")) { + return regionSetPolicyRequestResource; + } + if (fieldName.equals("resource")) { + return resource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public RegionSetPolicyRequest getApiMessageRequestBody() { + return regionSetPolicyRequestResource; + } + + @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 RegionSetPolicyRequest getRegionSetPolicyRequestResource() { + return regionSetPolicyRequestResource; + } + + public String getResource() { + return resource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(SetIamPolicySubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static SetIamPolicySubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final SetIamPolicySubnetworkHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new SetIamPolicySubnetworkHttpRequest(); + } + + public static class Builder { + private String access_token; + private String callback; + private String fields; + private String key; + private String prettyPrint; + private String quotaUser; + private RegionSetPolicyRequest regionSetPolicyRequestResource; + private String resource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(SetIamPolicySubnetworkHttpRequest other) { + if (other == SetIamPolicySubnetworkHttpRequest.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.getRegionSetPolicyRequestResource() != null) { + this.regionSetPolicyRequestResource = other.regionSetPolicyRequestResource; + } + if (other.getResource() != null) { + this.resource = other.resource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(SetIamPolicySubnetworkHttpRequest 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.regionSetPolicyRequestResource = source.regionSetPolicyRequestResource; + this.resource = source.resource; + 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 RegionSetPolicyRequest getRegionSetPolicyRequestResource() { + return regionSetPolicyRequestResource; + } + + public Builder setRegionSetPolicyRequestResource( + RegionSetPolicyRequest regionSetPolicyRequestResource) { + this.regionSetPolicyRequestResource = regionSetPolicyRequestResource; + return this; + } + + public String getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public SetIamPolicySubnetworkHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new SetIamPolicySubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + regionSetPolicyRequestResource, + resource, + 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.setRegionSetPolicyRequestResource(this.regionSetPolicyRequestResource); + newBuilder.setResource(this.resource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "SetIamPolicySubnetworkHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "regionSetPolicyRequestResource=" + + regionSetPolicyRequestResource + + ", " + + "resource=" + + resource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SetIamPolicySubnetworkHttpRequest) { + SetIamPolicySubnetworkHttpRequest that = (SetIamPolicySubnetworkHttpRequest) 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.regionSetPolicyRequestResource, that.getRegionSetPolicyRequestResource()) + && Objects.equals(this.resource, that.getResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + regionSetPolicyRequestResource, + resource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java index 83fc974dd78e..378d2766954c 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotClient.java @@ -368,6 +368,108 @@ public final UnaryCallable getSnapshotCallable return stub.getSnapshotCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = snapshotClient.getIamPolicySnapshot(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicySnapshot(ProjectGlobalSnapshotResourceName resource) { + + GetIamPolicySnapshotHttpRequest request = + GetIamPolicySnapshotHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicySnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   Policy response = snapshotClient.getIamPolicySnapshot(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicySnapshot(String resource) { + + GetIamPolicySnapshotHttpRequest request = + GetIamPolicySnapshotHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicySnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicySnapshotHttpRequest request = GetIamPolicySnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = snapshotClient.getIamPolicySnapshot(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 Policy getIamPolicySnapshot(GetIamPolicySnapshotHttpRequest request) { + return getIamPolicySnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GetIamPolicySnapshotHttpRequest request = GetIamPolicySnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = snapshotClient.getIamPolicySnapshotCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getIamPolicySnapshotCallable() { + return stub.getIamPolicySnapshotCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Retrieves the list of Snapshot resources contained within the specified project. @@ -504,6 +606,119 @@ public final UnaryCallable listSnapshots return stub.listSnapshotsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = snapshotClient.setIamPolicySnapshot(resource, globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicySnapshot( + ProjectGlobalSnapshotResourceName resource, + GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicySnapshotHttpRequest request = + SetIamPolicySnapshotHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicySnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   Policy response = snapshotClient.setIamPolicySnapshot(resource.toString(), globalSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param globalSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicySnapshot( + String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource) { + + SetIamPolicySnapshotHttpRequest request = + SetIamPolicySnapshotHttpRequest.newBuilder() + .setResource(resource) + .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource) + .build(); + return setIamPolicySnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicySnapshotHttpRequest request = SetIamPolicySnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = snapshotClient.setIamPolicySnapshot(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 Policy setIamPolicySnapshot(SetIamPolicySnapshotHttpRequest request) { + return setIamPolicySnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicySnapshotHttpRequest request = SetIamPolicySnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setGlobalSetPolicyRequestResource(globalSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = snapshotClient.setIamPolicySnapshotCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setIamPolicySnapshotCallable() { + return stub.setIamPolicySnapshotCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources @@ -620,6 +835,120 @@ public final UnaryCallable setLabelsSna return stub.setLabelsSnapshotCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = snapshotClient.testIamPermissionsSnapshot(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsSnapshot( + ProjectGlobalSnapshotResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsSnapshotHttpRequest request = + TestIamPermissionsSnapshotHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = snapshotClient.testIamPermissionsSnapshot(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsSnapshot( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsSnapshotHttpRequest request = + TestIamPermissionsSnapshotHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsSnapshotHttpRequest request = TestIamPermissionsSnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = snapshotClient.testIamPermissionsSnapshot(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 TestPermissionsResponse testIamPermissionsSnapshot( + TestIamPermissionsSnapshotHttpRequest request) { + return testIamPermissionsSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SnapshotClient snapshotClient = SnapshotClient.create()) {
+   *   ProjectGlobalSnapshotResourceName resource = ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsSnapshotHttpRequest request = TestIamPermissionsSnapshotHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = snapshotClient.testIamPermissionsSnapshotCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsSnapshotCallable() { + return stub.testIamPermissionsSnapshotCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java index a34412a40b85..c70e9ce389b0 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SnapshotSettings.java @@ -73,17 +73,33 @@ public UnaryCallSettings getSnapshotSettings() return ((SnapshotStubSettings) getStubSettings()).getSnapshotSettings(); } + /** Returns the object with the settings used for calls to getIamPolicySnapshot. */ + public UnaryCallSettings getIamPolicySnapshotSettings() { + return ((SnapshotStubSettings) getStubSettings()).getIamPolicySnapshotSettings(); + } + /** Returns the object with the settings used for calls to listSnapshots. */ public PagedCallSettings listSnapshotsSettings() { return ((SnapshotStubSettings) getStubSettings()).listSnapshotsSettings(); } + /** Returns the object with the settings used for calls to setIamPolicySnapshot. */ + public UnaryCallSettings setIamPolicySnapshotSettings() { + return ((SnapshotStubSettings) getStubSettings()).setIamPolicySnapshotSettings(); + } + /** Returns the object with the settings used for calls to setLabelsSnapshot. */ public UnaryCallSettings setLabelsSnapshotSettings() { return ((SnapshotStubSettings) getStubSettings()).setLabelsSnapshotSettings(); } + /** Returns the object with the settings used for calls to testIamPermissionsSnapshot. */ + public UnaryCallSettings + testIamPermissionsSnapshotSettings() { + return ((SnapshotStubSettings) getStubSettings()).testIamPermissionsSnapshotSettings(); + } + public static final SnapshotSettings create(SnapshotStubSettings stub) throws IOException { return new SnapshotSettings.Builder(stub.toBuilder()).build(); } @@ -196,6 +212,12 @@ public UnaryCallSettings.Builder getSnapshotSe return getStubSettingsBuilder().getSnapshotSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicySnapshot. */ + public UnaryCallSettings.Builder + getIamPolicySnapshotSettings() { + return getStubSettingsBuilder().getIamPolicySnapshotSettings(); + } + /** Returns the builder for the settings used for calls to listSnapshots. */ public PagedCallSettings.Builder< ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> @@ -203,12 +225,24 @@ public UnaryCallSettings.Builder getSnapshotSe return getStubSettingsBuilder().listSnapshotsSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicySnapshot. */ + public UnaryCallSettings.Builder + setIamPolicySnapshotSettings() { + return getStubSettingsBuilder().setIamPolicySnapshotSettings(); + } + /** Returns the builder for the settings used for calls to setLabelsSnapshot. */ public UnaryCallSettings.Builder setLabelsSnapshotSettings() { return getStubSettingsBuilder().setLabelsSnapshotSettings(); } + /** Returns the builder for the settings used for calls to testIamPermissionsSnapshot. */ + public UnaryCallSettings.Builder + testIamPermissionsSnapshotSettings() { + return getStubSettingsBuilder().testIamPermissionsSnapshotSettings(); + } + @Override public SnapshotSettings build() throws IOException { return new SnapshotSettings(this); 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 26b13decb193..f4c331ec7472 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 @@ -601,6 +601,108 @@ public final UnaryCallable getSubnetworkCa return stub.getSubnetworkCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   Policy response = subnetworkClient.getIamPolicySubnetwork(resource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicySubnetwork(ProjectRegionSubnetworkResourceName resource) { + + GetIamPolicySubnetworkHttpRequest request = + GetIamPolicySubnetworkHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicySubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   Policy response = subnetworkClient.getIamPolicySubnetwork(resource.toString());
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy getIamPolicySubnetwork(String resource) { + + GetIamPolicySubnetworkHttpRequest request = + GetIamPolicySubnetworkHttpRequest.newBuilder().setResource(resource).build(); + return getIamPolicySubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   GetIamPolicySubnetworkHttpRequest request = GetIamPolicySubnetworkHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = subnetworkClient.getIamPolicySubnetwork(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 Policy getIamPolicySubnetwork(GetIamPolicySubnetworkHttpRequest request) { + return getIamPolicySubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource + * exists. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   GetIamPolicySubnetworkHttpRequest request = GetIamPolicySubnetworkHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = subnetworkClient.getIamPolicySubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + getIamPolicySubnetworkCallable() { + return stub.getIamPolicySubnetworkCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Creates a subnetwork in the specified project using the data included in the request. @@ -1119,6 +1221,119 @@ public final UnaryCallable patchSubnetwor return stub.patchSubnetworkCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   Policy response = subnetworkClient.setIamPolicySubnetwork(resource, regionSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param regionSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicySubnetwork( + ProjectRegionSubnetworkResourceName resource, + RegionSetPolicyRequest regionSetPolicyRequestResource) { + + SetIamPolicySubnetworkHttpRequest request = + SetIamPolicySubnetworkHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource) + .build(); + return setIamPolicySubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   Policy response = subnetworkClient.setIamPolicySubnetwork(resource.toString(), regionSetPolicyRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param regionSetPolicyRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final Policy setIamPolicySubnetwork( + String resource, RegionSetPolicyRequest regionSetPolicyRequestResource) { + + SetIamPolicySubnetworkHttpRequest request = + SetIamPolicySubnetworkHttpRequest.newBuilder() + .setResource(resource) + .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource) + .build(); + return setIamPolicySubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicySubnetworkHttpRequest request = SetIamPolicySubnetworkHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource)
+   *     .build();
+   *   Policy response = subnetworkClient.setIamPolicySubnetwork(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 Policy setIamPolicySubnetwork(SetIamPolicySubnetworkHttpRequest request) { + return setIamPolicySubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   RegionSetPolicyRequest regionSetPolicyRequestResource = RegionSetPolicyRequest.newBuilder().build();
+   *   SetIamPolicySubnetworkHttpRequest request = SetIamPolicySubnetworkHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setRegionSetPolicyRequestResource(regionSetPolicyRequestResource)
+   *     .build();
+   *   ApiFuture<Policy> future = subnetworkClient.setIamPolicySubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + setIamPolicySubnetworkCallable() { + return stub.setIamPolicySubnetworkCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Set whether VMs in this subnet can access Google services without assigning external IP @@ -1242,6 +1457,120 @@ public final Operation setPrivateIpGoogleAccessSubnetwork( return stub.setPrivateIpGoogleAccessSubnetworkCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = subnetworkClient.testIamPermissionsSubnetwork(resource, testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsSubnetwork( + ProjectRegionSubnetworkResourceName resource, + TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsSubnetworkHttpRequest request = + TestIamPermissionsSubnetworkHttpRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestPermissionsResponse response = subnetworkClient.testIamPermissionsSubnetwork(resource.toString(), testPermissionsRequestResource);
+   * }
+   * 
+ * + * @param resource Name or id of the resource for this request. + * @param testPermissionsRequestResource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi + public final TestPermissionsResponse testIamPermissionsSubnetwork( + String resource, TestPermissionsRequest testPermissionsRequestResource) { + + TestIamPermissionsSubnetworkHttpRequest request = + TestIamPermissionsSubnetworkHttpRequest.newBuilder() + .setResource(resource) + .setTestPermissionsRequestResource(testPermissionsRequestResource) + .build(); + return testIamPermissionsSubnetwork(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsSubnetworkHttpRequest request = TestIamPermissionsSubnetworkHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   TestPermissionsResponse response = subnetworkClient.testIamPermissionsSubnetwork(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 TestPermissionsResponse testIamPermissionsSubnetwork( + TestIamPermissionsSubnetworkHttpRequest request) { + return testIamPermissionsSubnetworkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. + * + *

Sample code: + * + *


+   * try (SubnetworkClient subnetworkClient = SubnetworkClient.create()) {
+   *   ProjectRegionSubnetworkResourceName resource = ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]");
+   *   TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
+   *   TestIamPermissionsSubnetworkHttpRequest request = TestIamPermissionsSubnetworkHttpRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setTestPermissionsRequestResource(testPermissionsRequestResource)
+   *     .build();
+   *   ApiFuture<TestPermissionsResponse> future = subnetworkClient.testIamPermissionsSubnetworkCallable().futureCall(request);
+   *   // Do something
+   *   TestPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi + public final UnaryCallable + testIamPermissionsSubnetworkCallable() { + return stub.testIamPermissionsSubnetworkCallable(); + } + @Override public final void close() { stub.close(); 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 3640e80cc497..60ed3b8637dd 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 @@ -90,6 +90,12 @@ public UnaryCallSettings getSubnetworkSett return ((SubnetworkStubSettings) getStubSettings()).getSubnetworkSettings(); } + /** Returns the object with the settings used for calls to getIamPolicySubnetwork. */ + public UnaryCallSettings + getIamPolicySubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).getIamPolicySubnetworkSettings(); + } + /** Returns the object with the settings used for calls to insertSubnetwork. */ public UnaryCallSettings insertSubnetworkSettings() { return ((SubnetworkStubSettings) getStubSettings()).insertSubnetworkSettings(); @@ -115,6 +121,12 @@ public UnaryCallSettings patchSubnetworkS return ((SubnetworkStubSettings) getStubSettings()).patchSubnetworkSettings(); } + /** Returns the object with the settings used for calls to setIamPolicySubnetwork. */ + public UnaryCallSettings + setIamPolicySubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).setIamPolicySubnetworkSettings(); + } + /** Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */ public UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings() { @@ -122,6 +134,12 @@ public UnaryCallSettings patchSubnetworkS .setPrivateIpGoogleAccessSubnetworkSettings(); } + /** Returns the object with the settings used for calls to testIamPermissionsSubnetwork. */ + public UnaryCallSettings + testIamPermissionsSubnetworkSettings() { + return ((SubnetworkStubSettings) getStubSettings()).testIamPermissionsSubnetworkSettings(); + } + public static final SubnetworkSettings create(SubnetworkStubSettings stub) throws IOException { return new SubnetworkSettings.Builder(stub.toBuilder()).build(); } @@ -249,6 +267,12 @@ public UnaryCallSettings.Builder getSubnet return getStubSettingsBuilder().getSubnetworkSettings(); } + /** Returns the builder for the settings used for calls to getIamPolicySubnetwork. */ + public UnaryCallSettings.Builder + getIamPolicySubnetworkSettings() { + return getStubSettingsBuilder().getIamPolicySubnetworkSettings(); + } + /** Returns the builder for the settings used for calls to insertSubnetwork. */ public UnaryCallSettings.Builder insertSubnetworkSettings() { @@ -277,6 +301,12 @@ public UnaryCallSettings.Builder getSubnet return getStubSettingsBuilder().patchSubnetworkSettings(); } + /** Returns the builder for the settings used for calls to setIamPolicySubnetwork. */ + public UnaryCallSettings.Builder + setIamPolicySubnetworkSettings() { + return getStubSettingsBuilder().setIamPolicySubnetworkSettings(); + } + /** * Returns the builder for the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */ @@ -285,6 +315,13 @@ public UnaryCallSettings.Builder getSubnet return getStubSettingsBuilder().setPrivateIpGoogleAccessSubnetworkSettings(); } + /** Returns the builder for the settings used for calls to testIamPermissionsSubnetwork. */ + public UnaryCallSettings.Builder< + TestIamPermissionsSubnetworkHttpRequest, TestPermissionsResponse> + testIamPermissionsSubnetworkSettings() { + return getStubSettingsBuilder().testIamPermissionsSubnetworkSettings(); + } + @Override public SubnetworkSettings build() throws IOException { return new SubnetworkSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsDiskHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsDiskHttpRequest.java new file mode 100644 index 000000000000..0d8536ddfacc --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsDiskHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 TestIamPermissionsDiskHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsDiskHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsDiskHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsDiskHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsDiskHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsDiskHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsDiskHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsDiskHttpRequest other) { + if (other == TestIamPermissionsDiskHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsDiskHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsDiskHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsDiskHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsDiskHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsDiskHttpRequest) { + TestIamPermissionsDiskHttpRequest that = (TestIamPermissionsDiskHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsImageHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsImageHttpRequest.java new file mode 100644 index 000000000000..69b6998ad6ba --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsImageHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 TestIamPermissionsImageHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsImageHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsImageHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsImageHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsImageHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsImageHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsImageHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsImageHttpRequest other) { + if (other == TestIamPermissionsImageHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsImageHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsImageHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsImageHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsImageHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsImageHttpRequest) { + TestIamPermissionsImageHttpRequest that = (TestIamPermissionsImageHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceHttpRequest.java new file mode 100644 index 000000000000..38c0b9151a3a --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 TestIamPermissionsInstanceHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsInstanceHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsInstanceHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsInstanceHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsInstanceHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsInstanceHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsInstanceHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsInstanceHttpRequest other) { + if (other == TestIamPermissionsInstanceHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsInstanceHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsInstanceHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsInstanceHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsInstanceHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsInstanceHttpRequest) { + TestIamPermissionsInstanceHttpRequest that = (TestIamPermissionsInstanceHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceTemplateHttpRequest.java new file mode 100644 index 000000000000..75f983abeaaf --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsInstanceTemplateHttpRequest.java @@ -0,0 +1,416 @@ +/* + * 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 TestIamPermissionsInstanceTemplateHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsInstanceTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsInstanceTemplateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsInstanceTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsInstanceTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsInstanceTemplateHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsInstanceTemplateHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsInstanceTemplateHttpRequest other) { + if (other == TestIamPermissionsInstanceTemplateHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsInstanceTemplateHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsInstanceTemplateHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsInstanceTemplateHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsInstanceTemplateHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsInstanceTemplateHttpRequest) { + TestIamPermissionsInstanceTemplateHttpRequest that = + (TestIamPermissionsInstanceTemplateHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeGroupHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeGroupHttpRequest.java new file mode 100644 index 000000000000..b98589e335f2 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeGroupHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 TestIamPermissionsNodeGroupHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsNodeGroupHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsNodeGroupHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsNodeGroupHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsNodeGroupHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsNodeGroupHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsNodeGroupHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsNodeGroupHttpRequest other) { + if (other == TestIamPermissionsNodeGroupHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsNodeGroupHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsNodeGroupHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsNodeGroupHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsNodeGroupHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsNodeGroupHttpRequest) { + TestIamPermissionsNodeGroupHttpRequest that = (TestIamPermissionsNodeGroupHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeTemplateHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeTemplateHttpRequest.java new file mode 100644 index 000000000000..79ef2f08ae21 --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsNodeTemplateHttpRequest.java @@ -0,0 +1,416 @@ +/* + * 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 TestIamPermissionsNodeTemplateHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsNodeTemplateHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsNodeTemplateHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsNodeTemplateHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsNodeTemplateHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsNodeTemplateHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsNodeTemplateHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsNodeTemplateHttpRequest other) { + if (other == TestIamPermissionsNodeTemplateHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsNodeTemplateHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsNodeTemplateHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsNodeTemplateHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsNodeTemplateHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsNodeTemplateHttpRequest) { + TestIamPermissionsNodeTemplateHttpRequest that = + (TestIamPermissionsNodeTemplateHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSnapshotHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSnapshotHttpRequest.java new file mode 100644 index 000000000000..413a62234c0d --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSnapshotHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 TestIamPermissionsSnapshotHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsSnapshotHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsSnapshotHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsSnapshotHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsSnapshotHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsSnapshotHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsSnapshotHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsSnapshotHttpRequest other) { + if (other == TestIamPermissionsSnapshotHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsSnapshotHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsSnapshotHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsSnapshotHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsSnapshotHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsSnapshotHttpRequest) { + TestIamPermissionsSnapshotHttpRequest that = (TestIamPermissionsSnapshotHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSubnetworkHttpRequest.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSubnetworkHttpRequest.java new file mode 100644 index 000000000000..c39ed6123ede --- /dev/null +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TestIamPermissionsSubnetworkHttpRequest.java @@ -0,0 +1,415 @@ +/* + * 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 TestIamPermissionsSubnetworkHttpRequest 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 resource; + private final TestPermissionsRequest testPermissionsRequestResource; + private final String userIp; + + private TestIamPermissionsSubnetworkHttpRequest() { + this.access_token = null; + this.callback = null; + this.fields = null; + this.key = null; + this.prettyPrint = null; + this.quotaUser = null; + this.resource = null; + this.testPermissionsRequestResource = null; + this.userIp = null; + } + + private TestIamPermissionsSubnetworkHttpRequest( + String access_token, + String callback, + String fields, + String key, + String prettyPrint, + String quotaUser, + String resource, + TestPermissionsRequest testPermissionsRequestResource, + String userIp) { + this.access_token = access_token; + this.callback = callback; + this.fields = fields; + this.key = key; + this.prettyPrint = prettyPrint; + this.quotaUser = quotaUser; + this.resource = resource; + this.testPermissionsRequestResource = testPermissionsRequestResource; + 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("resource")) { + return resource; + } + if (fieldName.equals("testPermissionsRequestResource")) { + return testPermissionsRequestResource; + } + if (fieldName.equals("userIp")) { + return userIp; + } + return null; + } + + @Nullable + @Override + public TestPermissionsRequest getApiMessageRequestBody() { + return testPermissionsRequestResource; + } + + @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 getResource() { + return resource; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public String getUserIp() { + return userIp; + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(TestIamPermissionsSubnetworkHttpRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + public static TestIamPermissionsSubnetworkHttpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final TestIamPermissionsSubnetworkHttpRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new TestIamPermissionsSubnetworkHttpRequest(); + } + + 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 resource; + private TestPermissionsRequest testPermissionsRequestResource; + private String userIp; + + Builder() {} + + public Builder mergeFrom(TestIamPermissionsSubnetworkHttpRequest other) { + if (other == TestIamPermissionsSubnetworkHttpRequest.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.getResource() != null) { + this.resource = other.resource; + } + if (other.getTestPermissionsRequestResource() != null) { + this.testPermissionsRequestResource = other.testPermissionsRequestResource; + } + if (other.getUserIp() != null) { + this.userIp = other.userIp; + } + return this; + } + + Builder(TestIamPermissionsSubnetworkHttpRequest 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.resource = source.resource; + this.testPermissionsRequestResource = source.testPermissionsRequestResource; + 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 getResource() { + return resource; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + public TestPermissionsRequest getTestPermissionsRequestResource() { + return testPermissionsRequestResource; + } + + public Builder setTestPermissionsRequestResource( + TestPermissionsRequest testPermissionsRequestResource) { + this.testPermissionsRequestResource = testPermissionsRequestResource; + return this; + } + + public String getUserIp() { + return userIp; + } + + public Builder setUserIp(String userIp) { + this.userIp = userIp; + return this; + } + + public TestIamPermissionsSubnetworkHttpRequest build() { + String missing = ""; + + if (resource == null) { + missing += " resource"; + } + + if (!missing.isEmpty()) { + throw new IllegalStateException("Missing required properties:" + missing); + } + return new TestIamPermissionsSubnetworkHttpRequest( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + 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.setResource(this.resource); + newBuilder.setTestPermissionsRequestResource(this.testPermissionsRequestResource); + newBuilder.setUserIp(this.userIp); + return newBuilder; + } + } + + @Override + public String toString() { + return "TestIamPermissionsSubnetworkHttpRequest{" + + "access_token=" + + access_token + + ", " + + "callback=" + + callback + + ", " + + "fields=" + + fields + + ", " + + "key=" + + key + + ", " + + "prettyPrint=" + + prettyPrint + + ", " + + "quotaUser=" + + quotaUser + + ", " + + "resource=" + + resource + + ", " + + "testPermissionsRequestResource=" + + testPermissionsRequestResource + + ", " + + "userIp=" + + userIp + + "}"; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof TestIamPermissionsSubnetworkHttpRequest) { + TestIamPermissionsSubnetworkHttpRequest that = (TestIamPermissionsSubnetworkHttpRequest) 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.resource, that.getResource()) + && Objects.equals( + this.testPermissionsRequestResource, that.getTestPermissionsRequestResource()) + && Objects.equals(this.userIp, that.getUserIp()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash( + access_token, + callback, + fields, + key, + prettyPrint, + quotaUser, + resource, + testPermissionsRequestResource, + userIp); + } +} diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java index 77912923a901..7dbb791f2576 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStub.java @@ -28,11 +28,16 @@ import com.google.cloud.compute.v1.DiskAggregatedList; import com.google.cloud.compute.v1.DiskList; import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.SetIamPolicyDiskHttpRequest; import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsDiskHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -72,6 +77,11 @@ public UnaryCallable getDiskCallable() { throw new UnsupportedOperationException("Not implemented: getDiskCallable()"); } + @BetaApi + public UnaryCallable getIamPolicyDiskCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyDiskCallable()"); + } + @BetaApi public UnaryCallable insertDiskCallable() { throw new UnsupportedOperationException("Not implemented: insertDiskCallable()"); @@ -92,11 +102,22 @@ public UnaryCallable resizeDiskCallable() { throw new UnsupportedOperationException("Not implemented: resizeDiskCallable()"); } + @BetaApi + public UnaryCallable setIamPolicyDiskCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyDiskCallable()"); + } + @BetaApi public UnaryCallable setLabelsDiskCallable() { throw new UnsupportedOperationException("Not implemented: setLabelsDiskCallable()"); } + @BetaApi + public UnaryCallable + testIamPermissionsDiskCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsDiskCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java index 4616b4992859..cfa42ce12b49 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/DiskStubSettings.java @@ -48,11 +48,16 @@ import com.google.cloud.compute.v1.DiskList; import com.google.cloud.compute.v1.DisksScopedList; import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.SetIamPolicyDiskHttpRequest; import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsDiskHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -110,11 +115,15 @@ public class DiskStubSettings extends StubSettings { createSnapshotDiskSettings; private final UnaryCallSettings deleteDiskSettings; private final UnaryCallSettings getDiskSettings; + private final UnaryCallSettings getIamPolicyDiskSettings; private final UnaryCallSettings insertDiskSettings; private final PagedCallSettings listDisksSettings; private final UnaryCallSettings resizeDiskSettings; + private final UnaryCallSettings setIamPolicyDiskSettings; private final UnaryCallSettings setLabelsDiskSettings; + private final UnaryCallSettings + testIamPermissionsDiskSettings; /** Returns the object with the settings used for calls to aggregatedListDisks. */ public PagedCallSettings< @@ -138,6 +147,11 @@ public UnaryCallSettings getDiskSettings() { return getDiskSettings; } + /** Returns the object with the settings used for calls to getIamPolicyDisk. */ + public UnaryCallSettings getIamPolicyDiskSettings() { + return getIamPolicyDiskSettings; + } + /** Returns the object with the settings used for calls to insertDisk. */ public UnaryCallSettings insertDiskSettings() { return insertDiskSettings; @@ -154,11 +168,22 @@ public UnaryCallSettings resizeDiskSettings() return resizeDiskSettings; } + /** Returns the object with the settings used for calls to setIamPolicyDisk. */ + public UnaryCallSettings setIamPolicyDiskSettings() { + return setIamPolicyDiskSettings; + } + /** Returns the object with the settings used for calls to setLabelsDisk. */ public UnaryCallSettings setLabelsDiskSettings() { return setLabelsDiskSettings; } + /** Returns the object with the settings used for calls to testIamPermissionsDisk. */ + public UnaryCallSettings + testIamPermissionsDiskSettings() { + return testIamPermissionsDiskSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public DiskStub createStub() throws IOException { if (getTransportChannelProvider() @@ -237,10 +262,13 @@ protected DiskStubSettings(Builder settingsBuilder) throws IOException { createSnapshotDiskSettings = settingsBuilder.createSnapshotDiskSettings().build(); deleteDiskSettings = settingsBuilder.deleteDiskSettings().build(); getDiskSettings = settingsBuilder.getDiskSettings().build(); + getIamPolicyDiskSettings = settingsBuilder.getIamPolicyDiskSettings().build(); insertDiskSettings = settingsBuilder.insertDiskSettings().build(); listDisksSettings = settingsBuilder.listDisksSettings().build(); resizeDiskSettings = settingsBuilder.resizeDiskSettings().build(); + setIamPolicyDiskSettings = settingsBuilder.setIamPolicyDiskSettings().build(); setLabelsDiskSettings = settingsBuilder.setLabelsDiskSettings().build(); + testIamPermissionsDiskSettings = settingsBuilder.testIamPermissionsDiskSettings().build(); } private static final PagedListDescriptor< @@ -369,12 +397,19 @@ public static class Builder extends StubSettings.Builder deleteDiskSettings; private final UnaryCallSettings.Builder getDiskSettings; + private final UnaryCallSettings.Builder + getIamPolicyDiskSettings; private final UnaryCallSettings.Builder insertDiskSettings; private final PagedCallSettings.Builder listDisksSettings; private final UnaryCallSettings.Builder resizeDiskSettings; + private final UnaryCallSettings.Builder + setIamPolicyDiskSettings; private final UnaryCallSettings.Builder setLabelsDiskSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsDiskHttpRequest, TestPermissionsResponse> + testIamPermissionsDiskSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -426,24 +461,33 @@ protected Builder(ClientContext clientContext) { getDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listDisksSettings = PagedCallSettings.newBuilder(LIST_DISKS_PAGE_STR_FACT); resizeDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicyDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setLabelsDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsDiskSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListDisksSettings, createSnapshotDiskSettings, deleteDiskSettings, getDiskSettings, + getIamPolicyDiskSettings, insertDiskSettings, listDisksSettings, resizeDiskSettings, - setLabelsDiskSettings); + setIamPolicyDiskSettings, + setLabelsDiskSettings, + testIamPermissionsDiskSettings); initDefaults(this); } @@ -479,6 +523,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertDiskSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -494,11 +543,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setLabelsDiskSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .testIamPermissionsDiskSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -509,10 +568,13 @@ protected Builder(DiskStubSettings settings) { createSnapshotDiskSettings = settings.createSnapshotDiskSettings.toBuilder(); deleteDiskSettings = settings.deleteDiskSettings.toBuilder(); getDiskSettings = settings.getDiskSettings.toBuilder(); + getIamPolicyDiskSettings = settings.getIamPolicyDiskSettings.toBuilder(); insertDiskSettings = settings.insertDiskSettings.toBuilder(); listDisksSettings = settings.listDisksSettings.toBuilder(); resizeDiskSettings = settings.resizeDiskSettings.toBuilder(); + setIamPolicyDiskSettings = settings.setIamPolicyDiskSettings.toBuilder(); setLabelsDiskSettings = settings.setLabelsDiskSettings.toBuilder(); + testIamPermissionsDiskSettings = settings.testIamPermissionsDiskSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -520,10 +582,13 @@ protected Builder(DiskStubSettings settings) { createSnapshotDiskSettings, deleteDiskSettings, getDiskSettings, + getIamPolicyDiskSettings, insertDiskSettings, listDisksSettings, resizeDiskSettings, - setLabelsDiskSettings); + setIamPolicyDiskSettings, + setLabelsDiskSettings, + testIamPermissionsDiskSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -565,6 +630,12 @@ public UnaryCallSettings.Builder getDiskSettings() { return getDiskSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyDisk. */ + public UnaryCallSettings.Builder + getIamPolicyDiskSettings() { + return getIamPolicyDiskSettings; + } + /** Returns the builder for the settings used for calls to insertDisk. */ public UnaryCallSettings.Builder insertDiskSettings() { return insertDiskSettings; @@ -581,11 +652,23 @@ public UnaryCallSettings.Builder resizeDiskSet return resizeDiskSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyDisk. */ + public UnaryCallSettings.Builder + setIamPolicyDiskSettings() { + return setIamPolicyDiskSettings; + } + /** Returns the builder for the settings used for calls to setLabelsDisk. */ public UnaryCallSettings.Builder setLabelsDiskSettings() { return setLabelsDiskSettings; } + /** Returns the builder for the settings used for calls to testIamPermissionsDisk. */ + public UnaryCallSettings.Builder + testIamPermissionsDiskSettings() { + return testIamPermissionsDiskSettings; + } + @Override public DiskStubSettings build() throws IOException { return new DiskStubSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java index 601895c004fb..7ebeaf5fc5eb 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonDiskStub.java @@ -38,15 +38,20 @@ import com.google.cloud.compute.v1.DiskAggregatedList; import com.google.cloud.compute.v1.DiskList; import com.google.cloud.compute.v1.GetDiskHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyDiskHttpRequest; import com.google.cloud.compute.v1.InsertDiskHttpRequest; import com.google.cloud.compute.v1.ListDisksHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneDiskName; import com.google.cloud.compute.v1.ProjectZoneDiskResourceName; import com.google.cloud.compute.v1.ProjectZoneName; import com.google.cloud.compute.v1.ResizeDiskHttpRequest; +import com.google.cloud.compute.v1.SetIamPolicyDiskHttpRequest; import com.google.cloud.compute.v1.SetLabelsDiskHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsDiskHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -138,6 +143,27 @@ public class HttpJsonDiskStub extends DiskStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/disks/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneDiskResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertDiskMethodDescriptor = @@ -197,6 +223,27 @@ public class HttpJsonDiskStub extends DiskStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyDiskMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.disks.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/disks/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneDiskResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setLabelsDiskMethodDescriptor = @@ -217,6 +264,29 @@ public class HttpJsonDiskStub extends DiskStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsDiskHttpRequest, TestPermissionsResponse> + testIamPermissionsDiskMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.disks.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/disks/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneDiskResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable @@ -226,11 +296,15 @@ public class HttpJsonDiskStub extends DiskStub { private final UnaryCallable createSnapshotDiskCallable; private final UnaryCallable deleteDiskCallable; private final UnaryCallable getDiskCallable; + private final UnaryCallable getIamPolicyDiskCallable; private final UnaryCallable insertDiskCallable; private final UnaryCallable listDisksCallable; private final UnaryCallable listDisksPagedCallable; private final UnaryCallable resizeDiskCallable; + private final UnaryCallable setIamPolicyDiskCallable; private final UnaryCallable setLabelsDiskCallable; + private final UnaryCallable + testIamPermissionsDiskCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -286,6 +360,10 @@ protected HttpJsonDiskStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getDiskMethodDescriptor) .build(); + HttpJsonCallSettings getIamPolicyDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyDiskMethodDescriptor) + .build(); HttpJsonCallSettings insertDiskTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertDiskMethodDescriptor) @@ -298,10 +376,20 @@ protected HttpJsonDiskStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(resizeDiskMethodDescriptor) .build(); + HttpJsonCallSettings setIamPolicyDiskTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyDiskMethodDescriptor) + .build(); HttpJsonCallSettings setLabelsDiskTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setLabelsDiskMethodDescriptor) .build(); + HttpJsonCallSettings + testIamPermissionsDiskTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsDiskMethodDescriptor) + .build(); this.aggregatedListDisksCallable = callableFactory.createUnaryCallable( @@ -324,6 +412,9 @@ protected HttpJsonDiskStub( this.getDiskCallable = callableFactory.createUnaryCallable( getDiskTransportSettings, settings.getDiskSettings(), clientContext); + this.getIamPolicyDiskCallable = + callableFactory.createUnaryCallable( + getIamPolicyDiskTransportSettings, settings.getIamPolicyDiskSettings(), clientContext); this.insertDiskCallable = callableFactory.createUnaryCallable( insertDiskTransportSettings, settings.insertDiskSettings(), clientContext); @@ -336,9 +427,17 @@ protected HttpJsonDiskStub( this.resizeDiskCallable = callableFactory.createUnaryCallable( resizeDiskTransportSettings, settings.resizeDiskSettings(), clientContext); + this.setIamPolicyDiskCallable = + callableFactory.createUnaryCallable( + setIamPolicyDiskTransportSettings, settings.setIamPolicyDiskSettings(), clientContext); this.setLabelsDiskCallable = callableFactory.createUnaryCallable( setLabelsDiskTransportSettings, settings.setLabelsDiskSettings(), clientContext); + this.testIamPermissionsDiskCallable = + callableFactory.createUnaryCallable( + testIamPermissionsDiskTransportSettings, + settings.testIamPermissionsDiskSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -370,6 +469,11 @@ public UnaryCallable getDiskCallable() { return getDiskCallable; } + @BetaApi + public UnaryCallable getIamPolicyDiskCallable() { + return getIamPolicyDiskCallable; + } + @BetaApi public UnaryCallable insertDiskCallable() { return insertDiskCallable; @@ -390,11 +494,22 @@ public UnaryCallable resizeDiskCallable() { return resizeDiskCallable; } + @BetaApi + public UnaryCallable setIamPolicyDiskCallable() { + return setIamPolicyDiskCallable; + } + @BetaApi public UnaryCallable setLabelsDiskCallable() { return setLabelsDiskCallable; } + @BetaApi + public UnaryCallable + testIamPermissionsDiskCallable() { + return testIamPermissionsDiskCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java index 56beeda780b9..8e3b546e0df4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonImageStub.java @@ -33,17 +33,22 @@ import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; import com.google.cloud.compute.v1.Image; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ProjectGlobalImageFamilyName; import com.google.cloud.compute.v1.ProjectGlobalImageName; import com.google.cloud.compute.v1.ProjectGlobalImageResourceName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetIamPolicyImageHttpRequest; import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsImageHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -135,6 +140,26 @@ public class HttpJsonImageStub extends ImageStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/global/images/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalImageResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertImageMethodDescriptor = @@ -174,6 +199,26 @@ public class HttpJsonImageStub extends ImageStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyImageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.images.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/global/images/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalImageResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setLabelsImageMethodDescriptor = @@ -194,17 +239,44 @@ public class HttpJsonImageStub extends ImageStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsImageHttpRequest, TestPermissionsResponse> + testIamPermissionsImageMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.images.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/images/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalImageResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteImageCallable; private final UnaryCallable deprecateImageCallable; private final UnaryCallable getImageCallable; private final UnaryCallable getFromFamilyImageCallable; + private final UnaryCallable getIamPolicyImageCallable; private final UnaryCallable insertImageCallable; private final UnaryCallable listImagesCallable; private final UnaryCallable listImagesPagedCallable; + private final UnaryCallable setIamPolicyImageCallable; private final UnaryCallable setLabelsImageCallable; + private final UnaryCallable + testIamPermissionsImageCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -260,6 +332,10 @@ protected HttpJsonImageStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getFromFamilyImageMethodDescriptor) .build(); + HttpJsonCallSettings getIamPolicyImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyImageMethodDescriptor) + .build(); HttpJsonCallSettings insertImageTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertImageMethodDescriptor) @@ -268,10 +344,20 @@ protected HttpJsonImageStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listImagesMethodDescriptor) .build(); + HttpJsonCallSettings setIamPolicyImageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyImageMethodDescriptor) + .build(); HttpJsonCallSettings setLabelsImageTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setLabelsImageMethodDescriptor) .build(); + HttpJsonCallSettings + testIamPermissionsImageTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsImageMethodDescriptor) + .build(); this.deleteImageCallable = callableFactory.createUnaryCallable( @@ -287,6 +373,11 @@ protected HttpJsonImageStub( getFromFamilyImageTransportSettings, settings.getFromFamilyImageSettings(), clientContext); + this.getIamPolicyImageCallable = + callableFactory.createUnaryCallable( + getIamPolicyImageTransportSettings, + settings.getIamPolicyImageSettings(), + clientContext); this.insertImageCallable = callableFactory.createUnaryCallable( insertImageTransportSettings, settings.insertImageSettings(), clientContext); @@ -296,9 +387,19 @@ protected HttpJsonImageStub( this.listImagesPagedCallable = callableFactory.createPagedCallable( listImagesTransportSettings, settings.listImagesSettings(), clientContext); + this.setIamPolicyImageCallable = + callableFactory.createUnaryCallable( + setIamPolicyImageTransportSettings, + settings.setIamPolicyImageSettings(), + clientContext); this.setLabelsImageCallable = callableFactory.createUnaryCallable( setLabelsImageTransportSettings, settings.setLabelsImageSettings(), clientContext); + this.testIamPermissionsImageCallable = + callableFactory.createUnaryCallable( + testIamPermissionsImageTransportSettings, + settings.testIamPermissionsImageSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -323,6 +424,11 @@ public UnaryCallable getFromFamilyImageCal return getFromFamilyImageCallable; } + @BetaApi + public UnaryCallable getIamPolicyImageCallable() { + return getIamPolicyImageCallable; + } + @BetaApi public UnaryCallable insertImageCallable() { return insertImageCallable; @@ -338,11 +444,22 @@ public UnaryCallable listImagesCallable() { return listImagesCallable; } + @BetaApi + public UnaryCallable setIamPolicyImageCallable() { + return setIamPolicyImageCallable; + } + @BetaApi public UnaryCallable setLabelsImageCallable() { return setLabelsImageCallable; } + @BetaApi + public UnaryCallable + testIamPermissionsImageCallable() { + return testIamPermissionsImageCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java index 392f69a3c76d..62fb100df4d6 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceGroupManagerStub.java @@ -44,6 +44,7 @@ import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneInstanceGroupManagerName; import com.google.cloud.compute.v1.ProjectZoneName; @@ -252,6 +253,27 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + patchInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceGroupManagers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectZoneInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor< RecreateInstancesInstanceGroupManagerHttpRequest, Operation> @@ -371,6 +393,8 @@ public class HttpJsonInstanceGroupManagerStub extends InstanceGroupManagerStub { ListManagedInstancesInstanceGroupManagersHttpRequest, InstanceGroupManagersListManagedInstancesResponse> listManagedInstancesInstanceGroupManagersCallable; + private final UnaryCallable + patchInstanceGroupManagerCallable; private final UnaryCallable recreateInstancesInstanceGroupManagerCallable; private final UnaryCallable @@ -474,6 +498,11 @@ protected HttpJsonInstanceGroupManagerStub( newBuilder() .setMethodDescriptor(listManagedInstancesInstanceGroupManagersMethodDescriptor) .build(); + HttpJsonCallSettings + patchInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchInstanceGroupManagerMethodDescriptor) + .build(); HttpJsonCallSettings recreateInstancesInstanceGroupManagerTransportSettings = HttpJsonCallSettings @@ -548,6 +577,11 @@ protected HttpJsonInstanceGroupManagerStub( listManagedInstancesInstanceGroupManagersTransportSettings, settings.listManagedInstancesInstanceGroupManagersSettings(), clientContext); + this.patchInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + patchInstanceGroupManagerTransportSettings, + settings.patchInstanceGroupManagerSettings(), + clientContext); this.recreateInstancesInstanceGroupManagerCallable = callableFactory.createUnaryCallable( recreateInstancesInstanceGroupManagerTransportSettings, @@ -637,6 +671,12 @@ protected HttpJsonInstanceGroupManagerStub( return listManagedInstancesInstanceGroupManagersCallable; } + @BetaApi + public UnaryCallable + patchInstanceGroupManagerCallable() { + return patchInstanceGroupManagerCallable; + } + @BetaApi public UnaryCallable recreateInstancesInstanceGroupManagerCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java index af20d2b8b6c7..4039e7308bc2 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceStub.java @@ -38,6 +38,7 @@ import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyInstanceHttpRequest; import com.google.cloud.compute.v1.GetInstanceHttpRequest; import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; import com.google.cloud.compute.v1.InsertInstanceHttpRequest; @@ -48,6 +49,7 @@ import com.google.cloud.compute.v1.ListInstancesHttpRequest; import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectZoneInstanceName; import com.google.cloud.compute.v1.ProjectZoneInstanceResourceName; @@ -56,6 +58,7 @@ import com.google.cloud.compute.v1.SerialPortOutput; import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetIamPolicyInstanceHttpRequest; import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; @@ -68,6 +71,8 @@ import com.google.cloud.compute.v1.StartInstanceHttpRequest; import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsInstanceHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import com.google.common.collect.Sets; @@ -231,6 +236,27 @@ public class HttpJsonInstanceStub extends InstanceStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneInstanceResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getSerialPortOutputInstanceMethodDescriptor = @@ -379,6 +405,27 @@ public class HttpJsonInstanceStub extends InstanceStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instances.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneInstanceResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setLabelsInstanceMethodDescriptor = @@ -632,6 +679,29 @@ public class HttpJsonInstanceStub extends InstanceStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsInstanceHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instances.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/instances/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneInstanceResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor updateAccessConfigInstanceMethodDescriptor = @@ -690,6 +760,7 @@ public class HttpJsonInstanceStub extends InstanceStub { deleteAccessConfigInstanceCallable; private final UnaryCallable detachDiskInstanceCallable; private final UnaryCallable getInstanceCallable; + private final UnaryCallable getIamPolicyInstanceCallable; private final UnaryCallable getSerialPortOutputInstanceCallable; private final UnaryCallable insertInstanceCallable; @@ -706,6 +777,7 @@ public class HttpJsonInstanceStub extends InstanceStub { setDeletionProtectionInstanceCallable; private final UnaryCallable setDiskAutoDeleteInstanceCallable; + private final UnaryCallable setIamPolicyInstanceCallable; private final UnaryCallable setLabelsInstanceCallable; private final UnaryCallable setMachineResourcesInstanceCallable; @@ -726,6 +798,8 @@ public class HttpJsonInstanceStub extends InstanceStub { private final UnaryCallable startWithEncryptionKeyInstanceCallable; private final UnaryCallable stopInstanceCallable; + private final UnaryCallable + testIamPermissionsInstanceCallable; private final UnaryCallable updateAccessConfigInstanceCallable; private final UnaryCallable @@ -804,6 +878,11 @@ protected HttpJsonInstanceStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getInstanceMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicyInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyInstanceMethodDescriptor) + .build(); HttpJsonCallSettings getSerialPortOutputInstanceTransportSettings = HttpJsonCallSettings @@ -838,6 +917,11 @@ protected HttpJsonInstanceStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setDiskAutoDeleteInstanceMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicyInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyInstanceMethodDescriptor) + .build(); HttpJsonCallSettings setLabelsInstanceTransportSettings = HttpJsonCallSettings.newBuilder() @@ -896,6 +980,12 @@ protected HttpJsonInstanceStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(stopInstanceMethodDescriptor) .build(); + HttpJsonCallSettings + testIamPermissionsInstanceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsInstanceMethodDescriptor) + .build(); HttpJsonCallSettings updateAccessConfigInstanceTransportSettings = HttpJsonCallSettings.newBuilder() @@ -943,6 +1033,11 @@ protected HttpJsonInstanceStub( this.getInstanceCallable = callableFactory.createUnaryCallable( getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.getIamPolicyInstanceCallable = + callableFactory.createUnaryCallable( + getIamPolicyInstanceTransportSettings, + settings.getIamPolicyInstanceSettings(), + clientContext); this.getSerialPortOutputInstanceCallable = callableFactory.createUnaryCallable( getSerialPortOutputInstanceTransportSettings, @@ -980,6 +1075,11 @@ protected HttpJsonInstanceStub( setDiskAutoDeleteInstanceTransportSettings, settings.setDiskAutoDeleteInstanceSettings(), clientContext); + this.setIamPolicyInstanceCallable = + callableFactory.createUnaryCallable( + setIamPolicyInstanceTransportSettings, + settings.setIamPolicyInstanceSettings(), + clientContext); this.setLabelsInstanceCallable = callableFactory.createUnaryCallable( setLabelsInstanceTransportSettings, @@ -1034,6 +1134,11 @@ protected HttpJsonInstanceStub( this.stopInstanceCallable = callableFactory.createUnaryCallable( stopInstanceTransportSettings, settings.stopInstanceSettings(), clientContext); + this.testIamPermissionsInstanceCallable = + callableFactory.createUnaryCallable( + testIamPermissionsInstanceTransportSettings, + settings.testIamPermissionsInstanceSettings(), + clientContext); this.updateAccessConfigInstanceCallable = callableFactory.createUnaryCallable( updateAccessConfigInstanceTransportSettings, @@ -1092,6 +1197,11 @@ public UnaryCallable getInstanceCallable() { return getInstanceCallable; } + @BetaApi + public UnaryCallable getIamPolicyInstanceCallable() { + return getIamPolicyInstanceCallable; + } + @BetaApi public UnaryCallable getSerialPortOutputInstanceCallable() { @@ -1143,6 +1253,11 @@ public UnaryCallable resetInstanceCallable( return setDiskAutoDeleteInstanceCallable; } + @BetaApi + public UnaryCallable setIamPolicyInstanceCallable() { + return setIamPolicyInstanceCallable; + } + @BetaApi public UnaryCallable setLabelsInstanceCallable() { return setLabelsInstanceCallable; @@ -1210,6 +1325,12 @@ public UnaryCallable stopInstanceCallable() return stopInstanceCallable; } + @BetaApi + public UnaryCallable + testIamPermissionsInstanceCallable() { + return testIamPermissionsInstanceCallable; + } + @BetaApi public UnaryCallable updateAccessConfigInstanceCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java index bc01f1963a26..cc138ffb68ee 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInstanceTemplateStub.java @@ -31,14 +31,20 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InstanceTemplate; import com.google.cloud.compute.v1.InstanceTemplateList; import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ProjectGlobalInstanceTemplateName; +import com.google.cloud.compute.v1.ProjectGlobalInstanceTemplateResourceName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetIamPolicyInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -95,6 +101,29 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/instanceTemplates/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory( + ProjectGlobalInstanceTemplateResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertInstanceTemplateMethodDescriptor = @@ -134,18 +163,73 @@ public class HttpJsonInstanceTemplateStub extends InstanceTemplateStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyInstanceTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.instanceTemplates.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/instanceTemplates/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory( + ProjectGlobalInstanceTemplateResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsInstanceTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceTemplateMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.instanceTemplates.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/instanceTemplates/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory( + ProjectGlobalInstanceTemplateResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteInstanceTemplateCallable; private final UnaryCallable getInstanceTemplateCallable; + private final UnaryCallable + getIamPolicyInstanceTemplateCallable; private final UnaryCallable insertInstanceTemplateCallable; private final UnaryCallable listInstanceTemplatesCallable; private final UnaryCallable listInstanceTemplatesPagedCallable; + private final UnaryCallable + setIamPolicyInstanceTemplateCallable; + private final UnaryCallable< + TestIamPermissionsInstanceTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceTemplateCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -198,6 +282,11 @@ protected HttpJsonInstanceTemplateStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getInstanceTemplateMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicyInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyInstanceTemplateMethodDescriptor) + .build(); HttpJsonCallSettings insertInstanceTemplateTransportSettings = HttpJsonCallSettings.newBuilder() @@ -209,6 +298,18 @@ protected HttpJsonInstanceTemplateStub( .newBuilder() .setMethodDescriptor(listInstanceTemplatesMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicyInstanceTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyInstanceTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + testIamPermissionsInstanceTemplateTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(testIamPermissionsInstanceTemplateMethodDescriptor) + .build(); this.deleteInstanceTemplateCallable = callableFactory.createUnaryCallable( @@ -220,6 +321,11 @@ protected HttpJsonInstanceTemplateStub( getInstanceTemplateTransportSettings, settings.getInstanceTemplateSettings(), clientContext); + this.getIamPolicyInstanceTemplateCallable = + callableFactory.createUnaryCallable( + getIamPolicyInstanceTemplateTransportSettings, + settings.getIamPolicyInstanceTemplateSettings(), + clientContext); this.insertInstanceTemplateCallable = callableFactory.createUnaryCallable( insertInstanceTemplateTransportSettings, @@ -235,6 +341,16 @@ protected HttpJsonInstanceTemplateStub( listInstanceTemplatesTransportSettings, settings.listInstanceTemplatesSettings(), clientContext); + this.setIamPolicyInstanceTemplateCallable = + callableFactory.createUnaryCallable( + setIamPolicyInstanceTemplateTransportSettings, + settings.setIamPolicyInstanceTemplateSettings(), + clientContext); + this.testIamPermissionsInstanceTemplateCallable = + callableFactory.createUnaryCallable( + testIamPermissionsInstanceTemplateTransportSettings, + settings.testIamPermissionsInstanceTemplateSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -251,6 +367,12 @@ protected HttpJsonInstanceTemplateStub( return getInstanceTemplateCallable; } + @BetaApi + public UnaryCallable + getIamPolicyInstanceTemplateCallable() { + return getIamPolicyInstanceTemplateCallable; + } + @BetaApi public UnaryCallable insertInstanceTemplateCallable() { @@ -269,6 +391,18 @@ protected HttpJsonInstanceTemplateStub( return listInstanceTemplatesCallable; } + @BetaApi + public UnaryCallable + setIamPolicyInstanceTemplateCallable() { + return setIamPolicyInstanceTemplateCallable; + } + + @BetaApi + public UnaryCallable + testIamPermissionsInstanceTemplateCallable() { + return testIamPermissionsInstanceTemplateCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java index b1b15eb95a92..c6f3c1b007cb 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonInterconnectStub.java @@ -31,10 +31,12 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetDiagnosticsInterconnectHttpRequest; import com.google.cloud.compute.v1.GetInterconnectHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; import com.google.cloud.compute.v1.Interconnect; import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; @@ -94,6 +96,30 @@ public class HttpJsonInterconnectStub extends InterconnectStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("compute.interconnects.getDiagnostics") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/interconnects/{interconnect}/getDiagnostics")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalInterconnectName.newFactory()) + .setResourceNameField("interconnect") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(InterconnectsGetDiagnosticsResponse.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertInterconnectMethodDescriptor = @@ -157,6 +183,9 @@ public class HttpJsonInterconnectStub extends InterconnectStub { private final UnaryCallable deleteInterconnectCallable; private final UnaryCallable getInterconnectCallable; + private final UnaryCallable< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectCallable; private final UnaryCallable insertInterconnectCallable; private final UnaryCallable listInterconnectsCallable; @@ -215,6 +244,13 @@ protected HttpJsonInterconnectStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getInterconnectMethodDescriptor) .build(); + HttpJsonCallSettings + getDiagnosticsInterconnectTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(getDiagnosticsInterconnectMethodDescriptor) + .build(); HttpJsonCallSettings insertInterconnectTransportSettings = HttpJsonCallSettings.newBuilder() @@ -239,6 +275,11 @@ protected HttpJsonInterconnectStub( this.getInterconnectCallable = callableFactory.createUnaryCallable( getInterconnectTransportSettings, settings.getInterconnectSettings(), clientContext); + this.getDiagnosticsInterconnectCallable = + callableFactory.createUnaryCallable( + getDiagnosticsInterconnectTransportSettings, + settings.getDiagnosticsInterconnectSettings(), + clientContext); this.insertInterconnectCallable = callableFactory.createUnaryCallable( insertInterconnectTransportSettings, @@ -273,6 +314,12 @@ public UnaryCallable getInterconnectCa return getInterconnectCallable; } + @BetaApi + public UnaryCallable + getDiagnosticsInterconnectCallable() { + return getDiagnosticsInterconnectCallable; + } + @BetaApi public UnaryCallable insertInterconnectCallable() { return insertInterconnectCallable; diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java index a3e2dbb86fb3..b9365d99a919 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonLicenseStub.java @@ -31,15 +31,18 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteLicenseHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyLicenseHttpRequest; import com.google.cloud.compute.v1.GetLicenseHttpRequest; import com.google.cloud.compute.v1.InsertLicenseHttpRequest; import com.google.cloud.compute.v1.License; import com.google.cloud.compute.v1.LicensesListResponse; import com.google.cloud.compute.v1.ListLicensesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ProjectGlobalLicenseName; import com.google.cloud.compute.v1.ProjectGlobalLicenseResourceName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetIamPolicyLicenseHttpRequest; import com.google.cloud.compute.v1.TestIamPermissionsLicenseHttpRequest; import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; @@ -94,6 +97,26 @@ public class HttpJsonLicenseStub extends LicenseStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyLicenseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/global/licenses/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalLicenseResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertLicenseMethodDescriptor = @@ -133,6 +156,26 @@ public class HttpJsonLicenseStub extends LicenseStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyLicenseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.licenses.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/global/licenses/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalLicenseResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor< TestIamPermissionsLicenseHttpRequest, TestPermissionsResponse> @@ -160,10 +203,12 @@ public class HttpJsonLicenseStub extends LicenseStub { private final UnaryCallable deleteLicenseCallable; private final UnaryCallable getLicenseCallable; + private final UnaryCallable getIamPolicyLicenseCallable; private final UnaryCallable insertLicenseCallable; private final UnaryCallable listLicensesCallable; private final UnaryCallable listLicensesPagedCallable; + private final UnaryCallable setIamPolicyLicenseCallable; private final UnaryCallable testIamPermissionsLicenseCallable; @@ -213,6 +258,11 @@ protected HttpJsonLicenseStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getLicenseMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicyLicenseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyLicenseMethodDescriptor) + .build(); HttpJsonCallSettings insertLicenseTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertLicenseMethodDescriptor) @@ -222,6 +272,11 @@ protected HttpJsonLicenseStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listLicensesMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicyLicenseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyLicenseMethodDescriptor) + .build(); HttpJsonCallSettings testIamPermissionsLicenseTransportSettings = HttpJsonCallSettings @@ -235,6 +290,11 @@ protected HttpJsonLicenseStub( this.getLicenseCallable = callableFactory.createUnaryCallable( getLicenseTransportSettings, settings.getLicenseSettings(), clientContext); + this.getIamPolicyLicenseCallable = + callableFactory.createUnaryCallable( + getIamPolicyLicenseTransportSettings, + settings.getIamPolicyLicenseSettings(), + clientContext); this.insertLicenseCallable = callableFactory.createUnaryCallable( insertLicenseTransportSettings, settings.insertLicenseSettings(), clientContext); @@ -244,6 +304,11 @@ protected HttpJsonLicenseStub( this.listLicensesPagedCallable = callableFactory.createPagedCallable( listLicensesTransportSettings, settings.listLicensesSettings(), clientContext); + this.setIamPolicyLicenseCallable = + callableFactory.createUnaryCallable( + setIamPolicyLicenseTransportSettings, + settings.setIamPolicyLicenseSettings(), + clientContext); this.testIamPermissionsLicenseCallable = callableFactory.createUnaryCallable( testIamPermissionsLicenseTransportSettings, @@ -263,6 +328,11 @@ public UnaryCallable getLicenseCallable() { return getLicenseCallable; } + @BetaApi + public UnaryCallable getIamPolicyLicenseCallable() { + return getIamPolicyLicenseCallable; + } + @BetaApi public UnaryCallable insertLicenseCallable() { return insertLicenseCallable; @@ -279,6 +349,11 @@ public UnaryCallable listLicenses return listLicensesCallable; } + @BetaApi + public UnaryCallable setIamPolicyLicenseCallable() { + return setIamPolicyLicenseCallable; + } + @BetaApi public UnaryCallable testIamPermissionsLicenseCallable() { 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 index 031497a24be9..f90843cda444 100644 --- 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 @@ -36,6 +36,7 @@ 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.GetIamPolicyNodeGroupHttpRequest; import com.google.cloud.compute.v1.GetNodeGroupHttpRequest; import com.google.cloud.compute.v1.InsertNodeGroupHttpRequest; import com.google.cloud.compute.v1.ListNodeGroupsHttpRequest; @@ -45,10 +46,15 @@ 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.Policy; 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.ProjectZoneNodeGroupResourceName; +import com.google.cloud.compute.v1.SetIamPolicyNodeGroupHttpRequest; import com.google.cloud.compute.v1.SetNodeTemplateNodeGroupHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsNodeGroupHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -167,6 +173,27 @@ public class HttpJsonNodeGroupStub extends NodeGroupStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneNodeGroupResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertNodeGroupMethodDescriptor = @@ -228,6 +255,27 @@ public class HttpJsonNodeGroupStub extends NodeGroupStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyNodeGroupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeGroups.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneNodeGroupResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setNodeTemplateNodeGroupMethodDescriptor = @@ -249,6 +297,30 @@ public class HttpJsonNodeGroupStub extends NodeGroupStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsNodeGroupHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeGroupMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.nodeGroups.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectZoneNodeGroupResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable addNodesNodeGroupCallable; @@ -261,6 +333,8 @@ public class HttpJsonNodeGroupStub extends NodeGroupStub { private final UnaryCallable deleteNodesNodeGroupCallable; private final UnaryCallable getNodeGroupCallable; + private final UnaryCallable + getIamPolicyNodeGroupCallable; private final UnaryCallable insertNodeGroupCallable; private final UnaryCallable listNodeGroupsCallable; private final UnaryCallable @@ -269,8 +343,12 @@ public class HttpJsonNodeGroupStub extends NodeGroupStub { listNodesNodeGroupsCallable; private final UnaryCallable listNodesNodeGroupsPagedCallable; + private final UnaryCallable + setIamPolicyNodeGroupCallable; private final UnaryCallable setNodeTemplateNodeGroupCallable; + private final UnaryCallable + testIamPermissionsNodeGroupCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -335,6 +413,11 @@ protected HttpJsonNodeGroupStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getNodeGroupMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicyNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyNodeGroupMethodDescriptor) + .build(); HttpJsonCallSettings insertNodeGroupTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertNodeGroupMethodDescriptor) @@ -348,11 +431,22 @@ protected HttpJsonNodeGroupStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listNodesNodeGroupsMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicyNodeGroupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyNodeGroupMethodDescriptor) + .build(); HttpJsonCallSettings setNodeTemplateNodeGroupTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setNodeTemplateNodeGroupMethodDescriptor) .build(); + HttpJsonCallSettings + testIamPermissionsNodeGroupTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsNodeGroupMethodDescriptor) + .build(); this.addNodesNodeGroupCallable = callableFactory.createUnaryCallable( @@ -380,6 +474,11 @@ protected HttpJsonNodeGroupStub( this.getNodeGroupCallable = callableFactory.createUnaryCallable( getNodeGroupTransportSettings, settings.getNodeGroupSettings(), clientContext); + this.getIamPolicyNodeGroupCallable = + callableFactory.createUnaryCallable( + getIamPolicyNodeGroupTransportSettings, + settings.getIamPolicyNodeGroupSettings(), + clientContext); this.insertNodeGroupCallable = callableFactory.createUnaryCallable( insertNodeGroupTransportSettings, settings.insertNodeGroupSettings(), clientContext); @@ -399,11 +498,21 @@ protected HttpJsonNodeGroupStub( listNodesNodeGroupsTransportSettings, settings.listNodesNodeGroupsSettings(), clientContext); + this.setIamPolicyNodeGroupCallable = + callableFactory.createUnaryCallable( + setIamPolicyNodeGroupTransportSettings, + settings.setIamPolicyNodeGroupSettings(), + clientContext); this.setNodeTemplateNodeGroupCallable = callableFactory.createUnaryCallable( setNodeTemplateNodeGroupTransportSettings, settings.setNodeTemplateNodeGroupSettings(), clientContext); + this.testIamPermissionsNodeGroupCallable = + callableFactory.createUnaryCallable( + testIamPermissionsNodeGroupTransportSettings, + settings.testIamPermissionsNodeGroupSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -440,6 +549,11 @@ public UnaryCallable getNodeGroupCallable() return getNodeGroupCallable; } + @BetaApi + public UnaryCallable getIamPolicyNodeGroupCallable() { + return getIamPolicyNodeGroupCallable; + } + @BetaApi public UnaryCallable insertNodeGroupCallable() { return insertNodeGroupCallable; @@ -468,12 +582,23 @@ public UnaryCallable listNodeGroupsCal return listNodesNodeGroupsCallable; } + @BetaApi + public UnaryCallable setIamPolicyNodeGroupCallable() { + return setIamPolicyNodeGroupCallable; + } + @BetaApi public UnaryCallable setNodeTemplateNodeGroupCallable() { return setNodeTemplateNodeGroupCallable; } + @BetaApi + public UnaryCallable + testIamPermissionsNodeGroupCallable() { + return testIamPermissionsNodeGroupCallable; + } + @Override public final void close() { shutdown(); 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 index 0027f80e1a79..2120f6bd9abe 100644 --- 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 @@ -33,6 +33,7 @@ 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.GetIamPolicyNodeTemplateHttpRequest; import com.google.cloud.compute.v1.GetNodeTemplateHttpRequest; import com.google.cloud.compute.v1.InsertNodeTemplateHttpRequest; import com.google.cloud.compute.v1.ListNodeTemplatesHttpRequest; @@ -40,9 +41,14 @@ 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.Policy; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.ProjectRegionNodeTemplateName; +import com.google.cloud.compute.v1.ProjectRegionNodeTemplateResourceName; +import com.google.cloud.compute.v1.SetIamPolicyNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -122,6 +128,27 @@ public class HttpJsonNodeTemplateStub extends NodeTemplateStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicyNodeTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTemplates.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionNodeTemplateResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertNodeTemplateMethodDescriptor = @@ -163,6 +190,51 @@ public class HttpJsonNodeTemplateStub extends NodeTemplateStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicyNodeTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.nodeTemplates.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionNodeTemplateResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsNodeTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeTemplateMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.nodeTemplates.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionNodeTemplateResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable @@ -172,11 +244,17 @@ public class HttpJsonNodeTemplateStub extends NodeTemplateStub { aggregatedListNodeTemplatesPagedCallable; private final UnaryCallable deleteNodeTemplateCallable; private final UnaryCallable getNodeTemplateCallable; + private final UnaryCallable + getIamPolicyNodeTemplateCallable; private final UnaryCallable insertNodeTemplateCallable; private final UnaryCallable listNodeTemplatesCallable; private final UnaryCallable listNodeTemplatesPagedCallable; + private final UnaryCallable + setIamPolicyNodeTemplateCallable; + private final UnaryCallable + testIamPermissionsNodeTemplateCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -235,6 +313,11 @@ protected HttpJsonNodeTemplateStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getNodeTemplateMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicyNodeTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyNodeTemplateMethodDescriptor) + .build(); HttpJsonCallSettings insertNodeTemplateTransportSettings = HttpJsonCallSettings.newBuilder() @@ -245,6 +328,17 @@ protected HttpJsonNodeTemplateStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listNodeTemplatesMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicyNodeTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyNodeTemplateMethodDescriptor) + .build(); + HttpJsonCallSettings + testIamPermissionsNodeTemplateTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsNodeTemplateMethodDescriptor) + .build(); this.aggregatedListNodeTemplatesCallable = callableFactory.createUnaryCallable( @@ -264,6 +358,11 @@ protected HttpJsonNodeTemplateStub( this.getNodeTemplateCallable = callableFactory.createUnaryCallable( getNodeTemplateTransportSettings, settings.getNodeTemplateSettings(), clientContext); + this.getIamPolicyNodeTemplateCallable = + callableFactory.createUnaryCallable( + getIamPolicyNodeTemplateTransportSettings, + settings.getIamPolicyNodeTemplateSettings(), + clientContext); this.insertNodeTemplateCallable = callableFactory.createUnaryCallable( insertNodeTemplateTransportSettings, @@ -279,6 +378,16 @@ protected HttpJsonNodeTemplateStub( listNodeTemplatesTransportSettings, settings.listNodeTemplatesSettings(), clientContext); + this.setIamPolicyNodeTemplateCallable = + callableFactory.createUnaryCallable( + setIamPolicyNodeTemplateTransportSettings, + settings.setIamPolicyNodeTemplateSettings(), + clientContext); + this.testIamPermissionsNodeTemplateCallable = + callableFactory.createUnaryCallable( + testIamPermissionsNodeTemplateTransportSettings, + settings.testIamPermissionsNodeTemplateSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -306,6 +415,12 @@ public UnaryCallable getNodeTemplateCa return getNodeTemplateCallable; } + @BetaApi + public UnaryCallable + getIamPolicyNodeTemplateCallable() { + return getIamPolicyNodeTemplateCallable; + } + @BetaApi public UnaryCallable insertNodeTemplateCallable() { return insertNodeTemplateCallable; @@ -322,6 +437,18 @@ public UnaryCallable listNodeTem return listNodeTemplatesCallable; } + @BetaApi + public UnaryCallable + setIamPolicyNodeTemplateCallable() { + return setIamPolicyNodeTemplateCallable; + } + + @BetaApi + public UnaryCallable + testIamPermissionsNodeTemplateCallable() { + return testIamPermissionsNodeTemplateCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java index cb4fbae5818d..9db073010795 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRegionInstanceGroupManagerStub.java @@ -39,6 +39,7 @@ import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.ProjectRegionInstanceGroupManagerName; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; @@ -231,6 +232,28 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + patchRegionInstanceGroupManagerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.regionInstanceGroupManagers.patch") + .setHttpMethod(HttpMethods.PATCH) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")) + .setQueryParams(Sets.newHashSet("requestId")) + .setResourceNameFactory(ProjectRegionInstanceGroupManagerName.newFactory()) + .setResourceNameField("instanceGroupManager") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Operation.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor< RecreateInstancesRegionInstanceGroupManagerHttpRequest, Operation> @@ -347,6 +370,8 @@ public class HttpJsonRegionInstanceGroupManagerStub extends RegionInstanceGroupM ListManagedInstancesRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagersListInstancesResponse> listManagedInstancesRegionInstanceGroupManagersCallable; + private final UnaryCallable + patchRegionInstanceGroupManagerCallable; private final UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable; private final UnaryCallable @@ -448,6 +473,11 @@ protected HttpJsonRegionInstanceGroupManagerStub( .setMethodDescriptor( listManagedInstancesRegionInstanceGroupManagersMethodDescriptor) .build(); + HttpJsonCallSettings + patchRegionInstanceGroupManagerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(patchRegionInstanceGroupManagerMethodDescriptor) + .build(); HttpJsonCallSettings recreateInstancesRegionInstanceGroupManagerTransportSettings = HttpJsonCallSettings @@ -513,6 +543,11 @@ protected HttpJsonRegionInstanceGroupManagerStub( listManagedInstancesRegionInstanceGroupManagersTransportSettings, settings.listManagedInstancesRegionInstanceGroupManagersSettings(), clientContext); + this.patchRegionInstanceGroupManagerCallable = + callableFactory.createUnaryCallable( + patchRegionInstanceGroupManagerTransportSettings, + settings.patchRegionInstanceGroupManagerSettings(), + clientContext); this.recreateInstancesRegionInstanceGroupManagerCallable = callableFactory.createUnaryCallable( recreateInstancesRegionInstanceGroupManagerTransportSettings, @@ -588,6 +623,12 @@ protected HttpJsonRegionInstanceGroupManagerStub( return listManagedInstancesRegionInstanceGroupManagersCallable; } + @BetaApi + public UnaryCallable + patchRegionInstanceGroupManagerCallable() { + return patchRegionInstanceGroupManagerCallable; + } + @BetaApi public UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java index f47074367384..5b51e625c303 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonRouterStub.java @@ -16,6 +16,7 @@ package com.google.cloud.compute.v1.stub; import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.GetNatMappingInfoRoutersPagedResponse; import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.api.client.http.HttpMethods; @@ -33,6 +34,7 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetNatMappingInfoRoutersHttpRequest; import com.google.cloud.compute.v1.GetRouterHttpRequest; import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; import com.google.cloud.compute.v1.InsertRouterHttpRequest; @@ -49,6 +51,7 @@ import com.google.cloud.compute.v1.RouterStatusResponse; import com.google.cloud.compute.v1.RoutersPreviewResponse; import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import com.google.cloud.compute.v1.VmEndpointNatMappingsList; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -122,6 +125,30 @@ public class HttpJsonRouterStub extends RouterStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + GetNatMappingInfoRoutersHttpRequest, VmEndpointNatMappingsList> + getNatMappingInfoRoutersMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.routers.getNatMappingInfo") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/routers/{router}/getNatMappingInfo")) + .setQueryParams( + Sets.newHashSet("filter", "maxResults", "orderBy", "pageToken")) + .setResourceNameFactory(ProjectRegionRouterName.newFactory()) + .setResourceNameField("router") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(VmEndpointNatMappingsList.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor getRouterStatusRouterMethodDescriptor = @@ -251,6 +278,11 @@ public class HttpJsonRouterStub extends RouterStub { aggregatedListRoutersPagedCallable; private final UnaryCallable deleteRouterCallable; private final UnaryCallable getRouterCallable; + private final UnaryCallable + getNatMappingInfoRoutersCallable; + private final UnaryCallable< + GetNatMappingInfoRoutersHttpRequest, GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersPagedCallable; private final UnaryCallable getRouterStatusRouterCallable; private final UnaryCallable insertRouterCallable; @@ -314,6 +346,12 @@ protected HttpJsonRouterStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getRouterMethodDescriptor) .build(); + HttpJsonCallSettings + getNatMappingInfoRoutersTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getNatMappingInfoRoutersMethodDescriptor) + .build(); HttpJsonCallSettings getRouterStatusRouterTransportSettings = HttpJsonCallSettings @@ -358,6 +396,16 @@ protected HttpJsonRouterStub( this.getRouterCallable = callableFactory.createUnaryCallable( getRouterTransportSettings, settings.getRouterSettings(), clientContext); + this.getNatMappingInfoRoutersCallable = + callableFactory.createUnaryCallable( + getNatMappingInfoRoutersTransportSettings, + settings.getNatMappingInfoRoutersSettings(), + clientContext); + this.getNatMappingInfoRoutersPagedCallable = + callableFactory.createPagedCallable( + getNatMappingInfoRoutersTransportSettings, + settings.getNatMappingInfoRoutersSettings(), + clientContext); this.getRouterStatusRouterCallable = callableFactory.createUnaryCallable( getRouterStatusRouterTransportSettings, @@ -407,6 +455,18 @@ public UnaryCallable getRouterCallable() { return getRouterCallable; } + @BetaApi + public UnaryCallable + getNatMappingInfoRoutersPagedCallable() { + return getNatMappingInfoRoutersPagedCallable; + } + + @BetaApi + public UnaryCallable + getNatMappingInfoRoutersCallable() { + return getNatMappingInfoRoutersCallable; + } + @BetaApi public UnaryCallable getRouterStatusRouterCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java index 5cc1d823aa4c..191fc8d9051b 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/HttpJsonSnapshotStub.java @@ -31,15 +31,20 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicySnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ProjectGlobalSnapshotName; import com.google.cloud.compute.v1.ProjectGlobalSnapshotResourceName; import com.google.cloud.compute.v1.ProjectName; +import com.google.cloud.compute.v1.SetIamPolicySnapshotHttpRequest; import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.TestIamPermissionsSnapshotHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.Sets; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -92,6 +97,26 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicySnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/global/snapshots/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSnapshotResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor listSnapshotsMethodDescriptor = @@ -112,6 +137,26 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicySnapshotMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.snapshots.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create("{project}/global/snapshots/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSnapshotResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setLabelsSnapshotMethodDescriptor = @@ -132,14 +177,41 @@ public class HttpJsonSnapshotStub extends SnapshotStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsSnapshotHttpRequest, TestPermissionsResponse> + testIamPermissionsSnapshotMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.snapshots.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/global/snapshots/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectGlobalSnapshotResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable deleteSnapshotCallable; private final UnaryCallable getSnapshotCallable; + private final UnaryCallable getIamPolicySnapshotCallable; private final UnaryCallable listSnapshotsCallable; private final UnaryCallable listSnapshotsPagedCallable; + private final UnaryCallable setIamPolicySnapshotCallable; private final UnaryCallable setLabelsSnapshotCallable; + private final UnaryCallable + testIamPermissionsSnapshotCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -188,15 +260,31 @@ protected HttpJsonSnapshotStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getSnapshotMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicySnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicySnapshotMethodDescriptor) + .build(); HttpJsonCallSettings listSnapshotsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicySnapshotTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicySnapshotMethodDescriptor) + .build(); HttpJsonCallSettings setLabelsSnapshotTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setLabelsSnapshotMethodDescriptor) .build(); + HttpJsonCallSettings + testIamPermissionsSnapshotTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsSnapshotMethodDescriptor) + .build(); this.deleteSnapshotCallable = callableFactory.createUnaryCallable( @@ -204,17 +292,32 @@ protected HttpJsonSnapshotStub( this.getSnapshotCallable = callableFactory.createUnaryCallable( getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); + this.getIamPolicySnapshotCallable = + callableFactory.createUnaryCallable( + getIamPolicySnapshotTransportSettings, + settings.getIamPolicySnapshotSettings(), + clientContext); this.listSnapshotsCallable = callableFactory.createUnaryCallable( listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); this.listSnapshotsPagedCallable = callableFactory.createPagedCallable( listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); + this.setIamPolicySnapshotCallable = + callableFactory.createUnaryCallable( + setIamPolicySnapshotTransportSettings, + settings.setIamPolicySnapshotSettings(), + clientContext); this.setLabelsSnapshotCallable = callableFactory.createUnaryCallable( setLabelsSnapshotTransportSettings, settings.setLabelsSnapshotSettings(), clientContext); + this.testIamPermissionsSnapshotCallable = + callableFactory.createUnaryCallable( + testIamPermissionsSnapshotTransportSettings, + settings.testIamPermissionsSnapshotSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -229,6 +332,11 @@ public UnaryCallable getSnapshotCallable() { return getSnapshotCallable; } + @BetaApi + public UnaryCallable getIamPolicySnapshotCallable() { + return getIamPolicySnapshotCallable; + } + @BetaApi public UnaryCallable listSnapshotsPagedCallable() { @@ -240,11 +348,22 @@ public UnaryCallable listSnapshotsCallab return listSnapshotsCallable; } + @BetaApi + public UnaryCallable setIamPolicySnapshotCallable() { + return setIamPolicySnapshotCallable; + } + @BetaApi public UnaryCallable setLabelsSnapshotCallable() { return setLabelsSnapshotCallable; } + @BetaApi + public UnaryCallable + testIamPermissionsSnapshotCallable() { + return testIamPermissionsSnapshotCallable; + } + @Override public final void close() { shutdown(); 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 4f2a8ee380e4..2a0338c79237 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 @@ -35,19 +35,25 @@ import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicySubnetworkHttpRequest; 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.Policy; import com.google.cloud.compute.v1.ProjectName; import com.google.cloud.compute.v1.ProjectRegionName; import com.google.cloud.compute.v1.ProjectRegionSubnetworkName; +import com.google.cloud.compute.v1.ProjectRegionSubnetworkResourceName; +import com.google.cloud.compute.v1.SetIamPolicySubnetworkHttpRequest; 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.TestIamPermissionsSubnetworkHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.cloud.compute.v1.UsableSubnetworksAggregatedList; import com.google.common.collect.Sets; import java.io.IOException; @@ -149,6 +155,27 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + getIamPolicySubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.getIamPolicy") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionSubnetworkResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor insertSubnetworkMethodDescriptor = @@ -234,6 +261,27 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor + setIamPolicySubnetworkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("compute.subnetworks.setIamPolicy") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter.newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionSubnetworkResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(Policy.getDefaultInstance()) + .build()) + .build(); + @InternalApi public static final ApiMethodDescriptor setPrivateIpGoogleAccessSubnetworkMethodDescriptor = @@ -256,6 +304,30 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { .build()) .build(); + @InternalApi + public static final ApiMethodDescriptor< + TestIamPermissionsSubnetworkHttpRequest, TestPermissionsResponse> + testIamPermissionsSubnetworkMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("compute.subnetworks.testIamPermissions") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ApiMessageHttpRequestFormatter + .newBuilder() + .setPathTemplate( + PathTemplate.create( + "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")) + .setQueryParams(Sets.newHashSet()) + .setResourceNameFactory(ProjectRegionSubnetworkResourceName.newFactory()) + .setResourceNameField("resource") + .build()) + .setResponseParser( + ApiMessageHttpResponseParser.newBuilder() + .setResponseInstance(TestPermissionsResponse.getDefaultInstance()) + .build()) + .build(); + private final BackgroundResource backgroundResources; private final UnaryCallable @@ -267,6 +339,8 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { private final UnaryCallable expandIpCidrRangeSubnetworkCallable; private final UnaryCallable getSubnetworkCallable; + private final UnaryCallable + getIamPolicySubnetworkCallable; private final UnaryCallable insertSubnetworkCallable; private final UnaryCallable listSubnetworksCallable; private final UnaryCallable @@ -276,8 +350,12 @@ public class HttpJsonSubnetworkStub extends SubnetworkStub { private final UnaryCallable listUsableSubnetworksPagedCallable; private final UnaryCallable patchSubnetworkCallable; + private final UnaryCallable + setIamPolicySubnetworkCallable; private final UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable; + private final UnaryCallable + testIamPermissionsSubnetworkCallable; private final HttpJsonStubCallableFactory callableFactory; @@ -338,6 +416,11 @@ protected HttpJsonSubnetworkStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getSubnetworkMethodDescriptor) .build(); + HttpJsonCallSettings + getIamPolicySubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicySubnetworkMethodDescriptor) + .build(); HttpJsonCallSettings insertSubnetworkTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertSubnetworkMethodDescriptor) @@ -357,12 +440,23 @@ protected HttpJsonSubnetworkStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(patchSubnetworkMethodDescriptor) .build(); + HttpJsonCallSettings + setIamPolicySubnetworkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicySubnetworkMethodDescriptor) + .build(); HttpJsonCallSettings setPrivateIpGoogleAccessSubnetworkTransportSettings = HttpJsonCallSettings .newBuilder() .setMethodDescriptor(setPrivateIpGoogleAccessSubnetworkMethodDescriptor) .build(); + HttpJsonCallSettings + testIamPermissionsSubnetworkTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(testIamPermissionsSubnetworkMethodDescriptor) + .build(); this.aggregatedListSubnetworksCallable = callableFactory.createUnaryCallable( @@ -385,6 +479,11 @@ protected HttpJsonSubnetworkStub( this.getSubnetworkCallable = callableFactory.createUnaryCallable( getSubnetworkTransportSettings, settings.getSubnetworkSettings(), clientContext); + this.getIamPolicySubnetworkCallable = + callableFactory.createUnaryCallable( + getIamPolicySubnetworkTransportSettings, + settings.getIamPolicySubnetworkSettings(), + clientContext); this.insertSubnetworkCallable = callableFactory.createUnaryCallable( insertSubnetworkTransportSettings, settings.insertSubnetworkSettings(), clientContext); @@ -407,11 +506,21 @@ protected HttpJsonSubnetworkStub( this.patchSubnetworkCallable = callableFactory.createUnaryCallable( patchSubnetworkTransportSettings, settings.patchSubnetworkSettings(), clientContext); + this.setIamPolicySubnetworkCallable = + callableFactory.createUnaryCallable( + setIamPolicySubnetworkTransportSettings, + settings.setIamPolicySubnetworkSettings(), + clientContext); this.setPrivateIpGoogleAccessSubnetworkCallable = callableFactory.createUnaryCallable( setPrivateIpGoogleAccessSubnetworkTransportSettings, settings.setPrivateIpGoogleAccessSubnetworkSettings(), clientContext); + this.testIamPermissionsSubnetworkCallable = + callableFactory.createUnaryCallable( + testIamPermissionsSubnetworkTransportSettings, + settings.testIamPermissionsSubnetworkSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -444,6 +553,11 @@ public UnaryCallable getSubnetworkCallable return getSubnetworkCallable; } + @BetaApi + public UnaryCallable getIamPolicySubnetworkCallable() { + return getIamPolicySubnetworkCallable; + } + @BetaApi public UnaryCallable insertSubnetworkCallable() { return insertSubnetworkCallable; @@ -477,12 +591,23 @@ public UnaryCallable patchSubnetworkCalla return patchSubnetworkCallable; } + @BetaApi + public UnaryCallable setIamPolicySubnetworkCallable() { + return setIamPolicySubnetworkCallable; + } + @BetaApi public UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { return setPrivateIpGoogleAccessSubnetworkCallable; } + @BetaApi + public UnaryCallable + testIamPermissionsSubnetworkCallable() { + return testIamPermissionsSubnetworkCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java index 658201c561cc..0b7430c27f2a 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStub.java @@ -23,13 +23,18 @@ import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; import com.google.cloud.compute.v1.Image; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyImageHttpRequest; import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsImageHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -62,6 +67,11 @@ public UnaryCallable getFromFamilyImageCal throw new UnsupportedOperationException("Not implemented: getFromFamilyImageCallable()"); } + @BetaApi + public UnaryCallable getIamPolicyImageCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyImageCallable()"); + } + @BetaApi public UnaryCallable insertImageCallable() { throw new UnsupportedOperationException("Not implemented: insertImageCallable()"); @@ -77,11 +87,22 @@ public UnaryCallable listImagesCallable() { throw new UnsupportedOperationException("Not implemented: listImagesCallable()"); } + @BetaApi + public UnaryCallable setIamPolicyImageCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyImageCallable()"); + } + @BetaApi public UnaryCallable setLabelsImageCallable() { throw new UnsupportedOperationException("Not implemented: setLabelsImageCallable()"); } + @BetaApi + public UnaryCallable + testIamPermissionsImageCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsImageCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java index e3c32ae4c562..5383bcb8957c 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/ImageStubSettings.java @@ -42,13 +42,18 @@ import com.google.cloud.compute.v1.DeleteImageHttpRequest; import com.google.cloud.compute.v1.DeprecateImageHttpRequest; import com.google.cloud.compute.v1.GetFromFamilyImageHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyImageHttpRequest; import com.google.cloud.compute.v1.GetImageHttpRequest; import com.google.cloud.compute.v1.Image; import com.google.cloud.compute.v1.ImageList; import com.google.cloud.compute.v1.InsertImageHttpRequest; import com.google.cloud.compute.v1.ListImagesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyImageHttpRequest; import com.google.cloud.compute.v1.SetLabelsImageHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsImageHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -103,10 +108,14 @@ public class ImageStubSettings extends StubSettings { private final UnaryCallSettings deprecateImageSettings; private final UnaryCallSettings getImageSettings; private final UnaryCallSettings getFromFamilyImageSettings; + private final UnaryCallSettings getIamPolicyImageSettings; private final UnaryCallSettings insertImageSettings; private final PagedCallSettings listImagesSettings; + private final UnaryCallSettings setIamPolicyImageSettings; private final UnaryCallSettings setLabelsImageSettings; + private final UnaryCallSettings + testIamPermissionsImageSettings; /** Returns the object with the settings used for calls to deleteImage. */ public UnaryCallSettings deleteImageSettings() { @@ -128,6 +137,11 @@ public UnaryCallSettings getFromFamilyImag return getFromFamilyImageSettings; } + /** Returns the object with the settings used for calls to getIamPolicyImage. */ + public UnaryCallSettings getIamPolicyImageSettings() { + return getIamPolicyImageSettings; + } + /** Returns the object with the settings used for calls to insertImage. */ public UnaryCallSettings insertImageSettings() { return insertImageSettings; @@ -139,11 +153,22 @@ public UnaryCallSettings insertImageSettings( return listImagesSettings; } + /** Returns the object with the settings used for calls to setIamPolicyImage. */ + public UnaryCallSettings setIamPolicyImageSettings() { + return setIamPolicyImageSettings; + } + /** Returns the object with the settings used for calls to setLabelsImage. */ public UnaryCallSettings setLabelsImageSettings() { return setLabelsImageSettings; } + /** Returns the object with the settings used for calls to testIamPermissionsImage. */ + public UnaryCallSettings + testIamPermissionsImageSettings() { + return testIamPermissionsImageSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ImageStub createStub() throws IOException { if (getTransportChannelProvider() @@ -222,9 +247,12 @@ protected ImageStubSettings(Builder settingsBuilder) throws IOException { deprecateImageSettings = settingsBuilder.deprecateImageSettings().build(); getImageSettings = settingsBuilder.getImageSettings().build(); getFromFamilyImageSettings = settingsBuilder.getFromFamilyImageSettings().build(); + getIamPolicyImageSettings = settingsBuilder.getIamPolicyImageSettings().build(); insertImageSettings = settingsBuilder.insertImageSettings().build(); listImagesSettings = settingsBuilder.listImagesSettings().build(); + setIamPolicyImageSettings = settingsBuilder.setIamPolicyImageSettings().build(); setLabelsImageSettings = settingsBuilder.setLabelsImageSettings().build(); + testIamPermissionsImageSettings = settingsBuilder.testIamPermissionsImageSettings().build(); } private static final PagedListDescriptor @@ -291,12 +319,19 @@ public static class Builder extends StubSettings.Builder getImageSettings; private final UnaryCallSettings.Builder getFromFamilyImageSettings; + private final UnaryCallSettings.Builder + getIamPolicyImageSettings; private final UnaryCallSettings.Builder insertImageSettings; private final PagedCallSettings.Builder< ListImagesHttpRequest, ImageList, ListImagesPagedResponse> listImagesSettings; + private final UnaryCallSettings.Builder + setIamPolicyImageSettings; private final UnaryCallSettings.Builder setLabelsImageSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsImageHttpRequest, TestPermissionsResponse> + testIamPermissionsImageSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -347,21 +382,30 @@ protected Builder(ClientContext clientContext) { getFromFamilyImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listImagesSettings = PagedCallSettings.newBuilder(LIST_IMAGES_PAGE_STR_FACT); + setIamPolicyImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setLabelsImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsImageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( deleteImageSettings, deprecateImageSettings, getImageSettings, getFromFamilyImageSettings, + getIamPolicyImageSettings, insertImageSettings, listImagesSettings, - setLabelsImageSettings); + setIamPolicyImageSettings, + setLabelsImageSettings, + testIamPermissionsImageSettings); initDefaults(this); } @@ -397,6 +441,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertImageSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -407,11 +456,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setLabelsImageSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .testIamPermissionsImageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -422,9 +481,12 @@ protected Builder(ImageStubSettings settings) { deprecateImageSettings = settings.deprecateImageSettings.toBuilder(); getImageSettings = settings.getImageSettings.toBuilder(); getFromFamilyImageSettings = settings.getFromFamilyImageSettings.toBuilder(); + getIamPolicyImageSettings = settings.getIamPolicyImageSettings.toBuilder(); insertImageSettings = settings.insertImageSettings.toBuilder(); listImagesSettings = settings.listImagesSettings.toBuilder(); + setIamPolicyImageSettings = settings.setIamPolicyImageSettings.toBuilder(); setLabelsImageSettings = settings.setLabelsImageSettings.toBuilder(); + testIamPermissionsImageSettings = settings.testIamPermissionsImageSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -432,9 +494,12 @@ protected Builder(ImageStubSettings settings) { deprecateImageSettings, getImageSettings, getFromFamilyImageSettings, + getIamPolicyImageSettings, insertImageSettings, listImagesSettings, - setLabelsImageSettings); + setIamPolicyImageSettings, + setLabelsImageSettings, + testIamPermissionsImageSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -475,6 +540,12 @@ public UnaryCallSettings.Builder getImageSettings() return getFromFamilyImageSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyImage. */ + public UnaryCallSettings.Builder + getIamPolicyImageSettings() { + return getIamPolicyImageSettings; + } + /** Returns the builder for the settings used for calls to insertImage. */ public UnaryCallSettings.Builder insertImageSettings() { return insertImageSettings; @@ -486,12 +557,24 @@ public UnaryCallSettings.Builder insertImageS return listImagesSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyImage. */ + public UnaryCallSettings.Builder + setIamPolicyImageSettings() { + return setIamPolicyImageSettings; + } + /** Returns the builder for the settings used for calls to setLabelsImage. */ public UnaryCallSettings.Builder setLabelsImageSettings() { return setLabelsImageSettings; } + /** Returns the builder for the settings used for calls to testIamPermissionsImage. */ + public UnaryCallSettings.Builder + testIamPermissionsImageSettings() { + return testIamPermissionsImageSettings; + } + @Override public ImageStubSettings build() throws IOException { return new ImageStubSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java index 335298698f64..202d852ce5a1 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStub.java @@ -34,6 +34,7 @@ import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; @@ -123,6 +124,12 @@ public abstract class InstanceGroupManagerStub implements BackgroundResource { "Not implemented: listManagedInstancesInstanceGroupManagersCallable()"); } + @BetaApi + public UnaryCallable + patchInstanceGroupManagerCallable() { + throw new UnsupportedOperationException("Not implemented: patchInstanceGroupManagerCallable()"); + } + @BetaApi public UnaryCallable recreateInstancesInstanceGroupManagerCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java index 15488ad1ea6a..9befca23171d 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceGroupManagerStubSettings.java @@ -54,6 +54,7 @@ import com.google.cloud.compute.v1.ListInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.ResizeInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerHttpRequest; @@ -133,6 +134,8 @@ public class InstanceGroupManagerStubSettings ListManagedInstancesInstanceGroupManagersHttpRequest, InstanceGroupManagersListManagedInstancesResponse> listManagedInstancesInstanceGroupManagersSettings; + private final UnaryCallSettings + patchInstanceGroupManagerSettings; private final UnaryCallSettings recreateInstancesInstanceGroupManagerSettings; private final UnaryCallSettings @@ -203,6 +206,12 @@ public class InstanceGroupManagerStubSettings return listManagedInstancesInstanceGroupManagersSettings; } + /** Returns the object with the settings used for calls to patchInstanceGroupManager. */ + public UnaryCallSettings + patchInstanceGroupManagerSettings() { + return patchInstanceGroupManagerSettings; + } + /** * Returns the object with the settings used for calls to recreateInstancesInstanceGroupManager. */ @@ -320,6 +329,7 @@ protected InstanceGroupManagerStubSettings(Builder settingsBuilder) throws IOExc listInstanceGroupManagersSettings = settingsBuilder.listInstanceGroupManagersSettings().build(); listManagedInstancesInstanceGroupManagersSettings = settingsBuilder.listManagedInstancesInstanceGroupManagersSettings().build(); + patchInstanceGroupManagerSettings = settingsBuilder.patchInstanceGroupManagerSettings().build(); recreateInstancesInstanceGroupManagerSettings = settingsBuilder.recreateInstancesInstanceGroupManagerSettings().build(); resizeInstanceGroupManagerSettings = @@ -520,6 +530,8 @@ public static class Builder ListManagedInstancesInstanceGroupManagersHttpRequest, InstanceGroupManagersListManagedInstancesResponse> listManagedInstancesInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder + patchInstanceGroupManagerSettings; private final UnaryCallSettings.Builder< RecreateInstancesInstanceGroupManagerHttpRequest, Operation> recreateInstancesInstanceGroupManagerSettings; @@ -593,6 +605,8 @@ protected Builder(ClientContext clientContext) { listManagedInstancesInstanceGroupManagersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + patchInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + recreateInstancesInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -613,6 +627,7 @@ protected Builder(ClientContext clientContext) { insertInstanceGroupManagerSettings, listInstanceGroupManagersSettings, listManagedInstancesInstanceGroupManagersSettings, + patchInstanceGroupManagerSettings, recreateInstancesInstanceGroupManagerSettings, resizeInstanceGroupManagerSettings, setInstanceTemplateInstanceGroupManagerSettings, @@ -672,6 +687,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .patchInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .recreateInstancesInstanceGroupManagerSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -710,6 +730,7 @@ protected Builder(InstanceGroupManagerStubSettings settings) { listInstanceGroupManagersSettings = settings.listInstanceGroupManagersSettings.toBuilder(); listManagedInstancesInstanceGroupManagersSettings = settings.listManagedInstancesInstanceGroupManagersSettings.toBuilder(); + patchInstanceGroupManagerSettings = settings.patchInstanceGroupManagerSettings.toBuilder(); recreateInstancesInstanceGroupManagerSettings = settings.recreateInstancesInstanceGroupManagerSettings.toBuilder(); resizeInstanceGroupManagerSettings = settings.resizeInstanceGroupManagerSettings.toBuilder(); @@ -728,6 +749,7 @@ protected Builder(InstanceGroupManagerStubSettings settings) { insertInstanceGroupManagerSettings, listInstanceGroupManagersSettings, listManagedInstancesInstanceGroupManagersSettings, + patchInstanceGroupManagerSettings, recreateInstancesInstanceGroupManagerSettings, resizeInstanceGroupManagerSettings, setInstanceTemplateInstanceGroupManagerSettings, @@ -815,6 +837,12 @@ public Builder applyToAllUnaryMethods( return listManagedInstancesInstanceGroupManagersSettings; } + /** Returns the builder for the settings used for calls to patchInstanceGroupManager. */ + public UnaryCallSettings.Builder + patchInstanceGroupManagerSettings() { + return patchInstanceGroupManagerSettings; + } + /** * Returns the builder for the settings used for calls to recreateInstancesInstanceGroupManager. */ diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java index 5b28407e5148..0a121dcb46b4 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStub.java @@ -28,6 +28,7 @@ import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyInstanceHttpRequest; import com.google.cloud.compute.v1.GetInstanceHttpRequest; import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; import com.google.cloud.compute.v1.InsertInstanceHttpRequest; @@ -38,10 +39,12 @@ import com.google.cloud.compute.v1.ListInstancesHttpRequest; import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; import com.google.cloud.compute.v1.SerialPortOutput; import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetIamPolicyInstanceHttpRequest; import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; @@ -54,6 +57,8 @@ import com.google.cloud.compute.v1.StartInstanceHttpRequest; import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsInstanceHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import javax.annotation.Generated; @@ -114,6 +119,11 @@ public UnaryCallable getInstanceCallable() { throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); } + @BetaApi + public UnaryCallable getIamPolicyInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyInstanceCallable()"); + } + @BetaApi public UnaryCallable getSerialPortOutputInstanceCallable() { @@ -168,6 +178,11 @@ public UnaryCallable resetInstanceCallable( throw new UnsupportedOperationException("Not implemented: setDiskAutoDeleteInstanceCallable()"); } + @BetaApi + public UnaryCallable setIamPolicyInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyInstanceCallable()"); + } + @BetaApi public UnaryCallable setLabelsInstanceCallable() { throw new UnsupportedOperationException("Not implemented: setLabelsInstanceCallable()"); @@ -238,6 +253,13 @@ public UnaryCallable stopInstanceCallable() throw new UnsupportedOperationException("Not implemented: stopInstanceCallable()"); } + @BetaApi + public UnaryCallable + testIamPermissionsInstanceCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsInstanceCallable()"); + } + @BetaApi public UnaryCallable updateAccessConfigInstanceCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java index 17107b25db36..2c07e4469c1a 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceStubSettings.java @@ -47,6 +47,7 @@ import com.google.cloud.compute.v1.DeleteAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.DeleteInstanceHttpRequest; import com.google.cloud.compute.v1.DetachDiskInstanceHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyInstanceHttpRequest; import com.google.cloud.compute.v1.GetInstanceHttpRequest; import com.google.cloud.compute.v1.GetSerialPortOutputInstanceHttpRequest; import com.google.cloud.compute.v1.InsertInstanceHttpRequest; @@ -58,11 +59,13 @@ import com.google.cloud.compute.v1.ListInstancesHttpRequest; import com.google.cloud.compute.v1.ListReferrersInstancesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; import com.google.cloud.compute.v1.Reference; import com.google.cloud.compute.v1.ResetInstanceHttpRequest; import com.google.cloud.compute.v1.SerialPortOutput; import com.google.cloud.compute.v1.SetDeletionProtectionInstanceHttpRequest; import com.google.cloud.compute.v1.SetDiskAutoDeleteInstanceHttpRequest; +import com.google.cloud.compute.v1.SetIamPolicyInstanceHttpRequest; import com.google.cloud.compute.v1.SetLabelsInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineResourcesInstanceHttpRequest; import com.google.cloud.compute.v1.SetMachineTypeInstanceHttpRequest; @@ -75,6 +78,8 @@ import com.google.cloud.compute.v1.StartInstanceHttpRequest; import com.google.cloud.compute.v1.StartWithEncryptionKeyInstanceHttpRequest; import com.google.cloud.compute.v1.StopInstanceHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsInstanceHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.cloud.compute.v1.UpdateAccessConfigInstanceHttpRequest; import com.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceHttpRequest; import com.google.common.collect.ImmutableList; @@ -142,6 +147,8 @@ public class InstanceStubSettings extends StubSettings { private final UnaryCallSettings detachDiskInstanceSettings; private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings + getIamPolicyInstanceSettings; private final UnaryCallSettings getSerialPortOutputInstanceSettings; private final UnaryCallSettings insertInstanceSettings; @@ -158,6 +165,8 @@ public class InstanceStubSettings extends StubSettings { setDeletionProtectionInstanceSettings; private final UnaryCallSettings setDiskAutoDeleteInstanceSettings; + private final UnaryCallSettings + setIamPolicyInstanceSettings; private final UnaryCallSettings setLabelsInstanceSettings; private final UnaryCallSettings @@ -179,6 +188,8 @@ public class InstanceStubSettings extends StubSettings { private final UnaryCallSettings startWithEncryptionKeyInstanceSettings; private final UnaryCallSettings stopInstanceSettings; + private final UnaryCallSettings + testIamPermissionsInstanceSettings; private final UnaryCallSettings updateAccessConfigInstanceSettings; private final UnaryCallSettings @@ -225,6 +236,11 @@ public UnaryCallSettings getInstanceSettings() return getInstanceSettings; } + /** Returns the object with the settings used for calls to getIamPolicyInstance. */ + public UnaryCallSettings getIamPolicyInstanceSettings() { + return getIamPolicyInstanceSettings; + } + /** Returns the object with the settings used for calls to getSerialPortOutputInstance. */ public UnaryCallSettings getSerialPortOutputInstanceSettings() { @@ -268,6 +284,11 @@ public UnaryCallSettings resetInstanceSetti return setDiskAutoDeleteInstanceSettings; } + /** Returns the object with the settings used for calls to setIamPolicyInstance. */ + public UnaryCallSettings setIamPolicyInstanceSettings() { + return setIamPolicyInstanceSettings; + } + /** Returns the object with the settings used for calls to setLabelsInstance. */ public UnaryCallSettings setLabelsInstanceSettings() { return setLabelsInstanceSettings; @@ -336,6 +357,12 @@ public UnaryCallSettings stopInstanceSetting return stopInstanceSettings; } + /** Returns the object with the settings used for calls to testIamPermissionsInstance. */ + public UnaryCallSettings + testIamPermissionsInstanceSettings() { + return testIamPermissionsInstanceSettings; + } + /** Returns the object with the settings used for calls to updateAccessConfigInstance. */ public UnaryCallSettings updateAccessConfigInstanceSettings() { @@ -430,6 +457,7 @@ protected InstanceStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.deleteAccessConfigInstanceSettings().build(); detachDiskInstanceSettings = settingsBuilder.detachDiskInstanceSettings().build(); getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + getIamPolicyInstanceSettings = settingsBuilder.getIamPolicyInstanceSettings().build(); getSerialPortOutputInstanceSettings = settingsBuilder.getSerialPortOutputInstanceSettings().build(); insertInstanceSettings = settingsBuilder.insertInstanceSettings().build(); @@ -439,6 +467,7 @@ protected InstanceStubSettings(Builder settingsBuilder) throws IOException { setDeletionProtectionInstanceSettings = settingsBuilder.setDeletionProtectionInstanceSettings().build(); setDiskAutoDeleteInstanceSettings = settingsBuilder.setDiskAutoDeleteInstanceSettings().build(); + setIamPolicyInstanceSettings = settingsBuilder.setIamPolicyInstanceSettings().build(); setLabelsInstanceSettings = settingsBuilder.setLabelsInstanceSettings().build(); setMachineResourcesInstanceSettings = settingsBuilder.setMachineResourcesInstanceSettings().build(); @@ -454,6 +483,8 @@ protected InstanceStubSettings(Builder settingsBuilder) throws IOException { startWithEncryptionKeyInstanceSettings = settingsBuilder.startWithEncryptionKeyInstanceSettings().build(); stopInstanceSettings = settingsBuilder.stopInstanceSettings().build(); + testIamPermissionsInstanceSettings = + settingsBuilder.testIamPermissionsInstanceSettings().build(); updateAccessConfigInstanceSettings = settingsBuilder.updateAccessConfigInstanceSettings().build(); updateNetworkInterfaceInstanceSettings = @@ -672,6 +703,8 @@ public static class Builder extends StubSettings.Builder detachDiskInstanceSettings; private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + getIamPolicyInstanceSettings; private final UnaryCallSettings.Builder< GetSerialPortOutputInstanceHttpRequest, SerialPortOutput> getSerialPortOutputInstanceSettings; @@ -691,6 +724,8 @@ public static class Builder extends StubSettings.Builder setDiskAutoDeleteInstanceSettings; + private final UnaryCallSettings.Builder + setIamPolicyInstanceSettings; private final UnaryCallSettings.Builder setLabelsInstanceSettings; private final UnaryCallSettings.Builder @@ -715,6 +750,9 @@ public static class Builder extends StubSettings.Builder stopInstanceSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsInstanceHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceSettings; private final UnaryCallSettings.Builder updateAccessConfigInstanceSettings; private final UnaryCallSettings.Builder @@ -776,6 +814,8 @@ protected Builder(ClientContext clientContext) { getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSerialPortOutputInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); insertInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -791,6 +831,8 @@ protected Builder(ClientContext clientContext) { setDiskAutoDeleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicyInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setLabelsInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setMachineResourcesInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -815,6 +857,8 @@ protected Builder(ClientContext clientContext) { stopInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAccessConfigInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateNetworkInterfaceInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -828,6 +872,7 @@ protected Builder(ClientContext clientContext) { deleteAccessConfigInstanceSettings, detachDiskInstanceSettings, getInstanceSettings, + getIamPolicyInstanceSettings, getSerialPortOutputInstanceSettings, insertInstanceSettings, listInstancesSettings, @@ -835,6 +880,7 @@ protected Builder(ClientContext clientContext) { resetInstanceSettings, setDeletionProtectionInstanceSettings, setDiskAutoDeleteInstanceSettings, + setIamPolicyInstanceSettings, setLabelsInstanceSettings, setMachineResourcesInstanceSettings, setMachineTypeInstanceSettings, @@ -847,6 +893,7 @@ protected Builder(ClientContext clientContext) { startInstanceSettings, startWithEncryptionKeyInstanceSettings, stopInstanceSettings, + testIamPermissionsInstanceSettings, updateAccessConfigInstanceSettings, updateNetworkInterfaceInstanceSettings); @@ -899,6 +946,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .getSerialPortOutputInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -934,6 +986,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setLabelsInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -994,6 +1051,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .testIamPermissionsInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .updateAccessConfigInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -1017,6 +1079,7 @@ protected Builder(InstanceStubSettings settings) { deleteAccessConfigInstanceSettings = settings.deleteAccessConfigInstanceSettings.toBuilder(); detachDiskInstanceSettings = settings.detachDiskInstanceSettings.toBuilder(); getInstanceSettings = settings.getInstanceSettings.toBuilder(); + getIamPolicyInstanceSettings = settings.getIamPolicyInstanceSettings.toBuilder(); getSerialPortOutputInstanceSettings = settings.getSerialPortOutputInstanceSettings.toBuilder(); insertInstanceSettings = settings.insertInstanceSettings.toBuilder(); @@ -1026,6 +1089,7 @@ protected Builder(InstanceStubSettings settings) { setDeletionProtectionInstanceSettings = settings.setDeletionProtectionInstanceSettings.toBuilder(); setDiskAutoDeleteInstanceSettings = settings.setDiskAutoDeleteInstanceSettings.toBuilder(); + setIamPolicyInstanceSettings = settings.setIamPolicyInstanceSettings.toBuilder(); setLabelsInstanceSettings = settings.setLabelsInstanceSettings.toBuilder(); setMachineResourcesInstanceSettings = settings.setMachineResourcesInstanceSettings.toBuilder(); @@ -1041,6 +1105,7 @@ protected Builder(InstanceStubSettings settings) { startWithEncryptionKeyInstanceSettings = settings.startWithEncryptionKeyInstanceSettings.toBuilder(); stopInstanceSettings = settings.stopInstanceSettings.toBuilder(); + testIamPermissionsInstanceSettings = settings.testIamPermissionsInstanceSettings.toBuilder(); updateAccessConfigInstanceSettings = settings.updateAccessConfigInstanceSettings.toBuilder(); updateNetworkInterfaceInstanceSettings = settings.updateNetworkInterfaceInstanceSettings.toBuilder(); @@ -1054,6 +1119,7 @@ protected Builder(InstanceStubSettings settings) { deleteAccessConfigInstanceSettings, detachDiskInstanceSettings, getInstanceSettings, + getIamPolicyInstanceSettings, getSerialPortOutputInstanceSettings, insertInstanceSettings, listInstancesSettings, @@ -1061,6 +1127,7 @@ protected Builder(InstanceStubSettings settings) { resetInstanceSettings, setDeletionProtectionInstanceSettings, setDiskAutoDeleteInstanceSettings, + setIamPolicyInstanceSettings, setLabelsInstanceSettings, setMachineResourcesInstanceSettings, setMachineTypeInstanceSettings, @@ -1073,6 +1140,7 @@ protected Builder(InstanceStubSettings settings) { startInstanceSettings, startWithEncryptionKeyInstanceSettings, stopInstanceSettings, + testIamPermissionsInstanceSettings, updateAccessConfigInstanceSettings, updateNetworkInterfaceInstanceSettings); } @@ -1137,6 +1205,12 @@ public UnaryCallSettings.Builder getInstanceSe return getInstanceSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyInstance. */ + public UnaryCallSettings.Builder + getIamPolicyInstanceSettings() { + return getIamPolicyInstanceSettings; + } + /** Returns the builder for the settings used for calls to getSerialPortOutputInstance. */ public UnaryCallSettings.Builder getSerialPortOutputInstanceSettings() { @@ -1182,6 +1256,12 @@ public UnaryCallSettings.Builder resetInsta return setDiskAutoDeleteInstanceSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyInstance. */ + public UnaryCallSettings.Builder + setIamPolicyInstanceSettings() { + return setIamPolicyInstanceSettings; + } + /** Returns the builder for the settings used for calls to setLabelsInstance. */ public UnaryCallSettings.Builder setLabelsInstanceSettings() { @@ -1252,6 +1332,12 @@ public UnaryCallSettings.Builder stopInstanc return stopInstanceSettings; } + /** Returns the builder for the settings used for calls to testIamPermissionsInstance. */ + public UnaryCallSettings.Builder + testIamPermissionsInstanceSettings() { + return testIamPermissionsInstanceSettings; + } + /** Returns the builder for the settings used for calls to updateAccessConfigInstance. */ public UnaryCallSettings.Builder updateAccessConfigInstanceSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java index df2944463d78..6826da8ccf02 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStub.java @@ -21,12 +21,17 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InstanceTemplate; import com.google.cloud.compute.v1.InstanceTemplateList; import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -51,6 +56,13 @@ public abstract class InstanceTemplateStub implements BackgroundResource { throw new UnsupportedOperationException("Not implemented: getInstanceTemplateCallable()"); } + @BetaApi + public UnaryCallable + getIamPolicyInstanceTemplateCallable() { + throw new UnsupportedOperationException( + "Not implemented: getIamPolicyInstanceTemplateCallable()"); + } + @BetaApi public UnaryCallable insertInstanceTemplateCallable() { @@ -70,6 +82,20 @@ public abstract class InstanceTemplateStub implements BackgroundResource { throw new UnsupportedOperationException("Not implemented: listInstanceTemplatesCallable()"); } + @BetaApi + public UnaryCallable + setIamPolicyInstanceTemplateCallable() { + throw new UnsupportedOperationException( + "Not implemented: setIamPolicyInstanceTemplateCallable()"); + } + + @BetaApi + public UnaryCallable + testIamPermissionsInstanceTemplateCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsInstanceTemplateCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java index 770588895e19..65d938e29e3d 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplateStubSettings.java @@ -40,12 +40,17 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.GetInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InsertInstanceTemplateHttpRequest; import com.google.cloud.compute.v1.InstanceTemplate; import com.google.cloud.compute.v1.InstanceTemplateList; import com.google.cloud.compute.v1.ListInstanceTemplatesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -100,6 +105,8 @@ public class InstanceTemplateStubSettings extends StubSettings getInstanceTemplateSettings; + private final UnaryCallSettings + getIamPolicyInstanceTemplateSettings; private final UnaryCallSettings insertInstanceTemplateSettings; private final PagedCallSettings< @@ -107,6 +114,11 @@ public class InstanceTemplateStubSettings extends StubSettings listInstanceTemplatesSettings; + private final UnaryCallSettings + setIamPolicyInstanceTemplateSettings; + private final UnaryCallSettings< + TestIamPermissionsInstanceTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceTemplateSettings; /** Returns the object with the settings used for calls to deleteInstanceTemplate. */ public UnaryCallSettings @@ -120,6 +132,12 @@ public class InstanceTemplateStubSettings extends StubSettings + getIamPolicyInstanceTemplateSettings() { + return getIamPolicyInstanceTemplateSettings; + } + /** Returns the object with the settings used for calls to insertInstanceTemplate. */ public UnaryCallSettings insertInstanceTemplateSettings() { @@ -135,6 +153,18 @@ public class InstanceTemplateStubSettings extends StubSettings + setIamPolicyInstanceTemplateSettings() { + return setIamPolicyInstanceTemplateSettings; + } + + /** Returns the object with the settings used for calls to testIamPermissionsInstanceTemplate. */ + public UnaryCallSettings + testIamPermissionsInstanceTemplateSettings() { + return testIamPermissionsInstanceTemplateSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public InstanceTemplateStub createStub() throws IOException { if (getTransportChannelProvider() @@ -212,8 +242,14 @@ protected InstanceTemplateStubSettings(Builder settingsBuilder) throws IOExcepti deleteInstanceTemplateSettings = settingsBuilder.deleteInstanceTemplateSettings().build(); getInstanceTemplateSettings = settingsBuilder.getInstanceTemplateSettings().build(); + getIamPolicyInstanceTemplateSettings = + settingsBuilder.getIamPolicyInstanceTemplateSettings().build(); insertInstanceTemplateSettings = settingsBuilder.insertInstanceTemplateSettings().build(); listInstanceTemplatesSettings = settingsBuilder.listInstanceTemplatesSettings().build(); + setIamPolicyInstanceTemplateSettings = + settingsBuilder.setIamPolicyInstanceTemplateSettings().build(); + testIamPermissionsInstanceTemplateSettings = + settingsBuilder.testIamPermissionsInstanceTemplateSettings().build(); } private static final PagedListDescriptor< @@ -291,6 +327,8 @@ public static class Builder extends StubSettings.Builder getInstanceTemplateSettings; + private final UnaryCallSettings.Builder + getIamPolicyInstanceTemplateSettings; private final UnaryCallSettings.Builder insertInstanceTemplateSettings; private final PagedCallSettings.Builder< @@ -298,6 +336,11 @@ public static class Builder extends StubSettings.Builder listInstanceTemplatesSettings; + private final UnaryCallSettings.Builder + setIamPolicyInstanceTemplateSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsInstanceTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceTemplateSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -344,17 +387,26 @@ protected Builder(ClientContext clientContext) { getInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listInstanceTemplatesSettings = PagedCallSettings.newBuilder(LIST_INSTANCE_TEMPLATES_PAGE_STR_FACT); + setIamPolicyInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsInstanceTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( deleteInstanceTemplateSettings, getInstanceTemplateSettings, + getIamPolicyInstanceTemplateSettings, insertInstanceTemplateSettings, - listInstanceTemplatesSettings); + listInstanceTemplatesSettings, + setIamPolicyInstanceTemplateSettings, + testIamPermissionsInstanceTemplateSettings); initDefaults(this); } @@ -380,6 +432,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyInstanceTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertInstanceTemplateSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -390,6 +447,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyInstanceTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsInstanceTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -398,15 +465,24 @@ protected Builder(InstanceTemplateStubSettings settings) { deleteInstanceTemplateSettings = settings.deleteInstanceTemplateSettings.toBuilder(); getInstanceTemplateSettings = settings.getInstanceTemplateSettings.toBuilder(); + getIamPolicyInstanceTemplateSettings = + settings.getIamPolicyInstanceTemplateSettings.toBuilder(); insertInstanceTemplateSettings = settings.insertInstanceTemplateSettings.toBuilder(); listInstanceTemplatesSettings = settings.listInstanceTemplatesSettings.toBuilder(); + setIamPolicyInstanceTemplateSettings = + settings.setIamPolicyInstanceTemplateSettings.toBuilder(); + testIamPermissionsInstanceTemplateSettings = + settings.testIamPermissionsInstanceTemplateSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( deleteInstanceTemplateSettings, getInstanceTemplateSettings, + getIamPolicyInstanceTemplateSettings, insertInstanceTemplateSettings, - listInstanceTemplatesSettings); + listInstanceTemplatesSettings, + setIamPolicyInstanceTemplateSettings, + testIamPermissionsInstanceTemplateSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -437,6 +513,12 @@ public Builder applyToAllUnaryMethods( return getInstanceTemplateSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyInstanceTemplate. */ + public UnaryCallSettings.Builder + getIamPolicyInstanceTemplateSettings() { + return getIamPolicyInstanceTemplateSettings; + } + /** Returns the builder for the settings used for calls to insertInstanceTemplate. */ public UnaryCallSettings.Builder insertInstanceTemplateSettings() { @@ -452,6 +534,21 @@ public Builder applyToAllUnaryMethods( return listInstanceTemplatesSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyInstanceTemplate. */ + public UnaryCallSettings.Builder + setIamPolicyInstanceTemplateSettings() { + return setIamPolicyInstanceTemplateSettings; + } + + /** + * Returns the builder for the settings used for calls to testIamPermissionsInstanceTemplate. + */ + public UnaryCallSettings.Builder< + TestIamPermissionsInstanceTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsInstanceTemplateSettings() { + return testIamPermissionsInstanceTemplateSettings; + } + @Override public InstanceTemplateStubSettings build() throws IOException { return new InstanceTemplateStubSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java index 6dff773ec683..cb307e07bb6b 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStub.java @@ -21,10 +21,12 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetDiagnosticsInterconnectHttpRequest; import com.google.cloud.compute.v1.GetInterconnectHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; import com.google.cloud.compute.v1.Interconnect; import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; @@ -50,6 +52,13 @@ public UnaryCallable getInterconnectCa throw new UnsupportedOperationException("Not implemented: getInterconnectCallable()"); } + @BetaApi + public UnaryCallable + getDiagnosticsInterconnectCallable() { + throw new UnsupportedOperationException( + "Not implemented: getDiagnosticsInterconnectCallable()"); + } + @BetaApi public UnaryCallable insertInterconnectCallable() { throw new UnsupportedOperationException("Not implemented: insertInterconnectCallable()"); diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java index 5f6cdf330cda..baa6c7f13a43 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InterconnectStubSettings.java @@ -40,10 +40,12 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteInterconnectHttpRequest; +import com.google.cloud.compute.v1.GetDiagnosticsInterconnectHttpRequest; import com.google.cloud.compute.v1.GetInterconnectHttpRequest; import com.google.cloud.compute.v1.InsertInterconnectHttpRequest; import com.google.cloud.compute.v1.Interconnect; import com.google.cloud.compute.v1.InterconnectList; +import com.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; import com.google.cloud.compute.v1.ListInterconnectsHttpRequest; import com.google.cloud.compute.v1.Operation; import com.google.cloud.compute.v1.PatchInterconnectHttpRequest; @@ -100,6 +102,9 @@ public class InterconnectStubSettings extends StubSettings deleteInterconnectSettings; private final UnaryCallSettings getInterconnectSettings; + private final UnaryCallSettings< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectSettings; private final UnaryCallSettings insertInterconnectSettings; private final PagedCallSettings< @@ -118,6 +123,13 @@ public UnaryCallSettings getInterconne return getInterconnectSettings; } + /** Returns the object with the settings used for calls to getDiagnosticsInterconnect. */ + public UnaryCallSettings< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectSettings() { + return getDiagnosticsInterconnectSettings; + } + /** Returns the object with the settings used for calls to insertInterconnect. */ public UnaryCallSettings insertInterconnectSettings() { return insertInterconnectSettings; @@ -212,6 +224,8 @@ protected InterconnectStubSettings(Builder settingsBuilder) throws IOException { deleteInterconnectSettings = settingsBuilder.deleteInterconnectSettings().build(); getInterconnectSettings = settingsBuilder.getInterconnectSettings().build(); + getDiagnosticsInterconnectSettings = + settingsBuilder.getDiagnosticsInterconnectSettings().build(); insertInterconnectSettings = settingsBuilder.insertInterconnectSettings().build(); listInterconnectsSettings = settingsBuilder.listInterconnectsSettings().build(); patchInterconnectSettings = settingsBuilder.patchInterconnectSettings().build(); @@ -285,6 +299,9 @@ public static class Builder extends StubSettings.Builder getInterconnectSettings; + private final UnaryCallSettings.Builder< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectSettings; private final UnaryCallSettings.Builder insertInterconnectSettings; private final PagedCallSettings.Builder< @@ -338,6 +355,8 @@ protected Builder(ClientContext clientContext) { getInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDiagnosticsInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertInterconnectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listInterconnectsSettings = PagedCallSettings.newBuilder(LIST_INTERCONNECTS_PAGE_STR_FACT); @@ -348,6 +367,7 @@ protected Builder(ClientContext clientContext) { ImmutableList.>of( deleteInterconnectSettings, getInterconnectSettings, + getDiagnosticsInterconnectSettings, insertInterconnectSettings, listInterconnectsSettings, patchInterconnectSettings); @@ -376,6 +396,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getDiagnosticsInterconnectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertInterconnectSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -399,6 +424,7 @@ protected Builder(InterconnectStubSettings settings) { deleteInterconnectSettings = settings.deleteInterconnectSettings.toBuilder(); getInterconnectSettings = settings.getInterconnectSettings.toBuilder(); + getDiagnosticsInterconnectSettings = settings.getDiagnosticsInterconnectSettings.toBuilder(); insertInterconnectSettings = settings.insertInterconnectSettings.toBuilder(); listInterconnectsSettings = settings.listInterconnectsSettings.toBuilder(); patchInterconnectSettings = settings.patchInterconnectSettings.toBuilder(); @@ -407,6 +433,7 @@ protected Builder(InterconnectStubSettings settings) { ImmutableList.>of( deleteInterconnectSettings, getInterconnectSettings, + getDiagnosticsInterconnectSettings, insertInterconnectSettings, listInterconnectsSettings, patchInterconnectSettings); @@ -440,6 +467,13 @@ public Builder applyToAllUnaryMethods( return getInterconnectSettings; } + /** Returns the builder for the settings used for calls to getDiagnosticsInterconnect. */ + public UnaryCallSettings.Builder< + GetDiagnosticsInterconnectHttpRequest, InterconnectsGetDiagnosticsResponse> + getDiagnosticsInterconnectSettings() { + return getDiagnosticsInterconnectSettings; + } + /** Returns the builder for the settings used for calls to insertInterconnect. */ public UnaryCallSettings.Builder insertInterconnectSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java index e0210ccedad2..da237b0d97ef 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStub.java @@ -21,12 +21,15 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteLicenseHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyLicenseHttpRequest; import com.google.cloud.compute.v1.GetLicenseHttpRequest; import com.google.cloud.compute.v1.InsertLicenseHttpRequest; import com.google.cloud.compute.v1.License; import com.google.cloud.compute.v1.LicensesListResponse; import com.google.cloud.compute.v1.ListLicensesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyLicenseHttpRequest; import com.google.cloud.compute.v1.TestIamPermissionsLicenseHttpRequest; import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; @@ -51,6 +54,11 @@ public UnaryCallable getLicenseCallable() { throw new UnsupportedOperationException("Not implemented: getLicenseCallable()"); } + @BetaApi + public UnaryCallable getIamPolicyLicenseCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyLicenseCallable()"); + } + @BetaApi public UnaryCallable insertLicenseCallable() { throw new UnsupportedOperationException("Not implemented: insertLicenseCallable()"); @@ -67,6 +75,11 @@ public UnaryCallable listLicenses throw new UnsupportedOperationException("Not implemented: listLicensesCallable()"); } + @BetaApi + public UnaryCallable setIamPolicyLicenseCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyLicenseCallable()"); + } + @BetaApi public UnaryCallable testIamPermissionsLicenseCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java index e5593a950bb0..94f1403e37ea 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/LicenseStubSettings.java @@ -40,12 +40,15 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteLicenseHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicyLicenseHttpRequest; import com.google.cloud.compute.v1.GetLicenseHttpRequest; import com.google.cloud.compute.v1.InsertLicenseHttpRequest; import com.google.cloud.compute.v1.License; import com.google.cloud.compute.v1.LicensesListResponse; import com.google.cloud.compute.v1.ListLicensesHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyLicenseHttpRequest; import com.google.cloud.compute.v1.TestIamPermissionsLicenseHttpRequest; import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; @@ -100,10 +103,14 @@ public class LicenseStubSettings extends StubSettings { private final UnaryCallSettings deleteLicenseSettings; private final UnaryCallSettings getLicenseSettings; + private final UnaryCallSettings + getIamPolicyLicenseSettings; private final UnaryCallSettings insertLicenseSettings; private final PagedCallSettings< ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse> listLicensesSettings; + private final UnaryCallSettings + setIamPolicyLicenseSettings; private final UnaryCallSettings testIamPermissionsLicenseSettings; @@ -117,6 +124,11 @@ public UnaryCallSettings getLicenseSettings() { return getLicenseSettings; } + /** Returns the object with the settings used for calls to getIamPolicyLicense. */ + public UnaryCallSettings getIamPolicyLicenseSettings() { + return getIamPolicyLicenseSettings; + } + /** Returns the object with the settings used for calls to insertLicense. */ public UnaryCallSettings insertLicenseSettings() { return insertLicenseSettings; @@ -128,6 +140,11 @@ public UnaryCallSettings insertLicenseSetti return listLicensesSettings; } + /** Returns the object with the settings used for calls to setIamPolicyLicense. */ + public UnaryCallSettings setIamPolicyLicenseSettings() { + return setIamPolicyLicenseSettings; + } + /** Returns the object with the settings used for calls to testIamPermissionsLicense. */ public UnaryCallSettings testIamPermissionsLicenseSettings() { @@ -210,8 +227,10 @@ protected LicenseStubSettings(Builder settingsBuilder) throws IOException { deleteLicenseSettings = settingsBuilder.deleteLicenseSettings().build(); getLicenseSettings = settingsBuilder.getLicenseSettings().build(); + getIamPolicyLicenseSettings = settingsBuilder.getIamPolicyLicenseSettings().build(); insertLicenseSettings = settingsBuilder.insertLicenseSettings().build(); listLicensesSettings = settingsBuilder.listLicensesSettings().build(); + setIamPolicyLicenseSettings = settingsBuilder.setIamPolicyLicenseSettings().build(); testIamPermissionsLicenseSettings = settingsBuilder.testIamPermissionsLicenseSettings().build(); } @@ -277,11 +296,15 @@ public static class Builder extends StubSettings.Builder deleteLicenseSettings; private final UnaryCallSettings.Builder getLicenseSettings; + private final UnaryCallSettings.Builder + getIamPolicyLicenseSettings; private final UnaryCallSettings.Builder insertLicenseSettings; private final PagedCallSettings.Builder< ListLicensesHttpRequest, LicensesListResponse, ListLicensesPagedResponse> listLicensesSettings; + private final UnaryCallSettings.Builder + setIamPolicyLicenseSettings; private final UnaryCallSettings.Builder< TestIamPermissionsLicenseHttpRequest, TestPermissionsResponse> testIamPermissionsLicenseSettings; @@ -331,18 +354,24 @@ protected Builder(ClientContext clientContext) { getLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLicensesSettings = PagedCallSettings.newBuilder(LIST_LICENSES_PAGE_STR_FACT); + setIamPolicyLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsLicenseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( deleteLicenseSettings, getLicenseSettings, + getIamPolicyLicenseSettings, insertLicenseSettings, listLicensesSettings, + setIamPolicyLicenseSettings, testIamPermissionsLicenseSettings); initDefaults(this); @@ -369,6 +398,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyLicenseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertLicenseSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -379,6 +413,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyLicenseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .testIamPermissionsLicenseSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -392,16 +431,20 @@ protected Builder(LicenseStubSettings settings) { deleteLicenseSettings = settings.deleteLicenseSettings.toBuilder(); getLicenseSettings = settings.getLicenseSettings.toBuilder(); + getIamPolicyLicenseSettings = settings.getIamPolicyLicenseSettings.toBuilder(); insertLicenseSettings = settings.insertLicenseSettings.toBuilder(); listLicensesSettings = settings.listLicensesSettings.toBuilder(); + setIamPolicyLicenseSettings = settings.setIamPolicyLicenseSettings.toBuilder(); testIamPermissionsLicenseSettings = settings.testIamPermissionsLicenseSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( deleteLicenseSettings, getLicenseSettings, + getIamPolicyLicenseSettings, insertLicenseSettings, listLicensesSettings, + setIamPolicyLicenseSettings, testIamPermissionsLicenseSettings); } @@ -431,6 +474,12 @@ public UnaryCallSettings.Builder getLicenseSetti return getLicenseSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyLicense. */ + public UnaryCallSettings.Builder + getIamPolicyLicenseSettings() { + return getIamPolicyLicenseSettings; + } + /** Returns the builder for the settings used for calls to insertLicense. */ public UnaryCallSettings.Builder insertLicenseSettings() { return insertLicenseSettings; @@ -443,6 +492,12 @@ public UnaryCallSettings.Builder insertLice return listLicensesSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyLicense. */ + public UnaryCallSettings.Builder + setIamPolicyLicenseSettings() { + return setIamPolicyLicenseSettings; + } + /** Returns the builder for the settings used for calls to testIamPermissionsLicense. */ public UnaryCallSettings.Builder testIamPermissionsLicenseSettings() { 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 index 91b1d7549b67..10555e25c1a2 100644 --- 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 @@ -26,6 +26,7 @@ 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.GetIamPolicyNodeGroupHttpRequest; import com.google.cloud.compute.v1.GetNodeGroupHttpRequest; import com.google.cloud.compute.v1.InsertNodeGroupHttpRequest; import com.google.cloud.compute.v1.ListNodeGroupsHttpRequest; @@ -35,7 +36,11 @@ 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.Policy; +import com.google.cloud.compute.v1.SetIamPolicyNodeGroupHttpRequest; import com.google.cloud.compute.v1.SetNodeTemplateNodeGroupHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsNodeGroupHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -81,6 +86,11 @@ public UnaryCallable getNodeGroupCallable() throw new UnsupportedOperationException("Not implemented: getNodeGroupCallable()"); } + @BetaApi + public UnaryCallable getIamPolicyNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyNodeGroupCallable()"); + } + @BetaApi public UnaryCallable insertNodeGroupCallable() { throw new UnsupportedOperationException("Not implemented: insertNodeGroupCallable()"); @@ -109,12 +119,24 @@ public UnaryCallable listNodeGroupsCal throw new UnsupportedOperationException("Not implemented: listNodesNodeGroupsCallable()"); } + @BetaApi + public UnaryCallable setIamPolicyNodeGroupCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyNodeGroupCallable()"); + } + @BetaApi public UnaryCallable setNodeTemplateNodeGroupCallable() { throw new UnsupportedOperationException("Not implemented: setNodeTemplateNodeGroupCallable()"); } + @BetaApi + public UnaryCallable + testIamPermissionsNodeGroupCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsNodeGroupCallable()"); + } + @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 index 08564705c8e7..431aba42d04f 100644 --- 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 @@ -45,6 +45,7 @@ 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.GetIamPolicyNodeGroupHttpRequest; import com.google.cloud.compute.v1.GetNodeGroupHttpRequest; import com.google.cloud.compute.v1.InsertNodeGroupHttpRequest; import com.google.cloud.compute.v1.ListNodeGroupsHttpRequest; @@ -56,7 +57,11 @@ 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.Policy; +import com.google.cloud.compute.v1.SetIamPolicyNodeGroupHttpRequest; import com.google.cloud.compute.v1.SetNodeTemplateNodeGroupHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsNodeGroupHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -118,6 +123,8 @@ public class NodeGroupStubSettings extends StubSettings { private final UnaryCallSettings deleteNodesNodeGroupSettings; private final UnaryCallSettings getNodeGroupSettings; + private final UnaryCallSettings + getIamPolicyNodeGroupSettings; private final UnaryCallSettings insertNodeGroupSettings; private final PagedCallSettings< ListNodeGroupsHttpRequest, NodeGroupList, ListNodeGroupsPagedResponse> @@ -125,8 +132,12 @@ public class NodeGroupStubSettings extends StubSettings { private final PagedCallSettings< ListNodesNodeGroupsHttpRequest, NodeGroupsListNodes, ListNodesNodeGroupsPagedResponse> listNodesNodeGroupsSettings; + private final UnaryCallSettings + setIamPolicyNodeGroupSettings; private final UnaryCallSettings setNodeTemplateNodeGroupSettings; + private final UnaryCallSettings + testIamPermissionsNodeGroupSettings; /** Returns the object with the settings used for calls to addNodesNodeGroup. */ public UnaryCallSettings addNodesNodeGroupSettings() { @@ -158,6 +169,12 @@ public UnaryCallSettings getNodeGroupSetting return getNodeGroupSettings; } + /** Returns the object with the settings used for calls to getIamPolicyNodeGroup. */ + public UnaryCallSettings + getIamPolicyNodeGroupSettings() { + return getIamPolicyNodeGroupSettings; + } + /** Returns the object with the settings used for calls to insertNodeGroup. */ public UnaryCallSettings insertNodeGroupSettings() { return insertNodeGroupSettings; @@ -176,12 +193,24 @@ public UnaryCallSettings insertNodeGroupS return listNodesNodeGroupsSettings; } + /** Returns the object with the settings used for calls to setIamPolicyNodeGroup. */ + public UnaryCallSettings + setIamPolicyNodeGroupSettings() { + return setIamPolicyNodeGroupSettings; + } + /** Returns the object with the settings used for calls to setNodeTemplateNodeGroup. */ public UnaryCallSettings setNodeTemplateNodeGroupSettings() { return setNodeTemplateNodeGroupSettings; } + /** Returns the object with the settings used for calls to testIamPermissionsNodeGroup. */ + public UnaryCallSettings + testIamPermissionsNodeGroupSettings() { + return testIamPermissionsNodeGroupSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public NodeGroupStub createStub() throws IOException { if (getTransportChannelProvider() @@ -261,10 +290,14 @@ protected NodeGroupStubSettings(Builder settingsBuilder) throws IOException { deleteNodeGroupSettings = settingsBuilder.deleteNodeGroupSettings().build(); deleteNodesNodeGroupSettings = settingsBuilder.deleteNodesNodeGroupSettings().build(); getNodeGroupSettings = settingsBuilder.getNodeGroupSettings().build(); + getIamPolicyNodeGroupSettings = settingsBuilder.getIamPolicyNodeGroupSettings().build(); insertNodeGroupSettings = settingsBuilder.insertNodeGroupSettings().build(); listNodeGroupsSettings = settingsBuilder.listNodeGroupsSettings().build(); listNodesNodeGroupsSettings = settingsBuilder.listNodesNodeGroupsSettings().build(); + setIamPolicyNodeGroupSettings = settingsBuilder.setIamPolicyNodeGroupSettings().build(); setNodeTemplateNodeGroupSettings = settingsBuilder.setNodeTemplateNodeGroupSettings().build(); + testIamPermissionsNodeGroupSettings = + settingsBuilder.testIamPermissionsNodeGroupSettings().build(); } private static final PagedListDescriptor< @@ -476,6 +509,8 @@ public static class Builder extends StubSettings.Builder getNodeGroupSettings; + private final UnaryCallSettings.Builder + getIamPolicyNodeGroupSettings; private final UnaryCallSettings.Builder insertNodeGroupSettings; private final PagedCallSettings.Builder< @@ -484,8 +519,13 @@ public static class Builder extends StubSettings.Builder listNodesNodeGroupsSettings; + private final UnaryCallSettings.Builder + setIamPolicyNodeGroupSettings; private final UnaryCallSettings.Builder setNodeTemplateNodeGroupSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsNodeGroupHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeGroupSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -539,6 +579,8 @@ protected Builder(ClientContext clientContext) { getNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listNodeGroupsSettings = PagedCallSettings.newBuilder(LIST_NODE_GROUPS_PAGE_STR_FACT); @@ -546,8 +588,12 @@ protected Builder(ClientContext clientContext) { listNodesNodeGroupsSettings = PagedCallSettings.newBuilder(LIST_NODES_NODE_GROUPS_PAGE_STR_FACT); + setIamPolicyNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setNodeTemplateNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsNodeGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( addNodesNodeGroupSettings, @@ -555,10 +601,13 @@ protected Builder(ClientContext clientContext) { deleteNodeGroupSettings, deleteNodesNodeGroupSettings, getNodeGroupSettings, + getIamPolicyNodeGroupSettings, insertNodeGroupSettings, listNodeGroupsSettings, listNodesNodeGroupsSettings, - setNodeTemplateNodeGroupSettings); + setIamPolicyNodeGroupSettings, + setNodeTemplateNodeGroupSettings, + testIamPermissionsNodeGroupSettings); initDefaults(this); } @@ -599,6 +648,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertNodeGroupSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -614,11 +668,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyNodeGroupSettings() + .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")); + builder + .testIamPermissionsNodeGroupSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -630,10 +694,14 @@ protected Builder(NodeGroupStubSettings settings) { deleteNodeGroupSettings = settings.deleteNodeGroupSettings.toBuilder(); deleteNodesNodeGroupSettings = settings.deleteNodesNodeGroupSettings.toBuilder(); getNodeGroupSettings = settings.getNodeGroupSettings.toBuilder(); + getIamPolicyNodeGroupSettings = settings.getIamPolicyNodeGroupSettings.toBuilder(); insertNodeGroupSettings = settings.insertNodeGroupSettings.toBuilder(); listNodeGroupsSettings = settings.listNodeGroupsSettings.toBuilder(); listNodesNodeGroupsSettings = settings.listNodesNodeGroupsSettings.toBuilder(); + setIamPolicyNodeGroupSettings = settings.setIamPolicyNodeGroupSettings.toBuilder(); setNodeTemplateNodeGroupSettings = settings.setNodeTemplateNodeGroupSettings.toBuilder(); + testIamPermissionsNodeGroupSettings = + settings.testIamPermissionsNodeGroupSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -642,10 +710,13 @@ protected Builder(NodeGroupStubSettings settings) { deleteNodeGroupSettings, deleteNodesNodeGroupSettings, getNodeGroupSettings, + getIamPolicyNodeGroupSettings, insertNodeGroupSettings, listNodeGroupsSettings, listNodesNodeGroupsSettings, - setNodeTemplateNodeGroupSettings); + setIamPolicyNodeGroupSettings, + setNodeTemplateNodeGroupSettings, + testIamPermissionsNodeGroupSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -696,6 +767,12 @@ public UnaryCallSettings.Builder getNodeGrou return getNodeGroupSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyNodeGroup. */ + public UnaryCallSettings.Builder + getIamPolicyNodeGroupSettings() { + return getIamPolicyNodeGroupSettings; + } + /** Returns the builder for the settings used for calls to insertNodeGroup. */ public UnaryCallSettings.Builder insertNodeGroupSettings() { @@ -716,12 +793,25 @@ public UnaryCallSettings.Builder getNodeGrou return listNodesNodeGroupsSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyNodeGroup. */ + public UnaryCallSettings.Builder + setIamPolicyNodeGroupSettings() { + return setIamPolicyNodeGroupSettings; + } + /** Returns the builder for the settings used for calls to setNodeTemplateNodeGroup. */ public UnaryCallSettings.Builder setNodeTemplateNodeGroupSettings() { return setNodeTemplateNodeGroupSettings; } + /** Returns the builder for the settings used for calls to testIamPermissionsNodeGroup. */ + public UnaryCallSettings.Builder< + TestIamPermissionsNodeGroupHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeGroupSettings() { + return testIamPermissionsNodeGroupSettings; + } + @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 index c5d4087b6508..34cc37c2361d 100644 --- 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 @@ -23,6 +23,7 @@ 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.GetIamPolicyNodeTemplateHttpRequest; import com.google.cloud.compute.v1.GetNodeTemplateHttpRequest; import com.google.cloud.compute.v1.InsertNodeTemplateHttpRequest; import com.google.cloud.compute.v1.ListNodeTemplatesHttpRequest; @@ -30,6 +31,10 @@ 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.Policy; +import com.google.cloud.compute.v1.SetIamPolicyNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -67,6 +72,12 @@ public UnaryCallable getNodeTemplateCa throw new UnsupportedOperationException("Not implemented: getNodeTemplateCallable()"); } + @BetaApi + public UnaryCallable + getIamPolicyNodeTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyNodeTemplateCallable()"); + } + @BetaApi public UnaryCallable insertNodeTemplateCallable() { throw new UnsupportedOperationException("Not implemented: insertNodeTemplateCallable()"); @@ -83,6 +94,19 @@ public UnaryCallable listNodeTem throw new UnsupportedOperationException("Not implemented: listNodeTemplatesCallable()"); } + @BetaApi + public UnaryCallable + setIamPolicyNodeTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyNodeTemplateCallable()"); + } + + @BetaApi + public UnaryCallable + testIamPermissionsNodeTemplateCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsNodeTemplateCallable()"); + } + @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 index 1dc86b77275d..00fca4cbf9b0 100644 --- 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 @@ -42,6 +42,7 @@ 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.GetIamPolicyNodeTemplateHttpRequest; import com.google.cloud.compute.v1.GetNodeTemplateHttpRequest; import com.google.cloud.compute.v1.InsertNodeTemplateHttpRequest; import com.google.cloud.compute.v1.ListNodeTemplatesHttpRequest; @@ -50,6 +51,10 @@ import com.google.cloud.compute.v1.NodeTemplateList; import com.google.cloud.compute.v1.NodeTemplatesScopedList; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicyNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.TestIamPermissionsNodeTemplateHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -108,11 +113,18 @@ public class NodeTemplateStubSettings extends StubSettings deleteNodeTemplateSettings; private final UnaryCallSettings getNodeTemplateSettings; + private final UnaryCallSettings + getIamPolicyNodeTemplateSettings; private final UnaryCallSettings insertNodeTemplateSettings; private final PagedCallSettings< ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> listNodeTemplatesSettings; + private final UnaryCallSettings + setIamPolicyNodeTemplateSettings; + private final UnaryCallSettings< + TestIamPermissionsNodeTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeTemplateSettings; /** Returns the object with the settings used for calls to aggregatedListNodeTemplates. */ public PagedCallSettings< @@ -133,6 +145,12 @@ public UnaryCallSettings getNodeTempla return getNodeTemplateSettings; } + /** Returns the object with the settings used for calls to getIamPolicyNodeTemplate. */ + public UnaryCallSettings + getIamPolicyNodeTemplateSettings() { + return getIamPolicyNodeTemplateSettings; + } + /** Returns the object with the settings used for calls to insertNodeTemplate. */ public UnaryCallSettings insertNodeTemplateSettings() { return insertNodeTemplateSettings; @@ -145,6 +163,18 @@ public UnaryCallSettings insertNodeTem return listNodeTemplatesSettings; } + /** Returns the object with the settings used for calls to setIamPolicyNodeTemplate. */ + public UnaryCallSettings + setIamPolicyNodeTemplateSettings() { + return setIamPolicyNodeTemplateSettings; + } + + /** Returns the object with the settings used for calls to testIamPermissionsNodeTemplate. */ + public UnaryCallSettings + testIamPermissionsNodeTemplateSettings() { + return testIamPermissionsNodeTemplateSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public NodeTemplateStub createStub() throws IOException { if (getTransportChannelProvider() @@ -224,8 +254,12 @@ protected NodeTemplateStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.aggregatedListNodeTemplatesSettings().build(); deleteNodeTemplateSettings = settingsBuilder.deleteNodeTemplateSettings().build(); getNodeTemplateSettings = settingsBuilder.getNodeTemplateSettings().build(); + getIamPolicyNodeTemplateSettings = settingsBuilder.getIamPolicyNodeTemplateSettings().build(); insertNodeTemplateSettings = settingsBuilder.insertNodeTemplateSettings().build(); listNodeTemplatesSettings = settingsBuilder.listNodeTemplatesSettings().build(); + setIamPolicyNodeTemplateSettings = settingsBuilder.setIamPolicyNodeTemplateSettings().build(); + testIamPermissionsNodeTemplateSettings = + settingsBuilder.testIamPermissionsNodeTemplateSettings().build(); } private static final PagedListDescriptor< @@ -378,11 +412,18 @@ public static class Builder extends StubSettings.Builder getNodeTemplateSettings; + private final UnaryCallSettings.Builder + getIamPolicyNodeTemplateSettings; private final UnaryCallSettings.Builder insertNodeTemplateSettings; private final PagedCallSettings.Builder< ListNodeTemplatesHttpRequest, NodeTemplateList, ListNodeTemplatesPagedResponse> listNodeTemplatesSettings; + private final UnaryCallSettings.Builder + setIamPolicyNodeTemplateSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsNodeTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeTemplateSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -432,17 +473,26 @@ protected Builder(ClientContext clientContext) { getNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicyNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listNodeTemplatesSettings = PagedCallSettings.newBuilder(LIST_NODE_TEMPLATES_PAGE_STR_FACT); + setIamPolicyNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsNodeTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListNodeTemplatesSettings, deleteNodeTemplateSettings, getNodeTemplateSettings, + getIamPolicyNodeTemplateSettings, insertNodeTemplateSettings, - listNodeTemplatesSettings); + listNodeTemplatesSettings, + setIamPolicyNodeTemplateSettings, + testIamPermissionsNodeTemplateSettings); initDefaults(this); } @@ -473,6 +523,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicyNodeTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertNodeTemplateSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -483,6 +538,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicyNodeTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsNodeTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -493,16 +558,23 @@ protected Builder(NodeTemplateStubSettings settings) { settings.aggregatedListNodeTemplatesSettings.toBuilder(); deleteNodeTemplateSettings = settings.deleteNodeTemplateSettings.toBuilder(); getNodeTemplateSettings = settings.getNodeTemplateSettings.toBuilder(); + getIamPolicyNodeTemplateSettings = settings.getIamPolicyNodeTemplateSettings.toBuilder(); insertNodeTemplateSettings = settings.insertNodeTemplateSettings.toBuilder(); listNodeTemplatesSettings = settings.listNodeTemplatesSettings.toBuilder(); + setIamPolicyNodeTemplateSettings = settings.setIamPolicyNodeTemplateSettings.toBuilder(); + testIamPermissionsNodeTemplateSettings = + settings.testIamPermissionsNodeTemplateSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListNodeTemplatesSettings, deleteNodeTemplateSettings, getNodeTemplateSettings, + getIamPolicyNodeTemplateSettings, insertNodeTemplateSettings, - listNodeTemplatesSettings); + listNodeTemplatesSettings, + setIamPolicyNodeTemplateSettings, + testIamPermissionsNodeTemplateSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -542,6 +614,12 @@ public Builder applyToAllUnaryMethods( return getNodeTemplateSettings; } + /** Returns the builder for the settings used for calls to getIamPolicyNodeTemplate. */ + public UnaryCallSettings.Builder + getIamPolicyNodeTemplateSettings() { + return getIamPolicyNodeTemplateSettings; + } + /** Returns the builder for the settings used for calls to insertNodeTemplate. */ public UnaryCallSettings.Builder insertNodeTemplateSettings() { @@ -555,6 +633,19 @@ public Builder applyToAllUnaryMethods( return listNodeTemplatesSettings; } + /** Returns the builder for the settings used for calls to setIamPolicyNodeTemplate. */ + public UnaryCallSettings.Builder + setIamPolicyNodeTemplateSettings() { + return setIamPolicyNodeTemplateSettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissionsNodeTemplate. */ + public UnaryCallSettings.Builder< + TestIamPermissionsNodeTemplateHttpRequest, TestPermissionsResponse> + testIamPermissionsNodeTemplateSettings() { + return testIamPermissionsNodeTemplateSettings; + } + @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/RegionInstanceGroupManagerStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java index 930048b9b6ec..f349acbf4047 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStub.java @@ -29,6 +29,7 @@ import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; @@ -106,6 +107,13 @@ public abstract class RegionInstanceGroupManagerStub implements BackgroundResour "Not implemented: listManagedInstancesRegionInstanceGroupManagersCallable()"); } + @BetaApi + public UnaryCallable + patchRegionInstanceGroupManagerCallable() { + throw new UnsupportedOperationException( + "Not implemented: patchRegionInstanceGroupManagerCallable()"); + } + @BetaApi public UnaryCallable recreateInstancesRegionInstanceGroupManagerCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java index cdc4c6d65e9b..4019d1794252 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RegionInstanceGroupManagerStubSettings.java @@ -48,6 +48,7 @@ import com.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.ListRegionInstanceGroupManagersHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.PatchRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerHttpRequest; import com.google.cloud.compute.v1.RegionInstanceGroupManagerList; import com.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; @@ -124,6 +125,8 @@ public class RegionInstanceGroupManagerStubSettings ListManagedInstancesRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagersListInstancesResponse> listManagedInstancesRegionInstanceGroupManagersSettings; + private final UnaryCallSettings + patchRegionInstanceGroupManagerSettings; private final UnaryCallSettings recreateInstancesRegionInstanceGroupManagerSettings; private final UnaryCallSettings @@ -190,6 +193,12 @@ public class RegionInstanceGroupManagerStubSettings return listManagedInstancesRegionInstanceGroupManagersSettings; } + /** Returns the object with the settings used for calls to patchRegionInstanceGroupManager. */ + public UnaryCallSettings + patchRegionInstanceGroupManagerSettings() { + return patchRegionInstanceGroupManagerSettings; + } + /** * Returns the object with the settings used for calls to * recreateInstancesRegionInstanceGroupManager. @@ -312,6 +321,8 @@ protected RegionInstanceGroupManagerStubSettings(Builder settingsBuilder) throws settingsBuilder.listRegionInstanceGroupManagersSettings().build(); listManagedInstancesRegionInstanceGroupManagersSettings = settingsBuilder.listManagedInstancesRegionInstanceGroupManagersSettings().build(); + patchRegionInstanceGroupManagerSettings = + settingsBuilder.patchRegionInstanceGroupManagerSettings().build(); recreateInstancesRegionInstanceGroupManagerSettings = settingsBuilder.recreateInstancesRegionInstanceGroupManagerSettings().build(); resizeRegionInstanceGroupManagerSettings = @@ -430,6 +441,8 @@ public static class Builder ListManagedInstancesRegionInstanceGroupManagersHttpRequest, RegionInstanceGroupManagersListInstancesResponse> listManagedInstancesRegionInstanceGroupManagersSettings; + private final UnaryCallSettings.Builder + patchRegionInstanceGroupManagerSettings; private final UnaryCallSettings.Builder< RecreateInstancesRegionInstanceGroupManagerHttpRequest, Operation> recreateInstancesRegionInstanceGroupManagerSettings; @@ -501,6 +514,8 @@ protected Builder(ClientContext clientContext) { listManagedInstancesRegionInstanceGroupManagersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + patchRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + recreateInstancesRegionInstanceGroupManagerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -521,6 +536,7 @@ protected Builder(ClientContext clientContext) { insertRegionInstanceGroupManagerSettings, listRegionInstanceGroupManagersSettings, listManagedInstancesRegionInstanceGroupManagersSettings, + patchRegionInstanceGroupManagerSettings, recreateInstancesRegionInstanceGroupManagerSettings, resizeRegionInstanceGroupManagerSettings, setInstanceTemplateRegionInstanceGroupManagerSettings, @@ -575,6 +591,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .patchRegionInstanceGroupManagerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .recreateInstancesRegionInstanceGroupManagerSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -615,6 +636,8 @@ protected Builder(RegionInstanceGroupManagerStubSettings settings) { settings.listRegionInstanceGroupManagersSettings.toBuilder(); listManagedInstancesRegionInstanceGroupManagersSettings = settings.listManagedInstancesRegionInstanceGroupManagersSettings.toBuilder(); + patchRegionInstanceGroupManagerSettings = + settings.patchRegionInstanceGroupManagerSettings.toBuilder(); recreateInstancesRegionInstanceGroupManagerSettings = settings.recreateInstancesRegionInstanceGroupManagerSettings.toBuilder(); resizeRegionInstanceGroupManagerSettings = @@ -633,6 +656,7 @@ protected Builder(RegionInstanceGroupManagerStubSettings settings) { insertRegionInstanceGroupManagerSettings, listRegionInstanceGroupManagersSettings, listManagedInstancesRegionInstanceGroupManagersSettings, + patchRegionInstanceGroupManagerSettings, recreateInstancesRegionInstanceGroupManagerSettings, resizeRegionInstanceGroupManagerSettings, setInstanceTemplateRegionInstanceGroupManagerSettings, @@ -713,6 +737,12 @@ public Builder applyToAllUnaryMethods( return listManagedInstancesRegionInstanceGroupManagersSettings; } + /** Returns the builder for the settings used for calls to patchRegionInstanceGroupManager. */ + public UnaryCallSettings.Builder + patchRegionInstanceGroupManagerSettings() { + return patchRegionInstanceGroupManagerSettings; + } + /** * Returns the builder for the settings used for calls to * recreateInstancesRegionInstanceGroupManager. diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java index 7abe4c7450e2..9a305410d015 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStub.java @@ -16,6 +16,7 @@ package com.google.cloud.compute.v1.stub; import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.GetNatMappingInfoRoutersPagedResponse; import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.api.core.BetaApi; @@ -23,6 +24,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetNatMappingInfoRoutersHttpRequest; import com.google.cloud.compute.v1.GetRouterHttpRequest; import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; import com.google.cloud.compute.v1.InsertRouterHttpRequest; @@ -36,6 +38,7 @@ import com.google.cloud.compute.v1.RouterStatusResponse; import com.google.cloud.compute.v1.RoutersPreviewResponse; import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import com.google.cloud.compute.v1.VmEndpointNatMappingsList; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -71,6 +74,19 @@ public UnaryCallable getRouterCallable() { throw new UnsupportedOperationException("Not implemented: getRouterCallable()"); } + @BetaApi + public UnaryCallable + getNatMappingInfoRoutersPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: getNatMappingInfoRoutersPagedCallable()"); + } + + @BetaApi + public UnaryCallable + getNatMappingInfoRoutersCallable() { + throw new UnsupportedOperationException("Not implemented: getNatMappingInfoRoutersCallable()"); + } + @BetaApi public UnaryCallable getRouterStatusRouterCallable() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java index 1b6b528fa144..e3db468eee36 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/RouterStubSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.compute.v1.stub; import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.GetNatMappingInfoRoutersPagedResponse; import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import com.google.api.core.ApiFunction; @@ -42,6 +43,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.AggregatedListRoutersHttpRequest; import com.google.cloud.compute.v1.DeleteRouterHttpRequest; +import com.google.cloud.compute.v1.GetNatMappingInfoRoutersHttpRequest; import com.google.cloud.compute.v1.GetRouterHttpRequest; import com.google.cloud.compute.v1.GetRouterStatusRouterHttpRequest; import com.google.cloud.compute.v1.InsertRouterHttpRequest; @@ -56,6 +58,8 @@ import com.google.cloud.compute.v1.RoutersPreviewResponse; import com.google.cloud.compute.v1.RoutersScopedList; import com.google.cloud.compute.v1.UpdateRouterHttpRequest; +import com.google.cloud.compute.v1.VmEndpointNatMappings; +import com.google.cloud.compute.v1.VmEndpointNatMappingsList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -113,6 +117,11 @@ public class RouterStubSettings extends StubSettings { aggregatedListRoutersSettings; private final UnaryCallSettings deleteRouterSettings; private final UnaryCallSettings getRouterSettings; + private final PagedCallSettings< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersSettings; private final UnaryCallSettings getRouterStatusRouterSettings; private final UnaryCallSettings insertRouterSettings; @@ -142,6 +151,15 @@ public UnaryCallSettings getRouterSettings() { return getRouterSettings; } + /** Returns the object with the settings used for calls to getNatMappingInfoRouters. */ + public PagedCallSettings< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersSettings() { + return getNatMappingInfoRoutersSettings; + } + /** Returns the object with the settings used for calls to getRouterStatusRouter. */ public UnaryCallSettings getRouterStatusRouterSettings() { @@ -252,6 +270,7 @@ protected RouterStubSettings(Builder settingsBuilder) throws IOException { aggregatedListRoutersSettings = settingsBuilder.aggregatedListRoutersSettings().build(); deleteRouterSettings = settingsBuilder.deleteRouterSettings().build(); getRouterSettings = settingsBuilder.getRouterSettings().build(); + getNatMappingInfoRoutersSettings = settingsBuilder.getNatMappingInfoRoutersSettings().build(); getRouterStatusRouterSettings = settingsBuilder.getRouterStatusRouterSettings().build(); insertRouterSettings = settingsBuilder.insertRouterSettings().build(); listRoutersSettings = settingsBuilder.listRoutersSettings().build(); @@ -304,6 +323,53 @@ public Iterable extractResources(RouterAggregatedList payload } }; + private static final PagedListDescriptor< + GetNatMappingInfoRoutersHttpRequest, VmEndpointNatMappingsList, VmEndpointNatMappings> + GET_NAT_MAPPING_INFO_ROUTERS_PAGE_STR_DESC = + new PagedListDescriptor< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public GetNatMappingInfoRoutersHttpRequest injectToken( + GetNatMappingInfoRoutersHttpRequest payload, String token) { + return GetNatMappingInfoRoutersHttpRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public GetNatMappingInfoRoutersHttpRequest injectPageSize( + GetNatMappingInfoRoutersHttpRequest payload, int pageSize) { + return GetNatMappingInfoRoutersHttpRequest.newBuilder(payload) + .setMaxResults(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(GetNatMappingInfoRoutersHttpRequest payload) { + return payload.getMaxResults(); + } + + @Override + public String extractNextToken(VmEndpointNatMappingsList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + VmEndpointNatMappingsList payload) { + return payload.getResultList() != null + ? payload.getResultList() + : ImmutableList.of(); + } + }; + private static final PagedListDescriptor LIST_ROUTERS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -365,6 +431,33 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + GET_NAT_MAPPING_INFO_ROUTERS_PAGE_STR_FACT = + new PagedListResponseFactory< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + GetNatMappingInfoRoutersHttpRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + VmEndpointNatMappings> + pageContext = + PageContext.create( + callable, GET_NAT_MAPPING_INFO_ROUTERS_PAGE_STR_DESC, request, context); + return GetNatMappingInfoRoutersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListRoutersHttpRequest, RouterList, ListRoutersPagedResponse> LIST_ROUTERS_PAGE_STR_FACT = @@ -394,6 +487,11 @@ public static class Builder extends StubSettings.Builder deleteRouterSettings; private final UnaryCallSettings.Builder getRouterSettings; + private final PagedCallSettings.Builder< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersSettings; private final UnaryCallSettings.Builder getRouterStatusRouterSettings; private final UnaryCallSettings.Builder @@ -455,6 +553,9 @@ protected Builder(ClientContext clientContext) { getRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getNatMappingInfoRoutersSettings = + PagedCallSettings.newBuilder(GET_NAT_MAPPING_INFO_ROUTERS_PAGE_STR_FACT); + getRouterStatusRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); insertRouterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -472,6 +573,7 @@ protected Builder(ClientContext clientContext) { aggregatedListRoutersSettings, deleteRouterSettings, getRouterSettings, + getNatMappingInfoRoutersSettings, getRouterStatusRouterSettings, insertRouterSettings, listRoutersSettings, @@ -508,6 +610,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getNatMappingInfoRoutersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .getRouterStatusRouterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -547,6 +654,7 @@ protected Builder(RouterStubSettings settings) { aggregatedListRoutersSettings = settings.aggregatedListRoutersSettings.toBuilder(); deleteRouterSettings = settings.deleteRouterSettings.toBuilder(); getRouterSettings = settings.getRouterSettings.toBuilder(); + getNatMappingInfoRoutersSettings = settings.getNatMappingInfoRoutersSettings.toBuilder(); getRouterStatusRouterSettings = settings.getRouterStatusRouterSettings.toBuilder(); insertRouterSettings = settings.insertRouterSettings.toBuilder(); listRoutersSettings = settings.listRoutersSettings.toBuilder(); @@ -559,6 +667,7 @@ protected Builder(RouterStubSettings settings) { aggregatedListRoutersSettings, deleteRouterSettings, getRouterSettings, + getNatMappingInfoRoutersSettings, getRouterStatusRouterSettings, insertRouterSettings, listRoutersSettings, @@ -602,6 +711,15 @@ public UnaryCallSettings.Builder getRouterSettings return getRouterSettings; } + /** Returns the builder for the settings used for calls to getNatMappingInfoRouters. */ + public PagedCallSettings.Builder< + GetNatMappingInfoRoutersHttpRequest, + VmEndpointNatMappingsList, + GetNatMappingInfoRoutersPagedResponse> + getNatMappingInfoRoutersSettings() { + return getNatMappingInfoRoutersSettings; + } + /** Returns the builder for the settings used for calls to getRouterStatusRouter. */ public UnaryCallSettings.Builder getRouterStatusRouterSettings() { diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java index fe21a5908d56..77e8df4b6ca7 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStub.java @@ -21,12 +21,17 @@ import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicySnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicySnapshotHttpRequest; import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.TestIamPermissionsSnapshotHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -49,6 +54,11 @@ public UnaryCallable getSnapshotCallable() { throw new UnsupportedOperationException("Not implemented: getSnapshotCallable()"); } + @BetaApi + public UnaryCallable getIamPolicySnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicySnapshotCallable()"); + } + @BetaApi public UnaryCallable listSnapshotsPagedCallable() { @@ -60,11 +70,23 @@ public UnaryCallable listSnapshotsCallab throw new UnsupportedOperationException("Not implemented: listSnapshotsCallable()"); } + @BetaApi + public UnaryCallable setIamPolicySnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicySnapshotCallable()"); + } + @BetaApi public UnaryCallable setLabelsSnapshotCallable() { throw new UnsupportedOperationException("Not implemented: setLabelsSnapshotCallable()"); } + @BetaApi + public UnaryCallable + testIamPermissionsSnapshotCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsSnapshotCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java index 4139d24dcb11..48d3e6f24c55 100644 --- a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java +++ b/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/SnapshotStubSettings.java @@ -40,12 +40,17 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1.DeleteSnapshotHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicySnapshotHttpRequest; import com.google.cloud.compute.v1.GetSnapshotHttpRequest; import com.google.cloud.compute.v1.ListSnapshotsHttpRequest; import com.google.cloud.compute.v1.Operation; +import com.google.cloud.compute.v1.Policy; +import com.google.cloud.compute.v1.SetIamPolicySnapshotHttpRequest; import com.google.cloud.compute.v1.SetLabelsSnapshotHttpRequest; import com.google.cloud.compute.v1.Snapshot; import com.google.cloud.compute.v1.SnapshotList; +import com.google.cloud.compute.v1.TestIamPermissionsSnapshotHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -98,11 +103,17 @@ public class SnapshotStubSettings extends StubSettings { private final UnaryCallSettings deleteSnapshotSettings; private final UnaryCallSettings getSnapshotSettings; + private final UnaryCallSettings + getIamPolicySnapshotSettings; private final PagedCallSettings< ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> listSnapshotsSettings; + private final UnaryCallSettings + setIamPolicySnapshotSettings; private final UnaryCallSettings setLabelsSnapshotSettings; + private final UnaryCallSettings + testIamPermissionsSnapshotSettings; /** Returns the object with the settings used for calls to deleteSnapshot. */ public UnaryCallSettings deleteSnapshotSettings() { @@ -114,17 +125,33 @@ public UnaryCallSettings getSnapshotSettings() return getSnapshotSettings; } + /** Returns the object with the settings used for calls to getIamPolicySnapshot. */ + public UnaryCallSettings getIamPolicySnapshotSettings() { + return getIamPolicySnapshotSettings; + } + /** Returns the object with the settings used for calls to listSnapshots. */ public PagedCallSettings listSnapshotsSettings() { return listSnapshotsSettings; } + /** Returns the object with the settings used for calls to setIamPolicySnapshot. */ + public UnaryCallSettings setIamPolicySnapshotSettings() { + return setIamPolicySnapshotSettings; + } + /** Returns the object with the settings used for calls to setLabelsSnapshot. */ public UnaryCallSettings setLabelsSnapshotSettings() { return setLabelsSnapshotSettings; } + /** Returns the object with the settings used for calls to testIamPermissionsSnapshot. */ + public UnaryCallSettings + testIamPermissionsSnapshotSettings() { + return testIamPermissionsSnapshotSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public SnapshotStub createStub() throws IOException { if (getTransportChannelProvider() @@ -201,8 +228,12 @@ protected SnapshotStubSettings(Builder settingsBuilder) throws IOException { deleteSnapshotSettings = settingsBuilder.deleteSnapshotSettings().build(); getSnapshotSettings = settingsBuilder.getSnapshotSettings().build(); + getIamPolicySnapshotSettings = settingsBuilder.getIamPolicySnapshotSettings().build(); listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build(); + setIamPolicySnapshotSettings = settingsBuilder.setIamPolicySnapshotSettings().build(); setLabelsSnapshotSettings = settingsBuilder.setLabelsSnapshotSettings().build(); + testIamPermissionsSnapshotSettings = + settingsBuilder.testIamPermissionsSnapshotSettings().build(); } private static final PagedListDescriptor @@ -267,11 +298,18 @@ public static class Builder extends StubSettings.Builder deleteSnapshotSettings; private final UnaryCallSettings.Builder getSnapshotSettings; + private final UnaryCallSettings.Builder + getIamPolicySnapshotSettings; private final PagedCallSettings.Builder< ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> listSnapshotsSettings; + private final UnaryCallSettings.Builder + setIamPolicySnapshotSettings; private final UnaryCallSettings.Builder setLabelsSnapshotSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsSnapshotHttpRequest, TestPermissionsResponse> + testIamPermissionsSnapshotSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -318,16 +356,25 @@ protected Builder(ClientContext clientContext) { getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT); + setIamPolicySnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setLabelsSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( deleteSnapshotSettings, getSnapshotSettings, + getIamPolicySnapshotSettings, listSnapshotsSettings, - setLabelsSnapshotSettings); + setIamPolicySnapshotSettings, + setLabelsSnapshotSettings, + testIamPermissionsSnapshotSettings); initDefaults(this); } @@ -353,16 +400,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicySnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .listSnapshotsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicySnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setLabelsSnapshotSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .testIamPermissionsSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -371,15 +433,21 @@ protected Builder(SnapshotStubSettings settings) { deleteSnapshotSettings = settings.deleteSnapshotSettings.toBuilder(); getSnapshotSettings = settings.getSnapshotSettings.toBuilder(); + getIamPolicySnapshotSettings = settings.getIamPolicySnapshotSettings.toBuilder(); listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder(); + setIamPolicySnapshotSettings = settings.setIamPolicySnapshotSettings.toBuilder(); setLabelsSnapshotSettings = settings.setLabelsSnapshotSettings.toBuilder(); + testIamPermissionsSnapshotSettings = settings.testIamPermissionsSnapshotSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( deleteSnapshotSettings, getSnapshotSettings, + getIamPolicySnapshotSettings, listSnapshotsSettings, - setLabelsSnapshotSettings); + setIamPolicySnapshotSettings, + setLabelsSnapshotSettings, + testIamPermissionsSnapshotSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -409,6 +477,12 @@ public UnaryCallSettings.Builder getSnapshotSe return getSnapshotSettings; } + /** Returns the builder for the settings used for calls to getIamPolicySnapshot. */ + public UnaryCallSettings.Builder + getIamPolicySnapshotSettings() { + return getIamPolicySnapshotSettings; + } + /** Returns the builder for the settings used for calls to listSnapshots. */ public PagedCallSettings.Builder< ListSnapshotsHttpRequest, SnapshotList, ListSnapshotsPagedResponse> @@ -416,12 +490,24 @@ public UnaryCallSettings.Builder getSnapshotSe return listSnapshotsSettings; } + /** Returns the builder for the settings used for calls to setIamPolicySnapshot. */ + public UnaryCallSettings.Builder + setIamPolicySnapshotSettings() { + return setIamPolicySnapshotSettings; + } + /** Returns the builder for the settings used for calls to setLabelsSnapshot. */ public UnaryCallSettings.Builder setLabelsSnapshotSettings() { return setLabelsSnapshotSettings; } + /** Returns the builder for the settings used for calls to testIamPermissionsSnapshot. */ + public UnaryCallSettings.Builder + testIamPermissionsSnapshotSettings() { + return testIamPermissionsSnapshotSettings; + } + @Override public SnapshotStubSettings build() throws IOException { return new SnapshotStubSettings(this); 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 997f196b7220..45893df4e72b 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 @@ -25,16 +25,21 @@ import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicySubnetworkHttpRequest; 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.Policy; +import com.google.cloud.compute.v1.SetIamPolicySubnetworkHttpRequest; 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.TestIamPermissionsSubnetworkHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.cloud.compute.v1.UsableSubnetworksAggregatedList; import javax.annotation.Generated; @@ -78,6 +83,11 @@ public UnaryCallable getSubnetworkCallable throw new UnsupportedOperationException("Not implemented: getSubnetworkCallable()"); } + @BetaApi + public UnaryCallable getIamPolicySubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicySubnetworkCallable()"); + } + @BetaApi public UnaryCallable insertSubnetworkCallable() { throw new UnsupportedOperationException("Not implemented: insertSubnetworkCallable()"); @@ -112,6 +122,11 @@ public UnaryCallable patchSubnetworkCalla throw new UnsupportedOperationException("Not implemented: patchSubnetworkCallable()"); } + @BetaApi + public UnaryCallable setIamPolicySubnetworkCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicySubnetworkCallable()"); + } + @BetaApi public UnaryCallable setPrivateIpGoogleAccessSubnetworkCallable() { @@ -119,6 +134,13 @@ public UnaryCallable patchSubnetworkCalla "Not implemented: setPrivateIpGoogleAccessSubnetworkCallable()"); } + @BetaApi + public UnaryCallable + testIamPermissionsSubnetworkCallable() { + throw new UnsupportedOperationException( + "Not implemented: testIamPermissionsSubnetworkCallable()"); + } + @Override public abstract void close(); } 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 0708f9a54949..e1ba250980cd 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 @@ -44,17 +44,22 @@ import com.google.cloud.compute.v1.AggregatedListSubnetworksHttpRequest; import com.google.cloud.compute.v1.DeleteSubnetworkHttpRequest; import com.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkHttpRequest; +import com.google.cloud.compute.v1.GetIamPolicySubnetworkHttpRequest; 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.Policy; +import com.google.cloud.compute.v1.SetIamPolicySubnetworkHttpRequest; 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.SubnetworksScopedList; +import com.google.cloud.compute.v1.TestIamPermissionsSubnetworkHttpRequest; +import com.google.cloud.compute.v1.TestPermissionsResponse; import com.google.cloud.compute.v1.UsableSubnetwork; import com.google.cloud.compute.v1.UsableSubnetworksAggregatedList; import com.google.common.collect.ImmutableList; @@ -116,6 +121,8 @@ public class SubnetworkStubSettings extends StubSettings private final UnaryCallSettings expandIpCidrRangeSubnetworkSettings; private final UnaryCallSettings getSubnetworkSettings; + private final UnaryCallSettings + getIamPolicySubnetworkSettings; private final UnaryCallSettings insertSubnetworkSettings; private final PagedCallSettings< ListSubnetworksHttpRequest, SubnetworkList, ListSubnetworksPagedResponse> @@ -126,8 +133,12 @@ public class SubnetworkStubSettings extends StubSettings ListUsableSubnetworksPagedResponse> listUsableSubnetworksSettings; private final UnaryCallSettings patchSubnetworkSettings; + private final UnaryCallSettings + setIamPolicySubnetworkSettings; private final UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings; + private final UnaryCallSettings + testIamPermissionsSubnetworkSettings; /** Returns the object with the settings used for calls to aggregatedListSubnetworks. */ public PagedCallSettings< @@ -154,6 +165,12 @@ public UnaryCallSettings getSubnetworkSett return getSubnetworkSettings; } + /** Returns the object with the settings used for calls to getIamPolicySubnetwork. */ + public UnaryCallSettings + getIamPolicySubnetworkSettings() { + return getIamPolicySubnetworkSettings; + } + /** Returns the object with the settings used for calls to insertSubnetwork. */ public UnaryCallSettings insertSubnetworkSettings() { return insertSubnetworkSettings; @@ -179,12 +196,24 @@ public UnaryCallSettings patchSubnetworkS return patchSubnetworkSettings; } + /** Returns the object with the settings used for calls to setIamPolicySubnetwork. */ + public UnaryCallSettings + setIamPolicySubnetworkSettings() { + return setIamPolicySubnetworkSettings; + } + /** Returns the object with the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */ public UnaryCallSettings setPrivateIpGoogleAccessSubnetworkSettings() { return setPrivateIpGoogleAccessSubnetworkSettings; } + /** Returns the object with the settings used for calls to testIamPermissionsSubnetwork. */ + public UnaryCallSettings + testIamPermissionsSubnetworkSettings() { + return testIamPermissionsSubnetworkSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public SubnetworkStub createStub() throws IOException { if (getTransportChannelProvider() @@ -265,12 +294,16 @@ protected SubnetworkStubSettings(Builder settingsBuilder) throws IOException { expandIpCidrRangeSubnetworkSettings = settingsBuilder.expandIpCidrRangeSubnetworkSettings().build(); getSubnetworkSettings = settingsBuilder.getSubnetworkSettings().build(); + getIamPolicySubnetworkSettings = settingsBuilder.getIamPolicySubnetworkSettings().build(); insertSubnetworkSettings = settingsBuilder.insertSubnetworkSettings().build(); listSubnetworksSettings = settingsBuilder.listSubnetworksSettings().build(); listUsableSubnetworksSettings = settingsBuilder.listUsableSubnetworksSettings().build(); patchSubnetworkSettings = settingsBuilder.patchSubnetworkSettings().build(); + setIamPolicySubnetworkSettings = settingsBuilder.setIamPolicySubnetworkSettings().build(); setPrivateIpGoogleAccessSubnetworkSettings = settingsBuilder.setPrivateIpGoogleAccessSubnetworkSettings().build(); + testIamPermissionsSubnetworkSettings = + settingsBuilder.testIamPermissionsSubnetworkSettings().build(); } private static final PagedListDescriptor< @@ -492,6 +525,8 @@ public static class Builder extends StubSettings.Builder getSubnetworkSettings; + private final UnaryCallSettings.Builder + getIamPolicySubnetworkSettings; private final UnaryCallSettings.Builder insertSubnetworkSettings; private final PagedCallSettings.Builder< @@ -504,9 +539,14 @@ public static class Builder extends StubSettings.Builder patchSubnetworkSettings; + private final UnaryCallSettings.Builder + setIamPolicySubnetworkSettings; private final UnaryCallSettings.Builder< SetPrivateIpGoogleAccessSubnetworkHttpRequest, Operation> setPrivateIpGoogleAccessSubnetworkSettings; + private final UnaryCallSettings.Builder< + TestIamPermissionsSubnetworkHttpRequest, TestPermissionsResponse> + testIamPermissionsSubnetworkSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -558,6 +598,8 @@ protected Builder(ClientContext clientContext) { getSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + insertSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listSubnetworksSettings = PagedCallSettings.newBuilder(LIST_SUBNETWORKS_PAGE_STR_FACT); @@ -567,19 +609,26 @@ protected Builder(ClientContext clientContext) { patchSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setPrivateIpGoogleAccessSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSubnetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( aggregatedListSubnetworksSettings, deleteSubnetworkSettings, expandIpCidrRangeSubnetworkSettings, getSubnetworkSettings, + getIamPolicySubnetworkSettings, insertSubnetworkSettings, listSubnetworksSettings, listUsableSubnetworksSettings, patchSubnetworkSettings, - setPrivateIpGoogleAccessSubnetworkSettings); + setIamPolicySubnetworkSettings, + setPrivateIpGoogleAccessSubnetworkSettings, + testIamPermissionsSubnetworkSettings); initDefaults(this); } @@ -615,6 +664,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getIamPolicySubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .insertSubnetworkSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -635,11 +689,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .setIamPolicySubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setPrivateIpGoogleAccessSubnetworkSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .testIamPermissionsSubnetworkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -651,12 +715,16 @@ protected Builder(SubnetworkStubSettings settings) { expandIpCidrRangeSubnetworkSettings = settings.expandIpCidrRangeSubnetworkSettings.toBuilder(); getSubnetworkSettings = settings.getSubnetworkSettings.toBuilder(); + getIamPolicySubnetworkSettings = settings.getIamPolicySubnetworkSettings.toBuilder(); insertSubnetworkSettings = settings.insertSubnetworkSettings.toBuilder(); listSubnetworksSettings = settings.listSubnetworksSettings.toBuilder(); listUsableSubnetworksSettings = settings.listUsableSubnetworksSettings.toBuilder(); patchSubnetworkSettings = settings.patchSubnetworkSettings.toBuilder(); + setIamPolicySubnetworkSettings = settings.setIamPolicySubnetworkSettings.toBuilder(); setPrivateIpGoogleAccessSubnetworkSettings = settings.setPrivateIpGoogleAccessSubnetworkSettings.toBuilder(); + testIamPermissionsSubnetworkSettings = + settings.testIamPermissionsSubnetworkSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -664,11 +732,14 @@ protected Builder(SubnetworkStubSettings settings) { deleteSubnetworkSettings, expandIpCidrRangeSubnetworkSettings, getSubnetworkSettings, + getIamPolicySubnetworkSettings, insertSubnetworkSettings, listSubnetworksSettings, listUsableSubnetworksSettings, patchSubnetworkSettings, - setPrivateIpGoogleAccessSubnetworkSettings); + setIamPolicySubnetworkSettings, + setPrivateIpGoogleAccessSubnetworkSettings, + testIamPermissionsSubnetworkSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -713,6 +784,12 @@ public UnaryCallSettings.Builder getSubnet return getSubnetworkSettings; } + /** Returns the builder for the settings used for calls to getIamPolicySubnetwork. */ + public UnaryCallSettings.Builder + getIamPolicySubnetworkSettings() { + return getIamPolicySubnetworkSettings; + } + /** Returns the builder for the settings used for calls to insertSubnetwork. */ public UnaryCallSettings.Builder insertSubnetworkSettings() { @@ -741,6 +818,12 @@ public UnaryCallSettings.Builder getSubnet return patchSubnetworkSettings; } + /** Returns the builder for the settings used for calls to setIamPolicySubnetwork. */ + public UnaryCallSettings.Builder + setIamPolicySubnetworkSettings() { + return setIamPolicySubnetworkSettings; + } + /** * Returns the builder for the settings used for calls to setPrivateIpGoogleAccessSubnetwork. */ @@ -749,6 +832,13 @@ public UnaryCallSettings.Builder getSubnet return setPrivateIpGoogleAccessSubnetworkSettings; } + /** Returns the builder for the settings used for calls to testIamPermissionsSubnetwork. */ + public UnaryCallSettings.Builder< + TestIamPermissionsSubnetworkHttpRequest, TestPermissionsResponse> + testIamPermissionsSubnetworkSettings() { + return testIamPermissionsSubnetworkSettings; + } + @Override public SubnetworkStubSettings build() throws IOException { return new SubnetworkStubSettings(this); diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java index 688495f076a4..c8675f261156 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/DiskClientTest.java @@ -21,10 +21,13 @@ import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.createSnapshotDiskMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.deleteDiskMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.getDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.getIamPolicyDiskMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.insertDiskMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.listDisksMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.resizeDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.setIamPolicyDiskMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.setLabelsDiskMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonDiskStub.testIamPermissionsDiskMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -60,10 +63,13 @@ public class DiskClientTest { createSnapshotDiskMethodDescriptor, deleteDiskMethodDescriptor, getDiskMethodDescriptor, + getIamPolicyDiskMethodDescriptor, insertDiskMethodDescriptor, listDisksMethodDescriptor, resizeDiskMethodDescriptor, - setLabelsDiskMethodDescriptor)); + setIamPolicyDiskMethodDescriptor, + setLabelsDiskMethodDescriptor, + testIamPermissionsDiskMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, DiskStubSettings.getDefaultEndpoint()); @@ -421,6 +427,56 @@ public void getDiskExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyDiskTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyDisk(resource); + 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 getIamPolicyDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + + client.getIamPolicyDisk(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertDiskTest() { @@ -661,6 +717,58 @@ public void resizeDiskExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicyDiskTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicyDisk(resource, zoneSetPolicyRequestResource); + 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 setIamPolicyDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyDisk(resource, zoneSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setLabelsDiskTest() { @@ -752,4 +860,55 @@ public void setLabelsDiskExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsDiskTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsDisk(resource, testPermissionsRequestResource); + 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 testIamPermissionsDiskExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneDiskResourceName resource = + ProjectZoneDiskResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsDisk(resource, testPermissionsRequestResource); + 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/ImageClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java index 63dab8cb15df..737bba6e2c7c 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/ImageClientTest.java @@ -19,10 +19,13 @@ import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deleteImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.deprecateImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getFromFamilyImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getIamPolicyImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.getImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.insertImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.listImagesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.setIamPolicyImageMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.setLabelsImageMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonImageStub.testIamPermissionsImageMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -56,9 +59,12 @@ public class ImageClientTest { deprecateImageMethodDescriptor, getImageMethodDescriptor, getFromFamilyImageMethodDescriptor, + getIamPolicyImageMethodDescriptor, insertImageMethodDescriptor, listImagesMethodDescriptor, - setLabelsImageMethodDescriptor)); + setIamPolicyImageMethodDescriptor, + setLabelsImageMethodDescriptor, + testIamPermissionsImageMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, ImageStubSettings.getDefaultEndpoint()); @@ -431,6 +437,56 @@ public void getFromFamilyImageExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyImageTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyImage(resource); + 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 getIamPolicyImageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + + client.getIamPolicyImage(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertImageTest() { @@ -583,6 +639,60 @@ public void listImagesExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicyImageTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicyImage(resource, globalSetPolicyRequestResource); + 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 setIamPolicyImageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyImage(resource, globalSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setLabelsImageTest() { @@ -676,4 +786,55 @@ public void setLabelsImageExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsImageTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsImage(resource, testPermissionsRequestResource); + 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 testIamPermissionsImageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalImageResourceName resource = + ProjectGlobalImageResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsImage(resource, testPermissionsRequestResource); + 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/InstanceClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java index c7006223f378..359d0cc64337 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceClientTest.java @@ -24,6 +24,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.deleteAccessConfigInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.deleteInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.detachDiskInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.getIamPolicyInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.getInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.getSerialPortOutputInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.insertInstanceMethodDescriptor; @@ -32,6 +33,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.resetInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setDeletionProtectionInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setDiskAutoDeleteInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setIamPolicyInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setLabelsInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMachineResourcesInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.setMachineTypeInstanceMethodDescriptor; @@ -44,6 +46,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.startInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.startWithEncryptionKeyInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.stopInstanceMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.testIamPermissionsInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.updateAccessConfigInstanceMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceStub.updateNetworkInterfaceInstanceMethodDescriptor; @@ -85,6 +88,7 @@ public class InstanceClientTest { deleteAccessConfigInstanceMethodDescriptor, detachDiskInstanceMethodDescriptor, getInstanceMethodDescriptor, + getIamPolicyInstanceMethodDescriptor, getSerialPortOutputInstanceMethodDescriptor, insertInstanceMethodDescriptor, listInstancesMethodDescriptor, @@ -92,6 +96,7 @@ public class InstanceClientTest { resetInstanceMethodDescriptor, setDeletionProtectionInstanceMethodDescriptor, setDiskAutoDeleteInstanceMethodDescriptor, + setIamPolicyInstanceMethodDescriptor, setLabelsInstanceMethodDescriptor, setMachineResourcesInstanceMethodDescriptor, setMachineTypeInstanceMethodDescriptor, @@ -104,6 +109,7 @@ public class InstanceClientTest { startInstanceMethodDescriptor, startWithEncryptionKeyInstanceMethodDescriptor, stopInstanceMethodDescriptor, + testIamPermissionsInstanceMethodDescriptor, updateAccessConfigInstanceMethodDescriptor, updateNetworkInterfaceInstanceMethodDescriptor)); private static final MockHttpService mockService = @@ -746,6 +752,56 @@ public void getInstanceExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyInstanceTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyInstance(resource); + 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 getIamPolicyInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + + client.getIamPolicyInstance(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void getSerialPortOutputInstanceTest() { @@ -1296,6 +1352,58 @@ public void setDiskAutoDeleteInstanceExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicyInstanceTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicyInstance(resource, zoneSetPolicyRequestResource); + 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 setIamPolicyInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyInstance(resource, zoneSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setLabelsInstanceTest() { @@ -2414,6 +2522,57 @@ public void stopInstanceExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void testIamPermissionsInstanceTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsInstance(resource, testPermissionsRequestResource); + 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 testIamPermissionsInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneInstanceResourceName resource = + ProjectZoneInstanceResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsInstance(resource, testPermissionsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void updateAccessConfigInstanceTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java index 617333dead3e..2aa7f70379f2 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceGroupManagerClientTest.java @@ -25,6 +25,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.insertInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.listInstanceGroupManagersMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.listManagedInstancesInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.patchInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.recreateInstancesInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.resizeInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceGroupManagerStub.setInstanceTemplateInstanceGroupManagerMethodDescriptor; @@ -44,6 +45,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; @@ -68,6 +70,7 @@ public class InstanceGroupManagerClientTest { insertInstanceGroupManagerMethodDescriptor, listInstanceGroupManagersMethodDescriptor, listManagedInstancesInstanceGroupManagersMethodDescriptor, + patchInstanceGroupManagerMethodDescriptor, recreateInstancesInstanceGroupManagerMethodDescriptor, resizeInstanceGroupManagerMethodDescriptor, setInstanceTemplateInstanceGroupManagerMethodDescriptor, @@ -731,6 +734,103 @@ public void listManagedInstancesInstanceGroupManagersExceptionTest() throws Exce } } + @Test + @SuppressWarnings("all") + public void patchInstanceGroupManagerTest() { + 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); + + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + List fieldMask = new ArrayList<>(); + + Operation actualResponse = + client.patchInstanceGroupManager( + instanceGroupManager, instanceGroupManagerResource, 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 patchInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneInstanceGroupManagerName instanceGroupManager = + ProjectZoneInstanceGroupManagerName.of("[PROJECT]", "[ZONE]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + List fieldMask = new ArrayList<>(); + + client.patchInstanceGroupManager( + instanceGroupManager, instanceGroupManagerResource, fieldMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void recreateInstancesInstanceGroupManagerTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java index 768ceb763ea4..385ebc2fc9e1 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InstanceTemplateClientTest.java @@ -17,9 +17,12 @@ import static com.google.cloud.compute.v1.InstanceTemplateClient.ListInstanceTemplatesPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.deleteInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.getIamPolicyInstanceTemplateMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.getInstanceTemplateMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.insertInstanceTemplateMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.listInstanceTemplatesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.setIamPolicyInstanceTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInstanceTemplateStub.testIamPermissionsInstanceTemplateMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -51,8 +54,11 @@ public class InstanceTemplateClientTest { Lists.newArrayList( deleteInstanceTemplateMethodDescriptor, getInstanceTemplateMethodDescriptor, + getIamPolicyInstanceTemplateMethodDescriptor, insertInstanceTemplateMethodDescriptor, - listInstanceTemplatesMethodDescriptor)); + listInstanceTemplatesMethodDescriptor, + setIamPolicyInstanceTemplateMethodDescriptor, + testIamPermissionsInstanceTemplateMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, InstanceTemplateStubSettings.getDefaultEndpoint()); @@ -234,6 +240,56 @@ public void getInstanceTemplateExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyInstanceTemplateTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalInstanceTemplateResourceName resource = + ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyInstanceTemplate(resource); + 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 getIamPolicyInstanceTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalInstanceTemplateResourceName resource = + ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]"); + + client.getIamPolicyInstanceTemplate(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertInstanceTemplateTest() { @@ -383,4 +439,110 @@ public void listInstanceTemplatesExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void setIamPolicyInstanceTemplateTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalInstanceTemplateResourceName resource = + ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = + client.setIamPolicyInstanceTemplate(resource, globalSetPolicyRequestResource); + 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 setIamPolicyInstanceTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalInstanceTemplateResourceName resource = + ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyInstanceTemplate(resource, globalSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsInstanceTemplateTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalInstanceTemplateResourceName resource = + ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsInstanceTemplate(resource, testPermissionsRequestResource); + 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 testIamPermissionsInstanceTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalInstanceTemplateResourceName resource = + ProjectGlobalInstanceTemplateResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsInstanceTemplate(resource, testPermissionsRequestResource); + 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/InterconnectClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java index 54a25222b1e7..b2fc6168dea0 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/InterconnectClientTest.java @@ -17,6 +17,7 @@ import static com.google.cloud.compute.v1.InterconnectClient.ListInterconnectsPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.deleteInterconnectMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.getDiagnosticsInterconnectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.getInterconnectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.insertInterconnectMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonInterconnectStub.listInterconnectsMethodDescriptor; @@ -53,6 +54,7 @@ public class InterconnectClientTest { Lists.newArrayList( deleteInterconnectMethodDescriptor, getInterconnectMethodDescriptor, + getDiagnosticsInterconnectMethodDescriptor, insertInterconnectMethodDescriptor, listInterconnectsMethodDescriptor, patchInterconnectMethodDescriptor)); @@ -261,6 +263,54 @@ public void getInterconnectExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getDiagnosticsInterconnectTest() { + InterconnectsGetDiagnosticsResponse expectedResponse = + InterconnectsGetDiagnosticsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + + InterconnectsGetDiagnosticsResponse actualResponse = + client.getDiagnosticsInterconnect(interconnect); + 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 getDiagnosticsInterconnectExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalInterconnectName interconnect = + ProjectGlobalInterconnectName.of("[PROJECT]", "[INTERCONNECT]"); + + client.getDiagnosticsInterconnect(interconnect); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertInterconnectTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java index e33da4e3c227..a05c0a92e159 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/LicenseClientTest.java @@ -17,9 +17,11 @@ import static com.google.cloud.compute.v1.LicenseClient.ListLicensesPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.deleteLicenseMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.getIamPolicyLicenseMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.getLicenseMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.insertLicenseMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.listLicensesMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.setIamPolicyLicenseMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonLicenseStub.testIamPermissionsLicenseMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; @@ -52,8 +54,10 @@ public class LicenseClientTest { Lists.newArrayList( deleteLicenseMethodDescriptor, getLicenseMethodDescriptor, + getIamPolicyLicenseMethodDescriptor, insertLicenseMethodDescriptor, listLicensesMethodDescriptor, + setIamPolicyLicenseMethodDescriptor, testIamPermissionsLicenseMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, LicenseStubSettings.getDefaultEndpoint()); @@ -237,6 +241,56 @@ public void getLicenseExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyLicenseTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalLicenseResourceName resource = + ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyLicense(resource); + 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 getIamPolicyLicenseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalLicenseResourceName resource = + ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]"); + + client.getIamPolicyLicense(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertLicenseTest() { @@ -385,6 +439,60 @@ public void listLicensesExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicyLicenseTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalLicenseResourceName resource = + ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicyLicense(resource, globalSetPolicyRequestResource); + 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 setIamPolicyLicenseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalLicenseResourceName resource = + ProjectGlobalLicenseResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyLicense(resource, globalSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void testIamPermissionsLicenseTest() { 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 index 5ffa0fdf9b72..76ac92daede7 100644 --- 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 @@ -22,11 +22,14 @@ 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.getIamPolicyNodeGroupMethodDescriptor; 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.setIamPolicyNodeGroupMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.setNodeTemplateNodeGroupMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeGroupStub.testIamPermissionsNodeGroupMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -63,10 +66,13 @@ public class NodeGroupClientTest { deleteNodeGroupMethodDescriptor, deleteNodesNodeGroupMethodDescriptor, getNodeGroupMethodDescriptor, + getIamPolicyNodeGroupMethodDescriptor, insertNodeGroupMethodDescriptor, listNodeGroupsMethodDescriptor, listNodesNodeGroupsMethodDescriptor, - setNodeTemplateNodeGroupMethodDescriptor)); + setIamPolicyNodeGroupMethodDescriptor, + setNodeTemplateNodeGroupMethodDescriptor, + testIamPermissionsNodeGroupMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, NodeGroupStubSettings.getDefaultEndpoint()); @@ -508,6 +514,56 @@ public void getNodeGroupExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyNodeGroupTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupResourceName resource = + ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyNodeGroup(resource); + 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 getIamPolicyNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupResourceName resource = + ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + + client.getIamPolicyNodeGroup(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertNodeGroupTest() { @@ -722,6 +778,58 @@ public void listNodesNodeGroupsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicyNodeGroupTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupResourceName resource = + ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicyNodeGroup(resource, zoneSetPolicyRequestResource); + 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 setIamPolicyNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupResourceName resource = + ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyNodeGroup(resource, zoneSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setNodeTemplateNodeGroupTest() { @@ -816,4 +924,55 @@ public void setNodeTemplateNodeGroupExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsNodeGroupTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectZoneNodeGroupResourceName resource = + ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsNodeGroup(resource, testPermissionsRequestResource); + 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 testIamPermissionsNodeGroupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectZoneNodeGroupResourceName resource = + ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsNodeGroup(resource, testPermissionsRequestResource); + 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 index ad1df142f477..c9cdde06e0f3 100644 --- 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 @@ -19,9 +19,12 @@ 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.getIamPolicyNodeTemplateMethodDescriptor; 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 static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.setIamPolicyNodeTemplateMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonNodeTemplateStub.testIamPermissionsNodeTemplateMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -56,8 +59,11 @@ public class NodeTemplateClientTest { aggregatedListNodeTemplatesMethodDescriptor, deleteNodeTemplateMethodDescriptor, getNodeTemplateMethodDescriptor, + getIamPolicyNodeTemplateMethodDescriptor, insertNodeTemplateMethodDescriptor, - listNodeTemplatesMethodDescriptor)); + listNodeTemplatesMethodDescriptor, + setIamPolicyNodeTemplateMethodDescriptor, + testIamPermissionsNodeTemplateMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, NodeTemplateStubSettings.getDefaultEndpoint()); @@ -309,6 +315,56 @@ public void getNodeTemplateExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicyNodeTemplateTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectRegionNodeTemplateResourceName resource = + ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicyNodeTemplate(resource); + 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 getIamPolicyNodeTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionNodeTemplateResourceName resource = + ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + + client.getIamPolicyNodeTemplate(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertNodeTemplateTest() { @@ -458,4 +514,110 @@ public void listNodeTemplatesExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void setIamPolicyNodeTemplateTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectRegionNodeTemplateResourceName resource = + ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + RegionSetPolicyRequest regionSetPolicyRequestResource = + RegionSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = + client.setIamPolicyNodeTemplate(resource, regionSetPolicyRequestResource); + 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 setIamPolicyNodeTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionNodeTemplateResourceName resource = + ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + RegionSetPolicyRequest regionSetPolicyRequestResource = + RegionSetPolicyRequest.newBuilder().build(); + + client.setIamPolicyNodeTemplate(resource, regionSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsNodeTemplateTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectRegionNodeTemplateResourceName resource = + ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsNodeTemplate(resource, testPermissionsRequestResource); + 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 testIamPermissionsNodeTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionNodeTemplateResourceName resource = + ProjectRegionNodeTemplateResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsNodeTemplate(resource, testPermissionsRequestResource); + 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/RegionInstanceGroupManagerClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java index bdc9a057b6dd..fb10d4f0011f 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RegionInstanceGroupManagerClientTest.java @@ -23,6 +23,7 @@ import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.insertRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.listManagedInstancesRegionInstanceGroupManagersMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.listRegionInstanceGroupManagersMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.patchRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.recreateInstancesRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.resizeRegionInstanceGroupManagerMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagerStub.setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor; @@ -42,6 +43,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.List; import org.junit.After; @@ -63,6 +65,7 @@ public class RegionInstanceGroupManagerClientTest { insertRegionInstanceGroupManagerMethodDescriptor, listRegionInstanceGroupManagersMethodDescriptor, listManagedInstancesRegionInstanceGroupManagersMethodDescriptor, + patchRegionInstanceGroupManagerMethodDescriptor, recreateInstancesRegionInstanceGroupManagerMethodDescriptor, resizeRegionInstanceGroupManagerMethodDescriptor, setInstanceTemplateRegionInstanceGroupManagerMethodDescriptor, @@ -672,6 +675,105 @@ public void listManagedInstancesRegionInstanceGroupManagersExceptionTest() throw } } + @Test + @SuppressWarnings("all") + public void patchRegionInstanceGroupManagerTest() { + 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); + + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + List fieldMask = new ArrayList<>(); + + Operation actualResponse = + client.patchRegionInstanceGroupManager( + instanceGroupManager, instanceGroupManagerResource, 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 patchRegionInstanceGroupManagerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionInstanceGroupManagerName instanceGroupManager = + ProjectRegionInstanceGroupManagerName.of( + "[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]"); + InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build(); + List fieldMask = new ArrayList<>(); + + client.patchRegionInstanceGroupManager( + instanceGroupManager, instanceGroupManagerResource, fieldMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void recreateInstancesRegionInstanceGroupManagerTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java index 8e63632e7ae5..9339bbd03e52 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/RouterClientTest.java @@ -16,9 +16,11 @@ package com.google.cloud.compute.v1; import static com.google.cloud.compute.v1.RouterClient.AggregatedListRoutersPagedResponse; +import static com.google.cloud.compute.v1.RouterClient.GetNatMappingInfoRoutersPagedResponse; import static com.google.cloud.compute.v1.RouterClient.ListRoutersPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.aggregatedListRoutersMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.deleteRouterMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.getNatMappingInfoRoutersMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.getRouterMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.getRouterStatusRouterMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonRouterStub.insertRouterMethodDescriptor; @@ -61,6 +63,7 @@ public class RouterClientTest { aggregatedListRoutersMethodDescriptor, deleteRouterMethodDescriptor, getRouterMethodDescriptor, + getNatMappingInfoRoutersMethodDescriptor, getRouterStatusRouterMethodDescriptor, insertRouterMethodDescriptor, listRoutersMethodDescriptor, @@ -312,6 +315,69 @@ public void getRouterExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getNatMappingInfoRoutersTest() { + String kind = "kind3292052"; + String nextPageToken = ""; + String id = "id3355"; + String selfLink = "selfLink-1691268851"; + VmEndpointNatMappings resultElement = VmEndpointNatMappings.newBuilder().build(); + List result = Arrays.asList(resultElement); + VmEndpointNatMappingsList expectedResponse = + VmEndpointNatMappingsList.newBuilder() + .setKind(kind) + .setNextPageToken(nextPageToken) + .setId(id) + .setSelfLink(selfLink) + .addAllResult(result) + .build(); + mockService.addResponse(expectedResponse); + + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + GetNatMappingInfoRoutersPagedResponse pagedListResponse = + client.getNatMappingInfoRouters(router); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultList().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 getNatMappingInfoRoutersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionRouterName router = + ProjectRegionRouterName.of("[PROJECT]", "[REGION]", "[ROUTER]"); + + client.getNatMappingInfoRouters(router); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void getRouterStatusRouterTest() { diff --git a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java index f2e69ecc6a4c..24944e928882 100644 --- a/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java +++ b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SnapshotClientTest.java @@ -17,9 +17,12 @@ import static com.google.cloud.compute.v1.SnapshotClient.ListSnapshotsPagedResponse; import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.deleteSnapshotMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.getIamPolicySnapshotMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.getSnapshotMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.listSnapshotsMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.setIamPolicySnapshotMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.setLabelsSnapshotMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSnapshotStub.testIamPermissionsSnapshotMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -51,8 +54,11 @@ public class SnapshotClientTest { Lists.newArrayList( deleteSnapshotMethodDescriptor, getSnapshotMethodDescriptor, + getIamPolicySnapshotMethodDescriptor, listSnapshotsMethodDescriptor, - setLabelsSnapshotMethodDescriptor)); + setIamPolicySnapshotMethodDescriptor, + setLabelsSnapshotMethodDescriptor, + testIamPermissionsSnapshotMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, SnapshotStubSettings.getDefaultEndpoint()); @@ -242,6 +248,56 @@ public void getSnapshotExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicySnapshotTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicySnapshot(resource); + 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 getIamPolicySnapshotExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + + client.getIamPolicySnapshot(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void listSnapshotsTest() { @@ -302,6 +358,60 @@ public void listSnapshotsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicySnapshotTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicySnapshot(resource, globalSetPolicyRequestResource); + 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 setIamPolicySnapshotExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + GlobalSetPolicyRequest globalSetPolicyRequestResource = + GlobalSetPolicyRequest.newBuilder().build(); + + client.setIamPolicySnapshot(resource, globalSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setLabelsSnapshotTest() { @@ -395,4 +505,55 @@ public void setLabelsSnapshotExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsSnapshotTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsSnapshot(resource, testPermissionsRequestResource); + 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 testIamPermissionsSnapshotExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectGlobalSnapshotResourceName resource = + ProjectGlobalSnapshotResourceName.of("[PROJECT]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsSnapshot(resource, testPermissionsRequestResource); + 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/SubnetworkClientTest.java b/google-cloud-clients/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/SubnetworkClientTest.java index 78a6ab222ce9..b4f3d28fc0bc 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 @@ -21,12 +21,15 @@ 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.getIamPolicySubnetworkMethodDescriptor; 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.setIamPolicySubnetworkMethodDescriptor; import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.setPrivateIpGoogleAccessSubnetworkMethodDescriptor; +import static com.google.cloud.compute.v1.stub.HttpJsonSubnetworkStub.testIamPermissionsSubnetworkMethodDescriptor; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.httpjson.ApiMethodDescriptor; @@ -63,11 +66,14 @@ public class SubnetworkClientTest { deleteSubnetworkMethodDescriptor, expandIpCidrRangeSubnetworkMethodDescriptor, getSubnetworkMethodDescriptor, + getIamPolicySubnetworkMethodDescriptor, insertSubnetworkMethodDescriptor, listSubnetworksMethodDescriptor, listUsableSubnetworksMethodDescriptor, patchSubnetworkMethodDescriptor, - setPrivateIpGoogleAccessSubnetworkMethodDescriptor)); + setIamPolicySubnetworkMethodDescriptor, + setPrivateIpGoogleAccessSubnetworkMethodDescriptor, + testIamPermissionsSubnetworkMethodDescriptor)); private static final MockHttpService mockService = new MockHttpService(METHOD_DESCRIPTORS, SubnetworkStubSettings.getDefaultEndpoint()); @@ -419,6 +425,56 @@ public void getSubnetworkExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getIamPolicySubnetworkTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectRegionSubnetworkResourceName resource = + ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + + Policy actualResponse = client.getIamPolicySubnetwork(resource); + 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 getIamPolicySubnetworkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionSubnetworkResourceName resource = + ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + + client.getIamPolicySubnetwork(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void insertSubnetworkTest() { @@ -723,6 +779,60 @@ public void patchSubnetworkExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void setIamPolicySubnetworkTest() { + Boolean iamOwned = false; + String etag = "etag3123477"; + Integer version = 351608024; + Policy expectedResponse = + Policy.newBuilder().setIamOwned(iamOwned).setEtag(etag).setVersion(version).build(); + mockService.addResponse(expectedResponse); + + ProjectRegionSubnetworkResourceName resource = + ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + RegionSetPolicyRequest regionSetPolicyRequestResource = + RegionSetPolicyRequest.newBuilder().build(); + + Policy actualResponse = client.setIamPolicySubnetwork(resource, regionSetPolicyRequestResource); + 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 setIamPolicySubnetworkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionSubnetworkResourceName resource = + ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + RegionSetPolicyRequest regionSetPolicyRequestResource = + RegionSetPolicyRequest.newBuilder().build(); + + client.setIamPolicySubnetwork(resource, regionSetPolicyRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setPrivateIpGoogleAccessSubnetworkTest() { @@ -820,4 +930,55 @@ public void setPrivateIpGoogleAccessSubnetworkExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsSubnetworkTest() { + TestPermissionsResponse expectedResponse = TestPermissionsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ProjectRegionSubnetworkResourceName resource = + ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + TestPermissionsResponse actualResponse = + client.testIamPermissionsSubnetwork(resource, testPermissionsRequestResource); + 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 testIamPermissionsSubnetworkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectRegionSubnetworkResourceName resource = + ProjectRegionSubnetworkResourceName.of("[PROJECT]", "[REGION]", "[RESOURCE]"); + TestPermissionsRequest testPermissionsRequestResource = + TestPermissionsRequest.newBuilder().build(); + + client.testIamPermissionsSubnetwork(resource, testPermissionsRequestResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } } diff --git a/google-cloud-clients/google-cloud-compute/synth.metadata b/google-cloud-clients/google-cloud-compute/synth.metadata index a7e69ba472cb..d270120aa795 100644 --- a/google-cloud-clients/google-cloud-compute/synth.metadata +++ b/google-cloud-clients/google-cloud-compute/synth.metadata @@ -1,11 +1,11 @@ { - "updateTime": "2018-12-08T08:36:32.837586Z", + "updateTime": "2018-12-11T08:36:44.801706Z", "sources": [ { "git": { "name": "discovery-artifact-manager", "remote": "https://github.com/googleapis/discovery-artifact-manager.git", - "sha": "e91a43b559cdf54e5148f6e558a1b182917f1cff" + "sha": "0c2b7d9787d601bce81e5f8f2d1ad320d67c3792" } }, {