blob: 54d331462bee1bfd6bd6c35dbf810e3e8c4155f7 [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
/// Apigee Registry API - v1
///
/// For more information, see
/// <https://cloud.google.com/apigee/docs/api-hub/what-is-api-hub>
///
/// Create an instance of [ApigeeRegistryApi] to access these resources:
///
/// - [ProjectsResource]
/// - [ProjectsLocationsResource]
/// - [ProjectsLocationsApisResource]
/// - [ProjectsLocationsApisArtifactsResource]
/// - [ProjectsLocationsApisDeploymentsResource]
/// - [ProjectsLocationsApisDeploymentsArtifactsResource]
/// - [ProjectsLocationsApisVersionsResource]
/// - [ProjectsLocationsApisVersionsArtifactsResource]
/// - [ProjectsLocationsApisVersionsSpecsResource]
/// - [ProjectsLocationsApisVersionsSpecsArtifactsResource]
/// - [ProjectsLocationsArtifactsResource]
/// - [ProjectsLocationsDocumentsResource]
/// - [ProjectsLocationsInstancesResource]
/// - [ProjectsLocationsOperationsResource]
/// - [ProjectsLocationsRuntimeResource]
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;
class ApigeeRegistryApi {
/// 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);
ApigeeRegistryApi(
http.Client client, {
core.String rootUrl = 'https://apigeeregistry.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;
ProjectsLocationsApisResource get apis =>
ProjectsLocationsApisResource(_requester);
ProjectsLocationsArtifactsResource get artifacts =>
ProjectsLocationsArtifactsResource(_requester);
ProjectsLocationsDocumentsResource get documents =>
ProjectsLocationsDocumentsResource(_requester);
ProjectsLocationsInstancesResource get instances =>
ProjectsLocationsInstancesResource(_requester);
ProjectsLocationsOperationsResource get operations =>
ProjectsLocationsOperationsResource(_requester);
ProjectsLocationsRuntimeResource get runtime =>
ProjectsLocationsRuntimeResource(_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.
///
/// Request parameters:
///
/// [name] - The resource that owns the locations collection, if applicable.
/// Value must have pattern `^projects/\[^/\]+$`.
///
/// [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.String? filter,
core.int? pageSize,
core.String? pageToken,
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],
'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 ProjectsLocationsApisResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisArtifactsResource get artifacts =>
ProjectsLocationsApisArtifactsResource(_requester);
ProjectsLocationsApisDeploymentsResource get deployments =>
ProjectsLocationsApisDeploymentsResource(_requester);
ProjectsLocationsApisVersionsResource get versions =>
ProjectsLocationsApisVersionsResource(_requester);
ProjectsLocationsApisResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified API.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of APIs.
/// Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [apiId] - Required. The ID to use for the API, which will become the final
/// component of the API's resource name. This value should be 4-63
/// characters, and valid characters are /a-z-/. Following AIP-162, IDs must
/// not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Api].
///
/// 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<Api> create(
Api request,
core.String parent, {
core.String? apiId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'apiId': ?apiId == null ? null : [apiId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/apis';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Api.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified API and all of the resources that it owns.
///
/// Request parameters:
///
/// [name] - Required. The name of the API to delete. Format: `projects / *
/// /locations / * /apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [force] - If set to true, any child resources will also be deleted.
/// (Otherwise, the request will only work if there are no child resources.)
///
/// [$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.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'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 Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns a specified API.
///
/// Request parameters:
///
/// [name] - Required. The name of the API to retrieve. Format: `projects / *
/// /locations / * /apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Api].
///
/// 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<Api> 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 Api.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/\[^/\]+/apis/\[^/\]+$`.
///
/// [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 matching APIs.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of APIs.
/// Format: `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of APIs to return. The service may return
/// fewer than this value. If unspecified, at most 50 values will be returned.
/// The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListApis` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListApis` must match the call that provided the
/// page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListApisResponse].
///
/// 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<ListApisResponse> 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') + '/apis';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApisResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to modify a specified API.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [allowMissing] - If set to true, and the API is not found, a new API will
/// be created. In this situation, `update_mask` is ignored.
///
/// [updateMask] - The list of fields to be updated. If omitted, all fields
/// are updated that are set in the request message (fields set to default
/// values are ignored). If an asterisk "*" is specified, all fields are
/// updated, including fields that are unspecified/default in the request.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Api].
///
/// 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<Api> patch(
Api request,
core.String name, {
core.bool? allowMissing,
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'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 Api.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/\[^/\]+/apis/\[^/\]+$`.
///
/// [$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/\[^/\]+/apis/\[^/\]+$`.
///
/// [$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 ProjectsLocationsApisArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [artifactId] - Required. The ID to use for the artifact, which will become
/// the final component of the artifact's resource name. This value should be
/// 4-63 characters, and valid characters are /a-z-/. Following AIP-162, IDs
/// must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> create(
Artifact request,
core.String parent, {
core.String? artifactId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'artifactId': ?artifactId == null ? null : [artifactId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/artifacts';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to delete. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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>);
}
/// Returns a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to retrieve. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> 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 Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the contents of a specified artifact.
///
/// If artifacts are stored with GZip compression, the default behavior is to
/// return the artifact uncompressed (the mime_type response field indicates
/// the exact format returned).
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact whose contents should be
/// retrieved. Format: `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [HttpBody].
///
/// 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<HttpBody> getContents(
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') + ':getContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.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/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [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 matching artifacts.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields except
/// contents.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of artifacts to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListArtifacts` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListArtifacts` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListArtifactsResponse].
///
/// 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<ListArtifactsResponse> 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') + '/artifacts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListArtifactsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to replace a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> replaceArtifact(
Artifact 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');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Artifact.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/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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/\[^/\]+/apis/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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 ProjectsLocationsApisDeploymentsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisDeploymentsArtifactsResource get artifacts =>
ProjectsLocationsApisDeploymentsArtifactsResource(_requester);
ProjectsLocationsApisDeploymentsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified deployment.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of
/// deployments. Format: `projects / * /locations / * /apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [apiDeploymentId] - Required. The ID to use for the deployment, which will
/// become the final component of the deployment's resource name. This value
/// should be 4-63 characters, and valid characters are /a-z-/. Following
/// AIP-162, IDs must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiDeployment].
///
/// 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<ApiDeployment> create(
ApiDeployment request,
core.String parent, {
core.String? apiDeploymentId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'apiDeploymentId': ?apiDeploymentId == null ? null : [apiDeploymentId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/deployments';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiDeployment.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Removes a specified deployment, all revisions, and all child resources
/// (e.g., artifacts).
///
/// Request parameters:
///
/// [name] - Required. The name of the deployment to delete. Format: `projects
/// / * /locations / * /apis / * /deployments / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [force] - If set to true, any child resources will also be deleted.
/// (Otherwise, the request will only work if there are no child resources.)
///
/// [$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.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'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 Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a revision of a deployment.
///
/// Request parameters:
///
/// [name] - Required. The name of the deployment revision to be deleted, with
/// a revision ID explicitly included. Example:
/// `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiDeployment].
///
/// 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<ApiDeployment> deleteRevision(
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') + ':deleteRevision';
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return ApiDeployment.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Returns a specified deployment.
///
/// Request parameters:
///
/// [name] - Required. The name of the deployment to retrieve. Format:
/// `projects / * /locations / * /apis / * /deployments / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiDeployment].
///
/// 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<ApiDeployment> 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 ApiDeployment.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/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [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 matching deployments.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of
/// deployments. Format: `projects / * /locations / * /apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of deployments to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListApiDeployments`
/// call. Provide this to retrieve the subsequent page. When paginating, all
/// other parameters provided to `ListApiDeployments` must match the call that
/// provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListApiDeploymentsResponse].
///
/// 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<ListApiDeploymentsResponse> 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') + '/deployments';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApiDeploymentsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists all revisions of a deployment.
///
/// Revisions are returned in descending order of revision creation time.
///
/// Request parameters:
///
/// [name] - Required. The name of the deployment to list revisions for.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields.
///
/// [pageSize] - The maximum number of revisions to return per page.
///
/// [pageToken] - The page token, received from a previous
/// ListApiDeploymentRevisions call. Provide this to retrieve the subsequent
/// page.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListApiDeploymentRevisionsResponse].
///
/// 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<ListApiDeploymentRevisionsResponse> listRevisions(
core.String name, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
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],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':listRevisions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApiDeploymentRevisionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to modify a specified deployment.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [allowMissing] - If set to true, and the deployment is not found, a new
/// deployment will be created. In this situation, `update_mask` is ignored.
///
/// [updateMask] - The list of fields to be updated. If omitted, all fields
/// are updated that are set in the request message (fields set to default
/// values are ignored). If an asterisk "*" is specified, all fields are
/// updated, including fields that are unspecified/default in the request.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiDeployment].
///
/// 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<ApiDeployment> patch(
ApiDeployment request,
core.String name, {
core.bool? allowMissing,
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'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 ApiDeployment.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the current revision to a specified prior revision.
///
/// Note that this creates a new revision with a new revision ID.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The deployment being rolled back.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiDeployment].
///
/// 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<ApiDeployment> rollback(
RollbackApiDeploymentRequest 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') + ':rollback';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiDeployment.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/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [$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>);
}
/// Adds a tag to a specified revision of a deployment.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The name of the deployment to be tagged, including the
/// revision ID is optional. If a revision is not specified, it will tag the
/// latest revision.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiDeployment].
///
/// 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<ApiDeployment> tagRevision(
TagApiDeploymentRevisionRequest 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') + ':tagRevision';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiDeployment.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/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [$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 ProjectsLocationsApisDeploymentsArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisDeploymentsArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [artifactId] - Required. The ID to use for the artifact, which will become
/// the final component of the artifact's resource name. This value should be
/// 4-63 characters, and valid characters are /a-z-/. Following AIP-162, IDs
/// must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> create(
Artifact request,
core.String parent, {
core.String? artifactId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'artifactId': ?artifactId == null ? null : [artifactId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/artifacts';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to delete. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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>);
}
/// Returns a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to retrieve. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> 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 Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the contents of a specified artifact.
///
/// If artifacts are stored with GZip compression, the default behavior is to
/// return the artifact uncompressed (the mime_type response field indicates
/// the exact format returned).
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact whose contents should be
/// retrieved. Format: `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [HttpBody].
///
/// 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<HttpBody> getContents(
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') + ':getContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns matching artifacts.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields except
/// contents.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of artifacts to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListArtifacts` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListArtifacts` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListArtifactsResponse].
///
/// 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<ListArtifactsResponse> 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') + '/artifacts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListArtifactsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to replace a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/deployments/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> replaceArtifact(
Artifact 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');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsApisVersionsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisVersionsArtifactsResource get artifacts =>
ProjectsLocationsApisVersionsArtifactsResource(_requester);
ProjectsLocationsApisVersionsSpecsResource get specs =>
ProjectsLocationsApisVersionsSpecsResource(_requester);
ProjectsLocationsApisVersionsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified version.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of versions.
/// Format: `projects / * /locations / * /apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [apiVersionId] - Required. The ID to use for the version, which will
/// become the final component of the version's resource name. This value
/// should be 1-63 characters, and valid characters are /a-z-/. Following
/// AIP-162, IDs must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiVersion].
///
/// 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<ApiVersion> create(
ApiVersion request,
core.String parent, {
core.String? apiVersionId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'apiVersionId': ?apiVersionId == null ? null : [apiVersionId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/versions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiVersion.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Removes a specified version and all of the resources that it owns.
///
/// Request parameters:
///
/// [name] - Required. The name of the version to delete. Format: `projects /
/// * /locations / * /apis / * /versions / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [force] - If set to true, any child resources will also be deleted.
/// (Otherwise, the request will only work if there are no child resources.)
///
/// [$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.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'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 Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns a specified version.
///
/// Request parameters:
///
/// [name] - Required. The name of the version to retrieve. Format: `projects
/// / * /locations / * /apis / * /versions / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiVersion].
///
/// 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<ApiVersion> 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 ApiVersion.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [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 matching versions.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of versions.
/// Format: `projects / * /locations / * /apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of versions to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListApiVersions`
/// call. Provide this to retrieve the subsequent page. When paginating, all
/// other parameters provided to `ListApiVersions` must match the call that
/// provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListApiVersionsResponse].
///
/// 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<ListApiVersionsResponse> 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') + '/versions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApiVersionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to modify a specified version.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [allowMissing] - If set to true, and the version is not found, a new
/// version will be created. In this situation, `update_mask` is ignored.
///
/// [updateMask] - The list of fields to be updated. If omitted, all fields
/// are updated that are set in the request message (fields set to default
/// values are ignored). If an asterisk "*" is specified, all fields are
/// updated, including fields that are unspecified/default in the request.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiVersion].
///
/// 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<ApiVersion> patch(
ApiVersion request,
core.String name, {
core.bool? allowMissing,
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'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 ApiVersion.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [$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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [$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 ProjectsLocationsApisVersionsArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisVersionsArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [artifactId] - Required. The ID to use for the artifact, which will become
/// the final component of the artifact's resource name. This value should be
/// 4-63 characters, and valid characters are /a-z-/. Following AIP-162, IDs
/// must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> create(
Artifact request,
core.String parent, {
core.String? artifactId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'artifactId': ?artifactId == null ? null : [artifactId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/artifacts';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to delete. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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>);
}
/// Returns a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to retrieve. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> 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 Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the contents of a specified artifact.
///
/// If artifacts are stored with GZip compression, the default behavior is to
/// return the artifact uncompressed (the mime_type response field indicates
/// the exact format returned).
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact whose contents should be
/// retrieved. Format: `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [HttpBody].
///
/// 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<HttpBody> getContents(
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') + ':getContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [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 matching artifacts.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields except
/// contents.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of artifacts to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListArtifacts` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListArtifacts` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListArtifactsResponse].
///
/// 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<ListArtifactsResponse> 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') + '/artifacts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListArtifactsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to replace a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> replaceArtifact(
Artifact 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');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Artifact.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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 ProjectsLocationsApisVersionsSpecsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisVersionsSpecsArtifactsResource get artifacts =>
ProjectsLocationsApisVersionsSpecsArtifactsResource(_requester);
ProjectsLocationsApisVersionsSpecsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified spec.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of specs.
/// Format: `projects / * /locations / * /apis / * /versions / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [apiSpecId] - Required. The ID to use for the spec, which will become the
/// final component of the spec's resource name. This value should be 4-63
/// characters, and valid characters are /a-z-/. Following AIP-162, IDs must
/// not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiSpec].
///
/// 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<ApiSpec> create(
ApiSpec request,
core.String parent, {
core.String? apiSpecId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'apiSpecId': ?apiSpecId == null ? null : [apiSpecId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/specs';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiSpec.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified spec, all revisions, and all child resources (e.g.,
/// artifacts).
///
/// Request parameters:
///
/// [name] - Required. The name of the spec to delete. Format: `projects / *
/// /locations / * /apis / * /versions / * /specs / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [force] - If set to true, any child resources will also be deleted.
/// (Otherwise, the request will only work if there are no child resources.)
///
/// [$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.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'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 Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a revision of a spec.
///
/// Request parameters:
///
/// [name] - Required. The name of the spec revision to be deleted, with a
/// revision ID explicitly included. Example:
/// `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiSpec].
///
/// 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<ApiSpec> deleteRevision(
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') + ':deleteRevision';
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return ApiSpec.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns a specified spec.
///
/// Request parameters:
///
/// [name] - Required. The name of the spec to retrieve. Format: `projects / *
/// /locations / * /apis / * /versions / * /specs / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiSpec].
///
/// 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<ApiSpec> 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 ApiSpec.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the contents of a specified spec.
///
/// If specs are stored with GZip compression, the default behavior is to
/// return the spec uncompressed (the mime_type response field indicates the
/// exact format returned).
///
/// Request parameters:
///
/// [name] - Required. The name of the spec whose contents should be
/// retrieved. Format: `projects / * /locations / * /apis / * /versions / *
/// /specs / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [HttpBody].
///
/// 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<HttpBody> getContents(
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') + ':getContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [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 matching specs.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of specs.
/// Format: `projects / * /locations / * /apis / * /versions / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields except
/// contents.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of specs to return. The service may return
/// fewer than this value. If unspecified, at most 50 values will be returned.
/// The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListApiSpecs` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListApiSpecs` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListApiSpecsResponse].
///
/// 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<ListApiSpecsResponse> 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') + '/specs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApiSpecsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists all revisions of a spec.
///
/// Revisions are returned in descending order of revision creation time.
///
/// Request parameters:
///
/// [name] - Required. The name of the spec to list revisions for.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields.
///
/// [pageSize] - The maximum number of revisions to return per page.
///
/// [pageToken] - The page token, received from a previous
/// ListApiSpecRevisions call. Provide this to retrieve the subsequent page.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListApiSpecRevisionsResponse].
///
/// 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<ListApiSpecRevisionsResponse> listRevisions(
core.String name, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
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],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':listRevisions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListApiSpecRevisionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to modify a specified spec.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [allowMissing] - If set to true, and the spec is not found, a new spec
/// will be created. In this situation, `update_mask` is ignored.
///
/// [updateMask] - The list of fields to be updated. If omitted, all fields
/// are updated that are set in the request message (fields set to default
/// values are ignored). If an asterisk "*" is specified, all fields are
/// updated, including fields that are unspecified/default in the request.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiSpec].
///
/// 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<ApiSpec> patch(
ApiSpec request,
core.String name, {
core.bool? allowMissing,
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'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 ApiSpec.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Sets the current revision to a specified prior revision.
///
/// Note that this creates a new revision with a new revision ID.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The spec being rolled back.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiSpec].
///
/// 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<ApiSpec> rollback(
RollbackApiSpecRequest 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') + ':rollback';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiSpec.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$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>);
}
/// Adds a tag to a specified revision of a spec.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The name of the spec to be tagged, including the
/// revision ID is optional. If a revision is not specified, it will tag the
/// latest revision.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApiSpec].
///
/// 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<ApiSpec> tagRevision(
TagApiSpecRevisionRequest 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') + ':tagRevision';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return ApiSpec.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [$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 ProjectsLocationsApisVersionsSpecsArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisVersionsSpecsArtifactsResource(
commons.ApiRequester client,
) : _requester = client;
/// Creates a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [artifactId] - Required. The ID to use for the artifact, which will become
/// the final component of the artifact's resource name. This value should be
/// 4-63 characters, and valid characters are /a-z-/. Following AIP-162, IDs
/// must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> create(
Artifact request,
core.String parent, {
core.String? artifactId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'artifactId': ?artifactId == null ? null : [artifactId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/artifacts';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to delete. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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>);
}
/// Returns a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to retrieve. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> 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 Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the contents of a specified artifact.
///
/// If artifacts are stored with GZip compression, the default behavior is to
/// return the artifact uncompressed (the mime_type response field indicates
/// the exact format returned).
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact whose contents should be
/// retrieved. Format: `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [HttpBody].
///
/// 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<HttpBody> getContents(
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') + ':getContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [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 matching artifacts.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields except
/// contents.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of artifacts to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListArtifacts` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListArtifacts` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListArtifactsResponse].
///
/// 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<ListArtifactsResponse> 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') + '/artifacts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListArtifactsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to replace a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> replaceArtifact(
Artifact 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');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Artifact.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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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/\[^/\]+/apis/\[^/\]+/versions/\[^/\]+/specs/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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 ProjectsLocationsArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [artifactId] - Required. The ID to use for the artifact, which will become
/// the final component of the artifact's resource name. This value should be
/// 4-63 characters, and valid characters are /a-z-/. Following AIP-162, IDs
/// must not have the form of a UUID.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> create(
Artifact request,
core.String parent, {
core.String? artifactId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'artifactId': ?artifactId == null ? null : [artifactId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/artifacts';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Removes a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to delete. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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>);
}
/// Returns a specified artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact to retrieve. Format:
/// `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> 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 Artifact.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the contents of a specified artifact.
///
/// If artifacts are stored with GZip compression, the default behavior is to
/// return the artifact uncompressed (the mime_type response field indicates
/// the exact format returned).
///
/// Request parameters:
///
/// [name] - Required. The name of the artifact whose contents should be
/// retrieved. Format: `{parent}/artifacts / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [HttpBody].
///
/// 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<HttpBody> getContents(
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') + ':getContents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return HttpBody.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/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [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 matching artifacts.
///
/// Request parameters:
///
/// [parent] - Required. The parent, which owns this collection of artifacts.
/// Format: `{parent}`
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - An expression that can be used to filter the list. Filters use
/// the Common Expression Language and can refer to all message fields except
/// contents.
///
/// [orderBy] - A comma-separated list of fields, e.g. "foo,bar" Fields can be
/// sorted in descending order using the "desc" identifier, e.g. "foo
/// desc,bar"
///
/// [pageSize] - The maximum number of artifacts to return. The service may
/// return fewer than this value. If unspecified, at most 50 values will be
/// returned. The maximum is 1000; values above 1000 will be coerced to 1000.
///
/// [pageToken] - A page token, received from a previous `ListArtifacts` call.
/// Provide this to retrieve the subsequent page. When paginating, all other
/// parameters provided to `ListArtifacts` must match the call that provided
/// the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListArtifactsResponse].
///
/// 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<ListArtifactsResponse> 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') + '/artifacts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListArtifactsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Used to replace a specified artifact.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Resource name.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Artifact].
///
/// 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<Artifact> replaceArtifact(
Artifact 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');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Artifact.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/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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/\[^/\]+/artifacts/\[^/\]+$`.
///
/// [$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 ProjectsLocationsDocumentsResource {
final commons.ApiRequester _requester;
ProjectsLocationsDocumentsResource(commons.ApiRequester client)
: _requester = client;
/// 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/\[^/\]+/documents$`.
///
/// [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>);
}
/// 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/\[^/\]+/documents$`.
///
/// [$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/\[^/\]+/documents$`.
///
/// [$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 ProjectsLocationsInstancesResource {
final commons.ApiRequester _requester;
ProjectsLocationsInstancesResource(commons.ApiRequester client)
: _requester = client;
/// Provisions instance resources for the Registry.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the Instance, of the form:
/// `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [instanceId] - Required. Identifier to assign to the Instance. Must be
/// unique within scope of the parent resource.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// 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<Operation> create(
Instance request,
core.String parent, {
core.String? instanceId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'instanceId': ?instanceId == null ? null : [instanceId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/instances';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes the Registry instance.
///
/// Request parameters:
///
/// [name] - Required. The name of the Instance to delete. Format: `projects /
/// * /locations / * /instances / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// 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<Operation> 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 Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets details of a single Instance.
///
/// Request parameters:
///
/// [name] - Required. The name of the Instance to retrieve. Format: `projects
/// / * /locations / * /instances / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Instance].
///
/// 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<Instance> 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 Instance.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/\[^/\]+/instances/\[^/\]+$`.
///
/// [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>);
}
/// 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/\[^/\]+/instances/\[^/\]+$`.
///
/// [$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/\[^/\]+/instances/\[^/\]+$`.
///
/// [$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(
CancelOperationRequest 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 [Operation].
///
/// 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<Operation> 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 Operation.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.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListOperationsResponse].
///
/// 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<ListOperationsResponse> list(
core.String name, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
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],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/operations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListOperationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRuntimeResource {
final commons.ApiRequester _requester;
ProjectsLocationsRuntimeResource(commons.ApiRequester client)
: _requester = client;
/// 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/\[^/\]+/runtime$`.
///
/// [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>);
}
/// 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/\[^/\]+/runtime$`.
///
/// [$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/\[^/\]+/runtime$`.
///
/// [$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>,
);
}
}
/// A top-level description of an API.
///
/// Produced by producers and are commitments to provide services.
class Api {
/// Annotations attach non-identifying metadata to resources.
///
/// Annotation keys and values are less restricted than those of labels, but
/// should be generally used for small values of broad interest. Larger,
/// topic- specific metadata should be stored in Artifacts.
core.Map<core.String, core.String>? annotations;
/// A user-definable description of the availability of this service.
///
/// Format: free-form, but we expect single words that describe availability,
/// e.g., "NONE", "TESTING", "PREVIEW", "GENERAL", "DEPRECATED", "SHUTDOWN".
core.String? availability;
/// Creation timestamp.
///
/// Output only.
core.String? createTime;
/// A detailed description.
core.String? description;
/// Human-meaningful name.
core.String? displayName;
/// Labels attach identifying metadata to resources.
///
/// Identifying metadata can be used to filter list operations. Label keys and
/// values can be no longer than 64 characters (Unicode codepoints), can only
/// contain lowercase letters, numeric characters, underscores, and dashes.
/// International characters are allowed. No more than 64 user labels can be
/// associated with one resource (System labels are excluded). See
/// https://goo.gl/xmQnxf for more information and examples of labels. System
/// reserved label keys are prefixed with `apigeeregistry.googleapis.com/` and
/// cannot be changed.
core.Map<core.String, core.String>? labels;
/// Resource name.
core.String? name;
/// The recommended deployment of the API.
///
/// Format:
/// `projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}`
core.String? recommendedDeployment;
/// The recommended version of the API.
///
/// Format:
/// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
core.String? recommendedVersion;
/// Last update timestamp.
///
/// Output only.
core.String? updateTime;
Api({
this.annotations,
this.availability,
this.createTime,
this.description,
this.displayName,
this.labels,
this.name,
this.recommendedDeployment,
this.recommendedVersion,
this.updateTime,
});
Api.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
availability: json_['availability'] as core.String?,
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
displayName: json_['displayName'] 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?,
recommendedDeployment: json_['recommendedDeployment'] as core.String?,
recommendedVersion: json_['recommendedVersion'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final availability = this.availability;
final createTime = this.createTime;
final description = this.description;
final displayName = this.displayName;
final labels = this.labels;
final name = this.name;
final recommendedDeployment = this.recommendedDeployment;
final recommendedVersion = this.recommendedVersion;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'availability': ?availability,
'createTime': ?createTime,
'description': ?description,
'displayName': ?displayName,
'labels': ?labels,
'name': ?name,
'recommendedDeployment': ?recommendedDeployment,
'recommendedVersion': ?recommendedVersion,
'updateTime': ?updateTime,
};
}
}
/// Describes a service running at particular address that provides a particular
/// version of an API.
///
/// ApiDeployments have revisions which correspond to different configurations
/// of a single deployment in time. Revision identifiers should be updated
/// whenever the served API spec or endpoint address changes.
class ApiDeployment {
/// Text briefly describing how to access the endpoint.
///
/// Changes to this value will not affect the revision.
core.String? accessGuidance;
/// Annotations attach non-identifying metadata to resources.
///
/// Annotation keys and values are less restricted than those of labels, but
/// should be generally used for small values of broad interest. Larger,
/// topic- specific metadata should be stored in Artifacts.
core.Map<core.String, core.String>? annotations;
/// The full resource name (including revision ID) of the spec of the API
/// being served by the deployment.
///
/// Changes to this value will update the revision. Format:
/// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec@revision}`
core.String? apiSpecRevision;
/// Creation timestamp; when the deployment resource was created.
///
/// Output only.
core.String? createTime;
/// A detailed description.
core.String? description;
/// Human-meaningful name.
core.String? displayName;
/// The address where the deployment is serving.
///
/// Changes to this value will update the revision.
core.String? endpointUri;
/// The address of the external channel of the API (e.g., the Developer
/// Portal).
///
/// Changes to this value will not affect the revision.
core.String? externalChannelUri;
/// Text briefly identifying the intended audience of the API.
///
/// Changes to this value will not affect the revision.
core.String? intendedAudience;
/// Labels attach identifying metadata to resources.
///
/// Identifying metadata can be used to filter list operations. Label keys and
/// values can be no longer than 64 characters (Unicode codepoints), can only
/// contain lowercase letters, numeric characters, underscores and dashes.
/// International characters are allowed. No more than 64 user labels can be
/// associated with one resource (System labels are excluded). See
/// https://goo.gl/xmQnxf for more information and examples of labels. System
/// reserved label keys are prefixed with `apigeeregistry.googleapis.com/` and
/// cannot be changed.
core.Map<core.String, core.String>? labels;
/// Resource name.
core.String? name;
/// Revision creation timestamp; when the represented revision was created.
///
/// Output only.
core.String? revisionCreateTime;
/// The revision ID of the deployment.
///
/// A new revision is committed whenever the deployment contents are changed.
/// The format is an 8-character hexadecimal string.
///
/// Output only. Immutable.
core.String? revisionId;
/// Last update timestamp: when the represented revision was last modified.
///
/// Output only.
core.String? revisionUpdateTime;
ApiDeployment({
this.accessGuidance,
this.annotations,
this.apiSpecRevision,
this.createTime,
this.description,
this.displayName,
this.endpointUri,
this.externalChannelUri,
this.intendedAudience,
this.labels,
this.name,
this.revisionCreateTime,
this.revisionId,
this.revisionUpdateTime,
});
ApiDeployment.fromJson(core.Map json_)
: this(
accessGuidance: json_['accessGuidance'] as core.String?,
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
apiSpecRevision: json_['apiSpecRevision'] as core.String?,
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
displayName: json_['displayName'] as core.String?,
endpointUri: json_['endpointUri'] as core.String?,
externalChannelUri: json_['externalChannelUri'] as core.String?,
intendedAudience: json_['intendedAudience'] 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?,
revisionCreateTime: json_['revisionCreateTime'] as core.String?,
revisionId: json_['revisionId'] as core.String?,
revisionUpdateTime: json_['revisionUpdateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final accessGuidance = this.accessGuidance;
final annotations = this.annotations;
final apiSpecRevision = this.apiSpecRevision;
final createTime = this.createTime;
final description = this.description;
final displayName = this.displayName;
final endpointUri = this.endpointUri;
final externalChannelUri = this.externalChannelUri;
final intendedAudience = this.intendedAudience;
final labels = this.labels;
final name = this.name;
final revisionCreateTime = this.revisionCreateTime;
final revisionId = this.revisionId;
final revisionUpdateTime = this.revisionUpdateTime;
return {
'accessGuidance': ?accessGuidance,
'annotations': ?annotations,
'apiSpecRevision': ?apiSpecRevision,
'createTime': ?createTime,
'description': ?description,
'displayName': ?displayName,
'endpointUri': ?endpointUri,
'externalChannelUri': ?externalChannelUri,
'intendedAudience': ?intendedAudience,
'labels': ?labels,
'name': ?name,
'revisionCreateTime': ?revisionCreateTime,
'revisionId': ?revisionId,
'revisionUpdateTime': ?revisionUpdateTime,
};
}
}
/// Describes a version of an API in a structured way.
///
/// ApiSpecs provide formal descriptions that consumers can use to use a
/// version. ApiSpec resources are intended to be fully-resolved descriptions of
/// an ApiVersion. When specs consist of multiple files, these should be bundled
/// together (e.g., in a zip archive) and stored as a unit. Multiple specs can
/// exist to provide representations in different API description formats.
/// Synchronization of these representations would be provided by tooling and
/// background services.
class ApiSpec {
/// Annotations attach non-identifying metadata to resources.
///
/// Annotation keys and values are less restricted than those of labels, but
/// should be generally used for small values of broad interest. Larger,
/// topic- specific metadata should be stored in Artifacts.
core.Map<core.String, core.String>? annotations;
/// Input only.
///
/// The contents of the spec. Provided by API callers when specs are created
/// or updated. To access the contents of a spec, use GetApiSpecContents.
core.String? contents;
core.List<core.int> get contentsAsBytes => convert.base64.decode(contents!);
set contentsAsBytes(core.List<core.int> bytes_) {
contents = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// Creation timestamp; when the spec resource was created.
///
/// Output only.
core.String? createTime;
/// A detailed description.
core.String? description;
/// A possibly-hierarchical name used to refer to the spec from other specs.
core.String? filename;
/// A SHA-256 hash of the spec's contents.
///
/// If the spec is gzipped, this is the hash of the uncompressed spec.
///
/// Output only.
core.String? hash;
/// Labels attach identifying metadata to resources.
///
/// Identifying metadata can be used to filter list operations. Label keys and
/// values can be no longer than 64 characters (Unicode codepoints), can only
/// contain lowercase letters, numeric characters, underscores and dashes.
/// International characters are allowed. No more than 64 user labels can be
/// associated with one resource (System labels are excluded). See
/// https://goo.gl/xmQnxf for more information and examples of labels. System
/// reserved label keys are prefixed with `apigeeregistry.googleapis.com/` and
/// cannot be changed.
core.Map<core.String, core.String>? labels;
/// A style (format) descriptor for this spec that is specified as a
/// [Media Type](https://en.wikipedia.org/wiki/Media_type).
///
/// Possible values include `application/vnd.apigee.proto`,
/// `application/vnd.apigee.openapi`, and `application/vnd.apigee.graphql`,
/// with possible suffixes representing compression types. These hypothetical
/// names are defined in the vendor tree defined in RFC6838
/// (https://tools.ietf.org/html/rfc6838) and are not final. Content types can
/// specify compression. Currently only GZip compression is supported
/// (indicated with "+gzip").
core.String? mimeType;
/// Resource name.
core.String? name;
/// Revision creation timestamp; when the represented revision was created.
///
/// Output only.
core.String? revisionCreateTime;
/// The revision ID of the spec.
///
/// A new revision is committed whenever the spec contents are changed. The
/// format is an 8-character hexadecimal string.
///
/// Output only. Immutable.
core.String? revisionId;
/// Last update timestamp: when the represented revision was last modified.
///
/// Output only.
core.String? revisionUpdateTime;
/// The size of the spec file in bytes.
///
/// If the spec is gzipped, this is the size of the uncompressed spec.
///
/// Output only.
core.int? sizeBytes;
/// The original source URI of the spec (if one exists).
///
/// This is an external location that can be used for reference purposes but
/// which may not be authoritative since this external resource may change
/// after the spec is retrieved.
core.String? sourceUri;
ApiSpec({
this.annotations,
this.contents,
this.createTime,
this.description,
this.filename,
this.hash,
this.labels,
this.mimeType,
this.name,
this.revisionCreateTime,
this.revisionId,
this.revisionUpdateTime,
this.sizeBytes,
this.sourceUri,
});
ApiSpec.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
contents: json_['contents'] as core.String?,
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
filename: json_['filename'] as core.String?,
hash: json_['hash'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
mimeType: json_['mimeType'] as core.String?,
name: json_['name'] as core.String?,
revisionCreateTime: json_['revisionCreateTime'] as core.String?,
revisionId: json_['revisionId'] as core.String?,
revisionUpdateTime: json_['revisionUpdateTime'] as core.String?,
sizeBytes: json_['sizeBytes'] as core.int?,
sourceUri: json_['sourceUri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final contents = this.contents;
final createTime = this.createTime;
final description = this.description;
final filename = this.filename;
final hash = this.hash;
final labels = this.labels;
final mimeType = this.mimeType;
final name = this.name;
final revisionCreateTime = this.revisionCreateTime;
final revisionId = this.revisionId;
final revisionUpdateTime = this.revisionUpdateTime;
final sizeBytes = this.sizeBytes;
final sourceUri = this.sourceUri;
return {
'annotations': ?annotations,
'contents': ?contents,
'createTime': ?createTime,
'description': ?description,
'filename': ?filename,
'hash': ?hash,
'labels': ?labels,
'mimeType': ?mimeType,
'name': ?name,
'revisionCreateTime': ?revisionCreateTime,
'revisionId': ?revisionId,
'revisionUpdateTime': ?revisionUpdateTime,
'sizeBytes': ?sizeBytes,
'sourceUri': ?sourceUri,
};
}
}
/// Describes a particular version of an API.
///
/// ApiVersions are what consumers actually use.
class ApiVersion {
/// Annotations attach non-identifying metadata to resources.
///
/// Annotation keys and values are less restricted than those of labels, but
/// should be generally used for small values of broad interest. Larger,
/// topic- specific metadata should be stored in Artifacts.
core.Map<core.String, core.String>? annotations;
/// Creation timestamp.
///
/// Output only.
core.String? createTime;
/// A detailed description.
core.String? description;
/// Human-meaningful name.
core.String? displayName;
/// Labels attach identifying metadata to resources.
///
/// Identifying metadata can be used to filter list operations. Label keys and
/// values can be no longer than 64 characters (Unicode codepoints), can only
/// contain lowercase letters, numeric characters, underscores and dashes.
/// International characters are allowed. No more than 64 user labels can be
/// associated with one resource (System labels are excluded). See
/// https://goo.gl/xmQnxf for more information and examples of labels. System
/// reserved label keys are prefixed with `apigeeregistry.googleapis.com/` and
/// cannot be changed.
core.Map<core.String, core.String>? labels;
/// Resource name.
core.String? name;
/// The primary spec for this version.
///
/// Format:
/// projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}
core.String? primarySpec;
/// A user-definable description of the lifecycle phase of this API version.
///
/// Format: free-form, but we expect single words that describe API maturity,
/// e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION",
/// "DEPRECATED", "RETIRED".
core.String? state;
/// Last update timestamp.
///
/// Output only.
core.String? updateTime;
ApiVersion({
this.annotations,
this.createTime,
this.description,
this.displayName,
this.labels,
this.name,
this.primarySpec,
this.state,
this.updateTime,
});
ApiVersion.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
displayName: json_['displayName'] 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?,
primarySpec: json_['primarySpec'] as core.String?,
state: json_['state'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final createTime = this.createTime;
final description = this.description;
final displayName = this.displayName;
final labels = this.labels;
final name = this.name;
final primarySpec = this.primarySpec;
final state = this.state;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'createTime': ?createTime,
'description': ?description,
'displayName': ?displayName,
'labels': ?labels,
'name': ?name,
'primarySpec': ?primarySpec,
'state': ?state,
'updateTime': ?updateTime,
};
}
}
/// Artifacts of resources.
///
/// Artifacts are unique (single-value) per resource and are used to store
/// metadata that is too large or numerous to be stored directly on the
/// resource. Since artifacts are stored separately from parent resources, they
/// should generally be used for metadata that is needed infrequently, i.e., not
/// for display in primary views of the resource but perhaps displayed or
/// downloaded upon request. The `ListArtifacts` method allows artifacts to be
/// quickly enumerated and checked for presence without downloading their
/// (potentially-large) contents.
class Artifact {
/// Annotations attach non-identifying metadata to resources.
///
/// Annotation keys and values are less restricted than those of labels, but
/// should be generally used for small values of broad interest. Larger,
/// topic- specific metadata should be stored in Artifacts.
core.Map<core.String, core.String>? annotations;
/// Input only.
///
/// The contents of the artifact. Provided by API callers when artifacts are
/// created or replaced. To access the contents of an artifact, use
/// GetArtifactContents.
core.String? contents;
core.List<core.int> get contentsAsBytes => convert.base64.decode(contents!);
set contentsAsBytes(core.List<core.int> bytes_) {
contents = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// Creation timestamp.
///
/// Output only.
core.String? createTime;
/// A SHA-256 hash of the artifact's contents.
///
/// If the artifact is gzipped, this is the hash of the uncompressed artifact.
///
/// Output only.
core.String? hash;
/// Labels attach identifying metadata to resources.
///
/// Identifying metadata can be used to filter list operations. Label keys and
/// values can be no longer than 64 characters (Unicode codepoints), can only
/// contain lowercase letters, numeric characters, underscores and dashes.
/// International characters are allowed. No more than 64 user labels can be
/// associated with one resource (System labels are excluded). See
/// https://goo.gl/xmQnxf for more information and examples of labels. System
/// reserved label keys are prefixed with "registry.googleapis.com/" and
/// cannot be changed.
core.Map<core.String, core.String>? labels;
/// A content type specifier for the artifact.
///
/// Content type specifiers are Media Types
/// (https://en.wikipedia.org/wiki/Media_type) with a possible "schema"
/// parameter that specifies a schema for the stored information. Content
/// types can specify compression. Currently only GZip compression is
/// supported (indicated with "+gzip").
core.String? mimeType;
/// Resource name.
core.String? name;
/// The size of the artifact in bytes.
///
/// If the artifact is gzipped, this is the size of the uncompressed artifact.
///
/// Output only.
core.int? sizeBytes;
/// Last update timestamp.
///
/// Output only.
core.String? updateTime;
Artifact({
this.annotations,
this.contents,
this.createTime,
this.hash,
this.labels,
this.mimeType,
this.name,
this.sizeBytes,
this.updateTime,
});
Artifact.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
contents: json_['contents'] as core.String?,
createTime: json_['createTime'] as core.String?,
hash: json_['hash'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
mimeType: json_['mimeType'] as core.String?,
name: json_['name'] as core.String?,
sizeBytes: json_['sizeBytes'] as core.int?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final contents = this.contents;
final createTime = this.createTime;
final hash = this.hash;
final labels = this.labels;
final mimeType = this.mimeType;
final name = this.name;
final sizeBytes = this.sizeBytes;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'contents': ?contents,
'createTime': ?createTime,
'hash': ?hash,
'labels': ?labels,
'mimeType': ?mimeType,
'name': ?name,
'sizeBytes': ?sizeBytes,
'updateTime': ?updateTime,
};
}
}
/// 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`. * `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.
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`.
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};
}
}
/// Build information of the Instance if it's in `ACTIVE` state.
class Build {
/// Commit ID of the latest commit in the build.
///
/// Output only.
core.String? commitId;
/// Commit time of the latest commit in the build.
///
/// Output only.
core.String? commitTime;
/// Path of the open source repository: github.com/apigee/registry.
///
/// Output only.
core.String? repo;
Build({this.commitId, this.commitTime, this.repo});
Build.fromJson(core.Map json_)
: this(
commitId: json_['commitId'] as core.String?,
commitTime: json_['commitTime'] as core.String?,
repo: json_['repo'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final commitId = this.commitId;
final commitTime = this.commitTime;
final repo = this.repo;
return {'commitId': ?commitId, 'commitTime': ?commitTime, 'repo': ?repo};
}
}
/// The request message for Operations.CancelOperation.
typedef CancelOperationRequest = $Empty;
/// Available configurations to provision an Instance.
class Config {
/// The Customer Managed Encryption Key (CMEK) used for data encryption.
///
/// The CMEK name should follow the format of
/// `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
/// where the `location` must match InstanceConfig.location.
///
/// Required.
core.String? cmekKeyName;
/// The GCP location where the Instance resides.
///
/// Output only.
core.String? location;
Config({this.cmekKeyName, this.location});
Config.fromJson(core.Map json_)
: this(
cmekKeyName: json_['cmekKeyName'] as core.String?,
location: json_['location'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final cmekKeyName = this.cmekKeyName;
final location = this.location;
return {'cmekKeyName': ?cmekKeyName, 'location': ?location};
}
}
/// 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;
/// 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;
/// Message that represents an arbitrary HTTP body.
///
/// It should only be used for payload formats that can't be represented as
/// JSON, such as raw binary or an HTML page. This message can be used both in
/// streaming and non-streaming API methods in the request as well as the
/// response. It can be used as a top-level request field, which is convenient
/// if one wants to extract parameters from either the URL or HTTP template into
/// the request fields and also want access to the raw HTTP body. Example:
/// message GetResourceRequest { // A unique request id. string request_id = 1;
/// // The raw HTTP body is bound to this field. google.api.HttpBody http_body =
/// 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns
/// (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns
/// (google.protobuf.Empty); } Example with streaming methods: service
/// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream
/// google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns
/// (stream google.api.HttpBody); } Use of this type only changes how the
/// request and response bodies are handled, all other features will continue to
/// work unchanged.
typedef HttpBody = $HttpBody;
/// An Instance represents the instance resources of the Registry.
///
/// Currently, only one instance is allowed for each project.
class Instance {
/// Build info of the Instance if it's in `ACTIVE` state.
///
/// Output only.
Build? build;
/// Config of the Instance.
///
/// Required.
Config? config;
/// Creation timestamp.
///
/// Output only.
core.String? createTime;
/// Format: `projects / * /locations / * /instance`.
///
/// Currently only `locations/global` is supported.
core.String? name;
/// The current state of the Instance.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : The default value. This value is used if the state
/// is omitted.
/// - "INACTIVE" : The Instance has not been initialized or has been deleted.
/// - "CREATING" : The Instance is being created.
/// - "ACTIVE" : The Instance has been created and is ready for use.
/// - "UPDATING" : The Instance is being updated.
/// - "DELETING" : The Instance is being deleted.
/// - "FAILED" : The Instance encountered an error during a state change.
core.String? state;
/// Extra information of Instance.State if the state is `FAILED`.
///
/// Output only.
core.String? stateMessage;
/// Last update timestamp.
///
/// Output only.
core.String? updateTime;
Instance({
this.build,
this.config,
this.createTime,
this.name,
this.state,
this.stateMessage,
this.updateTime,
});
Instance.fromJson(core.Map json_)
: this(
build: json_.containsKey('build')
? Build.fromJson(
json_['build'] as core.Map<core.String, core.dynamic>,
)
: null,
config: json_.containsKey('config')
? Config.fromJson(
json_['config'] as core.Map<core.String, core.dynamic>,
)
: null,
createTime: json_['createTime'] as core.String?,
name: json_['name'] as core.String?,
state: json_['state'] as core.String?,
stateMessage: json_['stateMessage'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final build = this.build;
final config = this.config;
final createTime = this.createTime;
final name = this.name;
final state = this.state;
final stateMessage = this.stateMessage;
final updateTime = this.updateTime;
return {
'build': ?build,
'config': ?config,
'createTime': ?createTime,
'name': ?name,
'state': ?state,
'stateMessage': ?stateMessage,
'updateTime': ?updateTime,
};
}
}
/// Response message for ListApiDeploymentRevisionsResponse.
class ListApiDeploymentRevisionsResponse {
/// The revisions of the deployment.
core.List<ApiDeployment>? apiDeployments;
/// A token that can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListApiDeploymentRevisionsResponse({this.apiDeployments, this.nextPageToken});
ListApiDeploymentRevisionsResponse.fromJson(core.Map json_)
: this(
apiDeployments: (json_['apiDeployments'] as core.List?)
?.map(
(value) => ApiDeployment.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apiDeployments = this.apiDeployments;
final nextPageToken = this.nextPageToken;
return {'apiDeployments': ?apiDeployments, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListApiDeployments.
class ListApiDeploymentsResponse {
/// The deployments from the specified publisher.
core.List<ApiDeployment>? apiDeployments;
/// A token, which can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListApiDeploymentsResponse({this.apiDeployments, this.nextPageToken});
ListApiDeploymentsResponse.fromJson(core.Map json_)
: this(
apiDeployments: (json_['apiDeployments'] as core.List?)
?.map(
(value) => ApiDeployment.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apiDeployments = this.apiDeployments;
final nextPageToken = this.nextPageToken;
return {'apiDeployments': ?apiDeployments, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListApiSpecRevisionsResponse.
class ListApiSpecRevisionsResponse {
/// The revisions of the spec.
core.List<ApiSpec>? apiSpecs;
/// A token that can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListApiSpecRevisionsResponse({this.apiSpecs, this.nextPageToken});
ListApiSpecRevisionsResponse.fromJson(core.Map json_)
: this(
apiSpecs: (json_['apiSpecs'] as core.List?)
?.map(
(value) => ApiSpec.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apiSpecs = this.apiSpecs;
final nextPageToken = this.nextPageToken;
return {'apiSpecs': ?apiSpecs, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListApiSpecs.
class ListApiSpecsResponse {
/// The specs from the specified publisher.
core.List<ApiSpec>? apiSpecs;
/// A token, which can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListApiSpecsResponse({this.apiSpecs, this.nextPageToken});
ListApiSpecsResponse.fromJson(core.Map json_)
: this(
apiSpecs: (json_['apiSpecs'] as core.List?)
?.map(
(value) => ApiSpec.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apiSpecs = this.apiSpecs;
final nextPageToken = this.nextPageToken;
return {'apiSpecs': ?apiSpecs, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListApiVersions.
class ListApiVersionsResponse {
/// The versions from the specified publisher.
core.List<ApiVersion>? apiVersions;
/// A token, which can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListApiVersionsResponse({this.apiVersions, this.nextPageToken});
ListApiVersionsResponse.fromJson(core.Map json_)
: this(
apiVersions: (json_['apiVersions'] as core.List?)
?.map(
(value) => ApiVersion.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apiVersions = this.apiVersions;
final nextPageToken = this.nextPageToken;
return {'apiVersions': ?apiVersions, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListApis.
class ListApisResponse {
/// The APIs from the specified publisher.
core.List<Api>? apis;
/// A token, which can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListApisResponse({this.apis, this.nextPageToken});
ListApisResponse.fromJson(core.Map json_)
: this(
apis: (json_['apis'] as core.List?)
?.map(
(value) =>
Api.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apis = this.apis;
final nextPageToken = this.nextPageToken;
return {'apis': ?apis, 'nextPageToken': ?nextPageToken};
}
}
/// Response message for ListArtifacts.
class ListArtifactsResponse {
/// The artifacts from the specified publisher.
core.List<Artifact>? artifacts;
/// A token, which can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListArtifactsResponse({this.artifacts, this.nextPageToken});
ListArtifactsResponse.fromJson(core.Map json_)
: this(
artifacts: (json_['artifacts'] as core.List?)
?.map(
(value) => Artifact.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final artifacts = this.artifacts;
final nextPageToken = this.nextPageToken;
return {'artifacts': ?artifacts, 'nextPageToken': ?nextPageToken};
}
}
/// 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};
}
}
/// The response message for Operations.ListOperations.
class ListOperationsResponse {
/// The standard List next-page token.
core.String? nextPageToken;
/// A list of operations that matches the specified filter in the request.
core.List<Operation>? operations;
ListOperationsResponse({this.nextPageToken, this.operations});
ListOperationsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
operations: (json_['operations'] as core.List?)
?.map(
(value) => Operation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final operations = this.operations;
return {'nextPageToken': ?nextPageToken, 'operations': ?operations};
}
}
/// A resource that represents a Google Cloud location.
typedef Location = $Location00;
/// This resource represents a long-running operation that is the result of a
/// network API call.
class Operation {
/// 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.
Status? 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;
Operation({this.done, this.error, this.metadata, this.name, this.response});
Operation.fromJson(core.Map json_)
: this(
done: json_['done'] as core.bool?,
error: json_.containsKey('error')
? Status.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,
};
}
}
/// 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 {
/// 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.bindings, this.etag, this.version});
Policy.fromJson(core.Map json_)
: this(
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 bindings = this.bindings;
final etag = this.etag;
final version = this.version;
return {'bindings': ?bindings, 'etag': ?etag, 'version': ?version};
}
}
/// Request message for RollbackApiDeployment.
class RollbackApiDeploymentRequest {
/// The revision ID to roll back to.
///
/// It must be a revision of the same deployment. Example: `c7cfa2a8`
///
/// Required.
core.String? revisionId;
RollbackApiDeploymentRequest({this.revisionId});
RollbackApiDeploymentRequest.fromJson(core.Map json_)
: this(revisionId: json_['revisionId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final revisionId = this.revisionId;
return {'revisionId': ?revisionId};
}
}
/// Request message for RollbackApiSpec.
class RollbackApiSpecRequest {
/// The revision ID to roll back to.
///
/// It must be a revision of the same spec. Example: `c7cfa2a8`
///
/// Required.
core.String? revisionId;
RollbackApiSpecRequest({this.revisionId});
RollbackApiSpecRequest.fromJson(core.Map json_)
: this(revisionId: json_['revisionId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final revisionId = this.revisionId;
return {'revisionId': ?revisionId};
}
}
/// 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;
SetIamPolicyRequest({this.policy});
SetIamPolicyRequest.fromJson(core.Map json_)
: this(
policy: json_.containsKey('policy')
? Policy.fromJson(
json_['policy'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final policy = this.policy;
return {'policy': ?policy};
}
}
/// 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 Status = $Status00;
/// Request message for TagApiDeploymentRevision.
typedef TagApiDeploymentRevisionRequest = $RevisionRequest;
/// Request message for TagApiSpecRevision.
typedef TagApiSpecRevisionRequest = $RevisionRequest;
/// Request message for `TestIamPermissions` method.
typedef TestIamPermissionsRequest = $TestIamPermissionsRequest00;
/// Response message for `TestIamPermissions` method.
typedef TestIamPermissionsResponse = $PermissionsResponse;