blob: 66f7ef8cee0f4dcbb67dfb888f35553e1c0ec738 [file] [edit]
// Copyright 2022 Google LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// This is a generated file (see the discoveryapis_generator project).
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: doc_directive_unknown
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: unintended_html_in_doc_comment
// ignore_for_file: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_string_interpolations
/// Backup for GKE API - v1
///
/// Backup for GKE is a managed Kubernetes workload backup and restore service
/// for GKE clusters.
///
/// For more information, see
/// <https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke>
///
/// Create an instance of [BackupForGKEApi] to access these resources:
///
/// - [ProjectsResource]
/// - [ProjectsLocationsResource]
/// - [ProjectsLocationsBackupChannelsResource]
/// - [ProjectsLocationsBackupChannelsBackupPlanBindingsResource]
/// - [ProjectsLocationsBackupPlansResource]
/// - [ProjectsLocationsBackupPlansBackupsResource]
/// - [ProjectsLocationsBackupPlansBackupsVolumeBackupsResource]
/// - [ProjectsLocationsOperationsResource]
/// - [ProjectsLocationsRestoreChannelsResource]
/// - [ProjectsLocationsRestoreChannelsRestorePlanBindingsResource]
/// - [ProjectsLocationsRestorePlansResource]
/// - [ProjectsLocationsRestorePlansRestoresResource]
/// - [ProjectsLocationsRestorePlansRestoresVolumeRestoresResource]
library;
import 'dart:async' as async;
import 'dart:convert' as convert;
import 'dart:core' as core;
import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
import 'package:http/http.dart' as http;
import '../shared.dart';
import '../src/user_agent.dart';
export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
show ApiRequestError, DetailedApiRequestError;
/// Backup for GKE is a managed Kubernetes workload backup and restore service
/// for GKE clusters.
class BackupForGKEApi {
/// See, edit, configure, and delete your Google Cloud data and see the email
/// address for your Google Account.
static const cloudPlatformScope =
'https://www.googleapis.com/auth/cloud-platform';
final commons.ApiRequester _requester;
ProjectsResource get projects => ProjectsResource(_requester);
BackupForGKEApi(
http.Client client, {
core.String rootUrl = 'https://gkebackup.googleapis.com/',
core.String servicePath = '',
}) : _requester = commons.ApiRequester(
client,
rootUrl,
servicePath,
requestHeaders,
);
}
class ProjectsResource {
final commons.ApiRequester _requester;
ProjectsLocationsResource get locations =>
ProjectsLocationsResource(_requester);
ProjectsResource(commons.ApiRequester client) : _requester = client;
}
class ProjectsLocationsResource {
final commons.ApiRequester _requester;
ProjectsLocationsBackupChannelsResource get backupChannels =>
ProjectsLocationsBackupChannelsResource(_requester);
ProjectsLocationsBackupPlansResource get backupPlans =>
ProjectsLocationsBackupPlansResource(_requester);
ProjectsLocationsOperationsResource get operations =>
ProjectsLocationsOperationsResource(_requester);
ProjectsLocationsRestoreChannelsResource get restoreChannels =>
ProjectsLocationsRestoreChannelsResource(_requester);
ProjectsLocationsRestorePlansResource get restorePlans =>
ProjectsLocationsRestorePlansResource(_requester);
ProjectsLocationsResource(commons.ApiRequester client) : _requester = client;
/// Gets information about a location.
///
/// Request parameters:
///
/// [name] - Resource name for the location.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Location].
///
/// 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.
async.Future<Location> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Location.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists information about the supported locations for this service.
///
/// This method lists locations based on the resource scope provided in the
/// \[ListLocationsRequest.name\] field: * **Global locations**: If `name` is
/// empty, the method lists the public locations available to all projects. *
/// **Project-specific locations**: If `name` follows the format
/// `projects/{project}`, the method lists locations visible to that specific
/// project. This includes public, private, or other project-specific
/// locations enabled for the project. For gRPC and client library
/// implementations, the resource name is passed as the `name` field. For
/// direct service calls, the resource name is incorporated into the request
/// path based on the specific service implementation and version.
///
/// Request parameters:
///
/// [name] - The resource that owns the locations collection, if applicable.
/// Value must have pattern `^projects/\[^/\]+$`.
///
/// [extraLocationTypes] - Optional. Do not use this field. It is unsupported
/// and is ignored unless explicitly documented otherwise. This is primarily
/// for internal usage.
///
/// [filter] - A filter to narrow down results to a preferred subset. The
/// filtering language accepts strings like `"displayName=tokyo"`, and is
/// documented in more detail in \[AIP-160\](https://google.aip.dev/160).
///
/// [pageSize] - The maximum number of results to return. If not set, the
/// service selects a default.
///
/// [pageToken] - A page token received from the `next_page_token` field in
/// the response. Send that page token to receive the subsequent page.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListLocationsResponse].
///
/// 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.
async.Future<ListLocationsResponse> list(
core.String name, {
core.List<core.String>? extraLocationTypes,
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'extraLocationTypes': ?extraLocationTypes,
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/locations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListLocationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsBackupChannelsResource {
final commons.ApiRequester _requester;
ProjectsLocationsBackupChannelsBackupPlanBindingsResource
get backupPlanBindings =>
ProjectsLocationsBackupChannelsBackupPlanBindingsResource(_requester);
ProjectsLocationsBackupChannelsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new BackupChannel in a given location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The location within which to create the
/// BackupChannel. Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [backupChannelId] - Optional. The client-provided short name for the
/// BackupChannel resource. This name must: - be between 1 and 63 characters
/// long (inclusive) - consist of only lower-case ASCII letters, numbers, and
/// dashes - start with a lower-case letter - end with a lower-case letter or
/// number - be unique within the set of BackupChannels in this location If
/// the user does not provide a name, a uuid will be used as the name.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> create(
BackupChannel request,
core.String parent, {
core.String? backupChannelId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'backupChannelId': ?backupChannelId == null ? null : [backupChannelId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backupChannels';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes an existing BackupChannel.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified BackupChannel name. Format: `projects /
/// * /locations / * /backupChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupChannels/\[^/\]+$`.
///
/// [etag] - Optional. If provided, this value must match the current value of
/// the target BackupChannel's etag field or the request is rejected.
///
/// [force] - Optional. If set to true, any BackupPlanAssociations below this
/// BackupChannel will also be deleted. Otherwise, the request will only
/// succeed if the BackupChannel has no BackupPlanAssociations.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> delete(
core.String name, {
core.String? etag,
core.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'force': ?force == null ? null : ['${force}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieve the details of a single BackupChannel.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified BackupChannel name. Format: `projects /
/// * /locations / * /backupChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupChannels/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [BackupChannel].
///
/// 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.
async.Future<BackupChannel> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return BackupChannel.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists BackupChannels in a given location.
///
/// Request parameters:
///
/// [parent] - Required. The location that contains the BackupChannels to
/// list. Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListBackupChannels` call. Provide this to retrieve the
/// subsequent page in a multi-page list of results. When paginating, all
/// other parameters provided to `ListBackupChannels` must match the call that
/// provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListBackupChannelsResponse].
///
/// 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.
async.Future<ListBackupChannelsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backupChannels';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListBackupChannelsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Update a BackupChannel.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Identifier. The fully qualified name of the BackupChannel.
/// `projects / * /locations / * /backupChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupChannels/\[^/\]+$`.
///
/// [updateMask] - Optional. This is used to specify the fields to be
/// overwritten in the BackupChannel targeted for update. The values for each
/// of these updated fields will be taken from the `backup_channel` provided
/// with this request. Field names are relative to the root of the resource
/// (e.g., `description`, `labels`, etc.) If no `update_mask` is provided, all
/// fields in `backup_channel` will be written to the target BackupChannel
/// resource. Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_channel`
/// are ignored and are not used to update the target BackupChannel.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> patch(
BackupChannel request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsBackupChannelsBackupPlanBindingsResource {
final commons.ApiRequester _requester;
ProjectsLocationsBackupChannelsBackupPlanBindingsResource(
commons.ApiRequester client,
) : _requester = client;
/// Retrieve the details of a single BackupPlanBinding.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified BackupPlanBinding name. Format:
/// `projects / * /locations / * /backupChannels / * /backupPlanBindings / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupChannels/\[^/\]+/backupPlanBindings/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [BackupPlanBinding].
///
/// 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.
async.Future<BackupPlanBinding> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return BackupPlanBinding.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists BackupPlanBindings in a given location.
///
/// Request parameters:
///
/// [parent] - Required. The BackupChannel that contains the
/// BackupPlanBindings to list. Format: `projects / * /locations / *
/// /backupChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupChannels/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListBackupPlanBindings` call. Provide this to retrieve the
/// subsequent page in a multi-page list of results. When paginating, all
/// other parameters provided to `ListBackupPlanBindings` must match the call
/// that provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListBackupPlanBindingsResponse].
///
/// 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.
async.Future<ListBackupPlanBindingsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backupPlanBindings';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListBackupPlanBindingsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsBackupPlansResource {
final commons.ApiRequester _requester;
ProjectsLocationsBackupPlansBackupsResource get backups =>
ProjectsLocationsBackupPlansBackupsResource(_requester);
ProjectsLocationsBackupPlansResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new BackupPlan in a given location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The location within which to create the BackupPlan.
/// Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [backupPlanId] - Required. The client-provided short name for the
/// BackupPlan resource. This name must: - be between 1 and 63 characters long
/// (inclusive) - consist of only lower-case ASCII letters, numbers, and
/// dashes - start with a lower-case letter - end with a lower-case letter or
/// number - be unique within the set of BackupPlans in this location
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> create(
BackupPlan request,
core.String parent, {
core.String? backupPlanId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'backupPlanId': ?backupPlanId == null ? null : [backupPlanId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backupPlans';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes an existing BackupPlan.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified BackupPlan name. Format: `projects / *
/// /locations / * /backupPlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [etag] - Optional. If provided, this value must match the current value of
/// the target BackupPlan's etag field or the request is rejected.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> delete(
core.String name, {
core.String? etag,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieve the details of a single BackupPlan.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified BackupPlan name. Format: `projects / *
/// /locations / * /backupPlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [BackupPlan].
///
/// 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.
async.Future<BackupPlan> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return BackupPlan.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns tags directly bound to a GCP resource.
///
/// Request parameters:
///
/// [name] - Required. The full resource name of the service resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GetTagsResponse].
///
/// 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.
async.Future<GetTagsResponse> getTags(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':getTags';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GetTagsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists BackupPlans in a given location.
///
/// Request parameters:
///
/// [parent] - Required. The location that contains the BackupPlans to list.
/// Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListBackupPlans` call. Provide this to retrieve the subsequent
/// page in a multi-page list of results. When paginating, all other
/// parameters provided to `ListBackupPlans` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListBackupPlansResponse].
///
/// 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.
async.Future<ListBackupPlansResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backupPlans';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListBackupPlansResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Update a BackupPlan.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Identifier. The full name of the BackupPlan
/// resource. Format: `projects / * /locations / * /backupPlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [updateMask] - Optional. This is used to specify the fields to be
/// overwritten in the BackupPlan targeted for update. The values for each of
/// these updated fields will be taken from the `backup_plan` provided with
/// this request. Field names are relative to the root of the resource (e.g.,
/// `description`, `backup_config.include_volume_data`, etc.) If no
/// `update_mask` is provided, all fields in `backup_plan` will be written to
/// the target BackupPlan resource. Note that OUTPUT_ONLY and IMMUTABLE fields
/// in `backup_plan` are ignored and are not used to update the target
/// BackupPlan.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> patch(
BackupPlan request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Updates tags directly bound to a GCP resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The full resource name of the service resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [SetTagsResponse].
///
/// 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.
async.Future<SetTagsResponse> setTags(
SetTagsRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':setTags';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return SetTagsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// 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.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsBackupPlansBackupsResource {
final commons.ApiRequester _requester;
ProjectsLocationsBackupPlansBackupsVolumeBackupsResource get volumeBackups =>
ProjectsLocationsBackupPlansBackupsVolumeBackupsResource(_requester);
ProjectsLocationsBackupPlansBackupsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a Backup for the given BackupPlan.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The BackupPlan within which to create the Backup.
/// Format: `projects / * /locations / * /backupPlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [backupId] - Optional. The client-provided short name for the Backup
/// resource. This name must: - be between 1 and 63 characters long
/// (inclusive) - consist of only lower-case ASCII letters, numbers, and
/// dashes - start with a lower-case letter - end with a lower-case letter or
/// number - be unique within the set of Backups in this BackupPlan
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> create(
Backup request,
core.String parent, {
core.String? backupId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'backupId': ?backupId == null ? null : [backupId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backups';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes an existing Backup.
///
/// Request parameters:
///
/// [name] - Required. Name of the Backup resource. Format: `projects / *
/// /locations / * /backupPlans / * /backups / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [etag] - Optional. If provided, this value must match the current value of
/// the target Backup's etag field or the request is rejected.
///
/// [force] - Optional. If set to true, any VolumeBackups below this Backup
/// will also be deleted. Otherwise, the request will only succeed if the
/// Backup has no VolumeBackups.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> delete(
core.String name, {
core.String? etag,
core.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'force': ?force == null ? null : ['${force}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieve the details of a single Backup.
///
/// Request parameters:
///
/// [name] - Required. Full name of the Backup resource. Format: `projects / *
/// /locations / * /backupPlans / * /backups / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Backup].
///
/// 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.
async.Future<Backup> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Backup.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Retrieve the link to the backupIndex.
///
/// Request parameters:
///
/// [backup] - Required. Full name of Backup resource. Format:
/// projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GetBackupIndexDownloadUrlResponse].
///
/// 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.
async.Future<GetBackupIndexDownloadUrlResponse> getBackupIndexDownloadUrl(
core.String backup, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$backup') + ':getBackupIndexDownloadUrl';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GetBackupIndexDownloadUrlResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists the Backups for a given BackupPlan.
///
/// Request parameters:
///
/// [parent] - Required. The BackupPlan that contains the Backups to list.
/// Format: `projects / * /locations / * /backupPlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListBackups` call. Provide this to retrieve the subsequent page
/// in a multi-page list of results. When paginating, all other parameters
/// provided to `ListBackups` must match the call that provided the page
/// token.
///
/// [returnPartialSuccess] - Optional. If set to true, the response will
/// return partial results when some regions are unreachable and the
/// unreachable field will be populated.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListBackupsResponse].
///
/// 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.
async.Future<ListBackupsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.bool? returnPartialSuccess,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'returnPartialSuccess': ?returnPartialSuccess == null
? null
: ['${returnPartialSuccess}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/backups';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListBackupsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Update a Backup.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Identifier. The fully qualified name of the Backup.
/// `projects / * /locations / * /backupPlans / * /backups / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [updateMask] - Optional. This is used to specify the fields to be
/// overwritten in the Backup targeted for update. The values for each of
/// these updated fields will be taken from the `backup_plan` provided with
/// this request. Field names are relative to the root of the resource. If no
/// `update_mask` is provided, all fields in `backup` will be written to the
/// target Backup resource. Note that OUTPUT_ONLY and IMMUTABLE fields in
/// `backup` are ignored and are not used to update the target Backup.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> patch(
Backup request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// 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.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsBackupPlansBackupsVolumeBackupsResource {
final commons.ApiRequester _requester;
ProjectsLocationsBackupPlansBackupsVolumeBackupsResource(
commons.ApiRequester client,
) : _requester = client;
/// Retrieve the details of a single VolumeBackup.
///
/// Request parameters:
///
/// [name] - Required. Full name of the VolumeBackup resource. Format:
/// `projects / * /locations / * /backupPlans / * /backups / * /volumeBackups
/// / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+/volumeBackups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [VolumeBackup].
///
/// 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.
async.Future<VolumeBackup> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return VolumeBackup.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+/volumeBackups/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists the VolumeBackups for a given Backup.
///
/// Request parameters:
///
/// [parent] - Required. The Backup that contains the VolumeBackups to list.
/// Format: `projects / * /locations / * /backupPlans / * /backups / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListVolumeBackups` call. Provide this to retrieve the subsequent
/// page in a multi-page list of results. When paginating, all other
/// parameters provided to `ListVolumeBackups` must match the call that
/// provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListVolumeBackupsResponse].
///
/// 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.
async.Future<ListVolumeBackupsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/volumeBackups';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListVolumeBackupsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+/volumeBackups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/backupPlans/\[^/\]+/backups/\[^/\]+/volumeBackups/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// 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.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsOperationsResource {
final commons.ApiRequester _requester;
ProjectsLocationsOperationsResource(commons.ApiRequester client)
: _requester = client;
/// Starts asynchronous cancellation on a long-running operation.
///
/// The server makes a best effort to cancel the operation, but success is not
/// guaranteed. If the server doesn't support this method, it returns
/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation
/// or other methods to check whether the cancellation succeeded or whether
/// the operation completed despite cancellation. On successful cancellation,
/// the operation is not deleted; instead, it becomes an operation with an
/// Operation.error value with a google.rpc.Status.code of `1`, corresponding
/// to `Code.CANCELLED`.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the operation resource to be cancelled.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Empty].
///
/// 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.
async.Future<Empty> cancel(
GoogleLongrunningCancelOperationRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':cancel';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a long-running operation.
///
/// This method indicates that the client is no longer interested in the
/// operation result. It does not cancel the operation. If the server doesn't
/// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
///
/// Request parameters:
///
/// [name] - The name of the operation resource to be deleted.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Empty].
///
/// 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.
async.Future<Empty> delete(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets the latest state of a long-running operation.
///
/// Clients can use this method to poll the operation result at intervals as
/// recommended by the API service.
///
/// Request parameters:
///
/// [name] - The name of the operation resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists operations that match the specified filter in the request.
///
/// If the server doesn't support this method, it returns `UNIMPLEMENTED`.
///
/// Request parameters:
///
/// [name] - The name of the operation's parent resource.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - The standard list filter.
///
/// [pageSize] - The standard list page size.
///
/// [pageToken] - The standard list page token.
///
/// [returnPartialSuccess] - When set to `true`, operations that are reachable
/// are returned as normal, and those that are unreachable are returned in the
/// ListOperationsResponse.unreachable field. This can only be `true` when
/// reading across collections. For example, when `parent` is set to
/// `"projects/example/locations/-"`. This field is not supported by default
/// and will result in an `UNIMPLEMENTED` error if set unless explicitly
/// documented otherwise in service or product specific documentation.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningListOperationsResponse].
///
/// 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.
async.Future<GoogleLongrunningListOperationsResponse> list(
core.String name, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.bool? returnPartialSuccess,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'returnPartialSuccess': ?returnPartialSuccess == null
? null
: ['${returnPartialSuccess}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/operations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleLongrunningListOperationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRestoreChannelsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRestoreChannelsRestorePlanBindingsResource
get restorePlanBindings =>
ProjectsLocationsRestoreChannelsRestorePlanBindingsResource(_requester);
ProjectsLocationsRestoreChannelsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new RestoreChannel in a given location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The location within which to create the
/// RestoreChannel. Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [restoreChannelId] - Optional. The client-provided short name for the
/// RestoreChannel resource. This name must: - be between 1 and 63 characters
/// long (inclusive) - consist of only lower-case ASCII letters, numbers, and
/// dashes - start with a lower-case letter - end with a lower-case letter or
/// number - be unique within the set of RestoreChannels in this location If
/// the user does not provide a name, a uuid will be used as the name.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> create(
RestoreChannel request,
core.String parent, {
core.String? restoreChannelId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'restoreChannelId': ?restoreChannelId == null ? null : [restoreChannelId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/restoreChannels';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes an existing RestoreChannel.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified RestoreChannel name. Format: `projects
/// / * /locations / * /restoreChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restoreChannels/\[^/\]+$`.
///
/// [etag] - Optional. If provided, this value must match the current value of
/// the target RestoreChannel's etag field or the request is rejected.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> delete(
core.String name, {
core.String? etag,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieve the details of a single RestoreChannel.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified RestoreChannel name. Format: `projects
/// / * /locations / * /restoreChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restoreChannels/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [RestoreChannel].
///
/// 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.
async.Future<RestoreChannel> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return RestoreChannel.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists RestoreChannels in a given location.
///
/// Request parameters:
///
/// [parent] - Required. The location that contains the RestoreChannels to
/// list. Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListRestoreChannels` call. Provide this to retrieve the
/// subsequent page in a multi-page list of results. When paginating, all
/// other parameters provided to `ListRestoreChannels` must match the call
/// that provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRestoreChannelsResponse].
///
/// 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.
async.Future<ListRestoreChannelsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/restoreChannels';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRestoreChannelsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Update a RestoreChannel.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Identifier. The fully qualified name of the RestoreChannel.
/// `projects / * /locations / * /restoreChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restoreChannels/\[^/\]+$`.
///
/// [updateMask] - Optional. This is used to specify the fields to be
/// overwritten in the RestoreChannel targeted for update. The values for each
/// of these updated fields will be taken from the `restore_channel` provided
/// with this request. Field names are relative to the root of the resource
/// (e.g., `description`, `destination_project_id`, etc.) If no `update_mask`
/// is provided, all fields in `restore_channel` will be written to the target
/// RestoreChannel resource. Note that OUTPUT_ONLY and IMMUTABLE fields in
/// `restore_channel` are ignored and are not used to update the target
/// RestoreChannel.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> patch(
RestoreChannel request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRestoreChannelsRestorePlanBindingsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRestoreChannelsRestorePlanBindingsResource(
commons.ApiRequester client,
) : _requester = client;
/// Retrieve the details of a single RestorePlanBinding.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified RestorePlanBinding name. Format:
/// `projects / * /locations / * /restoreChannels / * /restorePlanBindings / *
/// `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restoreChannels/\[^/\]+/restorePlanBindings/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [RestorePlanBinding].
///
/// 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.
async.Future<RestorePlanBinding> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return RestorePlanBinding.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists RestorePlanBindings in a given location.
///
/// Request parameters:
///
/// [parent] - Required. The RestoreChannel that contains the
/// ListRestorePlanBindings to list. Format: `projects / * /locations / *
/// /restoreChannels / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restoreChannels/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListRestorePlanBindings` call. Provide this to retrieve the
/// subsequent page in a multi-page list of results. When paginating, all
/// other parameters provided to `ListRestorePlanBindings` must match the call
/// that provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRestorePlanBindingsResponse].
///
/// 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.
async.Future<ListRestorePlanBindingsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$parent') + '/restorePlanBindings';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRestorePlanBindingsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRestorePlansResource {
final commons.ApiRequester _requester;
ProjectsLocationsRestorePlansRestoresResource get restores =>
ProjectsLocationsRestorePlansRestoresResource(_requester);
ProjectsLocationsRestorePlansResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new RestorePlan in a given location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The location within which to create the RestorePlan.
/// Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [restorePlanId] - Required. The client-provided short name for the
/// RestorePlan resource. This name must: - be between 1 and 63 characters
/// long (inclusive) - consist of only lower-case ASCII letters, numbers, and
/// dashes - start with a lower-case letter - end with a lower-case letter or
/// number - be unique within the set of RestorePlans in this location
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> create(
RestorePlan request,
core.String parent, {
core.String? restorePlanId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'restorePlanId': ?restorePlanId == null ? null : [restorePlanId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/restorePlans';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes an existing RestorePlan.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified RestorePlan name. Format: `projects / *
/// /locations / * /restorePlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [etag] - Optional. If provided, this value must match the current value of
/// the target RestorePlan's etag field or the request is rejected.
///
/// [force] - Optional. If set to true, any Restores below this RestorePlan
/// will also be deleted. Otherwise, the request will only succeed if the
/// RestorePlan has no Restores.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> delete(
core.String name, {
core.String? etag,
core.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'force': ?force == null ? null : ['${force}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieve the details of a single RestorePlan.
///
/// Request parameters:
///
/// [name] - Required. Fully qualified RestorePlan name. Format: `projects / *
/// /locations / * /restorePlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [RestorePlan].
///
/// 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.
async.Future<RestorePlan> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return RestorePlan.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns tags directly bound to a GCP resource.
///
/// Request parameters:
///
/// [name] - Required. The full resource name of the service resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GetTagsResponse].
///
/// 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.
async.Future<GetTagsResponse> getTags(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':getTags';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GetTagsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists RestorePlans in a given location.
///
/// Request parameters:
///
/// [parent] - Required. The location that contains the RestorePlans to list.
/// Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListRestorePlans` call. Provide this to retrieve the subsequent
/// page in a multi-page list of results. When paginating, all other
/// parameters provided to `ListRestorePlans` must match the call that
/// provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRestorePlansResponse].
///
/// 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.
async.Future<ListRestorePlansResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/restorePlans';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRestorePlansResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Update a RestorePlan.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Identifier. The full name of the RestorePlan
/// resource. Format: `projects / * /locations / * /restorePlans / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [updateMask] - Optional. This is used to specify the fields to be
/// overwritten in the RestorePlan targeted for update. The values for each of
/// these updated fields will be taken from the `restore_plan` provided with
/// this request. Field names are relative to the root of the resource. If no
/// `update_mask` is provided, all fields in `restore_plan` will be written to
/// the target RestorePlan resource. Note that OUTPUT_ONLY and IMMUTABLE
/// fields in `restore_plan` are ignored and are not used to update the target
/// RestorePlan.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> patch(
RestorePlan request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Updates tags directly bound to a GCP resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The full resource name of the service resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [SetTagsResponse].
///
/// 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.
async.Future<SetTagsResponse> setTags(
SetTagsRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':setTags';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return SetTagsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// 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.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRestorePlansRestoresResource {
final commons.ApiRequester _requester;
ProjectsLocationsRestorePlansRestoresVolumeRestoresResource
get volumeRestores =>
ProjectsLocationsRestorePlansRestoresVolumeRestoresResource(_requester);
ProjectsLocationsRestorePlansRestoresResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new Restore for the given RestorePlan.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The RestorePlan within which to create the Restore.
/// Format: `projects / * /locations / * /restorePlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [restoreId] - Required. The client-provided short name for the Restore
/// resource. This name must: - be between 1 and 63 characters long
/// (inclusive) - consist of only lower-case ASCII letters, numbers, and
/// dashes - start with a lower-case letter - end with a lower-case letter or
/// number - be unique within the set of Restores in this RestorePlan.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> create(
Restore request,
core.String parent, {
core.String? restoreId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'restoreId': ?restoreId == null ? null : [restoreId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/restores';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes an existing Restore.
///
/// Request parameters:
///
/// [name] - Required. Full name of the Restore Format: `projects / *
/// /locations / * /restorePlans / * /restores / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [etag] - Optional. If provided, this value must match the current value of
/// the target Restore's etag field or the request is rejected.
///
/// [force] - Optional. If set to true, any VolumeRestores below this restore
/// will also be deleted. Otherwise, the request will only succeed if the
/// restore has no VolumeRestores.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> delete(
core.String name, {
core.String? etag,
core.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'force': ?force == null ? null : ['${force}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieves the details of a single Restore.
///
/// Request parameters:
///
/// [name] - Required. Name of the restore resource. Format: `projects / *
/// /locations / * /restorePlans / * /restores / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Restore].
///
/// 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.
async.Future<Restore> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Restore.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists the Restores for a given RestorePlan.
///
/// Request parameters:
///
/// [parent] - Required. The RestorePlan that contains the Restores to list.
/// Format: `projects / * /locations / * /restorePlans / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListRestores` call. Provide this to retrieve the subsequent page
/// in a multi-page list of results. When paginating, all other parameters
/// provided to `ListRestores` must match the call that provided the page
/// token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRestoresResponse].
///
/// 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.
async.Future<ListRestoresResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/restores';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRestoresResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Update a Restore.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Identifier. The full name of the Restore resource.
/// Format: `projects / * /locations / * /restorePlans / * /restores / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [updateMask] - Optional. This is used to specify the fields to be
/// overwritten in the Restore targeted for update. The values for each of
/// these updated fields will be taken from the `restore` provided with this
/// request. Field names are relative to the root of the resource. If no
/// `update_mask` is provided, all fields in `restore` will be written to the
/// target Restore resource. Note that OUTPUT_ONLY and IMMUTABLE fields in
/// `restore` are ignored and are not used to update the target Restore.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleLongrunningOperation].
///
/// 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.
async.Future<GoogleLongrunningOperation> patch(
Restore request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// 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.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRestorePlansRestoresVolumeRestoresResource {
final commons.ApiRequester _requester;
ProjectsLocationsRestorePlansRestoresVolumeRestoresResource(
commons.ApiRequester client,
) : _requester = client;
/// Retrieve the details of a single VolumeRestore.
///
/// Request parameters:
///
/// [name] - Required. Full name of the VolumeRestore resource. Format:
/// `projects / * /locations / * /restorePlans / * /restores / *
/// /volumeRestores / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+/volumeRestores/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [VolumeRestore].
///
/// 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.
async.Future<VolumeRestore> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return VolumeRestore.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+/volumeRestores/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists the VolumeRestores for a given Restore.
///
/// Request parameters:
///
/// [parent] - Required. The Restore that contains the VolumeRestores to list.
/// Format: `projects / * /locations / * /restorePlans / * /restores / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+$`.
///
/// [filter] - Optional. Field match expression used to filter the results.
///
/// [orderBy] - Optional. Field by which to sort the results.
///
/// [pageSize] - Optional. The target number of results to return in a single
/// response. If not specified, a default value will be chosen by the service.
/// Note that the response may include a partial list and a caller should only
/// rely on the response's next_page_token to determine if there are more
/// instances left to be queried.
///
/// [pageToken] - Optional. The value of next_page_token received from a
/// previous `ListVolumeRestores` call. Provide this to retrieve the
/// subsequent page in a multi-page list of results. When paginating, all
/// other parameters provided to `ListVolumeRestores` must match the call that
/// provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListVolumeRestoresResponse].
///
/// 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.
async.Future<ListVolumeRestoresResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/volumeRestores';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListVolumeRestoresResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+/volumeRestores/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// 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.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/restorePlans/\[^/\]+/restores/\[^/\]+/volumeRestores/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// 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.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
/// Specifies the audit configuration for a service.
///
/// The configuration determines which permission types are logged, and what
/// identities, if any, are exempted from logging. An AuditConfig must have one
/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
/// and a specific service, the union of the two AuditConfigs is used for that
/// service: the log_types specified in each AuditConfig are enabled, and the
/// exempted_members in each AuditLogConfig are exempted. Example Policy with
/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices",
/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[
/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type":
/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com",
/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type":
/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] }
/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
/// logging. It also exempts `jose@example.com` from DATA_READ logging, and
/// `aliya@example.com` from DATA_WRITE logging.
class AuditConfig {
/// The configuration for logging of each type of permission.
core.List<AuditLogConfig>? auditLogConfigs;
/// Specifies a service that will be enabled for audit logging.
///
/// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
/// `allServices` is a special value that covers all services.
core.String? service;
AuditConfig({this.auditLogConfigs, this.service});
AuditConfig.fromJson(core.Map json_)
: this(
auditLogConfigs: (json_['auditLogConfigs'] as core.List?)
?.map(
(value) => AuditLogConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
service: json_['service'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final auditLogConfigs = this.auditLogConfigs;
final service = this.service;
return {'auditLogConfigs': ?auditLogConfigs, 'service': ?service};
}
}
/// Provides the configuration for logging a type of permissions.
///
/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ",
/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type":
/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
/// exempting jose@example.com from DATA_READ logging.
typedef AuditLogConfig = $AuditLogConfig;
/// Represents a request to perform a single point-in-time capture of some
/// portion of the state of a GKE cluster, the record of the backup operation
/// itself, and an anchor for the underlying artifacts that comprise the Backup
/// (the config backup and VolumeBackups).
class Backup {
/// If True, all namespaces were included in the Backup.
///
/// Output only.
core.bool? allNamespaces;
/// Information about the GKE cluster from which this Backup was created.
///
/// Output only.
ClusterMetadata? clusterMetadata;
/// Completion time of the Backup
///
/// Output only.
core.String? completeTime;
/// The size of the config backup in bytes.
///
/// Output only.
core.String? configBackupSizeBytes;
/// Whether or not the Backup contains Kubernetes Secrets.
///
/// Controlled by the parent BackupPlan's include_secrets value.
///
/// Output only.
core.bool? containsSecrets;
/// Whether or not the Backup contains volume data.
///
/// Controlled by the parent BackupPlan's include_volume_data value.
///
/// Output only.
core.bool? containsVolumeData;
/// The timestamp when this Backup resource was created.
///
/// Output only.
core.String? createTime;
/// Minimum age for this Backup (in days).
///
/// If this field is set to a non-zero value, the Backup will be "locked"
/// against deletion (either manual or automatic deletion) for the number of
/// days provided (measured from the creation time of the Backup). MUST be an
/// integer value between 0-90 (inclusive). Defaults to parent BackupPlan's
/// backup_delete_lock_days setting and may only be increased (either at
/// creation time or in a subsequent update).
///
/// Optional.
core.int? deleteLockDays;
/// The time at which an existing delete lock will expire for this backup
/// (calculated from create_time + delete_lock_days).
///
/// Output only.
core.String? deleteLockExpireTime;
/// User specified descriptive string for this Backup.
///
/// Optional.
core.String? description;
/// The customer managed encryption key that was used to encrypt the Backup's
/// artifacts.
///
/// Inherited from the parent BackupPlan's encryption_key value.
///
/// Output only.
EncryptionKey? encryptionKey;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a backup from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform backup updates in order to avoid race
/// conditions: An `etag` is returned in the response to `GetBackup`, and
/// systems are expected to put that etag in the request to `UpdateBackup` or
/// `DeleteBackup` to ensure that their change will be applied to the same
/// version of the resource.
///
/// Output only.
core.String? etag;
/// A set of custom labels supplied by user.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// This flag indicates whether this Backup resource was created manually by a
/// user or via a schedule in the BackupPlan.
///
/// A value of True means that the Backup was created manually.
///
/// Output only.
core.bool? manual;
/// Identifier.
///
/// The fully qualified name of the Backup. `projects / * /locations / *
/// /backupPlans / * /backups / * `
///
/// Output only.
core.String? name;
/// The total number of user managed namespaces contained in the Backup.
///
/// Output only.
core.int? namespaceCount;
/// If false, Backup will fail when Backup for GKE detects Kubernetes
/// configuration that is non-standard or requires additional setup to
/// restore.
///
/// Inherited from the parent BackupPlan's permissive_mode value.
///
/// Output only.
core.bool? permissiveMode;
/// The total number of Kubernetes Pods contained in the Backup.
///
/// Output only.
core.int? podCount;
/// The total number of Kubernetes resources included in the Backup.
///
/// Output only.
core.int? resourceCount;
/// The age (in days) after which this Backup will be automatically deleted.
///
/// Must be an integer value \>= 0: - If 0, no automatic deletion will occur
/// for this Backup. - If not 0, this must be \>= delete_lock_days and \<=
/// 365. Once a Backup is created, this value may only be increased. Defaults
/// to the parent BackupPlan's backup_retain_days value.
///
/// Optional.
core.int? retainDays;
/// The time at which this Backup will be automatically deleted (calculated
/// from create_time + retain_days).
///
/// Output only.
core.String? retainExpireTime;
/// Reserved for future use.
///
/// Output only.
core.bool? satisfiesPzi;
/// Reserved for future use.
///
/// Output only.
core.bool? satisfiesPzs;
/// If set, the list of ProtectedApplications whose resources were included in
/// the Backup.
///
/// Output only.
NamespacedNames? selectedApplications;
/// If set, the list of labels whose constituent namespaces were included in
/// the Backup.
///
/// Output only.
ResourceLabels? selectedNamespaceLabels;
/// If set, the list of namespaces that were included in the Backup.
///
/// Output only.
Namespaces? selectedNamespaces;
/// The total size of the Backup in bytes = config backup size + sum(volume
/// backup sizes)
///
/// Output only.
core.String? sizeBytes;
/// Current state of the Backup
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : The Backup resource is in the process of being
/// created.
/// - "CREATING" : The Backup resource has been created and the associated
/// BackupJob Kubernetes resource has been injected into the source cluster.
/// - "IN_PROGRESS" : The gkebackup agent in the cluster has begun executing
/// the backup operation.
/// - "SUCCEEDED" : The backup operation has completed successfully.
/// - "FAILED" : The backup operation has failed.
/// - "DELETING" : This Backup resource (and its associated artifacts) is in
/// the process of being deleted.
core.String? state;
/// Human-readable description of why the backup is in the current `state`.
///
/// This field is only meant for human readability and should not be used
/// programmatically as this field is not guaranteed to be consistent.
///
/// Output only.
core.String? stateReason;
/// Information about the troubleshooting steps which will provide debugging
/// information to the end users.
///
/// Output only.
TroubleshootingInfo? troubleshootingInfo;
/// Server generated global unique identifier of
/// [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)
///
/// Output only.
core.String? uid;
/// The timestamp when this Backup resource was last updated.
///
/// Output only.
core.String? updateTime;
/// The total number of volume backups contained in the Backup.
///
/// Output only.
core.int? volumeCount;
Backup({
this.allNamespaces,
this.clusterMetadata,
this.completeTime,
this.configBackupSizeBytes,
this.containsSecrets,
this.containsVolumeData,
this.createTime,
this.deleteLockDays,
this.deleteLockExpireTime,
this.description,
this.encryptionKey,
this.etag,
this.labels,
this.manual,
this.name,
this.namespaceCount,
this.permissiveMode,
this.podCount,
this.resourceCount,
this.retainDays,
this.retainExpireTime,
this.satisfiesPzi,
this.satisfiesPzs,
this.selectedApplications,
this.selectedNamespaceLabels,
this.selectedNamespaces,
this.sizeBytes,
this.state,
this.stateReason,
this.troubleshootingInfo,
this.uid,
this.updateTime,
this.volumeCount,
});
Backup.fromJson(core.Map json_)
: this(
allNamespaces: json_['allNamespaces'] as core.bool?,
clusterMetadata: json_.containsKey('clusterMetadata')
? ClusterMetadata.fromJson(
json_['clusterMetadata'] as core.Map<core.String, core.dynamic>,
)
: null,
completeTime: json_['completeTime'] as core.String?,
configBackupSizeBytes: json_['configBackupSizeBytes'] as core.String?,
containsSecrets: json_['containsSecrets'] as core.bool?,
containsVolumeData: json_['containsVolumeData'] as core.bool?,
createTime: json_['createTime'] as core.String?,
deleteLockDays: json_['deleteLockDays'] as core.int?,
deleteLockExpireTime: json_['deleteLockExpireTime'] as core.String?,
description: json_['description'] as core.String?,
encryptionKey: json_.containsKey('encryptionKey')
? EncryptionKey.fromJson(
json_['encryptionKey'] as core.Map<core.String, core.dynamic>,
)
: null,
etag: json_['etag'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
manual: json_['manual'] as core.bool?,
name: json_['name'] as core.String?,
namespaceCount: json_['namespaceCount'] as core.int?,
permissiveMode: json_['permissiveMode'] as core.bool?,
podCount: json_['podCount'] as core.int?,
resourceCount: json_['resourceCount'] as core.int?,
retainDays: json_['retainDays'] as core.int?,
retainExpireTime: json_['retainExpireTime'] as core.String?,
satisfiesPzi: json_['satisfiesPzi'] as core.bool?,
satisfiesPzs: json_['satisfiesPzs'] as core.bool?,
selectedApplications: json_.containsKey('selectedApplications')
? NamespacedNames.fromJson(
json_['selectedApplications']
as core.Map<core.String, core.dynamic>,
)
: null,
selectedNamespaceLabels: json_.containsKey('selectedNamespaceLabels')
? ResourceLabels.fromJson(
json_['selectedNamespaceLabels']
as core.Map<core.String, core.dynamic>,
)
: null,
selectedNamespaces: json_.containsKey('selectedNamespaces')
? Namespaces.fromJson(
json_['selectedNamespaces']
as core.Map<core.String, core.dynamic>,
)
: null,
sizeBytes: json_['sizeBytes'] as core.String?,
state: json_['state'] as core.String?,
stateReason: json_['stateReason'] as core.String?,
troubleshootingInfo: json_.containsKey('troubleshootingInfo')
? TroubleshootingInfo.fromJson(
json_['troubleshootingInfo']
as core.Map<core.String, core.dynamic>,
)
: null,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
volumeCount: json_['volumeCount'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final allNamespaces = this.allNamespaces;
final clusterMetadata = this.clusterMetadata;
final completeTime = this.completeTime;
final configBackupSizeBytes = this.configBackupSizeBytes;
final containsSecrets = this.containsSecrets;
final containsVolumeData = this.containsVolumeData;
final createTime = this.createTime;
final deleteLockDays = this.deleteLockDays;
final deleteLockExpireTime = this.deleteLockExpireTime;
final description = this.description;
final encryptionKey = this.encryptionKey;
final etag = this.etag;
final labels = this.labels;
final manual = this.manual;
final name = this.name;
final namespaceCount = this.namespaceCount;
final permissiveMode = this.permissiveMode;
final podCount = this.podCount;
final resourceCount = this.resourceCount;
final retainDays = this.retainDays;
final retainExpireTime = this.retainExpireTime;
final satisfiesPzi = this.satisfiesPzi;
final satisfiesPzs = this.satisfiesPzs;
final selectedApplications = this.selectedApplications;
final selectedNamespaceLabels = this.selectedNamespaceLabels;
final selectedNamespaces = this.selectedNamespaces;
final sizeBytes = this.sizeBytes;
final state = this.state;
final stateReason = this.stateReason;
final troubleshootingInfo = this.troubleshootingInfo;
final uid = this.uid;
final updateTime = this.updateTime;
final volumeCount = this.volumeCount;
return {
'allNamespaces': ?allNamespaces,
'clusterMetadata': ?clusterMetadata,
'completeTime': ?completeTime,
'configBackupSizeBytes': ?configBackupSizeBytes,
'containsSecrets': ?containsSecrets,
'containsVolumeData': ?containsVolumeData,
'createTime': ?createTime,
'deleteLockDays': ?deleteLockDays,
'deleteLockExpireTime': ?deleteLockExpireTime,
'description': ?description,
'encryptionKey': ?encryptionKey,
'etag': ?etag,
'labels': ?labels,
'manual': ?manual,
'name': ?name,
'namespaceCount': ?namespaceCount,
'permissiveMode': ?permissiveMode,
'podCount': ?podCount,
'resourceCount': ?resourceCount,
'retainDays': ?retainDays,
'retainExpireTime': ?retainExpireTime,
'satisfiesPzi': ?satisfiesPzi,
'satisfiesPzs': ?satisfiesPzs,
'selectedApplications': ?selectedApplications,
'selectedNamespaceLabels': ?selectedNamespaceLabels,
'selectedNamespaces': ?selectedNamespaces,
'sizeBytes': ?sizeBytes,
'state': ?state,
'stateReason': ?stateReason,
'troubleshootingInfo': ?troubleshootingInfo,
'uid': ?uid,
'updateTime': ?updateTime,
'volumeCount': ?volumeCount,
};
}
}
/// A BackupChannel imposes constraints on where clusters can be backed up.
///
/// The BackupChannel should be in the same project and region as the cluster
/// being backed up. The backup can be created only in destination_project.
class BackupChannel {
/// The timestamp when this BackupChannel resource was created.
///
/// Output only.
core.String? createTime;
/// User specified descriptive string for this BackupChannel.
///
/// Optional.
core.String? description;
/// The project where Backups are allowed to be stored.
///
/// The format is `projects/{projectId}` or `projects/{projectNumber}`.
///
/// Required. Immutable.
core.String? destinationProject;
/// The project_id where Backups are allowed to be stored.
///
/// Example Project ID: "my-project-id". This will be an OUTPUT_ONLY field to
/// return the project_id of the destination project.
///
/// Output only.
core.String? destinationProjectId;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a BackupChannel from overwriting each other.
///
/// It is strongly suggested that systems make use of the 'etag' in the
/// read-modify-write cycle to perform BackupChannel updates in order to avoid
/// race conditions: An `etag` is returned in the response to
/// `GetBackupChannel`, and systems are expected to put that etag in the
/// request to `UpdateBackupChannel` or `DeleteBackupChannel` to ensure that
/// their change will be applied to the same version of the resource.
///
/// Output only.
core.String? etag;
/// A set of custom labels supplied by user.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The fully qualified name of the BackupChannel. `projects / * /locations /
/// * /backupChannels / * `
core.String? name;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this BackupChannel resource was last updated.
///
/// Output only.
core.String? updateTime;
BackupChannel({
this.createTime,
this.description,
this.destinationProject,
this.destinationProjectId,
this.etag,
this.labels,
this.name,
this.uid,
this.updateTime,
});
BackupChannel.fromJson(core.Map json_)
: this(
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
destinationProject: json_['destinationProject'] as core.String?,
destinationProjectId: json_['destinationProjectId'] as core.String?,
etag: json_['etag'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final createTime = this.createTime;
final description = this.description;
final destinationProject = this.destinationProject;
final destinationProjectId = this.destinationProjectId;
final etag = this.etag;
final labels = this.labels;
final name = this.name;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'createTime': ?createTime,
'description': ?description,
'destinationProject': ?destinationProject,
'destinationProjectId': ?destinationProjectId,
'etag': ?etag,
'labels': ?labels,
'name': ?name,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// BackupConfig defines the configuration of Backups created via this
/// BackupPlan.
class BackupConfig {
/// If True, include all namespaced resources
core.bool? allNamespaces;
/// This defines a customer managed encryption key that will be used to
/// encrypt the "config" portion (the Kubernetes resources) of Backups created
/// via this plan.
///
/// Default (empty): Config backup artifacts will not be encrypted.
///
/// Optional.
EncryptionKey? encryptionKey;
/// This flag specifies whether Kubernetes Secret resources should be included
/// when they fall into the scope of Backups.
///
/// Default: False
///
/// Optional.
core.bool? includeSecrets;
/// This flag specifies whether volume data should be backed up when PVCs are
/// included in the scope of a Backup.
///
/// Default: False
///
/// Optional.
core.bool? includeVolumeData;
/// If false, Backups will fail when Backup for GKE detects Kubernetes
/// configuration that is non-standard or requires additional setup to
/// restore.
///
/// Default: False
///
/// Optional.
core.bool? permissiveMode;
/// If set, include just the resources referenced by the listed
/// ProtectedApplications.
NamespacedNames? selectedApplications;
/// If set, the list of labels whose constituent namespaces were included in
/// the Backup.
ResourceLabels? selectedNamespaceLabels;
/// If set, include just the resources in the listed namespaces.
Namespaces? selectedNamespaces;
BackupConfig({
this.allNamespaces,
this.encryptionKey,
this.includeSecrets,
this.includeVolumeData,
this.permissiveMode,
this.selectedApplications,
this.selectedNamespaceLabels,
this.selectedNamespaces,
});
BackupConfig.fromJson(core.Map json_)
: this(
allNamespaces: json_['allNamespaces'] as core.bool?,
encryptionKey: json_.containsKey('encryptionKey')
? EncryptionKey.fromJson(
json_['encryptionKey'] as core.Map<core.String, core.dynamic>,
)
: null,
includeSecrets: json_['includeSecrets'] as core.bool?,
includeVolumeData: json_['includeVolumeData'] as core.bool?,
permissiveMode: json_['permissiveMode'] as core.bool?,
selectedApplications: json_.containsKey('selectedApplications')
? NamespacedNames.fromJson(
json_['selectedApplications']
as core.Map<core.String, core.dynamic>,
)
: null,
selectedNamespaceLabels: json_.containsKey('selectedNamespaceLabels')
? ResourceLabels.fromJson(
json_['selectedNamespaceLabels']
as core.Map<core.String, core.dynamic>,
)
: null,
selectedNamespaces: json_.containsKey('selectedNamespaces')
? Namespaces.fromJson(
json_['selectedNamespaces']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final allNamespaces = this.allNamespaces;
final encryptionKey = this.encryptionKey;
final includeSecrets = this.includeSecrets;
final includeVolumeData = this.includeVolumeData;
final permissiveMode = this.permissiveMode;
final selectedApplications = this.selectedApplications;
final selectedNamespaceLabels = this.selectedNamespaceLabels;
final selectedNamespaces = this.selectedNamespaces;
return {
'allNamespaces': ?allNamespaces,
'encryptionKey': ?encryptionKey,
'includeSecrets': ?includeSecrets,
'includeVolumeData': ?includeVolumeData,
'permissiveMode': ?permissiveMode,
'selectedApplications': ?selectedApplications,
'selectedNamespaceLabels': ?selectedNamespaceLabels,
'selectedNamespaces': ?selectedNamespaces,
};
}
}
/// BackupConfigDetails defines the configuration of Backups created via this
/// BackupPlan.
class BackupConfigDetails {
/// If True, include all namespaced resources
///
/// Output only.
core.bool? allNamespaces;
/// This defines a customer managed encryption key that will be used to
/// encrypt the "config" portion (the Kubernetes resources) of Backups created
/// via this plan.
///
/// Default (empty): Config backup artifacts will not be encrypted.
///
/// Output only.
EncryptionKey? encryptionKey;
/// This flag specifies whether Kubernetes Secret resources should be included
/// when they fall into the scope of Backups.
///
/// Default: False
///
/// Output only.
core.bool? includeSecrets;
/// This flag specifies whether volume data should be backed up when PVCs are
/// included in the scope of a Backup.
///
/// Default: False
///
/// Output only.
core.bool? includeVolumeData;
/// If set, include just the resources referenced by the listed
/// ProtectedApplications.
///
/// Output only.
NamespacedNames? selectedApplications;
/// If set, include just the resources in the listed namespaces.
///
/// Output only.
Namespaces? selectedNamespaces;
BackupConfigDetails({
this.allNamespaces,
this.encryptionKey,
this.includeSecrets,
this.includeVolumeData,
this.selectedApplications,
this.selectedNamespaces,
});
BackupConfigDetails.fromJson(core.Map json_)
: this(
allNamespaces: json_['allNamespaces'] as core.bool?,
encryptionKey: json_.containsKey('encryptionKey')
? EncryptionKey.fromJson(
json_['encryptionKey'] as core.Map<core.String, core.dynamic>,
)
: null,
includeSecrets: json_['includeSecrets'] as core.bool?,
includeVolumeData: json_['includeVolumeData'] as core.bool?,
selectedApplications: json_.containsKey('selectedApplications')
? NamespacedNames.fromJson(
json_['selectedApplications']
as core.Map<core.String, core.dynamic>,
)
: null,
selectedNamespaces: json_.containsKey('selectedNamespaces')
? Namespaces.fromJson(
json_['selectedNamespaces']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final allNamespaces = this.allNamespaces;
final encryptionKey = this.encryptionKey;
final includeSecrets = this.includeSecrets;
final includeVolumeData = this.includeVolumeData;
final selectedApplications = this.selectedApplications;
final selectedNamespaces = this.selectedNamespaces;
return {
'allNamespaces': ?allNamespaces,
'encryptionKey': ?encryptionKey,
'includeSecrets': ?includeSecrets,
'includeVolumeData': ?includeVolumeData,
'selectedApplications': ?selectedApplications,
'selectedNamespaces': ?selectedNamespaces,
};
}
}
/// Defines the configuration and scheduling for a "line" of Backups.
class BackupPlan {
/// The fully qualified name of the BackupChannel to be used to create a
/// backup.
///
/// This field is set only if the cluster being backed up is in a different
/// project. `projects / * /locations / * /backupChannels / * `
///
/// Output only.
core.String? backupChannel;
/// Defines the configuration of Backups created via this BackupPlan.
///
/// Optional.
BackupConfig? backupConfig;
/// Defines a schedule for automatic Backup creation via this BackupPlan.
///
/// Optional.
Schedule? backupSchedule;
/// The source cluster from which Backups will be created via this BackupPlan.
///
/// Valid formats: - `projects / * /locations / * /clusters / * ` - `projects
/// / * /zones / * /clusters / * `
///
/// Required. Immutable.
core.String? cluster;
/// The timestamp when this BackupPlan resource was created.
///
/// Output only.
core.String? createTime;
/// This flag indicates whether this BackupPlan has been deactivated.
///
/// Setting this field to True locks the BackupPlan such that no further
/// updates will be allowed (except deletes), including the deactivated field
/// itself. It also prevents any new Backups from being created via this
/// BackupPlan (including scheduled Backups). Default: False
///
/// Optional.
core.bool? deactivated;
/// User specified descriptive string for this BackupPlan.
///
/// Optional.
core.String? description;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a backup plan from overwriting each other.
///
/// It is strongly suggested that systems make use of the 'etag' in the
/// read-modify-write cycle to perform BackupPlan updates in order to avoid
/// race conditions: An `etag` is returned in the response to `GetBackupPlan`,
/// and systems are expected to put that etag in the request to
/// `UpdateBackupPlan` or `DeleteBackupPlan` to ensure that their change will
/// be applied to the same version of the resource.
///
/// Output only.
core.String? etag;
/// A set of custom labels supplied by user.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Completion time of the last successful Backup.
///
/// This is sourced from a successful Backup's complete_time field. This field
/// is added to maintain consistency with BackupPlanBinding to display last
/// successful backup time.
///
/// Output only.
core.String? lastSuccessfulBackupTime;
/// Identifier.
///
/// The full name of the BackupPlan resource. Format: `projects / * /locations
/// / * /backupPlans / * `
///
/// Output only.
core.String? name;
/// The number of user managed namespaces backed up in the last successful
/// Backup created via this BackupPlan.
///
/// Output only.
core.int? protectedNamespaceCount;
/// The number of Kubernetes Pods backed up in the last successful Backup
/// created via this BackupPlan.
///
/// Output only.
core.int? protectedPodCount;
/// RetentionPolicy governs lifecycle of Backups created under this plan.
///
/// Optional.
RetentionPolicy? retentionPolicy;
/// A number that represents the current risk level of this BackupPlan from
/// RPO perspective with 1 being no risk and 5 being highest risk.
///
/// Output only.
core.int? rpoRiskLevel;
/// Human-readable description of why the BackupPlan is in the current
/// rpo_risk_level and action items if any.
///
/// Output only.
core.String? rpoRiskReason;
/// State of the BackupPlan.
///
/// This State field reflects the various stages a BackupPlan can be in during
/// the Create operation. It will be set to "DEACTIVATED" if the BackupPlan is
/// deactivated on an Update
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : Default first value for Enums.
/// - "CLUSTER_PENDING" : Waiting for cluster state to be RUNNING.
/// - "PROVISIONING" : The BackupPlan is in the process of being created.
/// - "READY" : The BackupPlan has successfully been created and is ready for
/// Backups.
/// - "FAILED" : BackupPlan creation has failed.
/// - "DEACTIVATED" : The BackupPlan has been deactivated.
/// - "DELETING" : The BackupPlan is in the process of being deleted.
core.String? state;
/// Human-readable description of why BackupPlan is in the current `state`.
///
/// This field is only meant for human readability and should not be used
/// programmatically as this field is not guaranteed to be consistent.
///
/// Output only.
core.String? stateReason;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this BackupPlan resource was last updated.
///
/// Output only.
core.String? updateTime;
BackupPlan({
this.backupChannel,
this.backupConfig,
this.backupSchedule,
this.cluster,
this.createTime,
this.deactivated,
this.description,
this.etag,
this.labels,
this.lastSuccessfulBackupTime,
this.name,
this.protectedNamespaceCount,
this.protectedPodCount,
this.retentionPolicy,
this.rpoRiskLevel,
this.rpoRiskReason,
this.state,
this.stateReason,
this.uid,
this.updateTime,
});
BackupPlan.fromJson(core.Map json_)
: this(
backupChannel: json_['backupChannel'] as core.String?,
backupConfig: json_.containsKey('backupConfig')
? BackupConfig.fromJson(
json_['backupConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
backupSchedule: json_.containsKey('backupSchedule')
? Schedule.fromJson(
json_['backupSchedule'] as core.Map<core.String, core.dynamic>,
)
: null,
cluster: json_['cluster'] as core.String?,
createTime: json_['createTime'] as core.String?,
deactivated: json_['deactivated'] as core.bool?,
description: json_['description'] as core.String?,
etag: json_['etag'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
lastSuccessfulBackupTime:
json_['lastSuccessfulBackupTime'] as core.String?,
name: json_['name'] as core.String?,
protectedNamespaceCount: json_['protectedNamespaceCount'] as core.int?,
protectedPodCount: json_['protectedPodCount'] as core.int?,
retentionPolicy: json_.containsKey('retentionPolicy')
? RetentionPolicy.fromJson(
json_['retentionPolicy'] as core.Map<core.String, core.dynamic>,
)
: null,
rpoRiskLevel: json_['rpoRiskLevel'] as core.int?,
rpoRiskReason: json_['rpoRiskReason'] as core.String?,
state: json_['state'] as core.String?,
stateReason: json_['stateReason'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupChannel = this.backupChannel;
final backupConfig = this.backupConfig;
final backupSchedule = this.backupSchedule;
final cluster = this.cluster;
final createTime = this.createTime;
final deactivated = this.deactivated;
final description = this.description;
final etag = this.etag;
final labels = this.labels;
final lastSuccessfulBackupTime = this.lastSuccessfulBackupTime;
final name = this.name;
final protectedNamespaceCount = this.protectedNamespaceCount;
final protectedPodCount = this.protectedPodCount;
final retentionPolicy = this.retentionPolicy;
final rpoRiskLevel = this.rpoRiskLevel;
final rpoRiskReason = this.rpoRiskReason;
final state = this.state;
final stateReason = this.stateReason;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'backupChannel': ?backupChannel,
'backupConfig': ?backupConfig,
'backupSchedule': ?backupSchedule,
'cluster': ?cluster,
'createTime': ?createTime,
'deactivated': ?deactivated,
'description': ?description,
'etag': ?etag,
'labels': ?labels,
'lastSuccessfulBackupTime': ?lastSuccessfulBackupTime,
'name': ?name,
'protectedNamespaceCount': ?protectedNamespaceCount,
'protectedPodCount': ?protectedPodCount,
'retentionPolicy': ?retentionPolicy,
'rpoRiskLevel': ?rpoRiskLevel,
'rpoRiskReason': ?rpoRiskReason,
'state': ?state,
'stateReason': ?stateReason,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// A BackupPlanBinding binds a BackupPlan with a BackupChannel.
///
/// This resource is created automatically when a BackupPlan is created using a
/// BackupChannel. This also serves as a holder for cross-project fields that
/// need to be displayed in the current project.
class BackupPlanBinding {
/// The fully qualified name of the BackupPlan bound with the parent
/// BackupChannel.
///
/// `projects / * /locations / * /backupPlans/{backup_plan}`
///
/// Output only. Immutable.
core.String? backupPlan;
/// Contains details about the backup plan/backup.
///
/// Output only.
BackupPlanDetails? backupPlanDetails;
/// The fully qualified name of the cluster that is being backed up Valid
/// formats: - `projects / * /locations / * /clusters / * ` - `projects / *
/// /zones / * /clusters / * `
///
/// Output only. Immutable.
core.String? cluster;
/// The timestamp when this binding was created.
///
/// Output only.
core.String? createTime;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a BackupPlanBinding from overwriting each other.
///
/// It is strongly suggested that systems make use of the 'etag' in the
/// read-modify-write cycle to perform BackupPlanBinding updates in order to
/// avoid race conditions: An `etag` is returned in the response to
/// `GetBackupPlanBinding`, and systems are expected to put that etag in the
/// request to `UpdateBackupPlanBinding` or `DeleteBackupPlanBinding` to
/// ensure that their change will be applied to the same version of the
/// resource.
///
/// Output only.
core.String? etag;
/// Identifier.
///
/// The fully qualified name of the BackupPlanBinding. `projects / *
/// /locations / * /backupChannels / * /backupPlanBindings / * `
core.String? name;
/// Server generated global unique identifier of
/// [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)
///
/// Output only.
core.String? uid;
/// The timestamp when this binding was created.
///
/// Output only.
core.String? updateTime;
BackupPlanBinding({
this.backupPlan,
this.backupPlanDetails,
this.cluster,
this.createTime,
this.etag,
this.name,
this.uid,
this.updateTime,
});
BackupPlanBinding.fromJson(core.Map json_)
: this(
backupPlan: json_['backupPlan'] as core.String?,
backupPlanDetails: json_.containsKey('backupPlanDetails')
? BackupPlanDetails.fromJson(
json_['backupPlanDetails']
as core.Map<core.String, core.dynamic>,
)
: null,
cluster: json_['cluster'] as core.String?,
createTime: json_['createTime'] as core.String?,
etag: json_['etag'] as core.String?,
name: json_['name'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupPlan = this.backupPlan;
final backupPlanDetails = this.backupPlanDetails;
final cluster = this.cluster;
final createTime = this.createTime;
final etag = this.etag;
final name = this.name;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'backupPlan': ?backupPlan,
'backupPlanDetails': ?backupPlanDetails,
'cluster': ?cluster,
'createTime': ?createTime,
'etag': ?etag,
'name': ?name,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// Contains metadata about the backup plan/backup.
class BackupPlanDetails {
/// Contains details about the BackupConfig of Backups created via this
/// BackupPlan.
///
/// Output only.
BackupConfigDetails? backupConfigDetails;
/// The fully qualified name of the last successful Backup created under this
/// BackupPlan.
///
/// `projects / * /locations / * /backupPlans / * /backups / * `
///
/// Output only.
core.String? lastSuccessfulBackup;
/// Completion time of the last successful Backup.
///
/// This is sourced from a successful Backup's complete_time field.
///
/// Output only.
core.String? lastSuccessfulBackupTime;
/// Start time of next scheduled backup under this BackupPlan by either
/// cron_schedule or rpo config.
///
/// This is sourced from BackupPlan.
///
/// Output only.
core.String? nextScheduledBackupTime;
/// The number of Kubernetes Pods backed up in the last successful Backup
/// created via this BackupPlan.
///
/// Output only.
core.int? protectedPodCount;
/// Contains details about the RetentionPolicy of Backups created via this
/// BackupPlan.
///
/// Output only.
RetentionPolicyDetails? retentionPolicyDetails;
/// A number that represents the current risk level of this BackupPlan from
/// RPO perspective with 1 being no risk and 5 being highest risk.
///
/// Output only.
core.int? rpoRiskLevel;
/// State of the BackupPlan.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : Default first value for Enums.
/// - "CLUSTER_PENDING" : Waiting for cluster state to be RUNNING.
/// - "PROVISIONING" : The BackupPlan is in the process of being created.
/// - "READY" : The BackupPlan has successfully been created and is ready for
/// Backups.
/// - "FAILED" : BackupPlan creation has failed.
/// - "DEACTIVATED" : The BackupPlan has been deactivated.
/// - "DELETING" : The BackupPlan is in the process of being deleted.
core.String? state;
BackupPlanDetails({
this.backupConfigDetails,
this.lastSuccessfulBackup,
this.lastSuccessfulBackupTime,
this.nextScheduledBackupTime,
this.protectedPodCount,
this.retentionPolicyDetails,
this.rpoRiskLevel,
this.state,
});
BackupPlanDetails.fromJson(core.Map json_)
: this(
backupConfigDetails: json_.containsKey('backupConfigDetails')
? BackupConfigDetails.fromJson(
json_['backupConfigDetails']
as core.Map<core.String, core.dynamic>,
)
: null,
lastSuccessfulBackup: json_['lastSuccessfulBackup'] as core.String?,
lastSuccessfulBackupTime:
json_['lastSuccessfulBackupTime'] as core.String?,
nextScheduledBackupTime:
json_['nextScheduledBackupTime'] as core.String?,
protectedPodCount: json_['protectedPodCount'] as core.int?,
retentionPolicyDetails: json_.containsKey('retentionPolicyDetails')
? RetentionPolicyDetails.fromJson(
json_['retentionPolicyDetails']
as core.Map<core.String, core.dynamic>,
)
: null,
rpoRiskLevel: json_['rpoRiskLevel'] as core.int?,
state: json_['state'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupConfigDetails = this.backupConfigDetails;
final lastSuccessfulBackup = this.lastSuccessfulBackup;
final lastSuccessfulBackupTime = this.lastSuccessfulBackupTime;
final nextScheduledBackupTime = this.nextScheduledBackupTime;
final protectedPodCount = this.protectedPodCount;
final retentionPolicyDetails = this.retentionPolicyDetails;
final rpoRiskLevel = this.rpoRiskLevel;
final state = this.state;
return {
'backupConfigDetails': ?backupConfigDetails,
'lastSuccessfulBackup': ?lastSuccessfulBackup,
'lastSuccessfulBackupTime': ?lastSuccessfulBackupTime,
'nextScheduledBackupTime': ?nextScheduledBackupTime,
'protectedPodCount': ?protectedPodCount,
'retentionPolicyDetails': ?retentionPolicyDetails,
'rpoRiskLevel': ?rpoRiskLevel,
'state': ?state,
};
}
}
/// Associates `members`, or principals, with a `role`.
class Binding {
/// The condition that is associated with this binding.
///
/// If the condition evaluates to `true`, then this binding applies to the
/// current request. If the condition evaluates to `false`, then this binding
/// does not apply to the current request. However, a different role binding
/// might grant the same role to one or more of the principals in this
/// binding. To learn which resources support conditions in their IAM
/// policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Expr? condition;
/// Specifies the principals requesting access for a Google Cloud resource.
///
/// `members` can have the following values: * `allUsers`: A special
/// identifier that represents anyone who is on the internet; with or without
/// a Google account. * `allAuthenticatedUsers`: A special identifier that
/// represents anyone who is authenticated with a Google account or a service
/// account. Does not include identities that come from external identity
/// providers (IdPs) through identity federation. * `user:{emailid}`: An email
/// address that represents a specific Google account. For example,
/// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
/// represents a Google service account. For example,
/// `my-other-app@appspot.gserviceaccount.com`. *
/// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
/// identifier for a
/// [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
/// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
/// `group:{emailid}`: An email address that represents a Google group. For
/// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
/// (primary) that represents all the users of that domain. For example,
/// `google.com` or `example.com`. *
/// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`:
/// A single identity in a workforce identity pool. *
/// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`:
/// All workforce identities in a group. *
/// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`:
/// All workforce identities with a specific attribute value. *
/// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}
/// / * `: All identities in a workforce identity pool. *
/// `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`:
/// A single identity in a workload identity pool. *
/// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`:
/// A workload identity pool group. *
/// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`:
/// All identities in a workload identity pool with a certain attribute. *
/// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}
/// / * `: All identities in a workload identity pool. *
/// `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
/// identifier) representing a user that has been recently deleted. For
/// example, `alice@example.com?uid=123456789012345678901`. If the user is
/// recovered, this value reverts to `user:{emailid}` and the recovered user
/// retains the role in the binding. *
/// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
/// unique identifier) representing a service account that has been recently
/// deleted. For example,
/// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If
/// the service account is undeleted, this value reverts to
/// `serviceAccount:{emailid}` and the undeleted service account retains the
/// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
/// address (plus unique identifier) representing a Google group that has been
/// recently deleted. For example,
/// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
/// this value reverts to `group:{emailid}` and the recovered group retains
/// the role in the binding. *
/// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`:
/// Deleted single identity in a workforce identity pool. For example,
/// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
core.List<core.String>? members;
/// Role that is assigned to the list of `members`, or principals.
///
/// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an
/// overview of the IAM roles and permissions, see the
/// [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For
/// a list of the available pre-defined roles, see
/// [here](https://cloud.google.com/iam/docs/understanding-roles).
core.String? role;
Binding({this.condition, this.members, this.role});
Binding.fromJson(core.Map json_)
: this(
condition: json_.containsKey('condition')
? Expr.fromJson(
json_['condition'] as core.Map<core.String, core.dynamic>,
)
: null,
members: (json_['members'] as core.List?)
?.map((value) => value as core.String)
.toList(),
role: json_['role'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final condition = this.condition;
final members = this.members;
final role = this.role;
return {'condition': ?condition, 'members': ?members, 'role': ?role};
}
}
/// Information about the GKE cluster from which this Backup was created.
class ClusterMetadata {
/// Anthos version
///
/// Output only.
core.String? anthosVersion;
/// A list of the Backup for GKE CRD versions found in the cluster.
///
/// Output only.
core.Map<core.String, core.String>? backupCrdVersions;
/// The source cluster from which this Backup was created.
///
/// Valid formats: - `projects / * /locations / * /clusters / * ` - `projects
/// / * /zones / * /clusters / * ` This is inherited from the parent
/// BackupPlan's cluster field.
///
/// Output only.
core.String? cluster;
/// GKE version
///
/// Output only.
core.String? gkeVersion;
/// The Kubernetes server version of the source cluster.
///
/// Output only.
core.String? k8sVersion;
ClusterMetadata({
this.anthosVersion,
this.backupCrdVersions,
this.cluster,
this.gkeVersion,
this.k8sVersion,
});
ClusterMetadata.fromJson(core.Map json_)
: this(
anthosVersion: json_['anthosVersion'] as core.String?,
backupCrdVersions:
(json_['backupCrdVersions'] as core.Map<core.String, core.dynamic>?)
?.map((key, value) => core.MapEntry(key, value as core.String)),
cluster: json_['cluster'] as core.String?,
gkeVersion: json_['gkeVersion'] as core.String?,
k8sVersion: json_['k8sVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final anthosVersion = this.anthosVersion;
final backupCrdVersions = this.backupCrdVersions;
final cluster = this.cluster;
final gkeVersion = this.gkeVersion;
final k8sVersion = this.k8sVersion;
return {
'anthosVersion': ?anthosVersion,
'backupCrdVersions': ?backupCrdVersions,
'cluster': ?cluster,
'gkeVersion': ?gkeVersion,
'k8sVersion': ?k8sVersion,
};
}
}
/// Defines the scope of cluster-scoped resources to restore.
///
/// Some group kinds are not reasonable choices for a restore, and will cause an
/// error if selected here. Any scope selection that would restore "all valid"
/// resources automatically excludes these group kinds. - Node - ComponentStatus
/// - gkebackup.gke.io/BackupJob - gkebackup.gke.io/RestoreJob -
/// metrics.k8s.io/NodeMetrics - migration.k8s.io/StorageState -
/// migration.k8s.io/StorageVersionMigration -
/// snapshot.storage.k8s.io/VolumeSnapshotContent - storage.k8s.io/CSINode -
/// storage.k8s.io/VolumeAttachment Some group kinds are driven by restore
/// configuration elsewhere, and will cause an error if selected here. -
/// Namespace - PersistentVolume
class ClusterResourceRestoreScope {
/// If True, all valid cluster-scoped resources will be restored.
///
/// Mutually exclusive to any other field in the message.
///
/// Optional.
core.bool? allGroupKinds;
/// A list of cluster-scoped resource group kinds to NOT restore from the
/// backup.
///
/// If specified, all valid cluster-scoped resources will be restored except
/// for those specified in the list. Mutually exclusive to any other field in
/// the message.
///
/// Optional.
core.List<GroupKind>? excludedGroupKinds;
/// If True, no cluster-scoped resources will be restored.
///
/// This has the same restore scope as if the message is not defined. Mutually
/// exclusive to any other field in the message.
///
/// Optional.
core.bool? noGroupKinds;
/// A list of cluster-scoped resource group kinds to restore from the backup.
///
/// If specified, only the selected resources will be restored. Mutually
/// exclusive to any other field in the message.
///
/// Optional.
core.List<GroupKind>? selectedGroupKinds;
ClusterResourceRestoreScope({
this.allGroupKinds,
this.excludedGroupKinds,
this.noGroupKinds,
this.selectedGroupKinds,
});
ClusterResourceRestoreScope.fromJson(core.Map json_)
: this(
allGroupKinds: json_['allGroupKinds'] as core.bool?,
excludedGroupKinds: (json_['excludedGroupKinds'] as core.List?)
?.map(
(value) => GroupKind.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
noGroupKinds: json_['noGroupKinds'] as core.bool?,
selectedGroupKinds: (json_['selectedGroupKinds'] as core.List?)
?.map(
(value) => GroupKind.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final allGroupKinds = this.allGroupKinds;
final excludedGroupKinds = this.excludedGroupKinds;
final noGroupKinds = this.noGroupKinds;
final selectedGroupKinds = this.selectedGroupKinds;
return {
'allGroupKinds': ?allGroupKinds,
'excludedGroupKinds': ?excludedGroupKinds,
'noGroupKinds': ?noGroupKinds,
'selectedGroupKinds': ?selectedGroupKinds,
};
}
}
/// Represents a whole or partial calendar date, such as a birthday.
///
/// The time of day and time zone are either specified elsewhere or are
/// insignificant. The date is relative to the Gregorian Calendar. This can
/// represent one of the following: * A full date, with non-zero year, month,
/// and day values. * A month and day, with a zero year (for example, an
/// anniversary). * A year on its own, with a zero month and a zero day. * A
/// year and month, with a zero day (for example, a credit card expiration
/// date). Related types: * google.type.TimeOfDay * google.type.DateTime *
/// google.protobuf.Timestamp
typedef Date = $Date;
/// Holds repeated DaysOfWeek values as a container.
class DayOfWeekList {
/// A list of days of week.
///
/// Optional.
core.List<core.String>? daysOfWeek;
DayOfWeekList({this.daysOfWeek});
DayOfWeekList.fromJson(core.Map json_)
: this(
daysOfWeek: (json_['daysOfWeek'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final daysOfWeek = this.daysOfWeek;
return {'daysOfWeek': ?daysOfWeek};
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs.
///
/// A typical example is to use it as the request or the response type of an API
/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns
/// (google.protobuf.Empty); }
typedef Empty = $Empty;
/// Defined a customer managed encryption key that will be used to encrypt
/// Backup artifacts.
class EncryptionKey {
/// Google Cloud KMS encryption key.
///
/// Format: `projects / * /locations / * /keyRings / * /cryptoKeys / * `
///
/// Optional.
core.String? gcpKmsEncryptionKey;
EncryptionKey({this.gcpKmsEncryptionKey});
EncryptionKey.fromJson(core.Map json_)
: this(gcpKmsEncryptionKey: json_['gcpKmsEncryptionKey'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final gcpKmsEncryptionKey = this.gcpKmsEncryptionKey;
return {'gcpKmsEncryptionKey': ?gcpKmsEncryptionKey};
}
}
/// Defines a time window during which no backup should happen.
///
/// All time and date are in UTC.
class ExclusionWindow {
/// The exclusion window occurs every day if set to "True".
///
/// Specifying this field to "False" is an error.
core.bool? daily;
/// The exclusion window occurs on these days of each week in UTC.
DayOfWeekList? daysOfWeek;
/// Specifies duration of the window.
///
/// Duration must be \>= 5 minutes and \< (target RPO - 20 minutes).
/// Additional restrictions based on the recurrence type to allow some time
/// for backup to happen: - single_occurrence_date: no restriction, but UI may
/// warn about this when duration \>= target RPO - daily window: duration \<
/// 24 hours - weekly window: - days of week includes all seven days of a
/// week: duration \< 24 hours - all other weekly window: duration \< 168
/// hours (i.e., 24 * 7 hours)
///
/// Required.
core.String? duration;
/// No recurrence.
///
/// The exclusion window occurs only once and on this date in UTC.
Date? singleOccurrenceDate;
/// Specifies the start time of the window using time of the day in UTC.
///
/// Optional.
TimeOfDay? startTime;
ExclusionWindow({
this.daily,
this.daysOfWeek,
this.duration,
this.singleOccurrenceDate,
this.startTime,
});
ExclusionWindow.fromJson(core.Map json_)
: this(
daily: json_['daily'] as core.bool?,
daysOfWeek: json_.containsKey('daysOfWeek')
? DayOfWeekList.fromJson(
json_['daysOfWeek'] as core.Map<core.String, core.dynamic>,
)
: null,
duration: json_['duration'] as core.String?,
singleOccurrenceDate: json_.containsKey('singleOccurrenceDate')
? Date.fromJson(
json_['singleOccurrenceDate']
as core.Map<core.String, core.dynamic>,
)
: null,
startTime: json_.containsKey('startTime')
? TimeOfDay.fromJson(
json_['startTime'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final daily = this.daily;
final daysOfWeek = this.daysOfWeek;
final duration = this.duration;
final singleOccurrenceDate = this.singleOccurrenceDate;
final startTime = this.startTime;
return {
'daily': ?daily,
'daysOfWeek': ?daysOfWeek,
'duration': ?duration,
'singleOccurrenceDate': ?singleOccurrenceDate,
'startTime': ?startTime,
};
}
}
/// Represents a textual expression in the Common Expression Language (CEL)
/// syntax.
///
/// CEL is a C-like expression language. The syntax and semantics of CEL are
/// documented at https://github.com/google/cel-spec. Example (Comparison):
/// title: "Summary size limit" description: "Determines if a summary is less
/// than 100 chars" expression: "document.summary.size() \< 100" Example
/// (Equality): title: "Requestor is owner" description: "Determines if
/// requestor is the document owner" expression: "document.owner ==
/// request.auth.claims.email" Example (Logic): title: "Public documents"
/// description: "Determine whether the document should be publicly visible"
/// expression: "document.type != 'private' && document.type != 'internal'"
/// Example (Data Manipulation): title: "Notification string" description:
/// "Create a notification string with a timestamp." expression: "'New message
/// received at ' + string(document.create_time)" The exact variables and
/// functions that may be referenced within an expression are determined by the
/// service that evaluates it. See the service documentation for additional
/// information.
typedef Expr = $Expr;
/// Defines the filter for `Restore`.
///
/// This filter can be used to further refine the resource selection of the
/// `Restore` beyond the coarse-grained scope defined in the `RestorePlan`.
/// `exclusion_filters` take precedence over `inclusion_filters`. If a resource
/// matches both `inclusion_filters` and `exclusion_filters`, it will not be
/// restored.
class Filter {
/// Excludes resources from restoration.
///
/// If specified, a resource will not be restored if it matches any
/// `ResourceSelector` of the `exclusion_filters`.
///
/// Optional.
core.List<ResourceSelector>? exclusionFilters;
/// Selects resources for restoration.
///
/// If specified, only resources which match `inclusion_filters` will be
/// selected for restoration. A resource will be selected if it matches any
/// `ResourceSelector` of the `inclusion_filters`.
///
/// Optional.
core.List<ResourceSelector>? inclusionFilters;
Filter({this.exclusionFilters, this.inclusionFilters});
Filter.fromJson(core.Map json_)
: this(
exclusionFilters: (json_['exclusionFilters'] as core.List?)
?.map(
(value) => ResourceSelector.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
inclusionFilters: (json_['inclusionFilters'] as core.List?)
?.map(
(value) => ResourceSelector.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final exclusionFilters = this.exclusionFilters;
final inclusionFilters = this.inclusionFilters;
return {
'exclusionFilters': ?exclusionFilters,
'inclusionFilters': ?inclusionFilters,
};
}
}
/// Response message for GetBackupIndexDownloadUrl.
class GetBackupIndexDownloadUrlResponse {
/// The signed URL for downloading the backup index.
///
/// Required.
core.String? signedUrl;
GetBackupIndexDownloadUrlResponse({this.signedUrl});
GetBackupIndexDownloadUrlResponse.fromJson(core.Map json_)
: this(signedUrl: json_['signedUrl'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final signedUrl = this.signedUrl;
return {'signedUrl': ?signedUrl};
}
}
/// Response message for GetTags.
typedef GetTagsResponse = $TagsResponse;
/// The request message for Operations.CancelOperation.
typedef GoogleLongrunningCancelOperationRequest = $Empty;
/// The response message for Operations.ListOperations.
class GoogleLongrunningListOperationsResponse {
/// The standard List next-page token.
core.String? nextPageToken;
/// A list of operations that matches the specified filter in the request.
core.List<GoogleLongrunningOperation>? operations;
/// Unordered list.
///
/// Unreachable resources. Populated when the request sets
/// `ListOperationsRequest.return_partial_success` and reads across
/// collections. For example, when attempting to list all resources across all
/// supported locations.
core.List<core.String>? unreachable;
GoogleLongrunningListOperationsResponse({
this.nextPageToken,
this.operations,
this.unreachable,
});
GoogleLongrunningListOperationsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
operations: (json_['operations'] as core.List?)
?.map(
(value) => GoogleLongrunningOperation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final operations = this.operations;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'operations': ?operations,
'unreachable': ?unreachable,
};
}
}
/// This resource represents a long-running operation that is the result of a
/// network API call.
class GoogleLongrunningOperation {
/// If the value is `false`, it means the operation is still in progress.
///
/// If `true`, the operation is completed, and either `error` or `response` is
/// available.
core.bool? done;
/// The error result of the operation in case of failure or cancellation.
GoogleRpcStatus? error;
/// Service-specific metadata associated with the operation.
///
/// It typically contains progress information and common metadata such as
/// create time. Some services might not provide such metadata. Any method
/// that returns a long-running operation should document the metadata type,
/// if any.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object?>? metadata;
/// The server-assigned name, which is only unique within the same service
/// that originally returns it.
///
/// If you use the default HTTP mapping, the `name` should be a resource name
/// ending with `operations/{unique_id}`.
core.String? name;
/// The normal, successful response of the operation.
///
/// If the original method returns no data on success, such as `Delete`, the
/// response is `google.protobuf.Empty`. If the original method is standard
/// `Get`/`Create`/`Update`, the response should be the resource. For other
/// methods, the response should have the type `XxxResponse`, where `Xxx` is
/// the original method name. For example, if the original method name is
/// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object?>? response;
GoogleLongrunningOperation({
this.done,
this.error,
this.metadata,
this.name,
this.response,
});
GoogleLongrunningOperation.fromJson(core.Map json_)
: this(
done: json_['done'] as core.bool?,
error: json_.containsKey('error')
? GoogleRpcStatus.fromJson(
json_['error'] as core.Map<core.String, core.dynamic>,
)
: null,
metadata: json_.containsKey('metadata')
? json_['metadata'] as core.Map<core.String, core.dynamic>
: null,
name: json_['name'] as core.String?,
response: json_.containsKey('response')
? json_['response'] as core.Map<core.String, core.dynamic>
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final done = this.done;
final error = this.error;
final metadata = this.metadata;
final name = this.name;
final response = this.response;
return {
'done': ?done,
'error': ?error,
'metadata': ?metadata,
'name': ?name,
'response': ?response,
};
}
}
/// The `Status` type defines a logical error model that is suitable for
/// different programming environments, including REST APIs and RPC APIs.
///
/// It is used by [gRPC](https://github.com/grpc). Each `Status` message
/// contains three pieces of data: error code, error message, and error details.
/// You can find out more about this error model and how to work with it in the
/// [API Design Guide](https://cloud.google.com/apis/design/errors).
typedef GoogleRpcStatus = $Status00;
/// This is a direct map to the Kubernetes GroupKind type
/// [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
/// and is used for identifying specific "types" of resources to restore.
class GroupKind {
/// API group string of a Kubernetes resource, e.g. "apiextensions.k8s.io",
/// "storage.k8s.io", etc.
///
/// Note: use empty string for core API group.
///
/// Optional.
core.String? resourceGroup;
/// Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and
/// singular form.
///
/// E.g. "CustomResourceDefinition", "StorageClass", etc.
///
/// Optional.
core.String? resourceKind;
GroupKind({this.resourceGroup, this.resourceKind});
GroupKind.fromJson(core.Map json_)
: this(
resourceGroup: json_['resourceGroup'] as core.String?,
resourceKind: json_['resourceKind'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final resourceGroup = this.resourceGroup;
final resourceKind = this.resourceKind;
return {'resourceGroup': ?resourceGroup, 'resourceKind': ?resourceKind};
}
}
/// Defines a dependency between two group kinds.
class GroupKindDependency {
/// The requiring group kind requires that the other group kind be restored
/// first.
///
/// Required.
GroupKind? requiring;
/// The satisfying group kind must be restored first in order to satisfy the
/// dependency.
///
/// Required.
GroupKind? satisfying;
GroupKindDependency({this.requiring, this.satisfying});
GroupKindDependency.fromJson(core.Map json_)
: this(
requiring: json_.containsKey('requiring')
? GroupKind.fromJson(
json_['requiring'] as core.Map<core.String, core.dynamic>,
)
: null,
satisfying: json_.containsKey('satisfying')
? GroupKind.fromJson(
json_['satisfying'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final requiring = this.requiring;
final satisfying = this.satisfying;
return {'requiring': ?requiring, 'satisfying': ?satisfying};
}
}
/// A single Kubernetes label-value pair.
class Label {
/// The key/name of the label.
///
/// Optional.
core.String? key;
/// The value of the label.
///
/// Optional.
core.String? value;
Label({this.key, this.value});
Label.fromJson(core.Map json_)
: this(
key: json_['key'] as core.String?,
value: json_['value'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final key = this.key;
final value = this.value;
return {'key': ?key, 'value': ?value};
}
}
/// Response message for ListBackupChannels.
class ListBackupChannelsResponse {
/// The list of BackupChannels matching the given criteria.
core.List<BackupChannel>? backupChannels;
/// A token which may be sent as page_token in a subsequent
/// `ListBackupChannels` call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListBackupChannelsResponse({
this.backupChannels,
this.nextPageToken,
this.unreachable,
});
ListBackupChannelsResponse.fromJson(core.Map json_)
: this(
backupChannels: (json_['backupChannels'] as core.List?)
?.map(
(value) => BackupChannel.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final backupChannels = this.backupChannels;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'backupChannels': ?backupChannels,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListBackupPlanBindings.
class ListBackupPlanBindingsResponse {
/// The list of BackupPlanBindings matching the given criteria.
core.List<BackupPlanBinding>? backupPlanBindings;
/// A token which may be sent as page_token in a subsequent
/// `ListBackupPlanBindingss` call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListBackupPlanBindingsResponse({
this.backupPlanBindings,
this.nextPageToken,
this.unreachable,
});
ListBackupPlanBindingsResponse.fromJson(core.Map json_)
: this(
backupPlanBindings: (json_['backupPlanBindings'] as core.List?)
?.map(
(value) => BackupPlanBinding.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final backupPlanBindings = this.backupPlanBindings;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'backupPlanBindings': ?backupPlanBindings,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListBackupPlans.
class ListBackupPlansResponse {
/// The list of BackupPlans matching the given criteria.
core.List<BackupPlan>? backupPlans;
/// A token which may be sent as page_token in a subsequent `ListBackupPlans`
/// call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListBackupPlansResponse({
this.backupPlans,
this.nextPageToken,
this.unreachable,
});
ListBackupPlansResponse.fromJson(core.Map json_)
: this(
backupPlans: (json_['backupPlans'] as core.List?)
?.map(
(value) => BackupPlan.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final backupPlans = this.backupPlans;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'backupPlans': ?backupPlans,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListBackups.
class ListBackupsResponse {
/// The list of Backups matching the given criteria.
core.List<Backup>? backups;
/// A token which may be sent as page_token in a subsequent `ListBackups` call
/// to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListBackupsResponse({this.backups, this.nextPageToken, this.unreachable});
ListBackupsResponse.fromJson(core.Map json_)
: this(
backups: (json_['backups'] as core.List?)
?.map(
(value) =>
Backup.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final backups = this.backups;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'backups': ?backups,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// The response message for Locations.ListLocations.
class ListLocationsResponse {
/// A list of locations that matches the specified filter in the request.
core.List<Location>? locations;
/// The standard List next-page token.
core.String? nextPageToken;
ListLocationsResponse({this.locations, this.nextPageToken});
ListLocationsResponse.fromJson(core.Map json_)
: this(
locations: (json_['locations'] as core.List?)
?.map(
(value) => Location.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final locations = this.locations;
final nextPageToken = this.nextPageToken;
return {'locations': ?locations, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListRestoreChannels.
class ListRestoreChannelsResponse {
/// A token which may be sent as page_token in a subsequent
/// `ListRestoreChannels` call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// The list of RestoreChannels matching the given criteria.
core.List<RestoreChannel>? restoreChannels;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListRestoreChannelsResponse({
this.nextPageToken,
this.restoreChannels,
this.unreachable,
});
ListRestoreChannelsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
restoreChannels: (json_['restoreChannels'] as core.List?)
?.map(
(value) => RestoreChannel.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final restoreChannels = this.restoreChannels;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'restoreChannels': ?restoreChannels,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListRestorePlanBindings.
class ListRestorePlanBindingsResponse {
/// A token which may be sent as page_token in a subsequent
/// `ListRestorePlanBindings` call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// The list of RestorePlanBindings matching the given criteria.
core.List<RestorePlanBinding>? restorePlanBindings;
/// Unordered list.
///
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListRestorePlanBindingsResponse({
this.nextPageToken,
this.restorePlanBindings,
this.unreachable,
});
ListRestorePlanBindingsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
restorePlanBindings: (json_['restorePlanBindings'] as core.List?)
?.map(
(value) => RestorePlanBinding.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final restorePlanBindings = this.restorePlanBindings;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'restorePlanBindings': ?restorePlanBindings,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListRestorePlans.
class ListRestorePlansResponse {
/// A token which may be sent as page_token in a subsequent `ListRestorePlans`
/// call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// The list of RestorePlans matching the given criteria.
core.List<RestorePlan>? restorePlans;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListRestorePlansResponse({
this.nextPageToken,
this.restorePlans,
this.unreachable,
});
ListRestorePlansResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
restorePlans: (json_['restorePlans'] as core.List?)
?.map(
(value) => RestorePlan.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final restorePlans = this.restorePlans;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'restorePlans': ?restorePlans,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListRestores.
class ListRestoresResponse {
/// A token which may be sent as page_token in a subsequent `ListRestores`
/// call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// The list of Restores matching the given criteria.
core.List<Restore>? restores;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListRestoresResponse({this.nextPageToken, this.restores, this.unreachable});
ListRestoresResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
restores: (json_['restores'] as core.List?)
?.map(
(value) => Restore.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final restores = this.restores;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'restores': ?restores,
'unreachable': ?unreachable,
};
}
}
/// Response message for ListVolumeBackups.
class ListVolumeBackupsResponse {
/// A token which may be sent as page_token in a subsequent
/// `ListVolumeBackups` call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// The list of VolumeBackups matching the given criteria.
core.List<VolumeBackup>? volumeBackups;
ListVolumeBackupsResponse({this.nextPageToken, this.volumeBackups});
ListVolumeBackupsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
volumeBackups: (json_['volumeBackups'] as core.List?)
?.map(
(value) => VolumeBackup.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final volumeBackups = this.volumeBackups;
return {'nextPageToken': ?nextPageToken, 'volumeBackups': ?volumeBackups};
}
}
/// Response message for ListVolumeRestores.
class ListVolumeRestoresResponse {
/// A token which may be sent as page_token in a subsequent
/// `ListVolumeRestores` call to retrieve the next page of results.
///
/// If this field is omitted or empty, then there are no more results to
/// return.
core.String? nextPageToken;
/// The list of VolumeRestores matching the given criteria.
core.List<VolumeRestore>? volumeRestores;
ListVolumeRestoresResponse({this.nextPageToken, this.volumeRestores});
ListVolumeRestoresResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
volumeRestores: (json_['volumeRestores'] as core.List?)
?.map(
(value) => VolumeRestore.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final volumeRestores = this.volumeRestores;
return {'nextPageToken': ?nextPageToken, 'volumeRestores': ?volumeRestores};
}
}
/// A resource that represents a Google Cloud location.
typedef Location = $Location00;
/// A reference to a namespaced resource in Kubernetes.
class NamespacedName {
/// The name of the Kubernetes resource.
///
/// Optional.
core.String? name;
/// The Namespace of the Kubernetes resource.
///
/// Optional.
core.String? namespace;
NamespacedName({this.name, this.namespace});
NamespacedName.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
namespace: json_['namespace'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final namespace = this.namespace;
return {'name': ?name, 'namespace': ?namespace};
}
}
/// A list of namespaced Kubernetes resources.
class NamespacedNames {
/// A list of namespaced Kubernetes resources.
///
/// Optional.
core.List<NamespacedName>? namespacedNames;
NamespacedNames({this.namespacedNames});
NamespacedNames.fromJson(core.Map json_)
: this(
namespacedNames: (json_['namespacedNames'] as core.List?)
?.map(
(value) => NamespacedName.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final namespacedNames = this.namespacedNames;
return {'namespacedNames': ?namespacedNames};
}
}
/// A list of Kubernetes Namespaces.
class Namespaces {
/// A list of Kubernetes Namespaces.
///
/// Optional.
core.List<core.String>? namespaces;
Namespaces({this.namespaces});
Namespaces.fromJson(core.Map json_)
: this(
namespaces: (json_['namespaces'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final namespaces = this.namespaces;
return {'namespaces': ?namespaces};
}
}
/// An Identity and Access Management (IAM) policy, which specifies access
/// controls for Google Cloud resources.
///
/// A `Policy` is a collection of `bindings`. A `binding` binds one or more
/// `members`, or principals, to a single `role`. Principals can be user
/// accounts, service accounts, Google groups, and domains (such as G Suite). A
/// `role` is a named list of permissions; each `role` can be an IAM predefined
/// role or a user-created custom role. For some types of Google Cloud
/// resources, a `binding` can also specify a `condition`, which is a logical
/// expression that allows access to a resource only if the expression evaluates
/// to `true`. A condition can add constraints based on attributes of the
/// request, the resource, or both. To learn which resources support conditions
/// in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
/// **JSON example:** ``` { "bindings": [ { "role":
/// "roles/resourcemanager.organizationAdmin", "members": [
/// "user:mike@example.com", "group:admins@example.com", "domain:google.com",
/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
/// "roles/resourcemanager.organizationViewer", "members": [
/// "user:eve@example.com" ], "condition": { "title": "expirable access",
/// "description": "Does not grant access after Sep 2020", "expression":
/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
/// "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
/// members: - user:mike@example.com - group:admins@example.com -
/// domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
/// role: roles/resourcemanager.organizationAdmin - members: -
/// user:eve@example.com role: roles/resourcemanager.organizationViewer
/// condition: title: expirable access description: Does not grant access after
/// Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
/// etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
/// see the [IAM documentation](https://cloud.google.com/iam/docs/).
class Policy {
/// Specifies cloud audit logging configuration for this policy.
core.List<AuditConfig>? auditConfigs;
/// Associates a list of `members`, or principals, with a `role`.
///
/// Optionally, may specify a `condition` that determines how and when the
/// `bindings` are applied. Each of the `bindings` must contain at least one
/// principal. The `bindings` in a `Policy` can refer to up to 1,500
/// principals; up to 250 of these principals can be Google groups. Each
/// occurrence of a principal counts towards these limits. For example, if the
/// `bindings` grant 50 different roles to `user:alice@example.com`, and not
/// to any other principal, then you can add another 1,450 principals to the
/// `bindings` in the `Policy`.
core.List<Binding>? bindings;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a policy from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform policy updates in order to avoid race
/// conditions: An `etag` is returned in the response to `getIamPolicy`, and
/// systems are expected to put that etag in the request to `setIamPolicy` to
/// ensure that their change will be applied to the same version of the
/// policy. **Important:** If you use IAM Conditions, you must include the
/// `etag` field whenever you call `setIamPolicy`. If you omit this field,
/// then IAM allows you to overwrite a version `3` policy with a version `1`
/// policy, and all of the conditions in the version `3` policy are lost.
core.String? etag;
core.List<core.int> get etagAsBytes => convert.base64.decode(etag!);
set etagAsBytes(core.List<core.int> bytes_) {
etag = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// Specifies the format of the policy.
///
/// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
/// are rejected. Any operation that affects conditional role bindings must
/// specify version `3`. This requirement applies to the following operations:
/// * Getting a policy that includes a conditional role binding * Adding a
/// conditional role binding to a policy * Changing a conditional role binding
/// in a policy * Removing any role binding, with or without a condition, from
/// a policy that includes conditions **Important:** If you use IAM
/// Conditions, you must include the `etag` field whenever you call
/// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a
/// version `3` policy with a version `1` policy, and all of the conditions in
/// the version `3` policy are lost. If a policy does not include any
/// conditions, operations on that policy may specify any valid version or
/// leave the field unset. To learn which resources support conditions in
/// their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
core.int? version;
Policy({this.auditConfigs, this.bindings, this.etag, this.version});
Policy.fromJson(core.Map json_)
: this(
auditConfigs: (json_['auditConfigs'] as core.List?)
?.map(
(value) => AuditConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
bindings: (json_['bindings'] as core.List?)
?.map(
(value) => Binding.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
etag: json_['etag'] as core.String?,
version: json_['version'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final auditConfigs = this.auditConfigs;
final bindings = this.bindings;
final etag = this.etag;
final version = this.version;
return {
'auditConfigs': ?auditConfigs,
'bindings': ?bindings,
'etag': ?etag,
'version': ?version,
};
}
}
/// ResourceFilter specifies matching criteria to limit the scope of a change to
/// a specific set of kubernetes resources that are selected for restoration
/// from a backup.
class ResourceFilter {
/// (Filtering parameter) Any resource subject to transformation must belong
/// to one of the listed "types".
///
/// If this field is not provided, no type filtering will be performed (all
/// resources of all types matching previous filtering parameters will be
/// candidates for transformation).
///
/// Optional.
core.List<GroupKind>? groupKinds;
/// This is a
/// [JSONPath](https://github.com/json-path/JsonPath/blob/master/README.md)
/// expression that matches specific fields of candidate resources and it
/// operates as a filtering parameter (resources that are not matched with
/// this expression will not be candidates for transformation).
///
/// Optional.
core.String? jsonPath;
/// (Filtering parameter) Any resource subject to transformation must be
/// contained within one of the listed Kubernetes Namespace in the Backup.
///
/// If this field is not provided, no namespace filtering will be performed
/// (all resources in all Namespaces, including all cluster-scoped resources,
/// will be candidates for transformation).
///
/// Optional.
core.List<core.String>? namespaces;
ResourceFilter({this.groupKinds, this.jsonPath, this.namespaces});
ResourceFilter.fromJson(core.Map json_)
: this(
groupKinds: (json_['groupKinds'] as core.List?)
?.map(
(value) => GroupKind.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
jsonPath: json_['jsonPath'] as core.String?,
namespaces: (json_['namespaces'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final groupKinds = this.groupKinds;
final jsonPath = this.jsonPath;
final namespaces = this.namespaces;
return {
'groupKinds': ?groupKinds,
'jsonPath': ?jsonPath,
'namespaces': ?namespaces,
};
}
}
/// A list of Kubernetes labels.
class ResourceLabels {
/// A list of Kubernetes label-value pairs.
///
/// Optional.
core.List<Label>? resourceLabels;
ResourceLabels({this.resourceLabels});
ResourceLabels.fromJson(core.Map json_)
: this(
resourceLabels: (json_['resourceLabels'] as core.List?)
?.map(
(value) =>
Label.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final resourceLabels = this.resourceLabels;
return {'resourceLabels': ?resourceLabels};
}
}
/// Defines a selector to identify a single or a group of resources.
///
/// Conditions in the selector are optional, but at least one field should be
/// set to a non-empty value. If a condition is not specified, no restrictions
/// will be applied on that dimension. If more than one condition is specified,
/// a resource will be selected if and only if all conditions are met.
class ResourceSelector {
/// Selects resources using their Kubernetes GroupKinds.
///
/// If specified, only resources of provided GroupKind will be selected.
///
/// Optional.
GroupKind? groupKind;
/// Selects resources using Kubernetes
/// [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/).
///
/// If specified, a resource will be selected if and only if the resource has
/// all of the provided labels and all the label values match.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Selects resources using their resource names.
///
/// If specified, only resources with the provided name will be selected.
///
/// Optional.
core.String? name;
/// Selects resources using their namespaces.
///
/// This only applies to namespace scoped resources and cannot be used for
/// selecting cluster scoped resources. If specified, only resources in the
/// provided namespace will be selected. If not specified, the filter will
/// apply to both cluster scoped and namespace scoped resources (e.g. name or
/// label). The [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace)
/// resource itself will be restored if and only if any resources within the
/// namespace are restored.
///
/// Optional.
core.String? namespace;
ResourceSelector({this.groupKind, this.labels, this.name, this.namespace});
ResourceSelector.fromJson(core.Map json_)
: this(
groupKind: json_.containsKey('groupKind')
? GroupKind.fromJson(
json_['groupKind'] as core.Map<core.String, core.dynamic>,
)
: null,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
namespace: json_['namespace'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final groupKind = this.groupKind;
final labels = this.labels;
final name = this.name;
final namespace = this.namespace;
return {
'groupKind': ?groupKind,
'labels': ?labels,
'name': ?name,
'namespace': ?namespace,
};
}
}
/// Represents both a request to Restore some portion of a Backup into a target
/// GKE cluster and a record of the restore operation itself.
class Restore {
/// A reference to the Backup used as the source from which this Restore will
/// restore.
///
/// Note that this Backup must be a sub-resource of the RestorePlan's
/// backup_plan. Format: `projects / * /locations / * /backupPlans / *
/// /backups / * `.
///
/// Required. Immutable.
core.String? backup;
/// The target cluster into which this Restore will restore data.
///
/// Valid formats: - `projects / * /locations / * /clusters / * ` - `projects
/// / * /zones / * /clusters / * ` Inherited from parent RestorePlan's cluster
/// value.
///
/// Output only.
core.String? cluster;
/// Timestamp of when the restore operation completed.
///
/// Output only.
core.String? completeTime;
/// The timestamp when this Restore resource was created.
///
/// Output only.
core.String? createTime;
/// User specified descriptive string for this Restore.
///
/// Optional.
core.String? description;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a restore from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform restore updates in order to avoid race
/// conditions: An `etag` is returned in the response to `GetRestore`, and
/// systems are expected to put that etag in the request to `UpdateRestore` or
/// `DeleteRestore` to ensure that their change will be applied to the same
/// version of the resource.
///
/// Output only.
core.String? etag;
/// Filters resources for `Restore`.
///
/// If not specified, the scope of the restore will remain the same as defined
/// in the `RestorePlan`. If this is specified and no resources are matched by
/// the `inclusion_filters` or everything is excluded by the
/// `exclusion_filters`, nothing will be restored. This filter can only be
/// specified if the value of namespaced_resource_restore_mode is set to
/// `MERGE_SKIP_ON_CONFLICT`, `MERGE_REPLACE_VOLUME_ON_CONFLICT` or
/// `MERGE_REPLACE_ON_CONFLICT`.
///
/// Optional. Immutable.
Filter? filter;
/// A set of custom labels supplied by user.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The full name of the Restore resource. Format: `projects / * /locations /
/// * /restorePlans / * /restores / * `
///
/// Output only.
core.String? name;
/// Number of resources excluded during the restore execution.
///
/// Output only.
core.int? resourcesExcludedCount;
/// Number of resources that failed to be restored during the restore
/// execution.
///
/// Output only.
core.int? resourcesFailedCount;
/// Number of resources restored during the restore execution.
///
/// Output only.
core.int? resourcesRestoredCount;
/// Configuration of the Restore.
///
/// Inherited from parent RestorePlan's restore_config.
///
/// Output only.
RestoreConfig? restoreConfig;
/// The current state of the Restore.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : The Restore resource is in the process of being
/// created.
/// - "CREATING" : The Restore resource has been created and the associated
/// RestoreJob Kubernetes resource has been injected into target cluster.
/// - "IN_PROGRESS" : The gkebackup agent in the cluster has begun executing
/// the restore operation.
/// - "SUCCEEDED" : The restore operation has completed successfully. Restored
/// workloads may not yet be operational.
/// - "FAILED" : The restore operation has failed.
/// - "DELETING" : This Restore resource is in the process of being deleted.
/// - "VALIDATING" : The Kubernetes resources created by this Restore are
/// being validated.
core.String? state;
/// Human-readable description of why the Restore is in its current state.
///
/// This field is only meant for human readability and should not be used
/// programmatically as this field is not guaranteed to be consistent.
///
/// Output only.
core.String? stateReason;
/// Information about the troubleshooting steps which will provide debugging
/// information to the end users.
///
/// Output only.
TroubleshootingInfo? troubleshootingInfo;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this Restore resource was last updated.
///
/// Output only.
core.String? updateTime;
/// Overrides the volume data restore policies selected in the Restore Config
/// for override-scoped resources.
///
/// Optional. Immutable.
core.List<VolumeDataRestorePolicyOverride>? volumeDataRestorePolicyOverrides;
/// Number of volumes restored during the restore execution.
///
/// Output only.
core.int? volumesRestoredCount;
Restore({
this.backup,
this.cluster,
this.completeTime,
this.createTime,
this.description,
this.etag,
this.filter,
this.labels,
this.name,
this.resourcesExcludedCount,
this.resourcesFailedCount,
this.resourcesRestoredCount,
this.restoreConfig,
this.state,
this.stateReason,
this.troubleshootingInfo,
this.uid,
this.updateTime,
this.volumeDataRestorePolicyOverrides,
this.volumesRestoredCount,
});
Restore.fromJson(core.Map json_)
: this(
backup: json_['backup'] as core.String?,
cluster: json_['cluster'] as core.String?,
completeTime: json_['completeTime'] as core.String?,
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
etag: json_['etag'] as core.String?,
filter: json_.containsKey('filter')
? Filter.fromJson(
json_['filter'] as core.Map<core.String, core.dynamic>,
)
: null,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
resourcesExcludedCount: json_['resourcesExcludedCount'] as core.int?,
resourcesFailedCount: json_['resourcesFailedCount'] as core.int?,
resourcesRestoredCount: json_['resourcesRestoredCount'] as core.int?,
restoreConfig: json_.containsKey('restoreConfig')
? RestoreConfig.fromJson(
json_['restoreConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
state: json_['state'] as core.String?,
stateReason: json_['stateReason'] as core.String?,
troubleshootingInfo: json_.containsKey('troubleshootingInfo')
? TroubleshootingInfo.fromJson(
json_['troubleshootingInfo']
as core.Map<core.String, core.dynamic>,
)
: null,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
volumeDataRestorePolicyOverrides:
(json_['volumeDataRestorePolicyOverrides'] as core.List?)
?.map(
(value) => VolumeDataRestorePolicyOverride.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
volumesRestoredCount: json_['volumesRestoredCount'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final backup = this.backup;
final cluster = this.cluster;
final completeTime = this.completeTime;
final createTime = this.createTime;
final description = this.description;
final etag = this.etag;
final filter = this.filter;
final labels = this.labels;
final name = this.name;
final resourcesExcludedCount = this.resourcesExcludedCount;
final resourcesFailedCount = this.resourcesFailedCount;
final resourcesRestoredCount = this.resourcesRestoredCount;
final restoreConfig = this.restoreConfig;
final state = this.state;
final stateReason = this.stateReason;
final troubleshootingInfo = this.troubleshootingInfo;
final uid = this.uid;
final updateTime = this.updateTime;
final volumeDataRestorePolicyOverrides =
this.volumeDataRestorePolicyOverrides;
final volumesRestoredCount = this.volumesRestoredCount;
return {
'backup': ?backup,
'cluster': ?cluster,
'completeTime': ?completeTime,
'createTime': ?createTime,
'description': ?description,
'etag': ?etag,
'filter': ?filter,
'labels': ?labels,
'name': ?name,
'resourcesExcludedCount': ?resourcesExcludedCount,
'resourcesFailedCount': ?resourcesFailedCount,
'resourcesRestoredCount': ?resourcesRestoredCount,
'restoreConfig': ?restoreConfig,
'state': ?state,
'stateReason': ?stateReason,
'troubleshootingInfo': ?troubleshootingInfo,
'uid': ?uid,
'updateTime': ?updateTime,
'volumeDataRestorePolicyOverrides': ?volumeDataRestorePolicyOverrides,
'volumesRestoredCount': ?volumesRestoredCount,
};
}
}
/// A RestoreChannel imposes constraints on where backups can be restored.
///
/// The RestoreChannel should be in the same project and region as the backups.
/// The backups can only be restored in the `destination_project`.
class RestoreChannel {
/// The timestamp when this RestoreChannel was created.
///
/// Output only.
core.String? createTime;
/// User specified descriptive string for this RestoreChannel.
///
/// Optional.
core.String? description;
/// The project into which the backups will be restored.
///
/// The format is `projects/{projectId}` or `projects/{projectNumber}`.
///
/// Required. Immutable.
core.String? destinationProject;
/// The project_id where backups will be restored.
///
/// Example Project ID: "my-project-id". This will be an OUTPUT_ONLY field to
/// return the project_id of the destination project.
///
/// Output only.
core.String? destinationProjectId;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a RestoreChannel from overwriting each other.
///
/// It is strongly suggested that systems make use of the 'etag' in the
/// read-modify-write cycle to perform RestoreChannel updates in order to
/// avoid race conditions: An `etag` is returned in the response to
/// `GetRestoreChannel`, and systems are expected to put that etag in the
/// request to `UpdateRestoreChannel` or `DeleteRestoreChannel` to ensure that
/// their change will be applied to the same version of the resource.
///
/// Output only.
core.String? etag;
/// A set of custom labels supplied by user.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The fully qualified name of the RestoreChannel. `projects / * /locations /
/// * /restoreChannels / * `
core.String? name;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this RestoreChannel was last updated.
///
/// Output only.
core.String? updateTime;
RestoreChannel({
this.createTime,
this.description,
this.destinationProject,
this.destinationProjectId,
this.etag,
this.labels,
this.name,
this.uid,
this.updateTime,
});
RestoreChannel.fromJson(core.Map json_)
: this(
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
destinationProject: json_['destinationProject'] as core.String?,
destinationProjectId: json_['destinationProjectId'] as core.String?,
etag: json_['etag'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final createTime = this.createTime;
final description = this.description;
final destinationProject = this.destinationProject;
final destinationProjectId = this.destinationProjectId;
final etag = this.etag;
final labels = this.labels;
final name = this.name;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'createTime': ?createTime,
'description': ?description,
'destinationProject': ?destinationProject,
'destinationProjectId': ?destinationProjectId,
'etag': ?etag,
'labels': ?labels,
'name': ?name,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// Configuration of a restore.
class RestoreConfig {
/// Restore all namespaced resources in the Backup if set to "True".
///
/// Specifying this field to "False" is an error.
core.bool? allNamespaces;
/// Defines the behavior for handling the situation where cluster-scoped
/// resources being restored already exist in the target cluster.
///
/// This MUST be set to a value other than
/// CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if
/// cluster_resource_restore_scope is not empty.
///
/// Optional.
/// Possible string values are:
/// - "CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED" : Unspecified. Only
/// allowed if no cluster-scoped resources will be restored.
/// - "USE_EXISTING_VERSION" : Do not attempt to restore the conflicting
/// resource.
/// - "USE_BACKUP_VERSION" : Delete the existing version before re-creating it
/// from the Backup. This is a dangerous option which could cause
/// unintentional data loss if used inappropriately. For example, deleting a
/// CRD will cause Kubernetes to delete all CRs of that type.
core.String? clusterResourceConflictPolicy;
/// Identifies the cluster-scoped resources to restore from the Backup.
///
/// Not specifying it means NO cluster resource will be restored.
///
/// Optional.
ClusterResourceRestoreScope? clusterResourceRestoreScope;
/// A list of selected namespaces excluded from restoration.
///
/// All namespaces except those in this list will be restored.
Namespaces? excludedNamespaces;
/// Defines the behavior for handling the situation where sets of namespaced
/// resources being restored already exist in the target cluster.
///
/// This MUST be set to a value other than
/// NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
///
/// Optional.
/// Possible string values are:
/// - "NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED" : Unspecified (invalid).
/// - "DELETE_AND_RESTORE" : When conflicting top-level resources (either
/// Namespaces or ProtectedApplications, depending upon the scope) are
/// encountered, this will first trigger a delete of the conflicting resource
/// AND ALL OF ITS REFERENCED RESOURCES (e.g., all resources in the Namespace
/// or all resources referenced by the ProtectedApplication) before restoring
/// the resources from the Backup. This mode should only be used when you are
/// intending to revert some portion of a cluster to an earlier state.
/// - "FAIL_ON_CONFLICT" : If conflicting top-level resources (either
/// Namespaces or ProtectedApplications, depending upon the scope) are
/// encountered at the beginning of a restore process, the Restore will fail.
/// If a conflict occurs during the restore process itself (e.g., because an
/// out of band process creates conflicting resources), a conflict will be
/// reported.
/// - "MERGE_SKIP_ON_CONFLICT" : This mode merges the backup and the target
/// cluster and skips the conflicting resources. If a single resource to
/// restore exists in the cluster before restoration, the resource will be
/// skipped, otherwise it will be restored.
/// - "MERGE_REPLACE_VOLUME_ON_CONFLICT" : This mode merges the backup and the
/// target cluster and skips the conflicting resources except volume data. If
/// a PVC to restore already exists, this mode will restore/reconnect the
/// volume without overwriting the PVC. It is similar to
/// MERGE_SKIP_ON_CONFLICT except that it will apply the volume data policy
/// for the conflicting PVCs: - RESTORE_VOLUME_DATA_FROM_BACKUP: restore data
/// only and respect the reclaim policy of the original PV; -
/// REUSE_VOLUME_HANDLE_FROM_BACKUP: reconnect and respect the reclaim policy
/// of the original PV; - NO_VOLUME_DATA_RESTORATION: new provision and
/// respect the reclaim policy of the original PV. Note that this mode could
/// cause data loss as the original PV can be retained or deleted depending on
/// its reclaim policy.
/// - "MERGE_REPLACE_ON_CONFLICT" : This mode merges the backup and the target
/// cluster and replaces the conflicting resources with the ones in the
/// backup. If a single resource to restore exists in the cluster before
/// restoration, the resource will be replaced with the one from the backup.
/// To replace an existing resource, the first attempt is to update the
/// resource to match the one from the backup; if the update fails, the second
/// attempt is to delete the resource and restore it from the backup. Note
/// that this mode could cause data loss as it replaces the existing resources
/// in the target cluster, and the original PV can be retained or deleted
/// depending on its reclaim policy.
core.String? namespacedResourceRestoreMode;
/// Do not restore any namespaced resources if set to "True".
///
/// Specifying this field to "False" is not allowed.
core.bool? noNamespaces;
/// RestoreOrder contains custom ordering to use on a Restore.
///
/// Optional.
RestoreOrder? restoreOrder;
/// A list of selected ProtectedApplications to restore.
///
/// The listed ProtectedApplications and all the resources to which they refer
/// will be restored.
NamespacedNames? selectedApplications;
/// A list of selected Namespaces to restore from the Backup.
///
/// The listed Namespaces and all resources contained in them will be
/// restored.
Namespaces? selectedNamespaces;
/// A list of transformation rules to be applied against Kubernetes resources
/// as they are selected for restoration from a Backup.
///
/// Rules are executed in order defined - this order matters, as changes made
/// by a rule may impact the filtering logic of subsequent rules. An empty
/// list means no substitution will occur.
///
/// Optional.
core.List<SubstitutionRule>? substitutionRules;
/// A list of transformation rules to be applied against Kubernetes resources
/// as they are selected for restoration from a Backup.
///
/// Rules are executed in order defined - this order matters, as changes made
/// by a rule may impact the filtering logic of subsequent rules. An empty
/// list means no transformation will occur.
///
/// Optional.
core.List<TransformationRule>? transformationRules;
/// Specifies the mechanism to be used to restore volume data.
///
/// Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as
/// NO_VOLUME_DATA_RESTORATION).
///
/// Optional.
/// Possible string values are:
/// - "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED" : Unspecified (illegal).
/// - "RESTORE_VOLUME_DATA_FROM_BACKUP" : For each PVC to be restored, create
/// a new underlying volume and PV from the corresponding VolumeBackup
/// contained within the Backup.
/// - "REUSE_VOLUME_HANDLE_FROM_BACKUP" : For each PVC to be restored, attempt
/// to reuse the original PV contained in the Backup (with its original
/// underlying volume). This option is likely only usable when restoring a
/// workload to its original cluster.
/// - "NO_VOLUME_DATA_RESTORATION" : For each PVC to be restored, create PVC
/// without any particular action to restore data. In this case, the normal
/// Kubernetes provisioning logic would kick in, and this would likely result
/// in either dynamically provisioning blank PVs or binding to statically
/// provisioned PVs.
core.String? volumeDataRestorePolicy;
/// A table that binds volumes by their scope to a restore policy.
///
/// Bindings must have a unique scope. Any volumes not scoped in the bindings
/// are subject to the policy defined in volume_data_restore_policy.
///
/// Optional.
core.List<VolumeDataRestorePolicyBinding>? volumeDataRestorePolicyBindings;
RestoreConfig({
this.allNamespaces,
this.clusterResourceConflictPolicy,
this.clusterResourceRestoreScope,
this.excludedNamespaces,
this.namespacedResourceRestoreMode,
this.noNamespaces,
this.restoreOrder,
this.selectedApplications,
this.selectedNamespaces,
this.substitutionRules,
this.transformationRules,
this.volumeDataRestorePolicy,
this.volumeDataRestorePolicyBindings,
});
RestoreConfig.fromJson(core.Map json_)
: this(
allNamespaces: json_['allNamespaces'] as core.bool?,
clusterResourceConflictPolicy:
json_['clusterResourceConflictPolicy'] as core.String?,
clusterResourceRestoreScope:
json_.containsKey('clusterResourceRestoreScope')
? ClusterResourceRestoreScope.fromJson(
json_['clusterResourceRestoreScope']
as core.Map<core.String, core.dynamic>,
)
: null,
excludedNamespaces: json_.containsKey('excludedNamespaces')
? Namespaces.fromJson(
json_['excludedNamespaces']
as core.Map<core.String, core.dynamic>,
)
: null,
namespacedResourceRestoreMode:
json_['namespacedResourceRestoreMode'] as core.String?,
noNamespaces: json_['noNamespaces'] as core.bool?,
restoreOrder: json_.containsKey('restoreOrder')
? RestoreOrder.fromJson(
json_['restoreOrder'] as core.Map<core.String, core.dynamic>,
)
: null,
selectedApplications: json_.containsKey('selectedApplications')
? NamespacedNames.fromJson(
json_['selectedApplications']
as core.Map<core.String, core.dynamic>,
)
: null,
selectedNamespaces: json_.containsKey('selectedNamespaces')
? Namespaces.fromJson(
json_['selectedNamespaces']
as core.Map<core.String, core.dynamic>,
)
: null,
substitutionRules: (json_['substitutionRules'] as core.List?)
?.map(
(value) => SubstitutionRule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
transformationRules: (json_['transformationRules'] as core.List?)
?.map(
(value) => TransformationRule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
volumeDataRestorePolicy:
json_['volumeDataRestorePolicy'] as core.String?,
volumeDataRestorePolicyBindings:
(json_['volumeDataRestorePolicyBindings'] as core.List?)
?.map(
(value) => VolumeDataRestorePolicyBinding.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final allNamespaces = this.allNamespaces;
final clusterResourceConflictPolicy = this.clusterResourceConflictPolicy;
final clusterResourceRestoreScope = this.clusterResourceRestoreScope;
final excludedNamespaces = this.excludedNamespaces;
final namespacedResourceRestoreMode = this.namespacedResourceRestoreMode;
final noNamespaces = this.noNamespaces;
final restoreOrder = this.restoreOrder;
final selectedApplications = this.selectedApplications;
final selectedNamespaces = this.selectedNamespaces;
final substitutionRules = this.substitutionRules;
final transformationRules = this.transformationRules;
final volumeDataRestorePolicy = this.volumeDataRestorePolicy;
final volumeDataRestorePolicyBindings =
this.volumeDataRestorePolicyBindings;
return {
'allNamespaces': ?allNamespaces,
'clusterResourceConflictPolicy': ?clusterResourceConflictPolicy,
'clusterResourceRestoreScope': ?clusterResourceRestoreScope,
'excludedNamespaces': ?excludedNamespaces,
'namespacedResourceRestoreMode': ?namespacedResourceRestoreMode,
'noNamespaces': ?noNamespaces,
'restoreOrder': ?restoreOrder,
'selectedApplications': ?selectedApplications,
'selectedNamespaces': ?selectedNamespaces,
'substitutionRules': ?substitutionRules,
'transformationRules': ?transformationRules,
'volumeDataRestorePolicy': ?volumeDataRestorePolicy,
'volumeDataRestorePolicyBindings': ?volumeDataRestorePolicyBindings,
};
}
}
/// Allows customers to specify dependencies between resources that Backup for
/// GKE can use to compute a resasonable restore order.
class RestoreOrder {
/// Contains a list of group kind dependency pairs provided by the customer,
/// that is used by Backup for GKE to generate a group kind restore order.
///
/// Optional.
core.List<GroupKindDependency>? groupKindDependencies;
RestoreOrder({this.groupKindDependencies});
RestoreOrder.fromJson(core.Map json_)
: this(
groupKindDependencies: (json_['groupKindDependencies'] as core.List?)
?.map(
(value) => GroupKindDependency.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final groupKindDependencies = this.groupKindDependencies;
return {'groupKindDependencies': ?groupKindDependencies};
}
}
/// The configuration of a potential series of Restore operations to be
/// performed against Backups belong to a particular BackupPlan.
class RestorePlan {
/// A reference to the BackupPlan from which Backups may be used as the source
/// for Restores created via this RestorePlan.
///
/// Format: `projects / * /locations / * /backupPlans / * `.
///
/// Required. Immutable.
core.String? backupPlan;
/// The target cluster into which Restores created via this RestorePlan will
/// restore data.
///
/// NOTE: the cluster's region must be the same as the RestorePlan. Valid
/// formats: - `projects / * /locations / * /clusters / * ` - `projects / *
/// /zones / * /clusters / * `
///
/// Required. Immutable.
core.String? cluster;
/// The timestamp when this RestorePlan resource was created.
///
/// Output only.
core.String? createTime;
/// User specified descriptive string for this RestorePlan.
///
/// Optional.
core.String? description;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a restore from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform restore updates in order to avoid race
/// conditions: An `etag` is returned in the response to `GetRestorePlan`, and
/// systems are expected to put that etag in the request to
/// `UpdateRestorePlan` or `DeleteRestorePlan` to ensure that their change
/// will be applied to the same version of the resource.
///
/// Output only.
core.String? etag;
/// A set of custom labels supplied by user.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The full name of the RestorePlan resource. Format: `projects / *
/// /locations / * /restorePlans / * `.
///
/// Output only.
core.String? name;
/// The fully qualified name of the RestoreChannel to be used to create a
/// RestorePlan.
///
/// This field is set only if the `backup_plan` is in a different project than
/// the RestorePlan. Format: `projects / * /locations / * /restoreChannels / *
/// `
///
/// Output only.
core.String? restoreChannel;
/// Configuration of Restores created via this RestorePlan.
///
/// Required.
RestoreConfig? restoreConfig;
/// State of the RestorePlan.
///
/// This State field reflects the various stages a RestorePlan can be in
/// during the Create operation.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : Default first value for Enums.
/// - "CLUSTER_PENDING" : Waiting for cluster state to be RUNNING.
/// - "READY" : The RestorePlan has successfully been created and is ready for
/// Restores.
/// - "FAILED" : RestorePlan creation has failed.
/// - "DELETING" : The RestorePlan is in the process of being deleted.
core.String? state;
/// Human-readable description of why RestorePlan is in the current `state`.
///
/// This field is only meant for human readability and should not be used
/// programmatically as this field is not guaranteed to be consistent.
///
/// Output only.
core.String? stateReason;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this RestorePlan resource was last updated.
///
/// Output only.
core.String? updateTime;
RestorePlan({
this.backupPlan,
this.cluster,
this.createTime,
this.description,
this.etag,
this.labels,
this.name,
this.restoreChannel,
this.restoreConfig,
this.state,
this.stateReason,
this.uid,
this.updateTime,
});
RestorePlan.fromJson(core.Map json_)
: this(
backupPlan: json_['backupPlan'] as core.String?,
cluster: json_['cluster'] as core.String?,
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
etag: json_['etag'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
restoreChannel: json_['restoreChannel'] as core.String?,
restoreConfig: json_.containsKey('restoreConfig')
? RestoreConfig.fromJson(
json_['restoreConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
state: json_['state'] as core.String?,
stateReason: json_['stateReason'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupPlan = this.backupPlan;
final cluster = this.cluster;
final createTime = this.createTime;
final description = this.description;
final etag = this.etag;
final labels = this.labels;
final name = this.name;
final restoreChannel = this.restoreChannel;
final restoreConfig = this.restoreConfig;
final state = this.state;
final stateReason = this.stateReason;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'backupPlan': ?backupPlan,
'cluster': ?cluster,
'createTime': ?createTime,
'description': ?description,
'etag': ?etag,
'labels': ?labels,
'name': ?name,
'restoreChannel': ?restoreChannel,
'restoreConfig': ?restoreConfig,
'state': ?state,
'stateReason': ?stateReason,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// A RestorePlanBinding binds a RestorePlan with a RestoreChannel.
///
/// This resource is created automatically when a RestorePlan is created using a
/// RestoreChannel. This also serves as a holder for cross-project fields that
/// need to be displayed in the current project.
class RestorePlanBinding {
/// The fully qualified name of the BackupPlan bound to the specified
/// RestorePlan.
///
/// `projects / * /locations / * /backukpPlans/{backup_plan}`
///
/// Output only.
core.String? backupPlan;
/// The timestamp when this binding was created.
///
/// Output only.
core.String? createTime;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a RestorePlanBinding from overwriting each other.
///
/// It is strongly suggested that systems make use of the 'etag' in the
/// read-modify-write cycle to perform RestorePlanBinding updates in order to
/// avoid race conditions: An `etag` is returned in the response to
/// `GetRestorePlanBinding`, and systems are expected to put that etag in the
/// request to `UpdateRestorePlanBinding` or `DeleteRestorePlanBinding` to
/// ensure that their change will be applied to the same version of the
/// resource.
///
/// Output only.
core.String? etag;
/// Identifier.
///
/// The fully qualified name of the RestorePlanBinding. `projects / *
/// /locations / * /restoreChannels / * /restorePlanBindings / * `
core.String? name;
/// The fully qualified name of the RestorePlan bound to this RestoreChannel.
///
/// `projects / * /locations / * /restorePlans/{restore_plan}`
///
/// Output only.
core.String? restorePlan;
/// Server generated global unique identifier of
/// [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)
///
/// Output only.
core.String? uid;
/// The timestamp when this binding was created.
///
/// Output only.
core.String? updateTime;
RestorePlanBinding({
this.backupPlan,
this.createTime,
this.etag,
this.name,
this.restorePlan,
this.uid,
this.updateTime,
});
RestorePlanBinding.fromJson(core.Map json_)
: this(
backupPlan: json_['backupPlan'] as core.String?,
createTime: json_['createTime'] as core.String?,
etag: json_['etag'] as core.String?,
name: json_['name'] as core.String?,
restorePlan: json_['restorePlan'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupPlan = this.backupPlan;
final createTime = this.createTime;
final etag = this.etag;
final name = this.name;
final restorePlan = this.restorePlan;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'backupPlan': ?backupPlan,
'createTime': ?createTime,
'etag': ?etag,
'name': ?name,
'restorePlan': ?restorePlan,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// RetentionPolicy defines a Backup retention policy for a BackupPlan.
class RetentionPolicy {
/// Minimum age for Backups created via this BackupPlan (in days).
///
/// This field MUST be an integer value between 0-90 (inclusive). A Backup
/// created under this BackupPlan will NOT be deletable until it reaches
/// Backup's (create_time + backup_delete_lock_days). Updating this field of a
/// BackupPlan does NOT affect existing Backups under it. Backups created
/// AFTER a successful update will inherit the new value. Default: 0 (no
/// delete blocking)
///
/// Optional.
core.int? backupDeleteLockDays;
/// The default maximum age of a Backup created via this BackupPlan.
///
/// This field MUST be an integer value \>= 0 and \<= 365. If specified, a
/// Backup created under this BackupPlan will be automatically deleted after
/// its age reaches (create_time + backup_retain_days). If not specified,
/// Backups created under this BackupPlan will NOT be subject to automatic
/// deletion. Updating this field does NOT affect existing Backups under it.
/// Backups created AFTER a successful update will automatically pick up the
/// new value. NOTE: backup_retain_days must be \>= backup_delete_lock_days.
/// If cron_schedule is defined, then this must be \<= 360 * the creation
/// interval. If rpo_config is defined, then this must be \<= 360 *
/// target_rpo_minutes / (1440minutes/day). Default: 0 (no automatic deletion)
///
/// Optional.
core.int? backupRetainDays;
/// This flag denotes whether the retention policy of this BackupPlan is
/// locked.
///
/// If set to True, no further update is allowed on this policy, including the
/// `locked` field itself. Default: False
///
/// Optional.
core.bool? locked;
RetentionPolicy({
this.backupDeleteLockDays,
this.backupRetainDays,
this.locked,
});
RetentionPolicy.fromJson(core.Map json_)
: this(
backupDeleteLockDays: json_['backupDeleteLockDays'] as core.int?,
backupRetainDays: json_['backupRetainDays'] as core.int?,
locked: json_['locked'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupDeleteLockDays = this.backupDeleteLockDays;
final backupRetainDays = this.backupRetainDays;
final locked = this.locked;
return {
'backupDeleteLockDays': ?backupDeleteLockDays,
'backupRetainDays': ?backupRetainDays,
'locked': ?locked,
};
}
}
/// RetentionPolicyDetails defines a Backup retention policy for a BackupPlan.
class RetentionPolicyDetails {
/// Minimum age for Backups created via this BackupPlan (in days).
///
/// This field MUST be an integer value between 0-90 (inclusive). A Backup
/// created under this BackupPlan will NOT be deletable until it reaches
/// Backup's (create_time + backup_delete_lock_days). Updating this field of a
/// BackupPlan does NOT affect existing Backups under it. Backups created
/// AFTER a successful update will inherit the new value. Default: 0 (no
/// delete blocking)
///
/// Optional.
core.int? backupDeleteLockDays;
/// The default maximum age of a Backup created via this BackupPlan.
///
/// This field MUST be an integer value \>= 0 and \<= 365. If specified, a
/// Backup created under this BackupPlan will be automatically deleted after
/// its age reaches (create_time + backup_retain_days). If not specified,
/// Backups created under this BackupPlan will NOT be subject to automatic
/// deletion. Default: 0 (no automatic deletion)
///
/// Optional.
core.int? backupRetainDays;
RetentionPolicyDetails({this.backupDeleteLockDays, this.backupRetainDays});
RetentionPolicyDetails.fromJson(core.Map json_)
: this(
backupDeleteLockDays: json_['backupDeleteLockDays'] as core.int?,
backupRetainDays: json_['backupRetainDays'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final backupDeleteLockDays = this.backupDeleteLockDays;
final backupRetainDays = this.backupRetainDays;
return {
'backupDeleteLockDays': ?backupDeleteLockDays,
'backupRetainDays': ?backupRetainDays,
};
}
}
/// Defines RPO scheduling configuration for automatically creating Backups via
/// this BackupPlan.
class RpoConfig {
/// User specified time windows during which backup can NOT happen for this
/// BackupPlan - backups should start and finish outside of any given
/// exclusion window.
///
/// Note: backup jobs will be scheduled to start and finish outside the
/// duration of the window as much as possible, but running jobs will not get
/// canceled when it runs into the window. All the time and date values in
/// exclusion_windows entry in the API are in UTC. We only allow \<=1
/// recurrence (daily or weekly) exclusion window for a BackupPlan while no
/// restriction on number of single occurrence windows.
///
/// Optional.
core.List<ExclusionWindow>? exclusionWindows;
/// Defines the target RPO for the BackupPlan in minutes, which means the
/// target maximum data loss in time that is acceptable for this BackupPlan.
///
/// This must be at least 60, i.e., 1 hour, and at most 86400, i.e., 60 days.
///
/// Required.
core.int? targetRpoMinutes;
RpoConfig({this.exclusionWindows, this.targetRpoMinutes});
RpoConfig.fromJson(core.Map json_)
: this(
exclusionWindows: (json_['exclusionWindows'] as core.List?)
?.map(
(value) => ExclusionWindow.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
targetRpoMinutes: json_['targetRpoMinutes'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final exclusionWindows = this.exclusionWindows;
final targetRpoMinutes = this.targetRpoMinutes;
return {
'exclusionWindows': ?exclusionWindows,
'targetRpoMinutes': ?targetRpoMinutes,
};
}
}
/// Defines scheduling parameters for automatically creating Backups via this
/// BackupPlan.
class Schedule {
/// A standard [cron](https://wikipedia.com/wiki/cron) string that defines a
/// repeating schedule for creating Backups via this BackupPlan.
///
/// This is mutually exclusive with the rpo_config field since at most one
/// schedule can be defined for a BackupPlan. If this is defined, then
/// backup_retain_days must also be defined. Default (empty): no automatic
/// backup creation will occur.
///
/// Optional.
core.String? cronSchedule;
/// Start time of next scheduled backup under this BackupPlan by either
/// cron_schedule or rpo config.
///
/// Output only.
core.String? nextScheduledBackupTime;
/// This flag denotes whether automatic Backup creation is paused for this
/// BackupPlan.
///
/// Default: False
///
/// Optional.
core.bool? paused;
/// Defines the RPO schedule configuration for this BackupPlan.
///
/// This is mutually exclusive with the cron_schedule field since at most one
/// schedule can be defined for a BackupPLan. If this is defined, then
/// backup_retain_days must also be defined. Default (empty): no automatic
/// backup creation will occur.
///
/// Optional.
RpoConfig? rpoConfig;
Schedule({
this.cronSchedule,
this.nextScheduledBackupTime,
this.paused,
this.rpoConfig,
});
Schedule.fromJson(core.Map json_)
: this(
cronSchedule: json_['cronSchedule'] as core.String?,
nextScheduledBackupTime:
json_['nextScheduledBackupTime'] as core.String?,
paused: json_['paused'] as core.bool?,
rpoConfig: json_.containsKey('rpoConfig')
? RpoConfig.fromJson(
json_['rpoConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final cronSchedule = this.cronSchedule;
final nextScheduledBackupTime = this.nextScheduledBackupTime;
final paused = this.paused;
final rpoConfig = this.rpoConfig;
return {
'cronSchedule': ?cronSchedule,
'nextScheduledBackupTime': ?nextScheduledBackupTime,
'paused': ?paused,
'rpoConfig': ?rpoConfig,
};
}
}
/// Request message for `SetIamPolicy` method.
class SetIamPolicyRequest {
/// REQUIRED: The complete policy to be applied to the `resource`.
///
/// The size of the policy is limited to a few 10s of KB. An empty policy is a
/// valid policy but certain Google Cloud services (such as Projects) might
/// reject them.
Policy? policy;
/// OPTIONAL: A FieldMask specifying which fields of the policy to modify.
///
/// Only the fields in the mask will be modified. If no mask is provided, the
/// following default mask is used: `paths: "bindings, etag"`
core.String? updateMask;
SetIamPolicyRequest({this.policy, this.updateMask});
SetIamPolicyRequest.fromJson(core.Map json_)
: this(
policy: json_.containsKey('policy')
? Policy.fromJson(
json_['policy'] as core.Map<core.String, core.dynamic>,
)
: null,
updateMask: json_['updateMask'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final policy = this.policy;
final updateMask = this.updateMask;
return {'policy': ?policy, 'updateMask': ?updateMask};
}
}
/// Request message for SetTags.
typedef SetTagsRequest = $SetTagsRequest;
/// Response message for SetTags.
typedef SetTagsResponse = $TagsResponse;
/// A transformation rule to be applied against Kubernetes resources as they are
/// selected for restoration from a Backup.
///
/// A rule contains both filtering logic (which resources are subject to
/// substitution) and substitution logic.
class SubstitutionRule {
/// This is the new value to set for any fields that pass the filtering and
/// selection criteria.
///
/// To remove a value from a Kubernetes resource, either leave this field
/// unspecified, or set it to the empty string ("").
///
/// Optional.
core.String? newValue;
/// (Filtering parameter) This is a
/// [regular expression](https://en.wikipedia.org/wiki/Regular_expression)
/// that is compared against the fields matched by the target_json_path
/// expression (and must also have passed the previous filters).
///
/// Substitution will not be performed against fields whose value does not
/// match this expression. If this field is NOT specified, then ALL fields
/// matched by the target_json_path expression will undergo substitution. Note
/// that an empty (e.g., "", rather than unspecified) value for this field
/// will only match empty fields.
///
/// Optional.
core.String? originalValuePattern;
/// (Filtering parameter) Any resource subject to substitution must belong to
/// one of the listed "types".
///
/// If this field is not provided, no type filtering will be performed (all
/// resources of all types matching previous filtering parameters will be
/// candidates for substitution).
///
/// Optional.
core.List<GroupKind>? targetGroupKinds;
/// This is a
/// [JSONPath](https://kubernetes.io/docs/reference/kubectl/jsonpath/)
/// expression that matches specific fields of candidate resources and it
/// operates as both a filtering parameter (resources that are not matched
/// with this expression will not be candidates for substitution) as well as a
/// field identifier (identifies exactly which fields out of the candidate
/// resources will be modified).
///
/// Required.
core.String? targetJsonPath;
/// (Filtering parameter) Any resource subject to substitution must be
/// contained within one of the listed Kubernetes Namespace in the Backup.
///
/// If this field is not provided, no namespace filtering will be performed
/// (all resources in all Namespaces, including all cluster-scoped resources,
/// will be candidates for substitution). To mix cluster-scoped and namespaced
/// resources in the same rule, use an empty string ("") as one of the target
/// namespaces.
///
/// Optional.
core.List<core.String>? targetNamespaces;
SubstitutionRule({
this.newValue,
this.originalValuePattern,
this.targetGroupKinds,
this.targetJsonPath,
this.targetNamespaces,
});
SubstitutionRule.fromJson(core.Map json_)
: this(
newValue: json_['newValue'] as core.String?,
originalValuePattern: json_['originalValuePattern'] as core.String?,
targetGroupKinds: (json_['targetGroupKinds'] as core.List?)
?.map(
(value) => GroupKind.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
targetJsonPath: json_['targetJsonPath'] as core.String?,
targetNamespaces: (json_['targetNamespaces'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final newValue = this.newValue;
final originalValuePattern = this.originalValuePattern;
final targetGroupKinds = this.targetGroupKinds;
final targetJsonPath = this.targetJsonPath;
final targetNamespaces = this.targetNamespaces;
return {
'newValue': ?newValue,
'originalValuePattern': ?originalValuePattern,
'targetGroupKinds': ?targetGroupKinds,
'targetJsonPath': ?targetJsonPath,
'targetNamespaces': ?targetNamespaces,
};
}
}
/// Request message for `TestIamPermissions` method.
typedef TestIamPermissionsRequest = $TestIamPermissionsRequest00;
/// Response message for `TestIamPermissions` method.
typedef TestIamPermissionsResponse = $PermissionsResponse;
/// Represents a time of day.
///
/// The date and time zone are either not significant or are specified
/// elsewhere. An API may choose to allow leap seconds. Related types are
/// google.type.Date and `google.protobuf.Timestamp`.
typedef TimeOfDay = $TimeOfDay;
/// A transformation rule to be applied against Kubernetes resources as they are
/// selected for restoration from a Backup.
///
/// A rule contains both filtering logic (which resources are subject to
/// transform) and transformation logic.
class TransformationRule {
/// The description is a user specified string description of the
/// transformation rule.
///
/// Optional.
core.String? description;
/// A list of transformation rule actions to take against candidate resources.
///
/// Actions are executed in order defined - this order matters, as they could
/// potentially interfere with each other and the first operation could affect
/// the outcome of the second operation.
///
/// Required.
core.List<TransformationRuleAction>? fieldActions;
/// This field is used to specify a set of fields that should be used to
/// determine which resources in backup should be acted upon by the supplied
/// transformation rule actions, and this will ensure that only specific
/// resources are affected by transformation rule actions.
///
/// Optional.
ResourceFilter? resourceFilter;
TransformationRule({
this.description,
this.fieldActions,
this.resourceFilter,
});
TransformationRule.fromJson(core.Map json_)
: this(
description: json_['description'] as core.String?,
fieldActions: (json_['fieldActions'] as core.List?)
?.map(
(value) => TransformationRuleAction.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
resourceFilter: json_.containsKey('resourceFilter')
? ResourceFilter.fromJson(
json_['resourceFilter'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final description = this.description;
final fieldActions = this.fieldActions;
final resourceFilter = this.resourceFilter;
return {
'description': ?description,
'fieldActions': ?fieldActions,
'resourceFilter': ?resourceFilter,
};
}
}
/// TransformationRuleAction defines a TransformationRule action based on the
/// JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902)
class TransformationRuleAction {
/// A string containing a JSON Pointer value that references the location in
/// the target document to move the value from.
///
/// Optional.
core.String? fromPath;
/// op specifies the operation to perform.
///
/// Required.
/// Possible string values are:
/// - "OP_UNSPECIFIED" : Unspecified operation
/// - "REMOVE" : The "remove" operation removes the value at the target
/// location.
/// - "MOVE" : The "move" operation removes the value at a specified location
/// and adds it to the target location.
/// - "COPY" : The "copy" operation copies the value at a specified location
/// to the target location.
/// - "ADD" : The "add" operation performs one of the following functions,
/// depending upon what the target location references: 1. If the target
/// location specifies an array index, a new value is inserted into the array
/// at the specified index. 2. If the target location specifies an object
/// member that does not already exist, a new member is added to the object.
/// 3. If the target location specifies an object member that does exist, that
/// member's value is replaced.
/// - "TEST" : The "test" operation tests that a value at the target location
/// is equal to a specified value.
/// - "REPLACE" : The "replace" operation replaces the value at the target
/// location with a new value. The operation object MUST contain a "value"
/// member whose content specifies the replacement value.
core.String? op;
/// A string containing a JSON-Pointer value that references a location within
/// the target document where the operation is performed.
///
/// Optional.
core.String? path;
/// A string that specifies the desired value in string format to use for
/// transformation.
///
/// Optional.
core.String? value;
TransformationRuleAction({this.fromPath, this.op, this.path, this.value});
TransformationRuleAction.fromJson(core.Map json_)
: this(
fromPath: json_['fromPath'] as core.String?,
op: json_['op'] as core.String?,
path: json_['path'] as core.String?,
value: json_['value'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final fromPath = this.fromPath;
final op = this.op;
final path = this.path;
final value = this.value;
return {'fromPath': ?fromPath, 'op': ?op, 'path': ?path, 'value': ?value};
}
}
/// Stores information about troubleshooting doc for debugging a particular
/// state of an operation (eg - backup/restore).
///
/// This will be used by the end user to debug their operation failure scenario
/// easily.
class TroubleshootingInfo {
/// Unique code for each backup/restore operation failure message which helps
/// user identify the failure.
///
/// Output only.
core.String? stateReasonCode;
/// URL for the troubleshooting doc which will help the user fix the failing
/// backup/restore operation.
///
/// Output only.
core.String? stateReasonUri;
TroubleshootingInfo({this.stateReasonCode, this.stateReasonUri});
TroubleshootingInfo.fromJson(core.Map json_)
: this(
stateReasonCode: json_['stateReasonCode'] as core.String?,
stateReasonUri: json_['stateReasonUri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final stateReasonCode = this.stateReasonCode;
final stateReasonUri = this.stateReasonUri;
return {
'stateReasonCode': ?stateReasonCode,
'stateReasonUri': ?stateReasonUri,
};
}
}
/// Represents the backup of a specific persistent volume as a component of a
/// Backup - both the record of the operation and a pointer to the underlying
/// storage-specific artifacts.
class VolumeBackup {
/// The timestamp when the associated underlying volume backup operation
/// completed.
///
/// Output only.
core.String? completeTime;
/// The timestamp when this VolumeBackup resource was created.
///
/// Output only.
core.String? createTime;
/// The minimum size of the disk to which this VolumeBackup can be restored.
///
/// Output only.
core.String? diskSizeBytes;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a volume backup from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform volume backup updates in order to avoid
/// race conditions.
///
/// Output only.
core.String? etag;
/// The format used for the volume backup.
///
/// Output only.
/// Possible string values are:
/// - "VOLUME_BACKUP_FORMAT_UNSPECIFIED" : Default value, not specified.
/// - "GCE_PERSISTENT_DISK" : Compute Engine Persistent Disk snapshot based
/// volume backup.
core.String? format;
/// The full name of the VolumeBackup resource.
///
/// Format: `projects / * /locations / * /backupPlans / * /backups / *
/// /volumeBackups / * `.
///
/// Output only.
core.String? name;
/// Reserved for future use.
///
/// Output only.
core.bool? satisfiesPzi;
/// Reserved for future use.
///
/// Output only.
core.bool? satisfiesPzs;
/// A reference to the source Kubernetes PVC from which this VolumeBackup was
/// created.
///
/// Output only.
NamespacedName? sourcePvc;
/// The current state of this VolumeBackup.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : This is an illegal state and should not be
/// encountered.
/// - "CREATING" : A volume for the backup was identified and backup process
/// is about to start.
/// - "SNAPSHOTTING" : The volume backup operation has begun and is in the
/// initial "snapshot" phase of the process. Any defined ProtectedApplication
/// "pre" hooks will be executed before entering this state and "post" hooks
/// will be executed upon leaving this state.
/// - "UPLOADING" : The snapshot phase of the volume backup operation has
/// completed and the snapshot is now being uploaded to backup storage.
/// - "SUCCEEDED" : The volume backup operation has completed successfully.
/// - "FAILED" : The volume backup operation has failed.
/// - "DELETING" : This VolumeBackup resource (and its associated artifacts)
/// is in the process of being deleted.
/// - "CLEANED_UP" : The underlying artifacts of a volume backup (eg:
/// persistent disk snapshots) are deleted.
core.String? state;
/// A human readable message explaining why the VolumeBackup is in its current
/// state.
///
/// This field is only meant for human consumption and should not be used
/// programmatically as this field is not guaranteed to be consistent.
///
/// Output only.
core.String? stateMessage;
/// The aggregate size of the underlying artifacts associated with this
/// VolumeBackup in the backup storage.
///
/// This may change over time when multiple backups of the same volume share
/// the same backup storage location. In particular, this is likely to
/// increase in size when the immediately preceding backup of the same volume
/// is deleted.
///
/// Output only.
core.String? storageBytes;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this VolumeBackup resource was last updated.
///
/// Output only.
core.String? updateTime;
/// A storage system-specific opaque handle to the underlying volume backup.
///
/// Output only.
core.String? volumeBackupHandle;
VolumeBackup({
this.completeTime,
this.createTime,
this.diskSizeBytes,
this.etag,
this.format,
this.name,
this.satisfiesPzi,
this.satisfiesPzs,
this.sourcePvc,
this.state,
this.stateMessage,
this.storageBytes,
this.uid,
this.updateTime,
this.volumeBackupHandle,
});
VolumeBackup.fromJson(core.Map json_)
: this(
completeTime: json_['completeTime'] as core.String?,
createTime: json_['createTime'] as core.String?,
diskSizeBytes: json_['diskSizeBytes'] as core.String?,
etag: json_['etag'] as core.String?,
format: json_['format'] as core.String?,
name: json_['name'] as core.String?,
satisfiesPzi: json_['satisfiesPzi'] as core.bool?,
satisfiesPzs: json_['satisfiesPzs'] as core.bool?,
sourcePvc: json_.containsKey('sourcePvc')
? NamespacedName.fromJson(
json_['sourcePvc'] as core.Map<core.String, core.dynamic>,
)
: null,
state: json_['state'] as core.String?,
stateMessage: json_['stateMessage'] as core.String?,
storageBytes: json_['storageBytes'] as core.String?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
volumeBackupHandle: json_['volumeBackupHandle'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final completeTime = this.completeTime;
final createTime = this.createTime;
final diskSizeBytes = this.diskSizeBytes;
final etag = this.etag;
final format = this.format;
final name = this.name;
final satisfiesPzi = this.satisfiesPzi;
final satisfiesPzs = this.satisfiesPzs;
final sourcePvc = this.sourcePvc;
final state = this.state;
final stateMessage = this.stateMessage;
final storageBytes = this.storageBytes;
final uid = this.uid;
final updateTime = this.updateTime;
final volumeBackupHandle = this.volumeBackupHandle;
return {
'completeTime': ?completeTime,
'createTime': ?createTime,
'diskSizeBytes': ?diskSizeBytes,
'etag': ?etag,
'format': ?format,
'name': ?name,
'satisfiesPzi': ?satisfiesPzi,
'satisfiesPzs': ?satisfiesPzs,
'sourcePvc': ?sourcePvc,
'state': ?state,
'stateMessage': ?stateMessage,
'storageBytes': ?storageBytes,
'uid': ?uid,
'updateTime': ?updateTime,
'volumeBackupHandle': ?volumeBackupHandle,
};
}
}
/// Binds resources in the scope to the given VolumeDataRestorePolicy.
class VolumeDataRestorePolicyBinding {
/// The VolumeDataRestorePolicy to apply when restoring volumes in scope.
///
/// Required.
/// Possible string values are:
/// - "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED" : Unspecified (illegal).
/// - "RESTORE_VOLUME_DATA_FROM_BACKUP" : For each PVC to be restored, create
/// a new underlying volume and PV from the corresponding VolumeBackup
/// contained within the Backup.
/// - "REUSE_VOLUME_HANDLE_FROM_BACKUP" : For each PVC to be restored, attempt
/// to reuse the original PV contained in the Backup (with its original
/// underlying volume). This option is likely only usable when restoring a
/// workload to its original cluster.
/// - "NO_VOLUME_DATA_RESTORATION" : For each PVC to be restored, create PVC
/// without any particular action to restore data. In this case, the normal
/// Kubernetes provisioning logic would kick in, and this would likely result
/// in either dynamically provisioning blank PVs or binding to statically
/// provisioned PVs.
core.String? policy;
/// The volume type, as determined by the PVC's bound PV, to apply the policy
/// to.
/// Possible string values are:
/// - "VOLUME_TYPE_UNSPECIFIED" : Default
/// - "GCE_PERSISTENT_DISK" : Compute Engine Persistent Disk volume
core.String? volumeType;
VolumeDataRestorePolicyBinding({this.policy, this.volumeType});
VolumeDataRestorePolicyBinding.fromJson(core.Map json_)
: this(
policy: json_['policy'] as core.String?,
volumeType: json_['volumeType'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final policy = this.policy;
final volumeType = this.volumeType;
return {'policy': ?policy, 'volumeType': ?volumeType};
}
}
/// Defines an override to apply a VolumeDataRestorePolicy for scoped resources.
class VolumeDataRestorePolicyOverride {
/// The VolumeDataRestorePolicy to apply when restoring volumes in scope.
///
/// Required.
/// Possible string values are:
/// - "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED" : Unspecified (illegal).
/// - "RESTORE_VOLUME_DATA_FROM_BACKUP" : For each PVC to be restored, create
/// a new underlying volume and PV from the corresponding VolumeBackup
/// contained within the Backup.
/// - "REUSE_VOLUME_HANDLE_FROM_BACKUP" : For each PVC to be restored, attempt
/// to reuse the original PV contained in the Backup (with its original
/// underlying volume). This option is likely only usable when restoring a
/// workload to its original cluster.
/// - "NO_VOLUME_DATA_RESTORATION" : For each PVC to be restored, create PVC
/// without any particular action to restore data. In this case, the normal
/// Kubernetes provisioning logic would kick in, and this would likely result
/// in either dynamically provisioning blank PVs or binding to statically
/// provisioned PVs.
core.String? policy;
/// A list of PVCs to apply the policy override to.
NamespacedNames? selectedPvcs;
VolumeDataRestorePolicyOverride({this.policy, this.selectedPvcs});
VolumeDataRestorePolicyOverride.fromJson(core.Map json_)
: this(
policy: json_['policy'] as core.String?,
selectedPvcs: json_.containsKey('selectedPvcs')
? NamespacedNames.fromJson(
json_['selectedPvcs'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final policy = this.policy;
final selectedPvcs = this.selectedPvcs;
return {'policy': ?policy, 'selectedPvcs': ?selectedPvcs};
}
}
/// Represents the operation of restoring a volume from a VolumeBackup.
class VolumeRestore {
/// The timestamp when the associated underlying volume restoration completed.
///
/// Output only.
core.String? completeTime;
/// The timestamp when this VolumeRestore resource was created.
///
/// Output only.
core.String? createTime;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a volume restore from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform volume restore updates in order to
/// avoid race conditions.
///
/// Output only.
core.String? etag;
/// Full name of the VolumeRestore resource.
///
/// Format: `projects / * /locations / * /restorePlans / * /restores / *
/// /volumeRestores / * `
///
/// Output only.
core.String? name;
/// The current state of this VolumeRestore.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : This is an illegal state and should not be
/// encountered.
/// - "CREATING" : A volume for the restore was identified and restore process
/// is about to start.
/// - "RESTORING" : The volume is currently being restored.
/// - "SUCCEEDED" : The volume has been successfully restored.
/// - "FAILED" : The volume restoration process failed.
/// - "DELETING" : This VolumeRestore resource is in the process of being
/// deleted.
core.String? state;
/// A human readable message explaining why the VolumeRestore is in its
/// current state.
///
/// Output only.
core.String? stateMessage;
/// The reference to the target Kubernetes PVC to be restored.
///
/// Output only.
NamespacedName? targetPvc;
/// Server generated global unique identifier of
/// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
/// format.
///
/// Output only.
core.String? uid;
/// The timestamp when this VolumeRestore resource was last updated.
///
/// Output only.
core.String? updateTime;
/// The full name of the VolumeBackup from which the volume will be restored.
///
/// Format: `projects / * /locations / * /backupPlans / * /backups / *
/// /volumeBackups / * `.
///
/// Output only.
core.String? volumeBackup;
/// A storage system-specific opaque handler to the underlying volume created
/// for the target PVC from the volume backup.
///
/// Output only.
core.String? volumeHandle;
/// The type of volume provisioned
///
/// Output only.
/// Possible string values are:
/// - "VOLUME_TYPE_UNSPECIFIED" : Default
/// - "GCE_PERSISTENT_DISK" : Compute Engine Persistent Disk volume
core.String? volumeType;
VolumeRestore({
this.completeTime,
this.createTime,
this.etag,
this.name,
this.state,
this.stateMessage,
this.targetPvc,
this.uid,
this.updateTime,
this.volumeBackup,
this.volumeHandle,
this.volumeType,
});
VolumeRestore.fromJson(core.Map json_)
: this(
completeTime: json_['completeTime'] as core.String?,
createTime: json_['createTime'] as core.String?,
etag: json_['etag'] as core.String?,
name: json_['name'] as core.String?,
state: json_['state'] as core.String?,
stateMessage: json_['stateMessage'] as core.String?,
targetPvc: json_.containsKey('targetPvc')
? NamespacedName.fromJson(
json_['targetPvc'] as core.Map<core.String, core.dynamic>,
)
: null,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
volumeBackup: json_['volumeBackup'] as core.String?,
volumeHandle: json_['volumeHandle'] as core.String?,
volumeType: json_['volumeType'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final completeTime = this.completeTime;
final createTime = this.createTime;
final etag = this.etag;
final name = this.name;
final state = this.state;
final stateMessage = this.stateMessage;
final targetPvc = this.targetPvc;
final uid = this.uid;
final updateTime = this.updateTime;
final volumeBackup = this.volumeBackup;
final volumeHandle = this.volumeHandle;
final volumeType = this.volumeType;
return {
'completeTime': ?completeTime,
'createTime': ?createTime,
'etag': ?etag,
'name': ?name,
'state': ?state,
'stateMessage': ?stateMessage,
'targetPvc': ?targetPvc,
'uid': ?uid,
'updateTime': ?updateTime,
'volumeBackup': ?volumeBackup,
'volumeHandle': ?volumeHandle,
'volumeType': ?volumeType,
};
}
}