Skip to content

Commit

Permalink
feat: Updated the method signature of analyzeWorkloadMove for v1beta …
Browse files Browse the repository at this point in the history
…API to accept project as source. AnalyzeWorkloadMove now also returns information about org policy differences between the project and target folder (#463)

- [ ] Regenerate this pull request now.

Committer: @ketanbshah
PiperOrigin-RevId: 461626403

Source-Link: googleapis/googleapis@6aee59c

Source-Link: https://github.com/googleapis/googleapis-gen/commit/1e4553d63e79ed253db11974bc6c740567bcb03c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWU0NTUzZDYzZTc5ZWQyNTNkYjExOTc0YmM2Yzc0MDU2N2JjYjAzYyJ9
  • Loading branch information
gcf-owl-bot[bot] authored Jul 18, 2022
1 parent 1074488 commit c6ffe1f
Show file tree
Hide file tree
Showing 44 changed files with 8,492 additions and 1,422 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public final UnaryCallable<CreateWorkloadRequest, Operation> createWorkloadCalla
* }
* }</pre>
*
* @param workload Required. The workload to update. The workloads `name` field is used to
* @param workload Required. The workload to update. The workload's `name` field is used to
* identify the workload to be updated. Format:
* organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
* @param updateMask Required. The list of fields to be updated.
Expand Down Expand Up @@ -438,10 +438,126 @@ public final UnaryCallable<UpdateWorkloadRequest, Workload> updateWorkloadCallab
return stub.updateWorkloadCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Restrict the list of services allowed in the Workload environment. The current list of allowed
* services can be found at https://cloud.google.com/assured-workloads/docs/supported-products In
* addition to assuredworkloads.workload.update permission, the user should also have
* orgpolicy.policy.set permission on the folder resource to use this functionality.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* RestrictAllowedServicesRequest request =
* RestrictAllowedServicesRequest.newBuilder().setName("name3373707").build();
* RestrictAllowedServicesResponse response =
* assuredWorkloadsServiceClient.restrictAllowedServices(request);
* }
* }</pre>
*
* @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
*/
public final RestrictAllowedServicesResponse restrictAllowedServices(
RestrictAllowedServicesRequest request) {
return restrictAllowedServicesCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Restrict the list of services allowed in the Workload environment. The current list of allowed
* services can be found at https://cloud.google.com/assured-workloads/docs/supported-products In
* addition to assuredworkloads.workload.update permission, the user should also have
* orgpolicy.policy.set permission on the folder resource to use this functionality.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* RestrictAllowedServicesRequest request =
* RestrictAllowedServicesRequest.newBuilder().setName("name3373707").build();
* ApiFuture<RestrictAllowedServicesResponse> future =
* assuredWorkloadsServiceClient.restrictAllowedServicesCallable().futureCall(request);
* // Do something.
* RestrictAllowedServicesResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RestrictAllowedServicesRequest, RestrictAllowedServicesResponse>
restrictAllowedServicesCallable() {
return stub.restrictAllowedServicesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Restrict the list of resources allowed in the Workload environment. The current list of allowed
* products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In
* addition to assuredworkloads.workload.update permission, the user should also have
* orgpolicy.policy.set permission on the folder resource to use this functionality.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* RestrictAllowedResourcesRequest request =
* RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build();
* RestrictAllowedResourcesResponse response =
* assuredWorkloadsServiceClient.restrictAllowedResources(request);
* }
* }</pre>
*
* @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
*/
public final RestrictAllowedResourcesResponse restrictAllowedResources(
RestrictAllowedResourcesRequest request) {
return restrictAllowedResourcesCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Restrict the list of resources allowed in the Workload environment. The current list of allowed
* products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In
* addition to assuredworkloads.workload.update permission, the user should also have
* orgpolicy.policy.set permission on the folder resource to use this functionality.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* RestrictAllowedResourcesRequest request =
* RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build();
* ApiFuture<RestrictAllowedResourcesResponse> future =
* assuredWorkloadsServiceClient.restrictAllowedResourcesCallable().futureCall(request);
* // Do something.
* RestrictAllowedResourcesResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse>
restrictAllowedResourcesCallable() {
return stub.restrictAllowedResourcesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the workload. Make sure that workload's direct children are already in a deleted state,
* otherwise the request will fail with a FAILED_PRECONDITION error.
* otherwise the request will fail with a FAILED_PRECONDITION error. In addition to
* assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set
* permission on the deleted folder to remove Assured Workloads OrgPolicies.
*
* <p>Sample code:
*
Expand All @@ -468,7 +584,9 @@ public final void deleteWorkload(WorkloadName name) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the workload. Make sure that workload's direct children are already in a deleted state,
* otherwise the request will fail with a FAILED_PRECONDITION error.
* otherwise the request will fail with a FAILED_PRECONDITION error. In addition to
* assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set
* permission on the deleted folder to remove Assured Workloads OrgPolicies.
*
* <p>Sample code:
*
Expand All @@ -494,7 +612,9 @@ public final void deleteWorkload(String name) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the workload. Make sure that workload's direct children are already in a deleted state,
* otherwise the request will fail with a FAILED_PRECONDITION error.
* otherwise the request will fail with a FAILED_PRECONDITION error. In addition to
* assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set
* permission on the deleted folder to remove Assured Workloads OrgPolicies.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -522,7 +642,9 @@ public final void deleteWorkload(DeleteWorkloadRequest request) {
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the workload. Make sure that workload's direct children are already in a deleted state,
* otherwise the request will fail with a FAILED_PRECONDITION error.
* otherwise the request will fail with a FAILED_PRECONDITION error. In addition to
* assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set
* permission on the deleted folder to remove Assured Workloads OrgPolicies.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -654,6 +776,91 @@ public final UnaryCallable<GetWorkloadRequest, Workload> getWorkloadCallable() {
return stub.getWorkloadCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Analyze if the source Assured Workloads can be moved to the target Assured Workload
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* String project = "project-309310695";
* String target = "target-880905839";
* AnalyzeWorkloadMoveResponse response =
* assuredWorkloadsServiceClient.analyzeWorkloadMove(project, target);
* }
* }</pre>
*
* @param project The Source is a project based to be moved. This is the project's relative path
* in the API, formatted as "cloudresourcemanager.googleapis.com/projects/{project_number}"
* "projects/{project_number}" "cloudresourcemanager.googleapis.com/projects/{project_id}"
* "projects/{project_id}" For example,
* "organizations/123/locations/us-east1/workloads/assured-workload-1".
* @param target Required. The resource name of the Workload to fetch. This is the workloads's
* relative path in the API, formatted as
* "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". For
* example, "organizations/123/locations/us-east1/workloads/assured-workload-2".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AnalyzeWorkloadMoveResponse analyzeWorkloadMove(String project, String target) {
AnalyzeWorkloadMoveRequest request =
AnalyzeWorkloadMoveRequest.newBuilder().setProject(project).setTarget(target).build();
return analyzeWorkloadMove(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Analyze if the source Assured Workloads can be moved to the target Assured Workload
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* AnalyzeWorkloadMoveRequest request =
* AnalyzeWorkloadMoveRequest.newBuilder().setTarget("target-880905839").build();
* AnalyzeWorkloadMoveResponse response =
* assuredWorkloadsServiceClient.analyzeWorkloadMove(request);
* }
* }</pre>
*
* @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
*/
public final AnalyzeWorkloadMoveResponse analyzeWorkloadMove(AnalyzeWorkloadMoveRequest request) {
return analyzeWorkloadMoveCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Analyze if the source Assured Workloads can be moved to the target Assured Workload
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
* AssuredWorkloadsServiceClient.create()) {
* AnalyzeWorkloadMoveRequest request =
* AnalyzeWorkloadMoveRequest.newBuilder().setTarget("target-880905839").build();
* ApiFuture<AnalyzeWorkloadMoveResponse> future =
* assuredWorkloadsServiceClient.analyzeWorkloadMoveCallable().futureCall(request);
* // Do something.
* AnalyzeWorkloadMoveResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<AnalyzeWorkloadMoveRequest, AnalyzeWorkloadMoveResponse>
analyzeWorkloadMoveCallable() {
return stub.analyzeWorkloadMoveCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Assured Workloads under a CRM Node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ public UnaryCallSettings<UpdateWorkloadRequest, Workload> updateWorkloadSettings
return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).updateWorkloadSettings();
}

/** Returns the object with the settings used for calls to restrictAllowedServices. */
public UnaryCallSettings<RestrictAllowedServicesRequest, RestrictAllowedServicesResponse>
restrictAllowedServicesSettings() {
return ((AssuredWorkloadsServiceStubSettings) getStubSettings())
.restrictAllowedServicesSettings();
}

/** Returns the object with the settings used for calls to restrictAllowedResources. */
public UnaryCallSettings<RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse>
restrictAllowedResourcesSettings() {
return ((AssuredWorkloadsServiceStubSettings) getStubSettings())
.restrictAllowedResourcesSettings();
}

/** Returns the object with the settings used for calls to deleteWorkload. */
public UnaryCallSettings<DeleteWorkloadRequest, Empty> deleteWorkloadSettings() {
return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).deleteWorkloadSettings();
Expand All @@ -106,6 +120,12 @@ public UnaryCallSettings<GetWorkloadRequest, Workload> getWorkloadSettings() {
return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).getWorkloadSettings();
}

/** Returns the object with the settings used for calls to analyzeWorkloadMove. */
public UnaryCallSettings<AnalyzeWorkloadMoveRequest, AnalyzeWorkloadMoveResponse>
analyzeWorkloadMoveSettings() {
return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).analyzeWorkloadMoveSettings();
}

/** Returns the object with the settings used for calls to listWorkloads. */
public PagedCallSettings<ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse>
listWorkloadsSettings() {
Expand Down Expand Up @@ -245,6 +265,20 @@ public UnaryCallSettings.Builder<UpdateWorkloadRequest, Workload> updateWorkload
return getStubSettingsBuilder().updateWorkloadSettings();
}

/** Returns the builder for the settings used for calls to restrictAllowedServices. */
public UnaryCallSettings.Builder<
RestrictAllowedServicesRequest, RestrictAllowedServicesResponse>
restrictAllowedServicesSettings() {
return getStubSettingsBuilder().restrictAllowedServicesSettings();
}

/** Returns the builder for the settings used for calls to restrictAllowedResources. */
public UnaryCallSettings.Builder<
RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse>
restrictAllowedResourcesSettings() {
return getStubSettingsBuilder().restrictAllowedResourcesSettings();
}

/** Returns the builder for the settings used for calls to deleteWorkload. */
public UnaryCallSettings.Builder<DeleteWorkloadRequest, Empty> deleteWorkloadSettings() {
return getStubSettingsBuilder().deleteWorkloadSettings();
Expand All @@ -255,6 +289,12 @@ public UnaryCallSettings.Builder<GetWorkloadRequest, Workload> getWorkloadSettin
return getStubSettingsBuilder().getWorkloadSettings();
}

/** Returns the builder for the settings used for calls to analyzeWorkloadMove. */
public UnaryCallSettings.Builder<AnalyzeWorkloadMoveRequest, AnalyzeWorkloadMoveResponse>
analyzeWorkloadMoveSettings() {
return getStubSettingsBuilder().analyzeWorkloadMoveSettings();
}

/** Returns the builder for the settings used for calls to listWorkloads. */
public PagedCallSettings.Builder<
ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"grpc": {
"libraryClient": "AssuredWorkloadsServiceClient",
"rpcs": {
"AnalyzeWorkloadMove": {
"methods": ["analyzeWorkloadMove", "analyzeWorkloadMove", "analyzeWorkloadMoveCallable"]
},
"CreateWorkload": {
"methods": ["createWorkloadAsync", "createWorkloadAsync", "createWorkloadAsync", "createWorkloadOperationCallable", "createWorkloadCallable"]
},
Expand All @@ -22,6 +25,12 @@
"ListWorkloads": {
"methods": ["listWorkloads", "listWorkloads", "listWorkloads", "listWorkloadsPagedCallable", "listWorkloadsCallable"]
},
"RestrictAllowedResources": {
"methods": ["restrictAllowedResources", "restrictAllowedResourcesCallable"]
},
"RestrictAllowedServices": {
"methods": ["restrictAllowedServices", "restrictAllowedServicesCallable"]
},
"UpdateWorkload": {
"methods": ["updateWorkload", "updateWorkload", "updateWorkloadCallable"]
}
Expand Down
Loading

0 comments on commit c6ffe1f

Please sign in to comment.