blob: 232ce853f5b06f140d73244529371a56aaa71106 [file]
// This is a generated file (see the discoveryapis_generator project).
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: file_names
// ignore_for_file: library_names
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_expression_function_bodies
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_string_interpolations
/// API Gateway API - v1
///
/// For more information, see <https://cloud.google.com/api-gateway/docs>
///
/// Create an instance of [ApigatewayApi_1] to access these resources:
///
/// - [ProjectsResource]
/// - [ProjectsLocationsResource]
/// - [ProjectsLocationsApisResource]
/// - [ProjectsLocationsApisConfigsResource]
/// - [ProjectsLocationsGatewaysResource]
/// - [ProjectsLocationsOperationsResource]
library apigateway.v1;
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 '../src/user_agent.dart';
export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
show ApiRequestError, DetailedApiRequestError;
class ApigatewayApi_1 {
/// See, edit, configure, and delete your Google Cloud Platform data
static const cloudPlatformScope =
'https://www.googleapis.com/auth/cloud-platform';
final commons.ApiRequester _requester;
ProjectsResource get projects => ProjectsResource(_requester);
ApigatewayApi_1(http.Client client,
{core.String rootUrl = 'https://apigateway.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);
ProjectsLocationsGatewaysResource get gateways =>
ProjectsLocationsGatewaysResource(_requester);
ProjectsLocationsOperationsResource get operations =>
ProjectsLocationsOperationsResource(_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 [ApigatewayLocation].
///
/// 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<ApigatewayLocation> get(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayLocation.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 [ApigatewayListLocationsResponse].
///
/// 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<ApigatewayListLocationsResponse> 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>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name') + '/locations';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayListLocationsResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsApisResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisConfigsResource get configs =>
ProjectsLocationsApisConfigsResource(_requester);
ProjectsLocationsApisResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new Api in a given project and location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the API, of the form: `projects /
/// * /locations/global`
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [apiId] - Required. Identifier to assign to the API. Must be unique within
/// scope of the parent resource.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> create(
ApigatewayApi request,
core.String parent, {
core.String? apiId,
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if (apiId != null) 'apiId': [apiId],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/apis';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Deletes a single Api.
///
/// Request parameters:
///
/// [name] - Required. Resource name of the form: `projects / *
/// /locations/global/apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> delete(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'DELETE',
queryParams: _queryParams,
);
return ApigatewayOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Gets details of a single Api.
///
/// Request parameters:
///
/// [name] - Required. Resource name of the form: `projects / *
/// /locations/global/apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayApi].
///
/// 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<ApigatewayApi> get(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayApi.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The policy format version to
/// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid
/// value will be rejected. Requests for policies with any conditional
/// bindings must specify version 3. Policies without any conditional bindings
/// may specify any valid value 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).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayPolicy].
///
/// 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<ApigatewayPolicy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if (options_requestedPolicyVersion != null)
'options.requestedPolicyVersion': ['${options_requestedPolicyVersion}'],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayPolicy.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Lists Apis in a given project and location.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the API, of the form: `projects /
/// * /locations/global`
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Filter.
///
/// [orderBy] - Order by parameters.
///
/// [pageSize] - Page size.
///
/// [pageToken] - Page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayListApisResponse].
///
/// 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<ApigatewayListApisResponse> 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>>{
if (filter != null) 'filter': [filter],
if (orderBy != null) 'orderBy': [orderBy],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/apis';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayListApisResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Updates the parameters of a single Api.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Resource name of the API. Format:
/// projects/{project}/locations/global/apis/{api}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [updateMask] - Field mask is used to specify the fields to be overwritten
/// in the Api resource by the update. The fields specified in the update_mask
/// are relative to the resource, not the full request. A field will be
/// overwritten if it is in the mask. If the user does not provide a mask then
/// all fields will be overwritten.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> patch(
ApigatewayApi request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'PATCH',
body: _body,
queryParams: _queryParams,
);
return ApigatewayOperation.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 the operation documentation 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 [ApigatewayPolicy].
///
/// 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<ApigatewayPolicy> setIamPolicy(
ApigatewaySetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayPolicy.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 the operation documentation 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 [ApigatewayTestIamPermissionsResponse].
///
/// 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<ApigatewayTestIamPermissionsResponse> testIamPermissions(
ApigatewayTestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayTestIamPermissionsResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsApisConfigsResource {
final commons.ApiRequester _requester;
ProjectsLocationsApisConfigsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new ApiConfig in a given project and location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the API Config, of the form:
/// `projects / * /locations/global/apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [apiConfigId] - Required. Identifier to assign to the API Config. Must be
/// unique within scope of the parent resource.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> create(
ApigatewayApiConfig request,
core.String parent, {
core.String? apiConfigId,
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if (apiConfigId != null) 'apiConfigId': [apiConfigId],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/configs';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Deletes a single ApiConfig.
///
/// Request parameters:
///
/// [name] - Required. Resource name of the form: `projects / *
/// /locations/global/apis / * /configs / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/configs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> delete(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'DELETE',
queryParams: _queryParams,
);
return ApigatewayOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Gets details of a single ApiConfig.
///
/// Request parameters:
///
/// [name] - Required. Resource name of the form: `projects / *
/// /locations/global/apis / * /configs / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/configs/\[^/\]+$`.
///
/// [view] - Specifies which fields of the API Config are returned in the
/// response. Defaults to `BASIC` view.
/// Possible string values are:
/// - "CONFIG_VIEW_UNSPECIFIED"
/// - "BASIC" : Do not include configuration source files.
/// - "FULL" : Include configuration source files.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayApiConfig].
///
/// 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<ApigatewayApiConfig> get(
core.String name, {
core.String? view,
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayApiConfig.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/configs/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The policy format version to
/// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid
/// value will be rejected. Requests for policies with any conditional
/// bindings must specify version 3. Policies without any conditional bindings
/// may specify any valid value 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).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayPolicy].
///
/// 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<ApigatewayPolicy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if (options_requestedPolicyVersion != null)
'options.requestedPolicyVersion': ['${options_requestedPolicyVersion}'],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayPolicy.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Lists ApiConfigs in a given project and location.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the API Config, of the form:
/// `projects / * /locations/global/apis / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+$`.
///
/// [filter] - Filter.
///
/// [orderBy] - Order by parameters.
///
/// [pageSize] - Page size.
///
/// [pageToken] - Page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayListApiConfigsResponse].
///
/// 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<ApigatewayListApiConfigsResponse> 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>>{
if (filter != null) 'filter': [filter],
if (orderBy != null) 'orderBy': [orderBy],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/configs';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayListApiConfigsResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Updates the parameters of a single ApiConfig.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Resource name of the API Config. Format:
/// projects/{project}/locations/global/apis/{api}/configs/{api_config}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/configs/\[^/\]+$`.
///
/// [updateMask] - Field mask is used to specify the fields to be overwritten
/// in the ApiConfig resource by the update. The fields specified in the
/// update_mask are relative to the resource, not the full request. A field
/// will be overwritten if it is in the mask. If the user does not provide a
/// mask then all fields will be overwritten.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> patch(
ApigatewayApiConfig request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'PATCH',
body: _body,
queryParams: _queryParams,
);
return ApigatewayOperation.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/configs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayPolicy].
///
/// 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<ApigatewayPolicy> setIamPolicy(
ApigatewaySetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayPolicy.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/apis/\[^/\]+/configs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayTestIamPermissionsResponse].
///
/// 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<ApigatewayTestIamPermissionsResponse> testIamPermissions(
ApigatewayTestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayTestIamPermissionsResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsGatewaysResource {
final commons.ApiRequester _requester;
ProjectsLocationsGatewaysResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new Gateway in a given project and location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the Gateway, of the form:
/// `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [gatewayId] - Required. Identifier to assign to the Gateway. Must be
/// unique within scope of the parent resource.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> create(
ApigatewayGateway request,
core.String parent, {
core.String? gatewayId,
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if (gatewayId != null) 'gatewayId': [gatewayId],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/gateways';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Deletes a single Gateway.
///
/// Request parameters:
///
/// [name] - Required. Resource name of the form: `projects / * /locations / *
/// /gateways / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/gateways/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> delete(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'DELETE',
queryParams: _queryParams,
);
return ApigatewayOperation.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Gets details of a single Gateway.
///
/// Request parameters:
///
/// [name] - Required. Resource name of the form: `projects / * /locations / *
/// /gateways / * `
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/gateways/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayGateway].
///
/// 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<ApigatewayGateway> get(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayGateway.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/gateways/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The policy format version to
/// be returned. Valid values are 0, 1, and 3. Requests specifying an invalid
/// value will be rejected. Requests for policies with any conditional
/// bindings must specify version 3. Policies without any conditional bindings
/// may specify any valid value 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).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayPolicy].
///
/// 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<ApigatewayPolicy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if (options_requestedPolicyVersion != null)
'options.requestedPolicyVersion': ['${options_requestedPolicyVersion}'],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayPolicy.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Lists Gateways in a given project and location.
///
/// Request parameters:
///
/// [parent] - Required. Parent resource of the Gateway, of the form:
/// `projects / * /locations / * `
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Filter.
///
/// [orderBy] - Order by parameters.
///
/// [pageSize] - Page size.
///
/// [pageToken] - Page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayListGatewaysResponse].
///
/// 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<ApigatewayListGatewaysResponse> 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>>{
if (filter != null) 'filter': [filter],
if (orderBy != null) 'orderBy': [orderBy],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$parent') + '/gateways';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayListGatewaysResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
/// Updates the parameters of a single Gateway.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Output only. Resource name of the Gateway. Format:
/// projects/{project}/locations/{location}/gateways/{gateway}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/gateways/\[^/\]+$`.
///
/// [updateMask] - Field mask is used to specify the fields to be overwritten
/// in the Gateway resource by the update. The fields specified in the
/// update_mask are relative to the resource, not the full request. A field
/// will be overwritten if it is in the mask. If the user does not provide a
/// mask then all fields will be overwritten.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayOperation].
///
/// 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<ApigatewayOperation> patch(
ApigatewayGateway request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'PATCH',
body: _body,
queryParams: _queryParams,
);
return ApigatewayOperation.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/gateways/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayPolicy].
///
/// 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<ApigatewayPolicy> setIamPolicy(
ApigatewaySetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayPolicy.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 the operation documentation for the appropriate value for
/// this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/gateways/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ApigatewayTestIamPermissionsResponse].
///
/// 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<ApigatewayTestIamPermissionsResponse> testIamPermissions(
ApigatewayTestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return ApigatewayTestIamPermissionsResponse.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(
ApigatewayCancelOperationRequest request,
core.String name, {
core.String? $fields,
}) async {
final _body = convert.json.encode(request.toJson());
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$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>>{
if ($fields != null) 'fields': [$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 [ApigatewayOperation].
///
/// 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<ApigatewayOperation> get(
core.String name, {
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name');
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayOperation.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`.
/// NOTE: the `name` binding allows API services to override the binding to
/// use different resource name schemes, such as `users / * /operations`. To
/// override the binding, API services can add a binding such as
/// `"/v1/{name=users / * }/operations"` to their service configuration. For
/// backwards compatibility, the default name includes the operations
/// collection id, however overriding users must ensure the name binding is
/// the parent resource, without the operations collection id.
///
/// 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 [ApigatewayListOperationsResponse].
///
/// 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<ApigatewayListOperationsResponse> 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>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final _url = 'v1/' + core.Uri.encodeFull('$name') + '/operations';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return ApigatewayListOperationsResponse.fromJson(
_response as core.Map<core.String, core.dynamic>);
}
}
/// An API that can be served by one or more Gateways.
class ApigatewayApi {
/// Created time.
///
/// Output only.
core.String? createTime;
/// Display name.
///
/// Optional.
core.String? displayName;
/// Resource labels to represent user-provided metadata.
///
/// Refer to cloud documentation on labels for more details.
/// https://cloud.google.com/compute/docs/labeling-resources
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// The name of a Google Managed Service (
/// https://cloud.google.com/service-infrastructure/docs/glossary#managed).
///
/// If not specified, a new Service will automatically be created in the same
/// project as this API.
///
/// Optional. Immutable.
core.String? managedService;
/// Resource name of the API.
///
/// Format: projects/{project}/locations/global/apis/{api}
///
/// Output only.
core.String? name;
/// State of the API.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : API does not have a state yet.
/// - "CREATING" : API is being created.
/// - "ACTIVE" : API is active.
/// - "FAILED" : API creation failed.
/// - "DELETING" : API is being deleted.
/// - "UPDATING" : API is being updated.
core.String? state;
/// Updated time.
///
/// Output only.
core.String? updateTime;
ApigatewayApi();
ApigatewayApi.fromJson(core.Map _json) {
if (_json.containsKey('createTime')) {
createTime = _json['createTime'] as core.String;
}
if (_json.containsKey('displayName')) {
displayName = _json['displayName'] as core.String;
}
if (_json.containsKey('labels')) {
labels = (_json['labels'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.String,
),
);
}
if (_json.containsKey('managedService')) {
managedService = _json['managedService'] as core.String;
}
if (_json.containsKey('name')) {
name = _json['name'] as core.String;
}
if (_json.containsKey('state')) {
state = _json['state'] as core.String;
}
if (_json.containsKey('updateTime')) {
updateTime = _json['updateTime'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (createTime != null) 'createTime': createTime!,
if (displayName != null) 'displayName': displayName!,
if (labels != null) 'labels': labels!,
if (managedService != null) 'managedService': managedService!,
if (name != null) 'name': name!,
if (state != null) 'state': state!,
if (updateTime != null) 'updateTime': updateTime!,
};
}
/// An API Configuration is a combination of settings for both the Managed
/// Service and Gateways serving this API Config.
class ApigatewayApiConfig {
/// Created time.
///
/// Output only.
core.String? createTime;
/// Display name.
///
/// Optional.
core.String? displayName;
/// The Google Cloud IAM Service Account that Gateways serving this config
/// should use to authenticate to other services.
///
/// This may either be the Service Account's email
/// (`{ACCOUNT_ID}@{PROJECT}.iam.gserviceaccount.com`) or its full resource
/// name (`projects/{PROJECT}/accounts/{UNIQUE_ID}`). This is most often used
/// when the service is a GCP resource such as a Cloud Run Service or an
/// IAP-secured service.
///
/// Immutable.
core.String? gatewayServiceAccount;
/// gRPC service definition files.
///
/// If specified, openapi_documents must not be included.
///
/// Optional.
core.List<ApigatewayApiConfigGrpcServiceDefinition>? grpcServices;
/// Resource labels to represent user-provided metadata.
///
/// Refer to cloud documentation on labels for more details.
/// https://cloud.google.com/compute/docs/labeling-resources
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Service Configuration files.
///
/// At least one must be included when using gRPC service definitions. See
/// https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview
/// for the expected file contents. If multiple files are specified, the files
/// are merged with the following rules: * All singular scalar fields are
/// merged using "last one wins" semantics in the order of the files uploaded.
/// * Repeated fields are concatenated. * Singular embedded messages are
/// merged using these rules for nested fields.
///
/// Optional.
core.List<ApigatewayApiConfigFile>? managedServiceConfigs;
/// Resource name of the API Config.
///
/// Format:
/// projects/{project}/locations/global/apis/{api}/configs/{api_config}
///
/// Output only.
core.String? name;
/// OpenAPI specification documents.
///
/// If specified, grpc_services and managed_service_configs must not be
/// included.
///
/// Optional.
core.List<ApigatewayApiConfigOpenApiDocument>? openapiDocuments;
/// The ID of the associated Service Config (
/// https://cloud.google.com/service-infrastructure/docs/glossary#config).
///
/// Output only.
core.String? serviceConfigId;
/// State of the API Config.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : API Config does not have a state yet.
/// - "CREATING" : API Config is being created and deployed to the API
/// Controller.
/// - "ACTIVE" : API Config is ready for use by Gateways.
/// - "FAILED" : API Config creation failed.
/// - "DELETING" : API Config is being deleted.
/// - "UPDATING" : API Config is being updated.
/// - "ACTIVATING" : API Config settings are being activated in downstream
/// systems. API Configs in this state cannot be used by Gateways.
core.String? state;
/// Updated time.
///
/// Output only.
core.String? updateTime;
ApigatewayApiConfig();
ApigatewayApiConfig.fromJson(core.Map _json) {
if (_json.containsKey('createTime')) {
createTime = _json['createTime'] as core.String;
}
if (_json.containsKey('displayName')) {
displayName = _json['displayName'] as core.String;
}
if (_json.containsKey('gatewayServiceAccount')) {
gatewayServiceAccount = _json['gatewayServiceAccount'] as core.String;
}
if (_json.containsKey('grpcServices')) {
grpcServices = (_json['grpcServices'] as core.List)
.map<ApigatewayApiConfigGrpcServiceDefinition>((value) =>
ApigatewayApiConfigGrpcServiceDefinition.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('labels')) {
labels = (_json['labels'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.String,
),
);
}
if (_json.containsKey('managedServiceConfigs')) {
managedServiceConfigs = (_json['managedServiceConfigs'] as core.List)
.map<ApigatewayApiConfigFile>((value) =>
ApigatewayApiConfigFile.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('name')) {
name = _json['name'] as core.String;
}
if (_json.containsKey('openapiDocuments')) {
openapiDocuments = (_json['openapiDocuments'] as core.List)
.map<ApigatewayApiConfigOpenApiDocument>((value) =>
ApigatewayApiConfigOpenApiDocument.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('serviceConfigId')) {
serviceConfigId = _json['serviceConfigId'] as core.String;
}
if (_json.containsKey('state')) {
state = _json['state'] as core.String;
}
if (_json.containsKey('updateTime')) {
updateTime = _json['updateTime'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (createTime != null) 'createTime': createTime!,
if (displayName != null) 'displayName': displayName!,
if (gatewayServiceAccount != null)
'gatewayServiceAccount': gatewayServiceAccount!,
if (grpcServices != null)
'grpcServices': grpcServices!.map((value) => value.toJson()).toList(),
if (labels != null) 'labels': labels!,
if (managedServiceConfigs != null)
'managedServiceConfigs':
managedServiceConfigs!.map((value) => value.toJson()).toList(),
if (name != null) 'name': name!,
if (openapiDocuments != null)
'openapiDocuments':
openapiDocuments!.map((value) => value.toJson()).toList(),
if (serviceConfigId != null) 'serviceConfigId': serviceConfigId!,
if (state != null) 'state': state!,
if (updateTime != null) 'updateTime': updateTime!,
};
}
/// A lightweight description of a file.
class ApigatewayApiConfigFile {
/// The bytes that constitute the file.
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('+', '-');
}
/// The file path (full or relative path).
///
/// This is typically the path of the file when it is uploaded.
core.String? path;
ApigatewayApiConfigFile();
ApigatewayApiConfigFile.fromJson(core.Map _json) {
if (_json.containsKey('contents')) {
contents = _json['contents'] as core.String;
}
if (_json.containsKey('path')) {
path = _json['path'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (contents != null) 'contents': contents!,
if (path != null) 'path': path!,
};
}
/// A gRPC service definition.
class ApigatewayApiConfigGrpcServiceDefinition {
/// Input only.
///
/// File descriptor set, generated by protoc. To generate, use protoc with
/// imports and source info included. For an example test.proto file, the
/// following command would put the value in a new file named out.pb. $ protoc
/// --include_imports --include_source_info test.proto -o out.pb
ApigatewayApiConfigFile? fileDescriptorSet;
/// Uncompiled proto files associated with the descriptor set, used for
/// display purposes (server-side compilation is not supported).
///
/// These should match the inputs to 'protoc' command used to generate
/// file_descriptor_set.
///
/// Optional.
core.List<ApigatewayApiConfigFile>? source;
ApigatewayApiConfigGrpcServiceDefinition();
ApigatewayApiConfigGrpcServiceDefinition.fromJson(core.Map _json) {
if (_json.containsKey('fileDescriptorSet')) {
fileDescriptorSet = ApigatewayApiConfigFile.fromJson(
_json['fileDescriptorSet'] as core.Map<core.String, core.dynamic>);
}
if (_json.containsKey('source')) {
source = (_json['source'] as core.List)
.map<ApigatewayApiConfigFile>((value) =>
ApigatewayApiConfigFile.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (fileDescriptorSet != null)
'fileDescriptorSet': fileDescriptorSet!.toJson(),
if (source != null)
'source': source!.map((value) => value.toJson()).toList(),
};
}
/// An OpenAPI Specification Document describing an API.
class ApigatewayApiConfigOpenApiDocument {
/// The OpenAPI Specification document file.
ApigatewayApiConfigFile? document;
ApigatewayApiConfigOpenApiDocument();
ApigatewayApiConfigOpenApiDocument.fromJson(core.Map _json) {
if (_json.containsKey('document')) {
document = ApigatewayApiConfigFile.fromJson(
_json['document'] as core.Map<core.String, core.dynamic>);
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (document != null) 'document': document!.toJson(),
};
}
/// Specifies the audit configuration for a service.
///
/// The configuration determines which permission types are logged, and what
/// identities, if any, are exempted from logging. An AuditConfig must have one
/// or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
/// and a specific service, the union of the two AuditConfigs is used for that
/// service: the log_types specified in each AuditConfig are enabled, and the
/// exempted_members in each AuditLogConfig are exempted. Example Policy with
/// multiple AuditConfigs: { "audit_configs": \[ { "service": "allServices",
/// "audit_log_configs": \[ { "log_type": "DATA_READ", "exempted_members": \[
/// "user:jose@example.com" \] }, { "log_type": "DATA_WRITE" }, { "log_type":
/// "ADMIN_READ" } \] }, { "service": "sampleservice.googleapis.com",
/// "audit_log_configs": \[ { "log_type": "DATA_READ" }, { "log_type":
/// "DATA_WRITE", "exempted_members": \[ "user:aliya@example.com" \] } \] } \] }
/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
/// logging. It also exempts jose@example.com from DATA_READ logging, and
/// aliya@example.com from DATA_WRITE logging.
class ApigatewayAuditConfig {
/// The configuration for logging of each type of permission.
core.List<ApigatewayAuditLogConfig>? auditLogConfigs;
/// Specifies a service that will be enabled for audit logging.
///
/// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
/// `allServices` is a special value that covers all services.
core.String? service;
ApigatewayAuditConfig();
ApigatewayAuditConfig.fromJson(core.Map _json) {
if (_json.containsKey('auditLogConfigs')) {
auditLogConfigs = (_json['auditLogConfigs'] as core.List)
.map<ApigatewayAuditLogConfig>((value) =>
ApigatewayAuditLogConfig.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('service')) {
service = _json['service'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (auditLogConfigs != null)
'auditLogConfigs':
auditLogConfigs!.map((value) => value.toJson()).toList(),
if (service != null) 'service': service!,
};
}
/// Provides the configuration for logging a type of permissions.
///
/// Example: { "audit_log_configs": \[ { "log_type": "DATA_READ",
/// "exempted_members": \[ "user:jose@example.com" \] }, { "log_type":
/// "DATA_WRITE" } \] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
/// exempting jose@example.com from DATA_READ logging.
class ApigatewayAuditLogConfig {
/// Specifies the identities that do not cause logging for this type of
/// permission.
///
/// Follows the same format of Binding.members.
core.List<core.String>? exemptedMembers;
/// The log type that this config enables.
/// Possible string values are:
/// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this.
/// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy
/// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create
/// - "DATA_READ" : Data reads. Example: CloudSQL Users list
core.String? logType;
ApigatewayAuditLogConfig();
ApigatewayAuditLogConfig.fromJson(core.Map _json) {
if (_json.containsKey('exemptedMembers')) {
exemptedMembers = (_json['exemptedMembers'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
if (_json.containsKey('logType')) {
logType = _json['logType'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (exemptedMembers != null) 'exemptedMembers': exemptedMembers!,
if (logType != null) 'logType': logType!,
};
}
/// Associates `members` with a `role`.
class ApigatewayBinding {
/// 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 members 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).
ApigatewayExpr? condition;
/// Specifies the identities requesting access for a Cloud Platform 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. * `user:{emailid}`: An email address that represents a specific
/// Google account. For example, `alice@example.com` . *
/// `serviceAccount:{emailid}`: An email address that represents a service
/// account. For example, `my-other-app@appspot.gserviceaccount.com`. *
/// `group:{emailid}`: An email address that represents a Google group. For
/// example, `admins@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. * `domain:{domain}`: The G Suite domain (primary)
/// that represents all the users of that domain. For example, `google.com` or
/// `example.com`.
core.List<core.String>? members;
/// Role that is assigned to `members`.
///
/// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
core.String? role;
ApigatewayBinding();
ApigatewayBinding.fromJson(core.Map _json) {
if (_json.containsKey('condition')) {
condition = ApigatewayExpr.fromJson(
_json['condition'] as core.Map<core.String, core.dynamic>);
}
if (_json.containsKey('members')) {
members = (_json['members'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
if (_json.containsKey('role')) {
role = _json['role'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (condition != null) 'condition': condition!.toJson(),
if (members != null) 'members': members!,
if (role != null) 'role': role!,
};
}
/// The request message for Operations.CancelOperation.
class ApigatewayCancelOperationRequest {
ApigatewayCancelOperationRequest();
ApigatewayCancelOperationRequest.fromJson(
// ignore: avoid_unused_constructor_parameters
core.Map _json);
core.Map<core.String, core.dynamic> toJson() => {};
}
/// 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.
class ApigatewayExpr {
/// Description of the expression.
///
/// This is a longer text which describes the expression, e.g. when hovered
/// over it in a UI.
///
/// Optional.
core.String? description;
/// Textual representation of an expression in Common Expression Language
/// syntax.
core.String? expression;
/// String indicating the location of the expression for error reporting, e.g.
/// a file name and a position in the file.
///
/// Optional.
core.String? location;
/// Title for the expression, i.e. a short string describing its purpose.
///
/// This can be used e.g. in UIs which allow to enter the expression.
///
/// Optional.
core.String? title;
ApigatewayExpr();
ApigatewayExpr.fromJson(core.Map _json) {
if (_json.containsKey('description')) {
description = _json['description'] as core.String;
}
if (_json.containsKey('expression')) {
expression = _json['expression'] as core.String;
}
if (_json.containsKey('location')) {
location = _json['location'] as core.String;
}
if (_json.containsKey('title')) {
title = _json['title'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (description != null) 'description': description!,
if (expression != null) 'expression': expression!,
if (location != null) 'location': location!,
if (title != null) 'title': title!,
};
}
/// A Gateway is an API-aware HTTP proxy.
///
/// It performs API-Method and/or API-Consumer specific actions based on an API
/// Config such as authentication, policy enforcement, and backend selection.
class ApigatewayGateway {
/// Resource name of the API Config for this Gateway.
///
/// Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}
///
/// Required.
core.String? apiConfig;
/// Created time.
///
/// Output only.
core.String? createTime;
/// The default API Gateway host name of the form
/// `{gateway_id}-{hash}.{region_code}.gateway.dev`.
///
/// Output only.
core.String? defaultHostname;
/// Display name.
///
/// Optional.
core.String? displayName;
/// Resource labels to represent user-provided metadata.
///
/// Refer to cloud documentation on labels for more details.
/// https://cloud.google.com/compute/docs/labeling-resources
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Resource name of the Gateway.
///
/// Format: projects/{project}/locations/{location}/gateways/{gateway}
///
/// Output only.
core.String? name;
/// The current state of the Gateway.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : Gateway does not have a state yet.
/// - "CREATING" : Gateway is being created.
/// - "ACTIVE" : Gateway is running and ready for requests.
/// - "FAILED" : Gateway creation failed.
/// - "DELETING" : Gateway is being deleted.
/// - "UPDATING" : Gateway is being updated.
core.String? state;
/// Updated time.
///
/// Output only.
core.String? updateTime;
ApigatewayGateway();
ApigatewayGateway.fromJson(core.Map _json) {
if (_json.containsKey('apiConfig')) {
apiConfig = _json['apiConfig'] as core.String;
}
if (_json.containsKey('createTime')) {
createTime = _json['createTime'] as core.String;
}
if (_json.containsKey('defaultHostname')) {
defaultHostname = _json['defaultHostname'] as core.String;
}
if (_json.containsKey('displayName')) {
displayName = _json['displayName'] as core.String;
}
if (_json.containsKey('labels')) {
labels = (_json['labels'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.String,
),
);
}
if (_json.containsKey('name')) {
name = _json['name'] as core.String;
}
if (_json.containsKey('state')) {
state = _json['state'] as core.String;
}
if (_json.containsKey('updateTime')) {
updateTime = _json['updateTime'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (apiConfig != null) 'apiConfig': apiConfig!,
if (createTime != null) 'createTime': createTime!,
if (defaultHostname != null) 'defaultHostname': defaultHostname!,
if (displayName != null) 'displayName': displayName!,
if (labels != null) 'labels': labels!,
if (name != null) 'name': name!,
if (state != null) 'state': state!,
if (updateTime != null) 'updateTime': updateTime!,
};
}
/// Response message for ApiGatewayService.ListApiConfigs
class ApigatewayListApiConfigsResponse {
/// API Configs.
core.List<ApigatewayApiConfig>? apiConfigs;
/// Next page token.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachableLocations;
ApigatewayListApiConfigsResponse();
ApigatewayListApiConfigsResponse.fromJson(core.Map _json) {
if (_json.containsKey('apiConfigs')) {
apiConfigs = (_json['apiConfigs'] as core.List)
.map<ApigatewayApiConfig>((value) => ApigatewayApiConfig.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('nextPageToken')) {
nextPageToken = _json['nextPageToken'] as core.String;
}
if (_json.containsKey('unreachableLocations')) {
unreachableLocations = (_json['unreachableLocations'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (apiConfigs != null)
'apiConfigs': apiConfigs!.map((value) => value.toJson()).toList(),
if (nextPageToken != null) 'nextPageToken': nextPageToken!,
if (unreachableLocations != null)
'unreachableLocations': unreachableLocations!,
};
}
/// Response message for ApiGatewayService.ListApis
class ApigatewayListApisResponse {
/// APIs.
core.List<ApigatewayApi>? apis;
/// Next page token.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachableLocations;
ApigatewayListApisResponse();
ApigatewayListApisResponse.fromJson(core.Map _json) {
if (_json.containsKey('apis')) {
apis = (_json['apis'] as core.List)
.map<ApigatewayApi>((value) => ApigatewayApi.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('nextPageToken')) {
nextPageToken = _json['nextPageToken'] as core.String;
}
if (_json.containsKey('unreachableLocations')) {
unreachableLocations = (_json['unreachableLocations'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (apis != null) 'apis': apis!.map((value) => value.toJson()).toList(),
if (nextPageToken != null) 'nextPageToken': nextPageToken!,
if (unreachableLocations != null)
'unreachableLocations': unreachableLocations!,
};
}
/// Response message for ApiGatewayService.ListGateways
class ApigatewayListGatewaysResponse {
/// Gateways.
core.List<ApigatewayGateway>? gateways;
/// Next page token.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachableLocations;
ApigatewayListGatewaysResponse();
ApigatewayListGatewaysResponse.fromJson(core.Map _json) {
if (_json.containsKey('gateways')) {
gateways = (_json['gateways'] as core.List)
.map<ApigatewayGateway>((value) => ApigatewayGateway.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('nextPageToken')) {
nextPageToken = _json['nextPageToken'] as core.String;
}
if (_json.containsKey('unreachableLocations')) {
unreachableLocations = (_json['unreachableLocations'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (gateways != null)
'gateways': gateways!.map((value) => value.toJson()).toList(),
if (nextPageToken != null) 'nextPageToken': nextPageToken!,
if (unreachableLocations != null)
'unreachableLocations': unreachableLocations!,
};
}
/// The response message for Locations.ListLocations.
class ApigatewayListLocationsResponse {
/// A list of locations that matches the specified filter in the request.
core.List<ApigatewayLocation>? locations;
/// The standard List next-page token.
core.String? nextPageToken;
ApigatewayListLocationsResponse();
ApigatewayListLocationsResponse.fromJson(core.Map _json) {
if (_json.containsKey('locations')) {
locations = (_json['locations'] as core.List)
.map<ApigatewayLocation>((value) => ApigatewayLocation.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('nextPageToken')) {
nextPageToken = _json['nextPageToken'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (locations != null)
'locations': locations!.map((value) => value.toJson()).toList(),
if (nextPageToken != null) 'nextPageToken': nextPageToken!,
};
}
/// The response message for Operations.ListOperations.
class ApigatewayListOperationsResponse {
/// The standard List next-page token.
core.String? nextPageToken;
/// A list of operations that matches the specified filter in the request.
core.List<ApigatewayOperation>? operations;
ApigatewayListOperationsResponse();
ApigatewayListOperationsResponse.fromJson(core.Map _json) {
if (_json.containsKey('nextPageToken')) {
nextPageToken = _json['nextPageToken'] as core.String;
}
if (_json.containsKey('operations')) {
operations = (_json['operations'] as core.List)
.map<ApigatewayOperation>((value) => ApigatewayOperation.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (nextPageToken != null) 'nextPageToken': nextPageToken!,
if (operations != null)
'operations': operations!.map((value) => value.toJson()).toList(),
};
}
/// A resource that represents Google Cloud Platform location.
class ApigatewayLocation {
/// The friendly name for this location, typically a nearby city name.
///
/// For example, "Tokyo".
core.String? displayName;
/// Cross-service attributes for the location.
///
/// For example {"cloud.googleapis.com/region": "us-east1"}
core.Map<core.String, core.String>? labels;
/// The canonical id for this location.
///
/// For example: `"us-east1"`.
core.String? locationId;
/// Service-specific metadata.
///
/// For example the available capacity at the given location.
///
/// 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;
/// Resource name for the location, which may vary between implementations.
///
/// For example: `"projects/example-project/locations/us-east1"`
core.String? name;
ApigatewayLocation();
ApigatewayLocation.fromJson(core.Map _json) {
if (_json.containsKey('displayName')) {
displayName = _json['displayName'] as core.String;
}
if (_json.containsKey('labels')) {
labels = (_json['labels'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.String,
),
);
}
if (_json.containsKey('locationId')) {
locationId = _json['locationId'] as core.String;
}
if (_json.containsKey('metadata')) {
metadata = (_json['metadata'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.Object,
),
);
}
if (_json.containsKey('name')) {
name = _json['name'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (displayName != null) 'displayName': displayName!,
if (labels != null) 'labels': labels!,
if (locationId != null) 'locationId': locationId!,
if (metadata != null) 'metadata': metadata!,
if (name != null) 'name': name!,
};
}
/// This resource represents a long-running operation that is the result of a
/// network API call.
class ApigatewayOperation {
/// 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.
ApigatewayStatus? 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 response of the operation in case of success.
///
/// 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;
ApigatewayOperation();
ApigatewayOperation.fromJson(core.Map _json) {
if (_json.containsKey('done')) {
done = _json['done'] as core.bool;
}
if (_json.containsKey('error')) {
error = ApigatewayStatus.fromJson(
_json['error'] as core.Map<core.String, core.dynamic>);
}
if (_json.containsKey('metadata')) {
metadata = (_json['metadata'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.Object,
),
);
}
if (_json.containsKey('name')) {
name = _json['name'] as core.String;
}
if (_json.containsKey('response')) {
response = (_json['response'] as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.Object,
),
);
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (done != null) 'done': done!,
if (error != null) 'error': error!.toJson(),
if (metadata != null) 'metadata': metadata!,
if (name != null) 'name': name!,
if (response != null) 'response': response!,
};
}
/// Represents the metadata of the long-running operation.
class ApigatewayOperationMetadata {
/// API version used to start the operation.
///
/// Output only.
core.String? apiVersion;
/// The time the operation was created.
///
/// Output only.
core.String? createTime;
/// Diagnostics generated during processing of configuration source files.
///
/// Output only.
core.List<ApigatewayOperationMetadataDiagnostic>? diagnostics;
/// The time the operation finished running.
///
/// Output only.
core.String? endTime;
/// Identifies whether the user has requested cancellation of the operation.
///
/// Operations that have successfully been cancelled have Operation.error
/// value with a google.rpc.Status.code of 1, corresponding to
/// `Code.CANCELLED`.
///
/// Output only.
core.bool? requestedCancellation;
/// Human-readable status of the operation, if any.
///
/// Output only.
core.String? statusMessage;
/// Server-defined resource path for the target of the operation.
///
/// Output only.
core.String? target;
/// Name of the verb executed by the operation.
///
/// Output only.
core.String? verb;
ApigatewayOperationMetadata();
ApigatewayOperationMetadata.fromJson(core.Map _json) {
if (_json.containsKey('apiVersion')) {
apiVersion = _json['apiVersion'] as core.String;
}
if (_json.containsKey('createTime')) {
createTime = _json['createTime'] as core.String;
}
if (_json.containsKey('diagnostics')) {
diagnostics = (_json['diagnostics'] as core.List)
.map<ApigatewayOperationMetadataDiagnostic>((value) =>
ApigatewayOperationMetadataDiagnostic.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('endTime')) {
endTime = _json['endTime'] as core.String;
}
if (_json.containsKey('requestedCancellation')) {
requestedCancellation = _json['requestedCancellation'] as core.bool;
}
if (_json.containsKey('statusMessage')) {
statusMessage = _json['statusMessage'] as core.String;
}
if (_json.containsKey('target')) {
target = _json['target'] as core.String;
}
if (_json.containsKey('verb')) {
verb = _json['verb'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (apiVersion != null) 'apiVersion': apiVersion!,
if (createTime != null) 'createTime': createTime!,
if (diagnostics != null)
'diagnostics': diagnostics!.map((value) => value.toJson()).toList(),
if (endTime != null) 'endTime': endTime!,
if (requestedCancellation != null)
'requestedCancellation': requestedCancellation!,
if (statusMessage != null) 'statusMessage': statusMessage!,
if (target != null) 'target': target!,
if (verb != null) 'verb': verb!,
};
}
/// Diagnostic information from configuration processing.
class ApigatewayOperationMetadataDiagnostic {
/// Location of the diagnostic.
core.String? location;
/// The diagnostic message.
core.String? message;
ApigatewayOperationMetadataDiagnostic();
ApigatewayOperationMetadataDiagnostic.fromJson(core.Map _json) {
if (_json.containsKey('location')) {
location = _json['location'] as core.String;
}
if (_json.containsKey('message')) {
message = _json['message'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (location != null) 'location': location!,
if (message != null) 'message': message!,
};
}
/// 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` to a single `role`. Members 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 ApigatewayPolicy {
/// Specifies cloud audit logging configuration for this policy.
core.List<ApigatewayAuditConfig>? auditConfigs;
/// Associates a list of `members` to 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
/// member.
core.List<ApigatewayBinding>? 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;
ApigatewayPolicy();
ApigatewayPolicy.fromJson(core.Map _json) {
if (_json.containsKey('auditConfigs')) {
auditConfigs = (_json['auditConfigs'] as core.List)
.map<ApigatewayAuditConfig>((value) => ApigatewayAuditConfig.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('bindings')) {
bindings = (_json['bindings'] as core.List)
.map<ApigatewayBinding>((value) => ApigatewayBinding.fromJson(
value as core.Map<core.String, core.dynamic>))
.toList();
}
if (_json.containsKey('etag')) {
etag = _json['etag'] as core.String;
}
if (_json.containsKey('version')) {
version = _json['version'] as core.int;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (auditConfigs != null)
'auditConfigs': auditConfigs!.map((value) => value.toJson()).toList(),
if (bindings != null)
'bindings': bindings!.map((value) => value.toJson()).toList(),
if (etag != null) 'etag': etag!,
if (version != null) 'version': version!,
};
}
/// Request message for `SetIamPolicy` method.
class ApigatewaySetIamPolicyRequest {
/// 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 Cloud Platform services (such as Projects) might
/// reject them.
ApigatewayPolicy? policy;
/// OPTIONAL: A FieldMask specifying which fields of the policy to modify.
///
/// Only the fields in the mask will be modified. If no mask is provided, the
/// following default mask is used: `paths: "bindings, etag"`
core.String? updateMask;
ApigatewaySetIamPolicyRequest();
ApigatewaySetIamPolicyRequest.fromJson(core.Map _json) {
if (_json.containsKey('policy')) {
policy = ApigatewayPolicy.fromJson(
_json['policy'] as core.Map<core.String, core.dynamic>);
}
if (_json.containsKey('updateMask')) {
updateMask = _json['updateMask'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (policy != null) 'policy': policy!.toJson(),
if (updateMask != null) 'updateMask': updateMask!,
};
}
/// 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).
class ApigatewayStatus {
/// The status code, which should be an enum value of google.rpc.Code.
core.int? code;
/// A list of messages that carry the error details.
///
/// There is a common set of message types for APIs to use.
///
/// 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.List<core.Map<core.String, core.Object>>? details;
/// A developer-facing error message, which should be in English.
///
/// Any user-facing error message should be localized and sent in the
/// google.rpc.Status.details field, or localized by the client.
core.String? message;
ApigatewayStatus();
ApigatewayStatus.fromJson(core.Map _json) {
if (_json.containsKey('code')) {
code = _json['code'] as core.int;
}
if (_json.containsKey('details')) {
details = (_json['details'] as core.List)
.map<core.Map<core.String, core.Object>>(
(value) => (value as core.Map<core.String, core.dynamic>).map(
(key, item) => core.MapEntry(
key,
item as core.Object,
),
))
.toList();
}
if (_json.containsKey('message')) {
message = _json['message'] as core.String;
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (code != null) 'code': code!,
if (details != null) 'details': details!,
if (message != null) 'message': message!,
};
}
/// Request message for `TestIamPermissions` method.
class ApigatewayTestIamPermissionsRequest {
/// The set of permissions to check for the `resource`.
///
/// Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
/// For more information see
/// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
core.List<core.String>? permissions;
ApigatewayTestIamPermissionsRequest();
ApigatewayTestIamPermissionsRequest.fromJson(core.Map _json) {
if (_json.containsKey('permissions')) {
permissions = (_json['permissions'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (permissions != null) 'permissions': permissions!,
};
}
/// Response message for `TestIamPermissions` method.
class ApigatewayTestIamPermissionsResponse {
/// A subset of `TestPermissionsRequest.permissions` that the caller is
/// allowed.
core.List<core.String>? permissions;
ApigatewayTestIamPermissionsResponse();
ApigatewayTestIamPermissionsResponse.fromJson(core.Map _json) {
if (_json.containsKey('permissions')) {
permissions = (_json['permissions'] as core.List)
.map<core.String>((value) => value as core.String)
.toList();
}
}
core.Map<core.String, core.dynamic> toJson() => {
if (permissions != null) 'permissions': permissions!,
};
}
/// 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); } The JSON representation for `Empty` is empty JSON
/// object `{}`.
class Empty {
Empty();
Empty.fromJson(
// ignore: avoid_unused_constructor_parameters
core.Map _json);
core.Map<core.String, core.dynamic> toJson() => {};
}