blob: f635da5edc5fefa02fdd02b0fa5819e93a753271 [file] [edit]
// Copyright 2018 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
/// Service Usage API - v1
///
/// Enables services that service consumers want to use on Google Cloud
/// Platform, lists the available or enabled services, or disables services that
/// service consumers no longer use.
///
/// For more information, see <https://cloud.google.com/service-usage/>
///
/// Create an instance of [ServiceUsageApi] to access these resources:
///
/// - [OperationsResource]
/// - [ServicesResource]
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;
/// Enables services that service consumers want to use on Google Cloud
/// Platform, lists the available or enabled services, or disables services that
/// service consumers no longer use.
class ServiceUsageApi {
/// 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';
/// View your data across Google Cloud services and see the email address of
/// your Google Account
static const cloudPlatformReadOnlyScope =
'https://www.googleapis.com/auth/cloud-platform.read-only';
/// Manage your Google API service configuration
static const serviceManagementScope =
'https://www.googleapis.com/auth/service.management';
final commons.ApiRequester _requester;
OperationsResource get operations => OperationsResource(_requester);
ServicesResource get services => ServicesResource(_requester);
ServiceUsageApi(
http.Client client, {
core.String rootUrl = 'https://serviceusage.googleapis.com/',
core.String servicePath = '',
}) : _requester = commons.ApiRequester(
client,
rootUrl,
servicePath,
requestHeaders,
);
}
class OperationsResource {
final commons.ApiRequester _requester;
OperationsResource(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 `^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 `^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 `^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:
///
/// [filter] - The standard list filter.
///
/// [name] - The name of the operation's parent resource.
///
/// [pageSize] - The standard list page size.
///
/// [pageToken] - The standard list page token.
///
/// [returnPartialSuccess] - When set to `true`, operations that are reachable
/// are returned as normal, and those that are unreachable are returned in the
/// ListOperationsResponse.unreachable field. This can only be `true` when
/// reading across collections. For example, when `parent` is set to
/// `"projects/example/locations/-"`. This field is not supported by default
/// and will result in an `UNIMPLEMENTED` error if set unless explicitly
/// documented otherwise in service or product specific documentation.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [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? filter,
core.String? name,
core.int? pageSize,
core.String? pageToken,
core.bool? returnPartialSuccess,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'name': ?name == null ? null : [name],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'returnPartialSuccess': ?returnPartialSuccess == null
? null
: ['${returnPartialSuccess}'],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'v1/operations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListOperationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ServicesResource {
final commons.ApiRequester _requester;
ServicesResource(commons.ApiRequester client) : _requester = client;
/// Enable multiple services on a project.
///
/// The operation is atomic: if enabling any service fails, then the entire
/// batch fails, and no state changes occur. To enable a single service, use
/// the `EnableService` method instead.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Parent to enable services on. An example name would be:
/// `projects/123` where `123` is the project number. The
/// `BatchEnableServices` method currently only supports projects.
/// Value must have pattern `^\[^/\]+/\[^/\]+$`.
///
/// [$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> batchEnable(
BatchEnableServicesRequest request,
core.String parent, {
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('$parent') + '/services:batchEnable';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the service configurations and enabled states for a given list of
/// services.
///
/// Request parameters:
///
/// [parent] - Parent to retrieve services from. If this is set, the parent of
/// all of the services specified in `names` must match this field. An example
/// name would be: `projects/123` where `123` is the project number. The
/// `BatchGetServices` method currently only supports projects.
/// Value must have pattern `^\[^/\]+/\[^/\]+$`.
///
/// [names] - Names of the services to retrieve. An example name would be:
/// `projects/123/services/serviceusage.googleapis.com` where `123` is the
/// project number. A single request can get a maximum of 30 services at a
/// time.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [BatchGetServicesResponse].
///
/// 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<BatchGetServicesResponse> batchGet(
core.String parent, {
core.List<core.String>? names,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'names': ?names,
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/services:batchGet';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return BatchGetServicesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Disable a service so that it can no longer be used with a project.
///
/// This prevents unintended usage that may cause unexpected billing charges
/// or security leaks. It is not valid to call the disable method on a service
/// that is not currently enabled. Callers will receive a
/// `FAILED_PRECONDITION` status if the target service is not currently
/// enabled.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Name of the consumer and service to disable the service on. The
/// enable and disable methods currently only support projects. An example
/// name would be: `projects/123/services/serviceusage.googleapis.com` where
/// `123` is the project number.
/// Value must have pattern `^\[^/\]+/\[^/\]+/services/\[^/\]+$`.
///
/// [$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> disable(
DisableServiceRequest 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') + ':disable';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Enable a service so that it can be used with a project.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Name of the consumer and service to enable the service on. The
/// `EnableService` and `DisableService` methods currently only support
/// projects. Enabling a service requires that the service is public or is
/// shared with the user enabling the service. An example name would be:
/// `projects/123/services/serviceusage.googleapis.com` where `123` is the
/// project number.
/// Value must have pattern `^\[^/\]+/\[^/\]+/services/\[^/\]+$`.
///
/// [$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> enable(
EnableServiceRequest 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') + ':enable';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns the service configuration and enabled state for a given service.
///
/// Request parameters:
///
/// [name] - Name of the consumer and service to get the `ConsumerState` for.
/// An example name would be:
/// `projects/123/services/serviceusage.googleapis.com` where `123` is the
/// project number.
/// Value must have pattern `^\[^/\]+/\[^/\]+/services/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleApiServiceusageV1Service].
///
/// 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<GoogleApiServiceusageV1Service> 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 GoogleApiServiceusageV1Service.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// List all services available to the specified project, and the current
/// state of those services with respect to the project.
///
/// The list includes all public services, all services for which the calling
/// user has the `servicemanagement.services.bind` permission, and all
/// services that have already been enabled on the project. The list can be
/// filtered to only include services in a specific state, for example to only
/// include services enabled on the project. WARNING: If you need to query
/// enabled services frequently or across an organization, you should use
/// [Cloud Asset Inventory API](https://cloud.google.com/asset-inventory/docs/apis),
/// which provides higher throughput and richer filtering capability.
///
/// Request parameters:
///
/// [parent] - Parent to search for services on. An example name would be:
/// `projects/123` where `123` is the project number.
/// Value must have pattern `^\[^/\]+/\[^/\]+$`.
///
/// [filter] - Only list services that conform to the given filter. The
/// allowed filter strings are `state:ENABLED` and `state:DISABLED`.
///
/// [pageSize] - Requested size of the next page of data. Requested page size
/// cannot exceed 200. If not set, the default page size is 50.
///
/// [pageToken] - Token identifying which result to start with, which is
/// returned by a previous list call.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListServicesResponse].
///
/// 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<ListServicesResponse> list(
core.String parent, {
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('$parent') + '/services';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListServicesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
/// Api is a light-weight descriptor for an API Interface.
///
/// Interfaces are also described as "protocol buffer services" in some
/// contexts, such as by the "service" keyword in a .proto file, but they are
/// different from API Services, which represent a concrete implementation of an
/// interface as opposed to simply a description of methods and bindings. They
/// are also sometimes simply referred to as "APIs" in other contexts, such as
/// the name of this message itself. See
/// https://cloud.google.com/apis/design/glossary for detailed terminology. New
/// usages of this message as an alternative to ServiceDescriptorProto are
/// strongly discouraged. This message does not reliability preserve all
/// information necessary to model the schema and preserve semantics. Instead
/// make use of FileDescriptorSet which preserves the necessary information.
class Api {
/// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
core.String? edition;
/// The methods of this interface, in unspecified order.
core.List<Method>? methods;
/// Included interfaces.
///
/// See Mixin.
core.List<Mixin>? mixins;
/// The fully qualified name of this interface, including package name
/// followed by the interface's simple name.
core.String? name;
/// Any metadata attached to the interface.
core.List<Option>? options;
/// Source context for the protocol buffer service represented by this
/// message.
SourceContext? sourceContext;
/// The source syntax of the service.
/// Possible string values are:
/// - "SYNTAX_PROTO2" : Syntax `proto2`.
/// - "SYNTAX_PROTO3" : Syntax `proto3`.
/// - "SYNTAX_EDITIONS" : Syntax `editions`.
core.String? syntax;
/// A version string for this interface.
///
/// If specified, must have the form `major-version.minor-version`, as in
/// `1.10`. If the minor version is omitted, it defaults to zero. If the
/// entire version field is empty, the major version is derived from the
/// package name, as outlined below. If the field is not empty, the version in
/// the package name will be verified to be consistent with what is provided
/// here. The versioning schema uses [semantic versioning](http://semver.org)
/// where the major version number indicates a breaking change and the minor
/// version an additive, non-breaking change. Both version numbers are signals
/// to users what to expect from different versions, and should be carefully
/// chosen based on the product plan. The major version is also reflected in
/// the package name of the interface, which must end in `v`, as in
/// `google.feature.v1`. For major versions 0 and 1, the suffix can be
/// omitted. Zero major versions must only be used for experimental, non-GA
/// interfaces.
core.String? version;
Api({
this.edition,
this.methods,
this.mixins,
this.name,
this.options,
this.sourceContext,
this.syntax,
this.version,
});
Api.fromJson(core.Map json_)
: this(
edition: json_['edition'] as core.String?,
methods: (json_['methods'] as core.List?)
?.map(
(value) =>
Method.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
mixins: (json_['mixins'] as core.List?)
?.map(
(value) =>
Mixin.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
name: json_['name'] as core.String?,
options: (json_['options'] as core.List?)
?.map(
(value) =>
Option.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
sourceContext: json_.containsKey('sourceContext')
? SourceContext.fromJson(
json_['sourceContext'] as core.Map<core.String, core.dynamic>,
)
: null,
syntax: json_['syntax'] as core.String?,
version: json_['version'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final edition = this.edition;
final methods = this.methods;
final mixins = this.mixins;
final name = this.name;
final options = this.options;
final sourceContext = this.sourceContext;
final syntax = this.syntax;
final version = this.version;
return {
'edition': ?edition,
'methods': ?methods,
'mixins': ?mixins,
'name': ?name,
'options': ?options,
'sourceContext': ?sourceContext,
'syntax': ?syntax,
'version': ?version,
};
}
}
/// Configuration for an authentication provider, including support for \[JSON
/// Web Token
/// (JWT)\](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
class AuthProvider {
/// The list of JWT
/// [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
///
/// that are allowed to access. A JWT containing any of these audiences will
/// be accepted. When this setting is absent, JWTs with audiences: -
/// "https://\[service.name\]/\[google.protobuf.Api.name\]" -
/// "https://\[service.name\]/" will be accepted. For example, if no audiences
/// are in the setting, LibraryService API will accept JWTs with the following
/// audiences: -
/// https://library-example.googleapis.com/google.example.library.v1.LibraryService
/// - https://library-example.googleapis.com/ Example: audiences:
/// bookstore_android.apps.googleusercontent.com,
/// bookstore_web.apps.googleusercontent.com
core.String? audiences;
/// Redirect URL if JWT token is required but not present or is expired.
///
/// Implement authorizationUrl of securityDefinitions in OpenAPI spec.
core.String? authorizationUrl;
/// The unique identifier of the auth provider.
///
/// It will be referred to by `AuthRequirement.provider_id`. Example:
/// "bookstore_auth".
core.String? id;
/// Identifies the principal that issued the JWT.
///
/// See
/// https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1
/// Usually a URL or an email address. Example: https://securetoken.google.com
/// Example: 1234567-compute@developer.gserviceaccount.com
core.String? issuer;
/// URL of the provider's public key set to validate signature of the JWT.
///
/// See
/// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
/// Optional if the key set document: - can be retrieved from
/// [OpenID Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html)
/// of the issuer. - can be inferred from the email domain of the issuer (e.g.
/// a Google service account). Example:
/// https://www.googleapis.com/oauth2/v1/certs
core.String? jwksUri;
/// Defines the locations to extract the JWT.
///
/// For now it is only used by the Cloud Endpoints to store the OpenAPI
/// extension
/// \[x-google-jwt-locations\](https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations)
/// JWT locations can be one of HTTP headers, URL query parameters or cookies.
/// The rule is that the first match wins. If not specified, default to use
/// following 3 locations: 1) Authorization: Bearer 2)
/// x-goog-iap-jwt-assertion 3) access_token query parameter Default locations
/// can be specified as followings: jwt_locations: - header: Authorization
/// value_prefix: "Bearer " - header: x-goog-iap-jwt-assertion - query:
/// access_token
core.List<JwtLocation>? jwtLocations;
AuthProvider({
this.audiences,
this.authorizationUrl,
this.id,
this.issuer,
this.jwksUri,
this.jwtLocations,
});
AuthProvider.fromJson(core.Map json_)
: this(
audiences: json_['audiences'] as core.String?,
authorizationUrl: json_['authorizationUrl'] as core.String?,
id: json_['id'] as core.String?,
issuer: json_['issuer'] as core.String?,
jwksUri: json_['jwksUri'] as core.String?,
jwtLocations: (json_['jwtLocations'] as core.List?)
?.map(
(value) => JwtLocation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final audiences = this.audiences;
final authorizationUrl = this.authorizationUrl;
final id = this.id;
final issuer = this.issuer;
final jwksUri = this.jwksUri;
final jwtLocations = this.jwtLocations;
return {
'audiences': ?audiences,
'authorizationUrl': ?authorizationUrl,
'id': ?id,
'issuer': ?issuer,
'jwksUri': ?jwksUri,
'jwtLocations': ?jwtLocations,
};
}
}
/// User-defined authentication requirements, including support for \[JSON Web
/// Token
/// (JWT)\](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
typedef AuthRequirement = $AuthRequirement;
/// `Authentication` defines the authentication configuration for API methods
/// provided by an API service.
///
/// Example: name: calendar.googleapis.com authentication: providers: - id:
/// google_calendar_auth jwks_uri: https://www.googleapis.com/oauth2/v1/certs
/// issuer: https://securetoken.google.com rules: - selector: "*" requirements:
/// provider_id: google_calendar_auth - selector: google.calendar.Delegate
/// oauth: canonical_scopes: https://www.googleapis.com/auth/calendar.read
class Authentication {
/// Defines a set of authentication providers that a service supports.
core.List<AuthProvider>? providers;
/// A list of authentication rules that apply to individual API methods.
///
/// **NOTE:** All service configuration rules follow "last one wins" order.
core.List<AuthenticationRule>? rules;
Authentication({this.providers, this.rules});
Authentication.fromJson(core.Map json_)
: this(
providers: (json_['providers'] as core.List?)
?.map(
(value) => AuthProvider.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
rules: (json_['rules'] as core.List?)
?.map(
(value) => AuthenticationRule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final providers = this.providers;
final rules = this.rules;
return {'providers': ?providers, 'rules': ?rules};
}
}
/// Authentication rules for the service.
///
/// By default, if a method has any authentication requirements, every request
/// must include a valid credential matching one of the requirements. It's an
/// error to include more than one kind of credential in a single request. If a
/// method doesn't have any auth requirements, request credentials will be
/// ignored.
class AuthenticationRule {
/// If true, the service accepts API keys without any other credential.
///
/// This flag only applies to HTTP and gRPC requests.
core.bool? allowWithoutCredential;
/// The requirements for OAuth credentials.
OAuthRequirements? oauth;
/// Requirements for additional authentication providers.
core.List<AuthRequirement>? requirements;
/// Selects the methods to which this rule applies.
///
/// Refer to selector for syntax details.
core.String? selector;
AuthenticationRule({
this.allowWithoutCredential,
this.oauth,
this.requirements,
this.selector,
});
AuthenticationRule.fromJson(core.Map json_)
: this(
allowWithoutCredential: json_['allowWithoutCredential'] as core.bool?,
oauth: json_.containsKey('oauth')
? OAuthRequirements.fromJson(
json_['oauth'] as core.Map<core.String, core.dynamic>,
)
: null,
requirements: (json_['requirements'] as core.List?)
?.map(
(value) => AuthRequirement.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
selector: json_['selector'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final allowWithoutCredential = this.allowWithoutCredential;
final oauth = this.oauth;
final requirements = this.requirements;
final selector = this.selector;
return {
'allowWithoutCredential': ?allowWithoutCredential,
'oauth': ?oauth,
'requirements': ?requirements,
'selector': ?selector,
};
}
}
/// Request message for the `BatchEnableServices` method.
class BatchEnableServicesRequest {
/// The identifiers of the services to enable on the project.
///
/// A valid identifier would be: serviceusage.googleapis.com Enabling services
/// requires that each service is public or is shared with the user enabling
/// the service. A single request can enable a maximum of 20 services at a
/// time. If more than 20 services are specified, the request will fail, and
/// no state changes will occur.
core.List<core.String>? serviceIds;
BatchEnableServicesRequest({this.serviceIds});
BatchEnableServicesRequest.fromJson(core.Map json_)
: this(
serviceIds: (json_['serviceIds'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final serviceIds = this.serviceIds;
return {'serviceIds': ?serviceIds};
}
}
/// Response message for the `BatchGetServices` method.
class BatchGetServicesResponse {
/// The requested Service states.
core.List<GoogleApiServiceusageV1Service>? services;
BatchGetServicesResponse({this.services});
BatchGetServicesResponse.fromJson(core.Map json_)
: this(
services: (json_['services'] as core.List?)
?.map(
(value) => GoogleApiServiceusageV1Service.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final services = this.services;
return {'services': ?services};
}
}
/// The request message for Operations.CancelOperation.
typedef CancelOperationRequest = $Empty;
/// Request message for the `DisableService` method.
class DisableServiceRequest {
/// Defines the behavior for checking service usage when disabling a service.
/// Possible string values are:
/// - "CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED" : When unset, the default
/// behavior is used, which is SKIP.
/// - "SKIP" : If set, skip checking service usage when disabling a service.
/// - "CHECK" : If set, service usage is checked when disabling the service.
/// If a service, or its dependents, has usage in the last 30 days, the
/// request returns a FAILED_PRECONDITION error.
core.String? checkIfServiceHasUsage;
/// Indicates if services that are enabled and which depend on this service
/// should also be disabled.
///
/// If not set, an error will be generated if any enabled services depend on
/// the service to be disabled. When set, the service, and any enabled
/// services that depend on it, will be disabled together.
core.bool? disableDependentServices;
DisableServiceRequest({
this.checkIfServiceHasUsage,
this.disableDependentServices,
});
DisableServiceRequest.fromJson(core.Map json_)
: this(
checkIfServiceHasUsage: json_['checkIfServiceHasUsage'] as core.String?,
disableDependentServices:
json_['disableDependentServices'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final checkIfServiceHasUsage = this.checkIfServiceHasUsage;
final disableDependentServices = this.disableDependentServices;
return {
'checkIfServiceHasUsage': ?checkIfServiceHasUsage,
'disableDependentServices': ?disableDependentServices,
};
}
}
/// `Documentation` provides the information for describing a service.
///
/// Example: documentation: summary: \> The Google Calendar API gives access to
/// most calendar features. pages: - name: Overview content: (== include
/// google/foo/overview.md ==) - name: Tutorial content: (== include
/// google/foo/tutorial.md ==) subpages: - name: Java content: (== include
/// google/foo/tutorial_java.md ==) rules: - selector:
/// google.calendar.Calendar.Get description: \> ... - selector:
/// google.calendar.Calendar.Put description: \> ... Documentation is provided
/// in markdown syntax. In addition to standard markdown features, definition
/// lists, tables and fenced code blocks are supported. Section headers can be
/// provided and are interpreted relative to the section nesting of the context
/// where a documentation fragment is embedded. Documentation from the IDL is
/// merged with documentation defined via the config at normalization time,
/// where documentation provided by config rules overrides IDL provided. A
/// number of constructs specific to the API platform are supported in
/// documentation text. In order to reference a proto element, the following
/// notation can be used: \[fully.qualified.proto.name\]\[\] To override the
/// display text used for the link, this can be used: \[display
/// text\]\[fully.qualified.proto.name\] Text can be excluded from doc using the
/// following notation: (-- internal comment --) A few directives are available
/// in documentation. Note that directives must appear on a single line to be
/// properly identified. The `include` directive includes a markdown file from
/// an external source: (== include path/to/file ==) The `resource_for`
/// directive marks a message to be the resource of a collection in REST view.
/// If it is not specified, tools attempt to infer the resource from the
/// operations in a collection: (== resource_for v1.shelves.books ==) The
/// directive `suppress_warning` does not directly affect documentation and is
/// documented together with service config validation.
class Documentation {
/// Optional information about the IAM configuration.
///
/// This is typically used to link to documentation about a product's IAM
/// roles and permissions.
core.String? additionalIamInfo;
/// The URL to the root of documentation.
core.String? documentationRootUrl;
/// Declares a single overview page.
///
/// For example: documentation: summary: ... overview: (== include overview.md
/// ==) This is a shortcut for the following declaration (using pages style):
/// documentation: summary: ... pages: - name: Overview content: (== include
/// overview.md ==) Note: you cannot specify both `overview` field and `pages`
/// field.
core.String? overview;
/// The top level pages for the documentation set.
core.List<Page>? pages;
/// A list of documentation rules that apply to individual API elements.
///
/// **NOTE:** All service configuration rules follow "last one wins" order.
core.List<DocumentationRule>? rules;
/// Specifies section and content to override the boilerplate content.
///
/// Currently overrides following sections: 1. rest.service.client_libraries
core.List<Page>? sectionOverrides;
/// Specifies the service root url if the default one (the service name from
/// the yaml file) is not suitable.
///
/// This can be seen in any fully specified service urls as well as sections
/// that show a base that other urls are relative to.
core.String? serviceRootUrl;
/// A short description of what the service does.
///
/// The summary must be plain text. It becomes the overview of the service
/// displayed in Google Cloud Console. NOTE: This field is equivalent to the
/// standard field `description`.
core.String? summary;
Documentation({
this.additionalIamInfo,
this.documentationRootUrl,
this.overview,
this.pages,
this.rules,
this.sectionOverrides,
this.serviceRootUrl,
this.summary,
});
Documentation.fromJson(core.Map json_)
: this(
additionalIamInfo: json_['additionalIamInfo'] as core.String?,
documentationRootUrl: json_['documentationRootUrl'] as core.String?,
overview: json_['overview'] as core.String?,
pages: (json_['pages'] as core.List?)
?.map(
(value) =>
Page.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
rules: (json_['rules'] as core.List?)
?.map(
(value) => DocumentationRule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
sectionOverrides: (json_['sectionOverrides'] as core.List?)
?.map(
(value) =>
Page.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
serviceRootUrl: json_['serviceRootUrl'] as core.String?,
summary: json_['summary'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final additionalIamInfo = this.additionalIamInfo;
final documentationRootUrl = this.documentationRootUrl;
final overview = this.overview;
final pages = this.pages;
final rules = this.rules;
final sectionOverrides = this.sectionOverrides;
final serviceRootUrl = this.serviceRootUrl;
final summary = this.summary;
return {
'additionalIamInfo': ?additionalIamInfo,
'documentationRootUrl': ?documentationRootUrl,
'overview': ?overview,
'pages': ?pages,
'rules': ?rules,
'sectionOverrides': ?sectionOverrides,
'serviceRootUrl': ?serviceRootUrl,
'summary': ?summary,
};
}
}
/// A documentation rule provides information about individual API elements.
typedef DocumentationRule = $DocumentationRule;
/// 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;
/// Request message for the `EnableService` method.
typedef EnableServiceRequest = $Empty;
/// `Endpoint` describes a network address of a service that serves a set of
/// APIs.
///
/// It is commonly known as a service endpoint. A service may expose any number
/// of service endpoints, and all service endpoints share the same service
/// definition, such as quota limits and monitoring metrics. Example: type:
/// google.api.Service name: library-example.googleapis.com endpoints: #
/// Declares network address `https://library-example.googleapis.com` # for
/// service `library-example.googleapis.com`. The `https` scheme # is implicit
/// for all service endpoints. Other schemes may be # supported in the future. -
/// name: library-example.googleapis.com allow_cors: false - name:
/// content-staging-library-example.googleapis.com # Allows HTTP OPTIONS calls
/// to be passed to the API frontend, for it # to decide whether the subsequent
/// cross-origin request is allowed # to proceed. allow_cors: true
typedef Endpoint = $Endpoint;
/// A service that is available for use by the consumer.
class GoogleApiServiceusageV1Service {
/// The service configuration of the available service.
///
/// Some fields may be filtered out of the configuration in responses to the
/// `ListServices` method. These fields are present only in responses to the
/// `GetService` method.
GoogleApiServiceusageV1ServiceConfig? config;
/// The resource name of the consumer and service.
///
/// A valid name would be: - projects/123/services/serviceusage.googleapis.com
core.String? name;
/// The resource name of the consumer.
///
/// A valid name would be: - projects/123
core.String? parent;
/// Whether or not the service has been enabled for use by the consumer.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : The default value, which indicates that the
/// enabled state of the service is unspecified or not meaningful. Currently,
/// all consumers other than projects (such as folders and organizations) are
/// always in this state.
/// - "DISABLED" : The service cannot be used by this consumer. It has either
/// been explicitly disabled, or has never been enabled.
/// - "ENABLED" : The service has been explicitly enabled for use by this
/// consumer.
core.String? state;
GoogleApiServiceusageV1Service({
this.config,
this.name,
this.parent,
this.state,
});
GoogleApiServiceusageV1Service.fromJson(core.Map json_)
: this(
config: json_.containsKey('config')
? GoogleApiServiceusageV1ServiceConfig.fromJson(
json_['config'] as core.Map<core.String, core.dynamic>,
)
: null,
name: json_['name'] as core.String?,
parent: json_['parent'] as core.String?,
state: json_['state'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final config = this.config;
final name = this.name;
final parent = this.parent;
final state = this.state;
return {
'config': ?config,
'name': ?name,
'parent': ?parent,
'state': ?state,
};
}
}
/// The configuration of the service.
class GoogleApiServiceusageV1ServiceConfig {
/// A list of API interfaces exported by this service.
///
/// Contains only the names, versions, and method names of the interfaces.
core.List<Api>? apis;
/// Auth configuration.
///
/// Contains only the OAuth rules.
Authentication? authentication;
/// Additional API documentation.
///
/// Contains only the summary and the documentation URL.
Documentation? documentation;
/// Configuration for network endpoints.
///
/// Contains only the names and aliases of the endpoints.
core.List<Endpoint>? endpoints;
/// Defines the monitored resources used by this service.
///
/// This is required by the Service.monitoring and Service.logging
/// configurations.
core.List<MonitoredResourceDescriptor>? monitoredResources;
/// Monitoring configuration.
///
/// This should not include the 'producer_destinations' field.
Monitoring? monitoring;
/// The DNS address at which this service is available.
///
/// An example DNS address would be: `calendar.googleapis.com`.
core.String? name;
/// Quota configuration.
Quota? quota;
/// The product title for this service.
core.String? title;
/// Configuration controlling usage of this service.
Usage? usage;
GoogleApiServiceusageV1ServiceConfig({
this.apis,
this.authentication,
this.documentation,
this.endpoints,
this.monitoredResources,
this.monitoring,
this.name,
this.quota,
this.title,
this.usage,
});
GoogleApiServiceusageV1ServiceConfig.fromJson(core.Map json_)
: this(
apis: (json_['apis'] as core.List?)
?.map(
(value) =>
Api.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
authentication: json_.containsKey('authentication')
? Authentication.fromJson(
json_['authentication'] as core.Map<core.String, core.dynamic>,
)
: null,
documentation: json_.containsKey('documentation')
? Documentation.fromJson(
json_['documentation'] as core.Map<core.String, core.dynamic>,
)
: null,
endpoints: (json_['endpoints'] as core.List?)
?.map(
(value) => Endpoint.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
monitoredResources: (json_['monitoredResources'] as core.List?)
?.map(
(value) => MonitoredResourceDescriptor.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
monitoring: json_.containsKey('monitoring')
? Monitoring.fromJson(
json_['monitoring'] as core.Map<core.String, core.dynamic>,
)
: null,
name: json_['name'] as core.String?,
quota: json_.containsKey('quota')
? Quota.fromJson(
json_['quota'] as core.Map<core.String, core.dynamic>,
)
: null,
title: json_['title'] as core.String?,
usage: json_.containsKey('usage')
? Usage.fromJson(
json_['usage'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final apis = this.apis;
final authentication = this.authentication;
final documentation = this.documentation;
final endpoints = this.endpoints;
final monitoredResources = this.monitoredResources;
final monitoring = this.monitoring;
final name = this.name;
final quota = this.quota;
final title = this.title;
final usage = this.usage;
return {
'apis': ?apis,
'authentication': ?authentication,
'documentation': ?documentation,
'endpoints': ?endpoints,
'monitoredResources': ?monitoredResources,
'monitoring': ?monitoring,
'name': ?name,
'quota': ?quota,
'title': ?title,
'usage': ?usage,
};
}
}
/// Specifies a location to extract JWT from an API request.
typedef JwtLocation = $JwtLocation;
/// A description of a label.
typedef LabelDescriptor = $LabelDescriptor;
/// 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;
/// Unordered list.
///
/// Unreachable resources. Populated when the request sets
/// `ListOperationsRequest.return_partial_success` and reads across
/// collections. For example, when attempting to list all resources across all
/// supported locations.
core.List<core.String>? unreachable;
ListOperationsResponse({
this.nextPageToken,
this.operations,
this.unreachable,
});
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(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final operations = this.operations;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'operations': ?operations,
'unreachable': ?unreachable,
};
}
}
/// Response message for the `ListServices` method.
class ListServicesResponse {
/// Token that can be passed to `ListServices` to resume a paginated query.
core.String? nextPageToken;
/// The available services for the requested project.
core.List<GoogleApiServiceusageV1Service>? services;
ListServicesResponse({this.nextPageToken, this.services});
ListServicesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
services: (json_['services'] as core.List?)
?.map(
(value) => GoogleApiServiceusageV1Service.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final services = this.services;
return {'nextPageToken': ?nextPageToken, 'services': ?services};
}
}
/// Method represents a method of an API interface.
///
/// New usages of this message as an alternative to MethodDescriptorProto are
/// strongly discouraged. This message does not reliability preserve all
/// information necessary to model the schema and preserve semantics. Instead
/// make use of FileDescriptorSet which preserves the necessary information.
class Method {
/// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
///
/// This field should be ignored, instead the edition should be inherited from
/// Api. This is similar to Field and EnumValue.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.String? edition;
/// The simple name of this method.
core.String? name;
/// Any metadata attached to the method.
core.List<Option>? options;
/// If true, the request is streamed.
core.bool? requestStreaming;
/// A URL of the input message type.
core.String? requestTypeUrl;
/// If true, the response is streamed.
core.bool? responseStreaming;
/// The URL of the output message type.
core.String? responseTypeUrl;
/// The source syntax of this method.
///
/// This field should be ignored, instead the syntax should be inherited from
/// Api. This is similar to Field and EnumValue.
/// Possible string values are:
/// - "SYNTAX_PROTO2" : Syntax `proto2`.
/// - "SYNTAX_PROTO3" : Syntax `proto3`.
/// - "SYNTAX_EDITIONS" : Syntax `editions`.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.String? syntax;
Method({
this.edition,
this.name,
this.options,
this.requestStreaming,
this.requestTypeUrl,
this.responseStreaming,
this.responseTypeUrl,
this.syntax,
});
Method.fromJson(core.Map json_)
: this(
edition: json_['edition'] as core.String?,
name: json_['name'] as core.String?,
options: (json_['options'] as core.List?)
?.map(
(value) =>
Option.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
requestStreaming: json_['requestStreaming'] as core.bool?,
requestTypeUrl: json_['requestTypeUrl'] as core.String?,
responseStreaming: json_['responseStreaming'] as core.bool?,
responseTypeUrl: json_['responseTypeUrl'] as core.String?,
syntax: json_['syntax'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final edition = this.edition;
final name = this.name;
final options = this.options;
final requestStreaming = this.requestStreaming;
final requestTypeUrl = this.requestTypeUrl;
final responseStreaming = this.responseStreaming;
final responseTypeUrl = this.responseTypeUrl;
final syntax = this.syntax;
return {
'edition': ?edition,
'name': ?name,
'options': ?options,
'requestStreaming': ?requestStreaming,
'requestTypeUrl': ?requestTypeUrl,
'responseStreaming': ?responseStreaming,
'responseTypeUrl': ?responseTypeUrl,
'syntax': ?syntax,
};
}
}
/// Bind API methods to metrics.
///
/// Binding a method to a metric causes that metric's configured quota behaviors
/// to apply to the method call.
typedef MetricRule = $MetricRule;
/// Declares an API Interface to be included in this interface.
///
/// The including interface must redeclare all the methods from the included
/// interface, but documentation and options are inherited as follows: - If
/// after comment and whitespace stripping, the documentation string of the
/// redeclared method is empty, it will be inherited from the original method. -
/// Each annotation belonging to the service config (http, visibility) which is
/// not set in the redeclared method will be inherited. - If an http annotation
/// is inherited, the path pattern will be modified as follows. Any version
/// prefix will be replaced by the version of the including interface plus the
/// root path if specified. Example of a simple mixin: package google.acl.v1;
/// service AccessControl { // Get the underlying ACL object. rpc
/// GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get =
/// "/v1/{resource=**}:getAcl"; } } package google.storage.v2; service Storage {
/// // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc
/// GetData(GetDataRequest) returns (Data) { option (google.api.http).get =
/// "/v2/{resource=**}"; } } Example of a mixin configuration: apis: - name:
/// google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The
/// mixin construct implies that all methods in `AccessControl` are also
/// declared with same name and request/response types in `Storage`. A
/// documentation generator or annotation processor will see the effective
/// `Storage.GetAcl` method after inheriting documentation and annotations as
/// follows: service Storage { // Get the underlying ACL object. rpc
/// GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get =
/// "/v2/{resource=**}:getAcl"; } ... } Note how the version in the path pattern
/// changed from `v1` to `v2`. If the `root` field in the mixin is specified, it
/// should be a relative path under which inherited HTTP paths are placed.
/// Example: apis: - name: google.storage.v2.Storage mixins: - name:
/// google.acl.v1.AccessControl root: acls This implies the following inherited
/// HTTP annotation: service Storage { // Get the underlying ACL object. rpc
/// GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get =
/// "/v2/acls/{resource=**}:getAcl"; } ... }
typedef Mixin = $Mixin;
/// An object that describes the schema of a MonitoredResource object using a
/// type name and a set of labels.
///
/// For example, the monitored resource descriptor for Google Compute Engine VM
/// instances has a type of `"gce_instance"` and specifies the use of the labels
/// `"instance_id"` and `"zone"` to identify particular VM instances. Different
/// APIs can support different monitored resource types. APIs generally provide
/// a `list` method that returns the monitored resource descriptors used by the
/// API.
class MonitoredResourceDescriptor {
/// A detailed description of the monitored resource type that might be used
/// in documentation.
///
/// Optional.
core.String? description;
/// A concise name for the monitored resource type that might be displayed in
/// user interfaces.
///
/// It should be a Title Cased Noun Phrase, without any article or other
/// determiners. For example, `"Google Cloud SQL Database"`.
///
/// Optional.
core.String? displayName;
/// A set of labels used to describe instances of this monitored resource
/// type.
///
/// For example, an individual Google Cloud SQL database is identified by
/// values for the labels `"database_id"` and `"zone"`.
///
/// Required.
core.List<LabelDescriptor>? labels;
/// The launch stage of the monitored resource definition.
///
/// Optional.
/// Possible string values are:
/// - "LAUNCH_STAGE_UNSPECIFIED" : Do not use this default value.
/// - "UNIMPLEMENTED" : The feature is not yet implemented. Users can not use
/// it.
/// - "PRELAUNCH" : Prelaunch features are hidden from users and are only
/// visible internally.
/// - "EARLY_ACCESS" : Early Access features are limited to a closed group of
/// testers. To use these features, you must sign up in advance and sign a
/// Trusted Tester agreement (which includes confidentiality provisions).
/// These features may be unstable, changed in backward-incompatible ways, and
/// are not guaranteed to be released.
/// - "ALPHA" : Alpha is a limited availability test for releases before they
/// are cleared for widespread use. By Alpha, all significant design issues
/// are resolved and we are in the process of verifying functionality. Alpha
/// customers need to apply for access, agree to applicable terms, and have
/// their projects allowlisted. Alpha releases don't have to be feature
/// complete, no SLAs are provided, and there are no technical support
/// obligations, but they will be far enough along that customers can actually
/// use them in test environments or for limited-use tests -- just like they
/// would in normal production cases.
/// - "BETA" : Beta is the point at which we are ready to open a release for
/// any customer to use. There are no SLA or technical support obligations in
/// a Beta release. Products will be complete from a feature perspective, but
/// may have some open outstanding issues. Beta releases are suitable for
/// limited production use cases.
/// - "GA" : GA features are open to all developers and are considered stable
/// and fully qualified for production use.
/// - "DEPRECATED" : Deprecated features are scheduled to be shut down and
/// removed. For more information, see the "Deprecation Policy" section of our
/// [Terms of Service](https://cloud.google.com/terms/) and the
/// [Google Cloud Platform Subject to the Deprecation Policy](https://cloud.google.com/terms/deprecation)
/// documentation.
core.String? launchStage;
/// The resource name of the monitored resource descriptor:
/// `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where {type}
/// is the value of the `type` field in this object and {project_id} is a
/// project ID that provides API-specific context for accessing the type.
///
/// APIs that do not use project information can use the resource name format
/// `"monitoredResourceDescriptors/{type}"`.
///
/// Optional.
core.String? name;
/// The monitored resource type.
///
/// For example, the type `"cloudsql_database"` represents databases in Google
/// Cloud SQL. For a list of types, see
/// [Monitored resource types](https://cloud.google.com/monitoring/api/resources)
/// and
/// [Logging resource types](https://cloud.google.com/logging/docs/api/v2/resource-list).
///
/// Required.
core.String? type;
MonitoredResourceDescriptor({
this.description,
this.displayName,
this.labels,
this.launchStage,
this.name,
this.type,
});
MonitoredResourceDescriptor.fromJson(core.Map json_)
: this(
description: json_['description'] as core.String?,
displayName: json_['displayName'] as core.String?,
labels: (json_['labels'] as core.List?)
?.map(
(value) => LabelDescriptor.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
launchStage: json_['launchStage'] as core.String?,
name: json_['name'] as core.String?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final description = this.description;
final displayName = this.displayName;
final labels = this.labels;
final launchStage = this.launchStage;
final name = this.name;
final type = this.type;
return {
'description': ?description,
'displayName': ?displayName,
'labels': ?labels,
'launchStage': ?launchStage,
'name': ?name,
'type': ?type,
};
}
}
/// Monitoring configuration of the service.
///
/// The example below shows how to configure monitored resources and metrics for
/// monitoring. In the example, a monitored resource and two metrics are
/// defined. The `library.googleapis.com/book/returned_count` metric is sent to
/// both producer and consumer projects, whereas the
/// `library.googleapis.com/book/num_overdue` metric is only sent to the
/// consumer project. monitored_resources: - type: library.googleapis.com/Branch
/// display_name: "Library Branch" description: "A branch of a library."
/// launch_stage: GA labels: - key: resource_container description: "The Cloud
/// container (ie. project id) for the Branch." - key: location description:
/// "The location of the library branch." - key: branch_id description: "The id
/// of the branch." metrics: - name: library.googleapis.com/book/returned_count
/// display_name: "Books Returned" description: "The count of books that have
/// been returned." launch_stage: GA metric_kind: DELTA value_type: INT64 unit:
/// "1" labels: - key: customer_id description: "The id of the customer." -
/// name: library.googleapis.com/book/num_overdue display_name: "Books Overdue"
/// description: "The current number of overdue books." launch_stage: GA
/// metric_kind: GAUGE value_type: INT64 unit: "1" labels: - key: customer_id
/// description: "The id of the customer." monitoring: producer_destinations: -
/// monitored_resource: library.googleapis.com/Branch metrics: -
/// library.googleapis.com/book/returned_count consumer_destinations: -
/// monitored_resource: library.googleapis.com/Branch metrics: -
/// library.googleapis.com/book/returned_count -
/// library.googleapis.com/book/num_overdue
class Monitoring {
/// Monitoring configurations for sending metrics to the consumer project.
///
/// There can be multiple consumer destinations. A monitored resource type may
/// appear in multiple monitoring destinations if different aggregations are
/// needed for different sets of metrics associated with that monitored
/// resource type. A monitored resource and metric pair may only be used once
/// in the Monitoring configuration.
core.List<MonitoringDestination>? consumerDestinations;
/// Monitoring configurations for sending metrics to the producer project.
///
/// There can be multiple producer destinations. A monitored resource type may
/// appear in multiple monitoring destinations if different aggregations are
/// needed for different sets of metrics associated with that monitored
/// resource type. A monitored resource and metric pair may only be used once
/// in the Monitoring configuration.
core.List<MonitoringDestination>? producerDestinations;
Monitoring({this.consumerDestinations, this.producerDestinations});
Monitoring.fromJson(core.Map json_)
: this(
consumerDestinations: (json_['consumerDestinations'] as core.List?)
?.map(
(value) => MonitoringDestination.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
producerDestinations: (json_['producerDestinations'] as core.List?)
?.map(
(value) => MonitoringDestination.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final consumerDestinations = this.consumerDestinations;
final producerDestinations = this.producerDestinations;
return {
'consumerDestinations': ?consumerDestinations,
'producerDestinations': ?producerDestinations,
};
}
}
/// Configuration of a specific monitoring destination (the producer project or
/// the consumer project).
typedef MonitoringDestination = $MonitoringDestination;
/// OAuth scopes are a way to define data and permissions on data.
///
/// For example, there are scopes defined for "Read-only access to Google
/// Calendar" and "Access to Cloud Platform". Users can consent to a scope for
/// an application, giving it permission to access that data on their behalf.
/// OAuth scope specifications should be fairly coarse grained; a user will need
/// to see and understand the text description of what your scope means. In most
/// cases: use one or at most two OAuth scopes for an entire family of products.
/// If your product has multiple APIs, you should probably be sharing the OAuth
/// scope across all of those APIs. When you need finer grained OAuth consent
/// screens: talk with your product management about how developers will use
/// them in practice. Please note that even though each of the canonical scopes
/// is enough for a request to be accepted and passed to the backend, a request
/// can still fail due to the backend requiring additional scopes or
/// permissions.
typedef OAuthRequirements = $OAuthRequirements;
/// 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,
};
}
}
/// A protocol buffer option, which can be attached to a message, field,
/// enumeration, etc.
///
/// New usages of this message as an alternative to FileOptions, MessageOptions,
/// FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or
/// MethodOptions are strongly discouraged.
typedef Option = $Option;
/// Represents a documentation page.
///
/// A page can contain subpages to represent nested documentation set structure.
class Page {
/// The Markdown content of the page.
///
/// You can use ```(== include {path} ==)``` to include content from a
/// Markdown file. The content can be used to produce the documentation page
/// such as HTML format page.
core.String? content;
/// The name of the page.
///
/// It will be used as an identity of the page to generate URI of the page,
/// text of the link to this page in navigation, etc. The full page name
/// (start from the root page name to this page concatenated with `.`) can be
/// used as reference to the page in your documentation. For example: pages: -
/// name: Tutorial content: (== include tutorial.md ==) subpages: - name: Java
/// content: (== include tutorial_java.md ==) You can reference `Java` page
/// using Markdown reference link syntax: `Java`.
core.String? name;
/// Subpages of this page.
///
/// The order of subpages specified here will be honored in the generated
/// docset.
core.List<Page>? subpages;
Page({this.content, this.name, this.subpages});
Page.fromJson(core.Map json_)
: this(
content: json_['content'] as core.String?,
name: json_['name'] as core.String?,
subpages: (json_['subpages'] as core.List?)
?.map(
(value) =>
Page.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final content = this.content;
final name = this.name;
final subpages = this.subpages;
return {'content': ?content, 'name': ?name, 'subpages': ?subpages};
}
}
/// Quota configuration helps to achieve fairness and budgeting in service
/// usage.
///
/// The metric based quota configuration works this way: - The service
/// configuration defines a set of metrics. - For API calls, the
/// quota.metric_rules maps methods to metrics with corresponding costs. - The
/// quota.limits defines limits on the metrics, which will be used for quota
/// checks at runtime. An example quota configuration in yaml format: quota:
/// limits: - name: apiWriteQpsPerProject metric:
/// library.googleapis.com/write_calls unit: "1/min/{project}" # rate limit for
/// consumer projects values: STANDARD: 10000 (The metric rules bind all methods
/// to the read_calls metric, except for the UpdateBook and DeleteBook methods.
/// These two methods are mapped to the write_calls metric, with the UpdateBook
/// method consuming at twice rate as the DeleteBook method.) metric_rules: -
/// selector: "*" metric_costs: library.googleapis.com/read_calls: 1 - selector:
/// google.example.library.v1.LibraryService.UpdateBook metric_costs:
/// library.googleapis.com/write_calls: 2 - selector:
/// google.example.library.v1.LibraryService.DeleteBook metric_costs:
/// library.googleapis.com/write_calls: 1 Corresponding Metric definition:
/// metrics: - name: library.googleapis.com/read_calls display_name: Read
/// requests metric_kind: DELTA value_type: INT64 - name:
/// library.googleapis.com/write_calls display_name: Write requests metric_kind:
/// DELTA value_type: INT64
class Quota {
/// List of QuotaLimit definitions for the service.
core.List<QuotaLimit>? limits;
/// List of MetricRule definitions, each one mapping a selected method to one
/// or more metrics.
core.List<MetricRule>? metricRules;
Quota({this.limits, this.metricRules});
Quota.fromJson(core.Map json_)
: this(
limits: (json_['limits'] as core.List?)
?.map(
(value) => QuotaLimit.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
metricRules: (json_['metricRules'] as core.List?)
?.map(
(value) => MetricRule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final limits = this.limits;
final metricRules = this.metricRules;
return {'limits': ?limits, 'metricRules': ?metricRules};
}
}
/// `QuotaLimit` defines a specific limit that applies over a specified duration
/// for a limit type.
///
/// There can be at most one limit for a duration and limit type combination
/// defined within a `QuotaGroup`.
typedef QuotaLimit = $QuotaLimit;
/// `SourceContext` represents information about the source of a protobuf
/// element, like the file in which it is defined.
typedef SourceContext = $SourceContext;
/// 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;
/// Configuration controlling usage of a service.
class Usage {
/// The full resource name of a channel used for sending notifications to the
/// service producer.
///
/// Google Service Management currently only supports
/// [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
/// channel. To use Google Cloud Pub/Sub as the channel, this must be the name
/// of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
/// documented in https://cloud.google.com/pubsub/docs/overview.
core.String? producerNotificationChannel;
/// Requirements that must be satisfied before a consumer project can use the
/// service.
///
/// Each requirement is of the form /; for example
/// 'serviceusage.googleapis.com/billing-enabled'. For Google APIs, a Terms of
/// Service requirement must be included here. Google Cloud APIs must include
/// "serviceusage.googleapis.com/tos/cloud". Other Google APIs should include
/// "serviceusage.googleapis.com/tos/universal". Additional ToS can be
/// included based on the business needs.
core.List<core.String>? requirements;
/// A list of usage rules that apply to individual API methods.
///
/// **NOTE:** All service configuration rules follow "last one wins" order.
core.List<UsageRule>? rules;
Usage({this.producerNotificationChannel, this.requirements, this.rules});
Usage.fromJson(core.Map json_)
: this(
producerNotificationChannel:
json_['producerNotificationChannel'] as core.String?,
requirements: (json_['requirements'] as core.List?)
?.map((value) => value as core.String)
.toList(),
rules: (json_['rules'] as core.List?)
?.map(
(value) => UsageRule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final producerNotificationChannel = this.producerNotificationChannel;
final requirements = this.requirements;
final rules = this.rules;
return {
'producerNotificationChannel': ?producerNotificationChannel,
'requirements': ?requirements,
'rules': ?rules,
};
}
}
/// Usage configuration rules for the service.
typedef UsageRule = $UsageRule;