analyzeMove method

Future<AnalyzeMoveResponse> analyzeMove(
  1. String resource, {
  2. String? destinationParent,
  3. String? view,
  4. String? $fields,
})

Analyze moving a resource to a specified destination without kicking off the actual move.

The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.

Request parameters:

resource - Required. Name of the resource to perform the analysis against. Only Google Cloud projects are supported as of today. Hence, this can only be a project ID (such as "projects/my-project-id") or a project number (such as "projects/12345"). Value must have pattern ^\[^/\]+/\[^/\]+$.

destinationParent - Required. Name of the Google Cloud folder or organization to reparent the target resource. The analysis will be performed against hypothetically moving the resource to this specified desitination parent. This can only be a folder number (such as "folders/123") or an organization number (such as "organizations/123").

view - Analysis view indicating what information should be included in the analysis response. If unspecified, the default view is FULL. Possible string values are:

  • "ANALYSIS_VIEW_UNSPECIFIED" : The default/unset value. The API will default to the FULL view.
  • "FULL" : Full analysis including all level of impacts of the specified resource move.
  • "BASIC" : Basic analysis only including blockers which will prevent the specified resource move at runtime.

$fields - Selector specifying which fields to include in a partial response.

Completes with a AnalyzeMoveResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<AnalyzeMoveResponse> analyzeMove(
  core.String resource, {
  core.String? destinationParent,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (destinationParent != null) 'destinationParent': [destinationParent],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':analyzeMove';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return AnalyzeMoveResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}