blob: f1ddbc13da06f92acc4b0b08de73003627428e92 [file] [log] [blame] [edit]
// This is a generated file (see the discoveryapis_generator project).
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: doc_directive_unknown
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: unintended_html_in_doc_comment
// ignore_for_file: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_string_interpolations
/// Developer Connect API - v1
///
/// Connect third-party source code management to Google
///
/// For more information, see
/// <http://cloud.google.com/developer-connect/docs/overview>
///
/// Create an instance of [DeveloperConnectApi] to access these resources:
///
/// - [ProjectsResource]
/// - [ProjectsLocationsResource]
/// - [ProjectsLocationsAccountConnectorsResource]
/// - [ProjectsLocationsAccountConnectorsUsersResource]
/// - [ProjectsLocationsConnectionsResource]
/// - [ProjectsLocationsConnectionsGitRepositoryLinksResource]
/// - [ProjectsLocationsInsightsConfigsResource]
/// - [ProjectsLocationsInsightsConfigsDeploymentEventsResource]
/// - [ProjectsLocationsOperationsResource]
library;
import 'dart:async' as async;
import 'dart:convert' as convert;
import 'dart:core' as core;
import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
import 'package:http/http.dart' as http;
import '../shared.dart';
import '../src/user_agent.dart';
export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
show ApiRequestError, DetailedApiRequestError;
/// Connect third-party source code management to Google
class DeveloperConnectApi {
/// See, edit, configure, and delete your Google Cloud data and see the email
/// address for your Google Account.
static const cloudPlatformScope =
'https://www.googleapis.com/auth/cloud-platform';
final commons.ApiRequester _requester;
ProjectsResource get projects => ProjectsResource(_requester);
DeveloperConnectApi(
http.Client client, {
core.String rootUrl = 'https://developerconnect.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;
ProjectsLocationsAccountConnectorsResource get accountConnectors =>
ProjectsLocationsAccountConnectorsResource(_requester);
ProjectsLocationsConnectionsResource get connections =>
ProjectsLocationsConnectionsResource(_requester);
ProjectsLocationsInsightsConfigsResource get insightsConfigs =>
ProjectsLocationsInsightsConfigsResource(_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 [Location].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Location> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Location.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists information about the supported locations for this service.
///
/// This method can be called in two ways: * **List all public locations:**
/// Use the path `GET /v1/locations`. * **List project-visible locations:**
/// Use the path `GET /v1/projects/{project_id}/locations`. This may include
/// public locations as well as private or other locations specifically
/// visible to the project.
///
/// Request parameters:
///
/// [name] - The resource that owns the locations collection, if applicable.
/// Value must have pattern `^projects/\[^/\]+$`.
///
/// [extraLocationTypes] - Optional. Do not use this field. It is unsupported
/// and is ignored unless explicitly documented otherwise. This is primarily
/// for internal usage.
///
/// [filter] - A filter to narrow down results to a preferred subset. The
/// filtering language accepts strings like `"displayName=tokyo"`, and is
/// documented in more detail in \[AIP-160\](https://google.aip.dev/160).
///
/// [pageSize] - The maximum number of results to return. If not set, the
/// service selects a default.
///
/// [pageToken] - A page token received from the `next_page_token` field in
/// the response. Send that page token to receive the subsequent page.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListLocationsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ListLocationsResponse> list(
core.String name, {
core.List<core.String>? extraLocationTypes,
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'extraLocationTypes': ?extraLocationTypes,
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/locations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListLocationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsAccountConnectorsResource {
final commons.ApiRequester _requester;
ProjectsLocationsAccountConnectorsUsersResource get users =>
ProjectsLocationsAccountConnectorsUsersResource(_requester);
ProjectsLocationsAccountConnectorsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new AccountConnector in a given project and location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Location resource name as the account_connector’s
/// parent.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [accountConnectorId] - Required. The ID to use for the AccountConnector,
/// which will become the final component of the AccountConnector's resource
/// name. Its format should adhere to
/// https://google.aip.dev/122#resource-id-segments Names must be unique
/// per-project per-location.
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes since the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> create(
AccountConnector request,
core.String parent, {
core.String? accountConnectorId,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'accountConnectorId': ?accountConnectorId == null
? null
: [accountConnectorId],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/accountConnectors';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a single AccountConnector.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [etag] - Optional. The current etag of the AccountConnectorn. If an etag
/// is provided and does not match the current etag of the AccountConnector,
/// deletion will be blocked and an ABORTED error will be returned.
///
/// [force] - Optional. If set to true, any Users from this AccountConnector
/// will also be deleted. (Otherwise, the request will only work if the
/// AccountConnector has no Users.)
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes after the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? etag,
core.bool? force,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'force': ?force == null ? null : ['${force}'],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets details of a single AccountConnector.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [AccountConnector].
///
/// 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<AccountConnector> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return AccountConnector.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists AccountConnectors in a given project and location.
///
/// Request parameters:
///
/// [parent] - Required. Parent value for ListAccountConnectorsRequest
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Filtering results
///
/// [orderBy] - Optional. Hint for how to order the results
///
/// [pageSize] - Optional. Requested page size. Server may return fewer items
/// than requested. If unspecified, server will pick an appropriate default.
///
/// [pageToken] - Optional. A token identifying a page of results the server
/// should return.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListAccountConnectorsResponse].
///
/// 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<ListAccountConnectorsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/accountConnectors';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListAccountConnectorsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the parameters of a single AccountConnector.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Identifier. The resource name of the accountConnector, in the
/// format
/// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [allowMissing] - Optional. If set to true, and the accountConnector is not
/// found a new accountConnector will be created. In this situation
/// `update_mask` is ignored. The creation will succeed only if the input
/// accountConnector has all the necessary
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes since the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [updateMask] - Optional. The list of fields to be updated.
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> patch(
AccountConnector request,
core.String name, {
core.bool? allowMissing,
core.String? requestId,
core.String? updateMask,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'requestId': ?requestId == null ? null : [requestId],
'updateMask': ?updateMask == null ? null : [updateMask],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsAccountConnectorsUsersResource {
final commons.ApiRequester _requester;
ProjectsLocationsAccountConnectorsUsersResource(commons.ApiRequester client)
: _requester = client;
/// Deletes a single User.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+/users/\[^/\]+$`.
///
/// [etag] - Optional. This checksum is computed by the server based on the
/// value of other fields, and may be sent on update and delete requests to
/// ensure the client has an up-to-date value before proceeding.
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes after the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? etag,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Delete the User based on the user credentials.
///
/// Request parameters:
///
/// [name] - Required. Name of the AccountConnector resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> deleteSelf(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/users:deleteSelf';
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Fetches OAuth access token based on end user credentials.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [accountConnector] - Required. The resource name of the AccountConnector
/// in the format `projects / * /locations / * /accountConnectors / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FetchAccessTokenResponse].
///
/// 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<FetchAccessTokenResponse> fetchAccessToken(
FetchAccessTokenRequest request,
core.String accountConnector, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$accountConnector') +
'/users:fetchAccessToken';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return FetchAccessTokenResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Fetch the User based on the user credentials.
///
/// Request parameters:
///
/// [name] - Required. Name of the AccountConnector resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [User].
///
/// 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<User> fetchSelf(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/users:fetchSelf';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return User.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Finishes OAuth flow for an account connector.
///
/// Request parameters:
///
/// [accountConnector] - Required. The resource name of the AccountConnector
/// in the format `projects / * /locations / * /accountConnectors / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [googleOauthParams_scopes] - Required. The scopes returned by Google OAuth
/// flow.
///
/// [googleOauthParams_ticket] - Required. The ticket to be used for post
/// processing the callback from Google OAuth flow.
///
/// [googleOauthParams_versionInfo] - Optional. The version info returned by
/// Google OAuth flow.
///
/// [oauthParams_code] - Required. The code to be used for getting the token
/// from SCM provider.
///
/// [oauthParams_ticket] - Required. The ticket to be used for post processing
/// the callback from SCM provider.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FinishOAuthResponse].
///
/// 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<FinishOAuthResponse> finishOAuthFlow(
core.String accountConnector, {
core.List<core.String>? googleOauthParams_scopes,
core.String? googleOauthParams_ticket,
core.String? googleOauthParams_versionInfo,
core.String? oauthParams_code,
core.String? oauthParams_ticket,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'googleOauthParams.scopes': ?googleOauthParams_scopes,
'googleOauthParams.ticket': ?googleOauthParams_ticket == null
? null
: [googleOauthParams_ticket],
'googleOauthParams.versionInfo': ?googleOauthParams_versionInfo == null
? null
: [googleOauthParams_versionInfo],
'oauthParams.code': ?oauthParams_code == null ? null : [oauthParams_code],
'oauthParams.ticket': ?oauthParams_ticket == null
? null
: [oauthParams_ticket],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$accountConnector') +
'/users:finishOAuthFlow';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FinishOAuthResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists Users in a given project, location, and account_connector.
///
/// Request parameters:
///
/// [parent] - Required. Parent value for ListUsersRequest
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [filter] - Optional. Filtering results
///
/// [orderBy] - Optional. Hint for how to order the results
///
/// [pageSize] - Optional. Requested page size. Server may return fewer items
/// than requested. If unspecified, server will pick an appropriate default.
///
/// [pageToken] - Optional. A token identifying a page of results the server
/// should return.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListUsersResponse].
///
/// 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<ListUsersResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/users';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListUsersResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Starts OAuth flow for an account connector.
///
/// Request parameters:
///
/// [accountConnector] - Required. The resource name of the AccountConnector
/// in the format `projects / * /locations / * /accountConnectors / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [StartOAuthResponse].
///
/// 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<StartOAuthResponse> startOAuthFlow(
core.String accountConnector, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$accountConnector') +
'/users:startOAuthFlow';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return StartOAuthResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsConnectionsResource {
final commons.ApiRequester _requester;
ProjectsLocationsConnectionsGitRepositoryLinksResource
get gitRepositoryLinks =>
ProjectsLocationsConnectionsGitRepositoryLinksResource(_requester);
ProjectsLocationsConnectionsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new Connection in a given project and location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Value for parent.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [connectionId] - Required. Id of the requesting object If auto-generating
/// Id server-side, remove this field and connection_id from the
/// method_signature of Create RPC
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes since the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> create(
Connection request,
core.String parent, {
core.String? connectionId,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'connectionId': ?connectionId == null ? null : [connectionId],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/connections';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a single Connection.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [etag] - Optional. The current etag of the Connection. If an etag is
/// provided and does not match the current etag of the Connection, deletion
/// will be blocked and an ABORTED error will be returned.
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes after the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? etag,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// FetchGitHubInstallations returns the list of GitHub Installations that are
/// available to be added to a Connection.
///
/// For github.com, only installations accessible to the authorizer token are
/// returned. For GitHub Enterprise, all installations are returned.
///
/// Request parameters:
///
/// [connection] - Required. The resource name of the connection in the format
/// `projects / * /locations / * /connections / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FetchGitHubInstallationsResponse].
///
/// 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<FetchGitHubInstallationsResponse> fetchGitHubInstallations(
core.String connection, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$connection') +
':fetchGitHubInstallations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FetchGitHubInstallationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// FetchLinkableGitRepositories returns a list of git repositories from an
/// SCM that are available to be added to a Connection.
///
/// Request parameters:
///
/// [connection] - Required. The name of the Connection. Format: `projects / *
/// /locations / * /connections / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [pageSize] - Optional. Number of results to return in the list. Defaults
/// to 20.
///
/// [pageToken] - Optional. Page start.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FetchLinkableGitRepositoriesResponse].
///
/// 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<FetchLinkableGitRepositoriesResponse>
fetchLinkableGitRepositories(
core.String connection, {
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$connection') +
':fetchLinkableGitRepositories';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FetchLinkableGitRepositoriesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets details of a single Connection.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Connection].
///
/// 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<Connection> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Connection.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists Connections in a given project and location.
///
/// Request parameters:
///
/// [parent] - Required. Parent value for ListConnectionsRequest
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Filtering results
///
/// [orderBy] - Optional. Hint for how to order the results
///
/// [pageSize] - Optional. Requested page size. Server may return fewer items
/// than requested. If unspecified, server will pick an appropriate default.
///
/// [pageToken] - Optional. A token identifying a page of results the server
/// should return.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListConnectionsResponse].
///
/// 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<ListConnectionsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/connections';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListConnectionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the parameters of a single Connection.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Identifier. The resource name of the connection, in the format
/// `projects/{project}/locations/{location}/connections/{connection_id}`.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [allowMissing] - Optional. If set to true, and the connection is not found
/// a new connection will be created. In this situation `update_mask` is
/// ignored. The creation will succeed only if the input connection has all
/// the necessary information (e.g a github_config with both user_oauth_token
/// and installation_id properties).
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes since the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [updateMask] - Required. Field mask is used to specify the fields to be
/// overwritten in the Connection 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.
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> patch(
Connection request,
core.String name, {
core.bool? allowMissing,
core.String? requestId,
core.String? updateMask,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'requestId': ?requestId == null ? null : [requestId],
'updateMask': ?updateMask == null ? null : [updateMask],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// ProcessGitHubEnterpriseWebhook is called by the external GitHub Enterprise
/// instances for notifying events.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Project and location where the webhook will be
/// received. Format: `projects / * /locations / * `.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [$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> processGitHubEnterpriseWebhook(
ProcessGitHubEnterpriseWebhookRequest request,
core.String parent, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$parent') +
'/connections:processGitHubEnterpriseWebhook';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsConnectionsGitRepositoryLinksResource {
final commons.ApiRequester _requester;
ProjectsLocationsConnectionsGitRepositoryLinksResource(
commons.ApiRequester client,
) : _requester = client;
/// Creates a GitRepositoryLink.
///
/// Upon linking a Git Repository, Developer Connect will configure the Git
/// Repository to send webhook events to Developer Connect. Connections that
/// use Firebase GitHub Application will have events forwarded to the Firebase
/// service. Connections that use Gemini Code Assist will have events
/// forwarded to Gemini Code Assist service. All other Connections will have
/// events forwarded to Cloud Build.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Value for parent.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [gitRepositoryLinkId] - Required. The ID to use for the repository, which
/// will become the final component of the repository's resource name. This ID
/// should be unique in the connection. Allows alphanumeric characters and any
/// of -._~%!$&'()*+,;=@.
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes since the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> create(
GitRepositoryLink request,
core.String parent, {
core.String? gitRepositoryLinkId,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'gitRepositoryLinkId': ?gitRepositoryLinkId == null
? null
: [gitRepositoryLinkId],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/gitRepositoryLinks';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a single GitRepositoryLink.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [etag] - Optional. This checksum is computed by the server based on the
/// value of other fields, and may be sent on update and delete requests to
/// ensure the client has an up-to-date value before proceeding.
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes after the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? etag,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Fetch the list of branches or tags for a given repository.
///
/// Request parameters:
///
/// [gitRepositoryLink] - Required. The resource name of GitRepositoryLink in
/// the format `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [pageSize] - Optional. Number of results to return in the list. Default to
/// 20.
///
/// [pageToken] - Optional. Page start.
///
/// [refType] - Required. Type of refs to fetch.
/// Possible string values are:
/// - "REF_TYPE_UNSPECIFIED" : No type specified.
/// - "TAG" : To fetch tags.
/// - "BRANCH" : To fetch branches.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FetchGitRefsResponse].
///
/// 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<FetchGitRefsResponse> fetchGitRefs(
core.String gitRepositoryLink, {
core.int? pageSize,
core.String? pageToken,
core.String? refType,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'refType': ?refType == null ? null : [refType],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$gitRepositoryLink') + ':fetchGitRefs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FetchGitRefsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Fetches read token of a given gitRepositoryLink.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [gitRepositoryLink] - Required. The resource name of the gitRepositoryLink
/// in the format `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FetchReadTokenResponse].
///
/// 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<FetchReadTokenResponse> fetchReadToken(
FetchReadTokenRequest request,
core.String gitRepositoryLink, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$gitRepositoryLink') + ':fetchReadToken';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return FetchReadTokenResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Fetches read/write token of a given gitRepositoryLink.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [gitRepositoryLink] - Required. The resource name of the gitRepositoryLink
/// in the format `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FetchReadWriteTokenResponse].
///
/// 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<FetchReadWriteTokenResponse> fetchReadWriteToken(
FetchReadWriteTokenRequest request,
core.String gitRepositoryLink, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$gitRepositoryLink') +
':fetchReadWriteToken';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return FetchReadWriteTokenResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets details of a single GitRepositoryLink.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GitRepositoryLink].
///
/// 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<GitRepositoryLink> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GitRepositoryLink.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists GitRepositoryLinks in a given project, location, and connection.
///
/// Request parameters:
///
/// [parent] - Required. Parent value for ListGitRepositoryLinksRequest
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+$`.
///
/// [filter] - Optional. Filtering results
///
/// [orderBy] - Optional. Hint for how to order the results
///
/// [pageSize] - Optional. Requested page size. Server may return fewer items
/// than requested. If unspecified, server will pick an appropriate default.
///
/// [pageToken] - Optional. A token identifying a page of results the server
/// should return.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListGitRepositoryLinksResponse].
///
/// 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<ListGitRepositoryLinksResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/gitRepositoryLinks';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListGitRepositoryLinksResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// ProcessBitbucketCloudWebhook is called by the external Bitbucket Cloud
/// instances for notifying events.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The GitRepositoryLink where the webhook will be
/// received. Format: `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$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> processBitbucketCloudWebhook(
ProcessBitbucketCloudWebhookRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$name') + ':processBitbucketCloudWebhook';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// ProcessBitbucketDataCenterWebhook is called by the external Bitbucket Data
/// Center instances for notifying events.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The GitRepositoryLink where the webhook will be
/// received. Format: `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$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> processBitbucketDataCenterWebhook(
ProcessBitbucketDataCenterWebhookRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$name') +
':processBitbucketDataCenterWebhook';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// ProcessGitLabEnterpriseWebhook is called by the external GitLab Enterprise
/// instances for notifying events.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The GitRepositoryLink resource where the webhook will
/// be received. Format: `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$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> processGitLabEnterpriseWebhook(
ProcessGitLabEnterpriseWebhookRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$name') +
':processGitLabEnterpriseWebhook';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// ProcessGitLabWebhook is called by the GitLab.com for notifying events.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Required. The GitRepositoryLink resource where the webhook will
/// be received. Format: `projects / * /locations / * /connections / *
/// /gitRepositoryLinks / * `.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/gitRepositoryLinks/\[^/\]+$`.
///
/// [$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> processGitLabWebhook(
ProcessGitLabWebhookRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':processGitLabWebhook';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsInsightsConfigsResource {
final commons.ApiRequester _requester;
ProjectsLocationsInsightsConfigsDeploymentEventsResource
get deploymentEvents =>
ProjectsLocationsInsightsConfigsDeploymentEventsResource(_requester);
ProjectsLocationsInsightsConfigsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a new InsightsConfig in a given project and location.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. Value for parent.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [insightsConfigId] - Required. ID of the requesting InsightsConfig.
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> create(
InsightsConfig request,
core.String parent, {
core.String? insightsConfigId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'insightsConfigId': ?insightsConfigId == null ? null : [insightsConfigId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/insightsConfigs';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a single Insight.
///
/// Request parameters:
///
/// [name] - Required. Value for parent.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/insightsConfigs/\[^/\]+$`.
///
/// [etag] - Optional. This checksum is computed by the server based on the
/// value of other fields, and may be sent on update and delete requests to
/// ensure the client has an up-to-date value before proceeding.
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes after the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? etag,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'etag': ?etag == null ? null : [etag],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets details of a single Insight.
///
/// Request parameters:
///
/// [name] - Required. Name of the resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/insightsConfigs/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [InsightsConfig].
///
/// 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<InsightsConfig> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return InsightsConfig.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists InsightsConfigs in a given project and location.
///
/// Request parameters:
///
/// [parent] - Required. Parent value for ListInsightsConfigsRequest.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. Filtering results. See https://google.aip.dev/160 for
/// more details. Filter string, adhering to the rules in
/// https://google.aip.dev/160. List only InsightsConfigs matching the filter.
/// If filter is empty, all InsightsConfigs are listed.
///
/// [orderBy] - Optional. Hint for how to order the results.
///
/// [pageSize] - Optional. Requested page size. Server may return fewer items
/// than requested. If unspecified, server will pick an appropriate default.
///
/// [pageToken] - Optional. A token identifying a page of results the server
/// should return.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListInsightsConfigsResponse].
///
/// 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<ListInsightsConfigsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/insightsConfigs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListInsightsConfigsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the parameters of a single InsightsConfig.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Identifier. The name of the InsightsConfig. Format:
/// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/insightsConfigs/\[^/\]+$`.
///
/// [allowMissing] - Optional. If set to true, and the insightsConfig is not
/// found a new insightsConfig will be created. In this situation
/// `update_mask` is ignored. The creation will succeed only if the input
/// insightsConfig has all the necessary information (e.g a github_config with
/// both user_oauth_token and installation_id properties).
///
/// [requestId] - Optional. An optional request ID to identify requests.
/// Specify a unique request ID so that if you must retry your request, the
/// server will know to ignore the request if it has already been completed.
/// The server will guarantee that for at least 60 minutes after the first
/// request. For example, consider a situation where you make an initial
/// request and the request times out. If you make the request again with the
/// same request ID, the server can check if original operation with the same
/// request ID was received, and if so, will ignore the second request. This
/// prevents clients from accidentally creating duplicate commitments. The
/// request ID must be a valid UUID with the exception that zero UUID is not
/// supported (00000000-0000-0000-0000-000000000000).
///
/// [validateOnly] - Optional. If set, validate the request, but do not
/// actually post it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> patch(
InsightsConfig request,
core.String name, {
core.bool? allowMissing,
core.String? requestId,
core.bool? validateOnly,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'allowMissing': ?allowMissing == null ? null : ['${allowMissing}'],
'requestId': ?requestId == null ? null : [requestId],
'validateOnly': ?validateOnly == null ? null : ['${validateOnly}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsInsightsConfigsDeploymentEventsResource {
final commons.ApiRequester _requester;
ProjectsLocationsInsightsConfigsDeploymentEventsResource(
commons.ApiRequester client,
) : _requester = client;
/// Gets a single Deployment Event.
///
/// Request parameters:
///
/// [name] - Required. The name of the deployment event to retrieve. Format:
/// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/insightsConfigs/\[^/\]+/deploymentEvents/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [DeploymentEvent].
///
/// 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<DeploymentEvent> get(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return DeploymentEvent.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists Deployment Events in a given insights config.
///
/// Request parameters:
///
/// [parent] - Required. The parent insights config that owns this collection
/// of deployment events. Format:
/// projects/{project}/locations/{location}/insightsConfigs/{insights_config}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/insightsConfigs/\[^/\]+$`.
///
/// [filter] - Optional. Filter expression that matches a subset of the
/// DeploymentEvents. https://google.aip.dev/160.
///
/// [pageSize] - Optional. The maximum number of deployment events to return.
/// The service may return fewer than this value. If unspecified, at most 50
/// deployment events will be returned. The maximum value is 1000; values
/// above 1000 will be coerced to 1000.
///
/// [pageToken] - Optional. A page token, received from a previous
/// `ListDeploymentEvents` call. Provide this to retrieve the subsequent page.
/// When paginating, all other parameters provided to `ListDeploymentEvents`
/// must match the call that provided the page token.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListDeploymentEventsResponse].
///
/// 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<ListDeploymentEventsResponse> list(
core.String parent, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/deploymentEvents';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListDeploymentEventsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsOperationsResource {
final commons.ApiRequester _requester;
ProjectsLocationsOperationsResource(commons.ApiRequester client)
: _requester = client;
/// Starts asynchronous cancellation on a long-running operation.
///
/// The server makes a best effort to cancel the operation, but success is not
/// guaranteed. If the server doesn't support this method, it returns
/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation
/// or other methods to check whether the cancellation succeeded or whether
/// the operation completed despite cancellation. On successful cancellation,
/// the operation is not deleted; instead, it becomes an operation with an
/// Operation.error value with a google.rpc.Status.code of `1`, corresponding
/// to `Code.CANCELLED`.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the operation resource to be cancelled.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Empty].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Empty> cancel(
CancelOperationRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':cancel';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a long-running operation.
///
/// This method indicates that the client is no longer interested in the
/// operation result. It does not cancel the operation. If the server doesn't
/// support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
///
/// Request parameters:
///
/// [name] - The name of the operation resource to be deleted.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Empty].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Empty> delete(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets the latest state of a long-running operation.
///
/// Clients can use this method to poll the operation result at intervals as
/// recommended by the API service.
///
/// Request parameters:
///
/// [name] - The name of the operation resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/operations/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> get(core.String name, {core.String? $fields}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists operations that match the specified filter in the request.
///
/// If the server doesn't support this method, it returns `UNIMPLEMENTED`.
///
/// Request parameters:
///
/// [name] - The name of the operation's parent resource.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - The standard list filter.
///
/// [pageSize] - The standard list page size.
///
/// [pageToken] - The standard list page token.
///
/// [returnPartialSuccess] - When set to `true`, operations that are reachable
/// are returned as normal, and those that are unreachable are returned in the
/// ListOperationsResponse.unreachable field. This can only be `true` when
/// reading across collections. For example, when `parent` is set to
/// `"projects/example/locations/-"`. This field is not supported by default
/// and will result in an `UNIMPLEMENTED` error if set unless explicitly
/// documented otherwise in service or product specific documentation.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListOperationsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ListOperationsResponse> list(
core.String name, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.bool? returnPartialSuccess,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'returnPartialSuccess': ?returnPartialSuccess == null
? null
: ['${returnPartialSuccess}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/operations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListOperationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
/// AccountConnector encapsulates what a platform administrator needs to
/// configure for users to connect to the service providers, which includes,
/// among other fields, the OAuth client ID, client secret, and authorization
/// and token endpoints.
class AccountConnector {
/// Allows users to store small amounts of arbitrary data.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// The timestamp when the accountConnector was created.
///
/// Output only.
core.String? createTime;
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the client
/// has an up-to-date value before proceeding.
///
/// Optional.
core.String? etag;
/// Labels as key value pairs
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The resource name of the accountConnector, in the format
/// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
core.String? name;
/// Start OAuth flow by clicking on this URL.
///
/// Output only.
core.String? oauthStartUri;
/// Provider OAuth config.
///
/// Optional.
ProviderOAuthConfig? providerOauthConfig;
/// The timestamp when the accountConnector was updated.
///
/// Output only.
core.String? updateTime;
AccountConnector({
this.annotations,
this.createTime,
this.etag,
this.labels,
this.name,
this.oauthStartUri,
this.providerOauthConfig,
this.updateTime,
});
AccountConnector.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
createTime: json_['createTime'] as core.String?,
etag: json_['etag'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
oauthStartUri: json_['oauthStartUri'] as core.String?,
providerOauthConfig: json_.containsKey('providerOauthConfig')
? ProviderOAuthConfig.fromJson(
json_['providerOauthConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final createTime = this.createTime;
final etag = this.etag;
final labels = this.labels;
final name = this.name;
final oauthStartUri = this.oauthStartUri;
final providerOauthConfig = this.providerOauthConfig;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'createTime': ?createTime,
'etag': ?etag,
'labels': ?labels,
'name': ?name,
'oauthStartUri': ?oauthStartUri,
'providerOauthConfig': ?providerOauthConfig,
'updateTime': ?updateTime,
};
}
}
/// AppHubService represents the App Hub Service.
class AppHubService {
/// The name of the App Hub Service.
///
/// Format:
/// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
///
/// Required. Output only. Immutable.
core.String? apphubService;
/// The criticality of the App Hub Service.
///
/// Output only.
core.String? criticality;
/// The environment of the App Hub Service.
///
/// Output only.
core.String? environment;
AppHubService({this.apphubService, this.criticality, this.environment});
AppHubService.fromJson(core.Map json_)
: this(
apphubService: json_['apphubService'] as core.String?,
criticality: json_['criticality'] as core.String?,
environment: json_['environment'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final apphubService = this.apphubService;
final criticality = this.criticality;
final environment = this.environment;
return {
'apphubService': ?apphubService,
'criticality': ?criticality,
'environment': ?environment,
};
}
}
/// AppHubWorkload represents the App Hub Workload.
class AppHubWorkload {
/// The criticality of the App Hub Workload.
///
/// Output only.
core.String? criticality;
/// The environment of the App Hub Workload.
///
/// Output only.
core.String? environment;
/// The name of the App Hub Workload.
///
/// Format:
/// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
///
/// Required. Output only. Immutable.
core.String? workload;
AppHubWorkload({this.criticality, this.environment, this.workload});
AppHubWorkload.fromJson(core.Map json_)
: this(
criticality: json_['criticality'] as core.String?,
environment: json_['environment'] as core.String?,
workload: json_['workload'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final criticality = this.criticality;
final environment = this.environment;
final workload = this.workload;
return {
'criticality': ?criticality,
'environment': ?environment,
'workload': ?workload,
};
}
}
/// The artifact config of the artifact that is deployed.
class ArtifactConfig {
/// Set if the artifact metadata is stored in Artifact analysis.
///
/// Optional.
GoogleArtifactAnalysis? googleArtifactAnalysis;
/// Set if the artifact is stored in Artifact registry.
///
/// Optional.
GoogleArtifactRegistry? googleArtifactRegistry;
/// The URI of the artifact that is deployed.
///
/// e.g. `us-docker.pkg.dev/my-project/my-repo/image`. The URI does not
/// include the tag / digest because it captures a lineage of artifacts.
///
/// Required. Immutable.
core.String? uri;
ArtifactConfig({
this.googleArtifactAnalysis,
this.googleArtifactRegistry,
this.uri,
});
ArtifactConfig.fromJson(core.Map json_)
: this(
googleArtifactAnalysis: json_.containsKey('googleArtifactAnalysis')
? GoogleArtifactAnalysis.fromJson(
json_['googleArtifactAnalysis']
as core.Map<core.String, core.dynamic>,
)
: null,
googleArtifactRegistry: json_.containsKey('googleArtifactRegistry')
? GoogleArtifactRegistry.fromJson(
json_['googleArtifactRegistry']
as core.Map<core.String, core.dynamic>,
)
: null,
uri: json_['uri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final googleArtifactAnalysis = this.googleArtifactAnalysis;
final googleArtifactRegistry = this.googleArtifactRegistry;
final uri = this.uri;
return {
'googleArtifactAnalysis': ?googleArtifactAnalysis,
'googleArtifactRegistry': ?googleArtifactRegistry,
'uri': ?uri,
};
}
}
/// The ArtifactDeployment resource represents the deployment of the artifact
/// within the InsightsConfig resource.
class ArtifactDeployment {
/// The artifact alias in the deployment spec, with Tag/SHA.
///
/// e.g. us-docker.pkg.dev/my-project/my-repo/image:1.0.0
///
/// Output only.
core.String? artifactAlias;
/// The artifact that is deployed.
///
/// Output only.
core.String? artifactReference;
/// The summary of container status of the artifact deployment.
///
/// Format as `ContainerStatusState-Reason : restartCount` e.g.
/// "Waiting-ImagePullBackOff : 3"
///
/// Output only.
core.String? containerStatusSummary;
/// The time at which the deployment was deployed.
///
/// Output only.
core.String? deployTime;
/// Unique identifier of `ArtifactDeployment`.
///
/// Output only.
core.String? id;
/// The source commits at which this artifact was built.
///
/// Extracted from provenance.
///
/// Output only.
core.List<core.String>? sourceCommitUris;
/// The time at which the deployment was undeployed, all artifacts are
/// considered undeployed once this time is set.
///
/// Output only.
core.String? undeployTime;
ArtifactDeployment({
this.artifactAlias,
this.artifactReference,
this.containerStatusSummary,
this.deployTime,
this.id,
this.sourceCommitUris,
this.undeployTime,
});
ArtifactDeployment.fromJson(core.Map json_)
: this(
artifactAlias: json_['artifactAlias'] as core.String?,
artifactReference: json_['artifactReference'] as core.String?,
containerStatusSummary: json_['containerStatusSummary'] as core.String?,
deployTime: json_['deployTime'] as core.String?,
id: json_['id'] as core.String?,
sourceCommitUris: (json_['sourceCommitUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
undeployTime: json_['undeployTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final artifactAlias = this.artifactAlias;
final artifactReference = this.artifactReference;
final containerStatusSummary = this.containerStatusSummary;
final deployTime = this.deployTime;
final id = this.id;
final sourceCommitUris = this.sourceCommitUris;
final undeployTime = this.undeployTime;
return {
'artifactAlias': ?artifactAlias,
'artifactReference': ?artifactReference,
'containerStatusSummary': ?containerStatusSummary,
'deployTime': ?deployTime,
'id': ?id,
'sourceCommitUris': ?sourceCommitUris,
'undeployTime': ?undeployTime,
};
}
}
/// Basic authentication with username and password.
class BasicAuthentication {
/// The password SecretManager secret version to authenticate as.
core.String? passwordSecretVersion;
/// The username to authenticate as.
///
/// Required.
core.String? username;
BasicAuthentication({this.passwordSecretVersion, this.username});
BasicAuthentication.fromJson(core.Map json_)
: this(
passwordSecretVersion: json_['passwordSecretVersion'] as core.String?,
username: json_['username'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final passwordSecretVersion = this.passwordSecretVersion;
final username = this.username;
return {
'passwordSecretVersion': ?passwordSecretVersion,
'username': ?username,
};
}
}
/// Bearer token authentication with a token.
class BearerTokenAuthentication {
/// The token SecretManager secret version to authenticate as.
///
/// Optional.
core.String? tokenSecretVersion;
BearerTokenAuthentication({this.tokenSecretVersion});
BearerTokenAuthentication.fromJson(core.Map json_)
: this(tokenSecretVersion: json_['tokenSecretVersion'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final tokenSecretVersion = this.tokenSecretVersion;
return {'tokenSecretVersion': ?tokenSecretVersion};
}
}
/// Configuration for connections to an instance of Bitbucket Cloud.
class BitbucketCloudConfig {
/// An access token with the minimum `repository`, `pullrequest` and `webhook`
/// scope access.
///
/// It can either be a workspace, project or repository access token. This is
/// needed to create webhooks. It's recommended to use a system account to
/// generate these credentials.
///
/// Required.
UserCredential? authorizerCredential;
/// An access token with the minimum `repository` access.
///
/// It can either be a workspace, project or repository access token. It's
/// recommended to use a system account to generate the credentials.
///
/// Required.
UserCredential? readAuthorizerCredential;
/// SecretManager resource containing the webhook secret used to verify
/// webhook events, formatted as `projects / * /secrets / * /versions / * ` or
/// `projects / * /locations / * /secrets / * /versions / * ` (if regional
/// secrets are supported in that location).
///
/// This is used to validate and create webhooks.
///
/// Required. Immutable.
core.String? webhookSecretSecretVersion;
/// The Bitbucket Cloud Workspace ID to be connected to Google Cloud Platform.
///
/// Required.
core.String? workspace;
BitbucketCloudConfig({
this.authorizerCredential,
this.readAuthorizerCredential,
this.webhookSecretSecretVersion,
this.workspace,
});
BitbucketCloudConfig.fromJson(core.Map json_)
: this(
authorizerCredential: json_.containsKey('authorizerCredential')
? UserCredential.fromJson(
json_['authorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
readAuthorizerCredential: json_.containsKey('readAuthorizerCredential')
? UserCredential.fromJson(
json_['readAuthorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
webhookSecretSecretVersion:
json_['webhookSecretSecretVersion'] as core.String?,
workspace: json_['workspace'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final authorizerCredential = this.authorizerCredential;
final readAuthorizerCredential = this.readAuthorizerCredential;
final webhookSecretSecretVersion = this.webhookSecretSecretVersion;
final workspace = this.workspace;
return {
'authorizerCredential': ?authorizerCredential,
'readAuthorizerCredential': ?readAuthorizerCredential,
'webhookSecretSecretVersion': ?webhookSecretSecretVersion,
'workspace': ?workspace,
};
}
}
/// Configuration for connections to an instance of Bitbucket Data Center.
class BitbucketDataCenterConfig {
/// An http access token with the minimum `Repository admin` scope access.
///
/// This is needed to create webhooks. It's recommended to use a system
/// account to generate these credentials.
///
/// Required.
UserCredential? authorizerCredential;
/// The URI of the Bitbucket Data Center host this connection is for.
///
/// Required.
core.String? hostUri;
/// An http access token with the minimum `Repository read` access.
///
/// It's recommended to use a system account to generate the credentials.
///
/// Required.
UserCredential? readAuthorizerCredential;
/// Version of the Bitbucket Data Center server running on the `host_uri`.
///
/// Output only.
core.String? serverVersion;
/// Configuration for using Service Directory to privately connect to a
/// Bitbucket Data Center instance.
///
/// This should only be set if the Bitbucket Data Center is hosted on-premises
/// and not reachable by public internet. If this field is left empty, calls
/// to the Bitbucket Data Center will be made over the public internet.
///
/// Optional.
ServiceDirectoryConfig? serviceDirectoryConfig;
/// SSL certificate authority to trust when making requests to Bitbucket Data
/// Center.
///
/// Optional.
core.String? sslCaCertificate;
/// SecretManager resource containing the webhook secret used to verify
/// webhook events, formatted as `projects / * /secrets / * /versions / * ` or
/// `projects / * /locations / * /secrets / * /versions / * ` (if regional
/// secrets are supported in that location).
///
/// This is used to validate webhooks.
///
/// Required. Immutable.
core.String? webhookSecretSecretVersion;
BitbucketDataCenterConfig({
this.authorizerCredential,
this.hostUri,
this.readAuthorizerCredential,
this.serverVersion,
this.serviceDirectoryConfig,
this.sslCaCertificate,
this.webhookSecretSecretVersion,
});
BitbucketDataCenterConfig.fromJson(core.Map json_)
: this(
authorizerCredential: json_.containsKey('authorizerCredential')
? UserCredential.fromJson(
json_['authorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
hostUri: json_['hostUri'] as core.String?,
readAuthorizerCredential: json_.containsKey('readAuthorizerCredential')
? UserCredential.fromJson(
json_['readAuthorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
serverVersion: json_['serverVersion'] as core.String?,
serviceDirectoryConfig: json_.containsKey('serviceDirectoryConfig')
? ServiceDirectoryConfig.fromJson(
json_['serviceDirectoryConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
sslCaCertificate: json_['sslCaCertificate'] as core.String?,
webhookSecretSecretVersion:
json_['webhookSecretSecretVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final authorizerCredential = this.authorizerCredential;
final hostUri = this.hostUri;
final readAuthorizerCredential = this.readAuthorizerCredential;
final serverVersion = this.serverVersion;
final serviceDirectoryConfig = this.serviceDirectoryConfig;
final sslCaCertificate = this.sslCaCertificate;
final webhookSecretSecretVersion = this.webhookSecretSecretVersion;
return {
'authorizerCredential': ?authorizerCredential,
'hostUri': ?hostUri,
'readAuthorizerCredential': ?readAuthorizerCredential,
'serverVersion': ?serverVersion,
'serviceDirectoryConfig': ?serviceDirectoryConfig,
'sslCaCertificate': ?sslCaCertificate,
'webhookSecretSecretVersion': ?webhookSecretSecretVersion,
};
}
}
/// The request message for Operations.CancelOperation.
typedef CancelOperationRequest = $Empty;
/// Message describing Connection object
class Connection {
/// Allows clients to store small amounts of arbitrary data.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// Configuration for connections to an instance of Bitbucket Clouds.
BitbucketCloudConfig? bitbucketCloudConfig;
/// Configuration for connections to an instance of Bitbucket Data Center.
BitbucketDataCenterConfig? bitbucketDataCenterConfig;
/// Create timestamp
///
/// Output only.
core.String? createTime;
/// The crypto key configuration.
///
/// This field is used by the Customer-Managed Encryption Keys (CMEK) feature.
///
/// Optional.
CryptoKeyConfig? cryptoKeyConfig;
/// Delete timestamp
///
/// Output only.
core.String? deleteTime;
/// If disabled is set to true, functionality is disabled for this connection.
///
/// Repository based API methods and webhooks processing for repositories in
/// this connection will be disabled.
///
/// Optional.
core.bool? disabled;
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the client
/// has an up-to-date value before proceeding.
///
/// Optional.
core.String? etag;
/// Configuration for the git proxy feature.
///
/// Enabling the git proxy allows clients to perform git operations on the
/// repositories linked in the connection.
///
/// Optional.
GitProxyConfig? gitProxyConfig;
/// Configuration for connections to github.com.
GitHubConfig? githubConfig;
/// Configuration for connections to an instance of GitHub Enterprise.
GitHubEnterpriseConfig? githubEnterpriseConfig;
/// Configuration for connections to gitlab.com.
GitLabConfig? gitlabConfig;
/// Configuration for connections to an instance of GitLab Enterprise.
GitLabEnterpriseConfig? gitlabEnterpriseConfig;
/// Configuration for connections to an HTTP service provider.
///
/// Optional.
GenericHTTPEndpointConfig? httpConfig;
/// Installation state of the Connection.
///
/// Output only.
InstallationState? installationState;
/// Labels as key value pairs
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The resource name of the connection, in the format
/// `projects/{project}/locations/{location}/connections/{connection_id}`.
core.String? name;
/// Set to true when the connection is being set up or updated in the
/// background.
///
/// Output only.
core.bool? reconciling;
/// Configuration for connections to an instance of Secure Source Manager.
SecureSourceManagerInstanceConfig? secureSourceManagerInstanceConfig;
/// A system-assigned unique identifier for the Connection.
///
/// Output only.
core.String? uid;
/// Update timestamp
///
/// Output only.
core.String? updateTime;
Connection({
this.annotations,
this.bitbucketCloudConfig,
this.bitbucketDataCenterConfig,
this.createTime,
this.cryptoKeyConfig,
this.deleteTime,
this.disabled,
this.etag,
this.gitProxyConfig,
this.githubConfig,
this.githubEnterpriseConfig,
this.gitlabConfig,
this.gitlabEnterpriseConfig,
this.httpConfig,
this.installationState,
this.labels,
this.name,
this.reconciling,
this.secureSourceManagerInstanceConfig,
this.uid,
this.updateTime,
});
Connection.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
bitbucketCloudConfig: json_.containsKey('bitbucketCloudConfig')
? BitbucketCloudConfig.fromJson(
json_['bitbucketCloudConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
bitbucketDataCenterConfig:
json_.containsKey('bitbucketDataCenterConfig')
? BitbucketDataCenterConfig.fromJson(
json_['bitbucketDataCenterConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
createTime: json_['createTime'] as core.String?,
cryptoKeyConfig: json_.containsKey('cryptoKeyConfig')
? CryptoKeyConfig.fromJson(
json_['cryptoKeyConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
deleteTime: json_['deleteTime'] as core.String?,
disabled: json_['disabled'] as core.bool?,
etag: json_['etag'] as core.String?,
gitProxyConfig: json_.containsKey('gitProxyConfig')
? GitProxyConfig.fromJson(
json_['gitProxyConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
githubConfig: json_.containsKey('githubConfig')
? GitHubConfig.fromJson(
json_['githubConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
githubEnterpriseConfig: json_.containsKey('githubEnterpriseConfig')
? GitHubEnterpriseConfig.fromJson(
json_['githubEnterpriseConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
gitlabConfig: json_.containsKey('gitlabConfig')
? GitLabConfig.fromJson(
json_['gitlabConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
gitlabEnterpriseConfig: json_.containsKey('gitlabEnterpriseConfig')
? GitLabEnterpriseConfig.fromJson(
json_['gitlabEnterpriseConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
httpConfig: json_.containsKey('httpConfig')
? GenericHTTPEndpointConfig.fromJson(
json_['httpConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
installationState: json_.containsKey('installationState')
? InstallationState.fromJson(
json_['installationState']
as core.Map<core.String, core.dynamic>,
)
: null,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
reconciling: json_['reconciling'] as core.bool?,
secureSourceManagerInstanceConfig:
json_.containsKey('secureSourceManagerInstanceConfig')
? SecureSourceManagerInstanceConfig.fromJson(
json_['secureSourceManagerInstanceConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final bitbucketCloudConfig = this.bitbucketCloudConfig;
final bitbucketDataCenterConfig = this.bitbucketDataCenterConfig;
final createTime = this.createTime;
final cryptoKeyConfig = this.cryptoKeyConfig;
final deleteTime = this.deleteTime;
final disabled = this.disabled;
final etag = this.etag;
final gitProxyConfig = this.gitProxyConfig;
final githubConfig = this.githubConfig;
final githubEnterpriseConfig = this.githubEnterpriseConfig;
final gitlabConfig = this.gitlabConfig;
final gitlabEnterpriseConfig = this.gitlabEnterpriseConfig;
final httpConfig = this.httpConfig;
final installationState = this.installationState;
final labels = this.labels;
final name = this.name;
final reconciling = this.reconciling;
final secureSourceManagerInstanceConfig =
this.secureSourceManagerInstanceConfig;
final uid = this.uid;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'bitbucketCloudConfig': ?bitbucketCloudConfig,
'bitbucketDataCenterConfig': ?bitbucketDataCenterConfig,
'createTime': ?createTime,
'cryptoKeyConfig': ?cryptoKeyConfig,
'deleteTime': ?deleteTime,
'disabled': ?disabled,
'etag': ?etag,
'gitProxyConfig': ?gitProxyConfig,
'githubConfig': ?githubConfig,
'githubEnterpriseConfig': ?githubEnterpriseConfig,
'gitlabConfig': ?gitlabConfig,
'gitlabEnterpriseConfig': ?gitlabEnterpriseConfig,
'httpConfig': ?httpConfig,
'installationState': ?installationState,
'labels': ?labels,
'name': ?name,
'reconciling': ?reconciling,
'secureSourceManagerInstanceConfig': ?secureSourceManagerInstanceConfig,
'uid': ?uid,
'updateTime': ?updateTime,
};
}
}
/// The crypto key configuration.
///
/// This field is used by the Customer-managed encryption keys (CMEK) feature.
class CryptoKeyConfig {
/// The name of the key which is used to encrypt/decrypt customer data.
///
/// For key in Cloud KMS, the key should be in the format of `projects / *
/// /locations / * /keyRings / * /cryptoKeys / * `.
///
/// Required.
core.String? keyReference;
CryptoKeyConfig({this.keyReference});
CryptoKeyConfig.fromJson(core.Map json_)
: this(keyReference: json_['keyReference'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final keyReference = this.keyReference;
return {'keyReference': ?keyReference};
}
}
/// The DeploymentEvent resource represents the deployment of the artifact
/// within the InsightsConfig resource.
class DeploymentEvent {
/// The artifact deployments of the DeploymentEvent.
///
/// Each artifact deployment contains the artifact uri and the runtime
/// configuration uri. For GKE, this would be all the containers images that
/// are deployed in the pod.
///
/// Output only.
core.List<ArtifactDeployment>? artifactDeployments;
/// The create time of the DeploymentEvent.
///
/// Output only.
core.String? createTime;
/// The time at which the DeploymentEvent was deployed.
///
/// This would be the min of all ArtifactDeployment deploy_times.
///
/// Output only.
core.String? deployTime;
/// Identifier.
///
/// The name of the DeploymentEvent. This name is provided by Developer
/// Connect insights. Format:
/// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
core.String? name;
/// The runtime configurations where the DeploymentEvent happened.
///
/// Output only.
RuntimeConfig? runtimeConfig;
/// The runtime assigned URI of the DeploymentEvent.
///
/// For GKE, this is the fully qualified replica set uri. e.g.
/// container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id}
/// For Cloud Run, this is the revision name.
///
/// Output only.
core.String? runtimeDeploymentUri;
/// The state of the DeploymentEvent.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : No state specified.
/// - "STATE_ACTIVE" : The deployment is active in the runtime.
/// - "STATE_INACTIVE" : The deployment is not in the runtime.
core.String? state;
/// The time at which the DeploymentEvent was undeployed, all artifacts are
/// considered undeployed once this time is set.
///
/// This would be the max of all ArtifactDeployment undeploy_times. If any
/// ArtifactDeployment is still active (i.e. does not have an undeploy_time),
/// this field will be empty.
///
/// Output only.
core.String? undeployTime;
/// The update time of the DeploymentEvent.
///
/// Output only.
core.String? updateTime;
DeploymentEvent({
this.artifactDeployments,
this.createTime,
this.deployTime,
this.name,
this.runtimeConfig,
this.runtimeDeploymentUri,
this.state,
this.undeployTime,
this.updateTime,
});
DeploymentEvent.fromJson(core.Map json_)
: this(
artifactDeployments: (json_['artifactDeployments'] as core.List?)
?.map(
(value) => ArtifactDeployment.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
createTime: json_['createTime'] as core.String?,
deployTime: json_['deployTime'] as core.String?,
name: json_['name'] as core.String?,
runtimeConfig: json_.containsKey('runtimeConfig')
? RuntimeConfig.fromJson(
json_['runtimeConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
runtimeDeploymentUri: json_['runtimeDeploymentUri'] as core.String?,
state: json_['state'] as core.String?,
undeployTime: json_['undeployTime'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final artifactDeployments = this.artifactDeployments;
final createTime = this.createTime;
final deployTime = this.deployTime;
final name = this.name;
final runtimeConfig = this.runtimeConfig;
final runtimeDeploymentUri = this.runtimeDeploymentUri;
final state = this.state;
final undeployTime = this.undeployTime;
final updateTime = this.updateTime;
return {
'artifactDeployments': ?artifactDeployments,
'createTime': ?createTime,
'deployTime': ?deployTime,
'name': ?name,
'runtimeConfig': ?runtimeConfig,
'runtimeDeploymentUri': ?runtimeDeploymentUri,
'state': ?state,
'undeployTime': ?undeployTime,
'updateTime': ?updateTime,
};
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs.
///
/// A typical example is to use it as the request or the response type of an API
/// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns
/// (google.protobuf.Empty); }
typedef Empty = $Empty;
/// Message for representing an error from exchanging OAuth tokens.
class ExchangeError {
/// https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 - error
core.String? code;
/// https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 -
/// error_description
core.String? description;
ExchangeError({this.code, this.description});
ExchangeError.fromJson(core.Map json_)
: this(
code: json_['code'] as core.String?,
description: json_['description'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final code = this.code;
final description = this.description;
return {'code': ?code, 'description': ?description};
}
}
/// Message for fetching an OAuth access token.
typedef FetchAccessTokenRequest = $Empty;
/// Message for responding to getting an OAuth access token.
class FetchAccessTokenResponse {
/// The error resulted from exchanging OAuth tokens from the service provider.
ExchangeError? exchangeError;
/// Expiration timestamp.
///
/// Can be empty if unknown or non-expiring.
core.String? expirationTime;
/// The scopes of the access token.
core.List<core.String>? scopes;
/// The token content.
core.String? token;
FetchAccessTokenResponse({
this.exchangeError,
this.expirationTime,
this.scopes,
this.token,
});
FetchAccessTokenResponse.fromJson(core.Map json_)
: this(
exchangeError: json_.containsKey('exchangeError')
? ExchangeError.fromJson(
json_['exchangeError'] as core.Map<core.String, core.dynamic>,
)
: null,
expirationTime: json_['expirationTime'] as core.String?,
scopes: (json_['scopes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
token: json_['token'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final exchangeError = this.exchangeError;
final expirationTime = this.expirationTime;
final scopes = this.scopes;
final token = this.token;
return {
'exchangeError': ?exchangeError,
'expirationTime': ?expirationTime,
'scopes': ?scopes,
'token': ?token,
};
}
}
/// Response of fetching github installations.
class FetchGitHubInstallationsResponse {
/// List of installations available to the OAuth user (for github.com) or all
/// the installations (for GitHub enterprise).
core.List<Installation>? installations;
FetchGitHubInstallationsResponse({this.installations});
FetchGitHubInstallationsResponse.fromJson(core.Map json_)
: this(
installations: (json_['installations'] as core.List?)
?.map(
(value) => Installation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final installations = this.installations;
return {'installations': ?installations};
}
}
/// Response for fetching git refs.
typedef FetchGitRefsResponse = $FetchGitRefsResponse;
/// Response message for FetchLinkableGitRepositories.
class FetchLinkableGitRepositoriesResponse {
/// The git repositories that can be linked to the connection.
core.List<LinkableGitRepository>? linkableGitRepositories;
/// A token identifying a page of results the server should return.
core.String? nextPageToken;
FetchLinkableGitRepositoriesResponse({
this.linkableGitRepositories,
this.nextPageToken,
});
FetchLinkableGitRepositoriesResponse.fromJson(core.Map json_)
: this(
linkableGitRepositories:
(json_['linkableGitRepositories'] as core.List?)
?.map(
(value) => LinkableGitRepository.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final linkableGitRepositories = this.linkableGitRepositories;
final nextPageToken = this.nextPageToken;
return {
'linkableGitRepositories': ?linkableGitRepositories,
'nextPageToken': ?nextPageToken,
};
}
}
/// Message for fetching SCM read token.
typedef FetchReadTokenRequest = $Empty;
/// Message for responding to get read token.
typedef FetchReadTokenResponse = $TokenResponse01;
/// Message for fetching SCM read/write token.
typedef FetchReadWriteTokenRequest = $Empty;
/// Message for responding to get read/write token.
typedef FetchReadWriteTokenResponse = $TokenResponse01;
/// Message for responding to finishing an OAuth flow.
class FinishOAuthResponse {
/// The error resulted from exchanging OAuth tokens from the service provider.
ExchangeError? exchangeError;
FinishOAuthResponse({this.exchangeError});
FinishOAuthResponse.fromJson(core.Map json_)
: this(
exchangeError: json_.containsKey('exchangeError')
? ExchangeError.fromJson(
json_['exchangeError'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final exchangeError = this.exchangeError;
return {'exchangeError': ?exchangeError};
}
}
/// GKEWorkload represents the Google Kubernetes Engine runtime.
class GKEWorkload {
/// The name of the GKE cluster.
///
/// Format: `projects/{project}/locations/{location}/clusters/{cluster}`.
///
/// Required. Immutable.
core.String? cluster;
/// The name of the GKE deployment.
///
/// Format:
/// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
///
/// Output only.
core.String? deployment;
GKEWorkload({this.cluster, this.deployment});
GKEWorkload.fromJson(core.Map json_)
: this(
cluster: json_['cluster'] as core.String?,
deployment: json_['deployment'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final cluster = this.cluster;
final deployment = this.deployment;
return {'cluster': ?cluster, 'deployment': ?deployment};
}
}
/// Defines the configuration for connections to an HTTP service provider.
class GenericHTTPEndpointConfig {
/// Basic authentication with username and password.
///
/// Optional.
BasicAuthentication? basicAuthentication;
/// Bearer token authentication with a token.
///
/// Optional.
BearerTokenAuthentication? bearerTokenAuthentication;
/// The service provider's https endpoint.
///
/// Required. Immutable.
core.String? hostUri;
/// Configuration for using Service Directory to privately connect to a HTTP
/// service provider.
///
/// This should only be set if the Http service provider is hosted on-premises
/// and not reachable by public internet. If this field is left empty, calls
/// to the HTTP service provider will be made over the public internet.
///
/// Optional.
ServiceDirectoryConfig? serviceDirectoryConfig;
/// The SSL certificate to use for requests to the HTTP service provider.
///
/// Optional.
core.String? sslCaCertificate;
GenericHTTPEndpointConfig({
this.basicAuthentication,
this.bearerTokenAuthentication,
this.hostUri,
this.serviceDirectoryConfig,
this.sslCaCertificate,
});
GenericHTTPEndpointConfig.fromJson(core.Map json_)
: this(
basicAuthentication: json_.containsKey('basicAuthentication')
? BasicAuthentication.fromJson(
json_['basicAuthentication']
as core.Map<core.String, core.dynamic>,
)
: null,
bearerTokenAuthentication:
json_.containsKey('bearerTokenAuthentication')
? BearerTokenAuthentication.fromJson(
json_['bearerTokenAuthentication']
as core.Map<core.String, core.dynamic>,
)
: null,
hostUri: json_['hostUri'] as core.String?,
serviceDirectoryConfig: json_.containsKey('serviceDirectoryConfig')
? ServiceDirectoryConfig.fromJson(
json_['serviceDirectoryConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
sslCaCertificate: json_['sslCaCertificate'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final basicAuthentication = this.basicAuthentication;
final bearerTokenAuthentication = this.bearerTokenAuthentication;
final hostUri = this.hostUri;
final serviceDirectoryConfig = this.serviceDirectoryConfig;
final sslCaCertificate = this.sslCaCertificate;
return {
'basicAuthentication': ?basicAuthentication,
'bearerTokenAuthentication': ?bearerTokenAuthentication,
'hostUri': ?hostUri,
'serviceDirectoryConfig': ?serviceDirectoryConfig,
'sslCaCertificate': ?sslCaCertificate,
};
}
}
/// Configuration for connections to github.com.
class GitHubConfig {
/// GitHub App installation id.
///
/// Optional.
core.String? appInstallationId;
/// OAuth credential of the account that authorized the GitHub App.
///
/// It is recommended to use a robot account instead of a human user account.
/// The OAuth token must be tied to the GitHub App of this config.
///
/// Optional.
OAuthCredential? authorizerCredential;
/// The GitHub Application that was installed to the GitHub user or
/// organization.
///
/// Required. Immutable.
/// Possible string values are:
/// - "GIT_HUB_APP_UNSPECIFIED" : GitHub App not specified.
/// - "DEVELOPER_CONNECT" : The Developer Connect GitHub Application.
/// - "FIREBASE" : The Firebase GitHub Application.
/// - "GEMINI_CODE_ASSIST" : The Gemini Code Assist Application.
core.String? githubApp;
/// The URI to navigate to in order to manage the installation associated with
/// this GitHubConfig.
///
/// Output only.
core.String? installationUri;
GitHubConfig({
this.appInstallationId,
this.authorizerCredential,
this.githubApp,
this.installationUri,
});
GitHubConfig.fromJson(core.Map json_)
: this(
appInstallationId: json_['appInstallationId'] as core.String?,
authorizerCredential: json_.containsKey('authorizerCredential')
? OAuthCredential.fromJson(
json_['authorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
githubApp: json_['githubApp'] as core.String?,
installationUri: json_['installationUri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final appInstallationId = this.appInstallationId;
final authorizerCredential = this.authorizerCredential;
final githubApp = this.githubApp;
final installationUri = this.installationUri;
return {
'appInstallationId': ?appInstallationId,
'authorizerCredential': ?authorizerCredential,
'githubApp': ?githubApp,
'installationUri': ?installationUri,
};
}
}
/// Configuration for connections to an instance of GitHub Enterprise.
class GitHubEnterpriseConfig {
/// ID of the GitHub App created from the manifest.
///
/// Optional.
core.String? appId;
/// ID of the installation of the GitHub App.
///
/// Optional.
core.String? appInstallationId;
/// The URL-friendly name of the GitHub App.
///
/// Output only.
core.String? appSlug;
/// The URI of the GitHub Enterprise host this connection is for.
///
/// Required.
core.String? hostUri;
/// The URI to navigate to in order to manage the installation associated with
/// this GitHubEnterpriseConfig.
///
/// Output only.
core.String? installationUri;
/// GitHub Enterprise organization in which the GitHub App is created.
///
/// Optional. Immutable.
core.String? organization;
/// SecretManager resource containing the private key of the GitHub App,
/// formatted as `projects / * /secrets / * /versions / * ` or `projects / *
/// /locations / * /secrets / * /versions / * ` (if regional secrets are
/// supported in that location).
///
/// Optional.
core.String? privateKeySecretVersion;
/// GitHub Enterprise version installed at the host_uri.
///
/// Output only.
core.String? serverVersion;
/// Configuration for using Service Directory to privately connect to a GitHub
/// Enterprise server.
///
/// This should only be set if the GitHub Enterprise server is hosted
/// on-premises and not reachable by public internet. If this field is left
/// empty, calls to the GitHub Enterprise server will be made over the public
/// internet.
///
/// Optional.
ServiceDirectoryConfig? serviceDirectoryConfig;
/// SSL certificate to use for requests to GitHub Enterprise.
///
/// Optional.
core.String? sslCaCertificate;
/// SecretManager resource containing the webhook secret of the GitHub App,
/// formatted as `projects / * /secrets / * /versions / * ` or `projects / *
/// /locations / * /secrets / * /versions / * ` (if regional secrets are
/// supported in that location).
///
/// Optional.
core.String? webhookSecretSecretVersion;
GitHubEnterpriseConfig({
this.appId,
this.appInstallationId,
this.appSlug,
this.hostUri,
this.installationUri,
this.organization,
this.privateKeySecretVersion,
this.serverVersion,
this.serviceDirectoryConfig,
this.sslCaCertificate,
this.webhookSecretSecretVersion,
});
GitHubEnterpriseConfig.fromJson(core.Map json_)
: this(
appId: json_['appId'] as core.String?,
appInstallationId: json_['appInstallationId'] as core.String?,
appSlug: json_['appSlug'] as core.String?,
hostUri: json_['hostUri'] as core.String?,
installationUri: json_['installationUri'] as core.String?,
organization: json_['organization'] as core.String?,
privateKeySecretVersion:
json_['privateKeySecretVersion'] as core.String?,
serverVersion: json_['serverVersion'] as core.String?,
serviceDirectoryConfig: json_.containsKey('serviceDirectoryConfig')
? ServiceDirectoryConfig.fromJson(
json_['serviceDirectoryConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
sslCaCertificate: json_['sslCaCertificate'] as core.String?,
webhookSecretSecretVersion:
json_['webhookSecretSecretVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final appId = this.appId;
final appInstallationId = this.appInstallationId;
final appSlug = this.appSlug;
final hostUri = this.hostUri;
final installationUri = this.installationUri;
final organization = this.organization;
final privateKeySecretVersion = this.privateKeySecretVersion;
final serverVersion = this.serverVersion;
final serviceDirectoryConfig = this.serviceDirectoryConfig;
final sslCaCertificate = this.sslCaCertificate;
final webhookSecretSecretVersion = this.webhookSecretSecretVersion;
return {
'appId': ?appId,
'appInstallationId': ?appInstallationId,
'appSlug': ?appSlug,
'hostUri': ?hostUri,
'installationUri': ?installationUri,
'organization': ?organization,
'privateKeySecretVersion': ?privateKeySecretVersion,
'serverVersion': ?serverVersion,
'serviceDirectoryConfig': ?serviceDirectoryConfig,
'sslCaCertificate': ?sslCaCertificate,
'webhookSecretSecretVersion': ?webhookSecretSecretVersion,
};
}
}
/// Configuration for connections to gitlab.com.
class GitLabConfig {
/// A GitLab personal access token with the minimum `api` scope access and a
/// minimum role of `maintainer`.
///
/// The GitLab Projects visible to this Personal Access Token will control
/// which Projects Developer Connect has access to.
///
/// Required.
UserCredential? authorizerCredential;
/// A GitLab personal access token with the minimum `read_api` scope access
/// and a minimum role of `reporter`.
///
/// The GitLab Projects visible to this Personal Access Token will control
/// which Projects Developer Connect has access to.
///
/// Required.
UserCredential? readAuthorizerCredential;
/// SecretManager resource containing the webhook secret of a GitLab project,
/// formatted as `projects / * /secrets / * /versions / * ` or `projects / *
/// /locations / * /secrets / * /versions / * ` (if regional secrets are
/// supported in that location).
///
/// This is used to validate webhooks.
///
/// Required. Immutable.
core.String? webhookSecretSecretVersion;
GitLabConfig({
this.authorizerCredential,
this.readAuthorizerCredential,
this.webhookSecretSecretVersion,
});
GitLabConfig.fromJson(core.Map json_)
: this(
authorizerCredential: json_.containsKey('authorizerCredential')
? UserCredential.fromJson(
json_['authorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
readAuthorizerCredential: json_.containsKey('readAuthorizerCredential')
? UserCredential.fromJson(
json_['readAuthorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
webhookSecretSecretVersion:
json_['webhookSecretSecretVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final authorizerCredential = this.authorizerCredential;
final readAuthorizerCredential = this.readAuthorizerCredential;
final webhookSecretSecretVersion = this.webhookSecretSecretVersion;
return {
'authorizerCredential': ?authorizerCredential,
'readAuthorizerCredential': ?readAuthorizerCredential,
'webhookSecretSecretVersion': ?webhookSecretSecretVersion,
};
}
}
/// Configuration for connections to an instance of GitLab Enterprise.
class GitLabEnterpriseConfig {
/// A GitLab personal access token with the minimum `api` scope access and a
/// minimum role of `maintainer`.
///
/// The GitLab Projects visible to this Personal Access Token will control
/// which Projects Developer Connect has access to.
///
/// Required.
UserCredential? authorizerCredential;
/// The URI of the GitLab Enterprise host this connection is for.
///
/// Required.
core.String? hostUri;
/// A GitLab personal access token with the minimum `read_api` scope access
/// and a minimum role of `reporter`.
///
/// The GitLab Projects visible to this Personal Access Token will control
/// which Projects Developer Connect has access to.
///
/// Required.
UserCredential? readAuthorizerCredential;
/// Version of the GitLab Enterprise server running on the `host_uri`.
///
/// Output only.
core.String? serverVersion;
/// Configuration for using Service Directory to privately connect to a GitLab
/// Enterprise instance.
///
/// This should only be set if the GitLab Enterprise server is hosted
/// on-premises and not reachable by public internet. If this field is left
/// empty, calls to the GitLab Enterprise server will be made over the public
/// internet.
///
/// Optional.
ServiceDirectoryConfig? serviceDirectoryConfig;
/// SSL Certificate Authority certificate to use for requests to GitLab
/// Enterprise instance.
///
/// Optional.
core.String? sslCaCertificate;
/// SecretManager resource containing the webhook secret of a GitLab project,
/// formatted as `projects / * /secrets / * /versions / * ` or `projects / *
/// /locations / * /secrets / * /versions / * ` (if regional secrets are
/// supported in that location).
///
/// This is used to validate webhooks.
///
/// Required. Immutable.
core.String? webhookSecretSecretVersion;
GitLabEnterpriseConfig({
this.authorizerCredential,
this.hostUri,
this.readAuthorizerCredential,
this.serverVersion,
this.serviceDirectoryConfig,
this.sslCaCertificate,
this.webhookSecretSecretVersion,
});
GitLabEnterpriseConfig.fromJson(core.Map json_)
: this(
authorizerCredential: json_.containsKey('authorizerCredential')
? UserCredential.fromJson(
json_['authorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
hostUri: json_['hostUri'] as core.String?,
readAuthorizerCredential: json_.containsKey('readAuthorizerCredential')
? UserCredential.fromJson(
json_['readAuthorizerCredential']
as core.Map<core.String, core.dynamic>,
)
: null,
serverVersion: json_['serverVersion'] as core.String?,
serviceDirectoryConfig: json_.containsKey('serviceDirectoryConfig')
? ServiceDirectoryConfig.fromJson(
json_['serviceDirectoryConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
sslCaCertificate: json_['sslCaCertificate'] as core.String?,
webhookSecretSecretVersion:
json_['webhookSecretSecretVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final authorizerCredential = this.authorizerCredential;
final hostUri = this.hostUri;
final readAuthorizerCredential = this.readAuthorizerCredential;
final serverVersion = this.serverVersion;
final serviceDirectoryConfig = this.serviceDirectoryConfig;
final sslCaCertificate = this.sslCaCertificate;
final webhookSecretSecretVersion = this.webhookSecretSecretVersion;
return {
'authorizerCredential': ?authorizerCredential,
'hostUri': ?hostUri,
'readAuthorizerCredential': ?readAuthorizerCredential,
'serverVersion': ?serverVersion,
'serviceDirectoryConfig': ?serviceDirectoryConfig,
'sslCaCertificate': ?sslCaCertificate,
'webhookSecretSecretVersion': ?webhookSecretSecretVersion,
};
}
}
/// The git proxy configuration.
class GitProxyConfig {
/// Setting this to true allows the git proxy to be used for performing git
/// operations on the repositories linked in the connection.
///
/// Optional.
core.bool? enabled;
/// The base URI for the HTTP proxy endpoint.
///
/// Has the format
/// `https://{generatedID}-c-h-{shortRegion}.developerconnect.dev` Populated
/// only when enabled is set to true. This endpoint is used by other Google
/// services that integrate with Developer Connect.
///
/// Output only.
core.String? httpProxyBaseUri;
GitProxyConfig({this.enabled, this.httpProxyBaseUri});
GitProxyConfig.fromJson(core.Map json_)
: this(
enabled: json_['enabled'] as core.bool?,
httpProxyBaseUri: json_['httpProxyBaseUri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final enabled = this.enabled;
final httpProxyBaseUri = this.httpProxyBaseUri;
return {'enabled': ?enabled, 'httpProxyBaseUri': ?httpProxyBaseUri};
}
}
/// Message describing the GitRepositoryLink object
class GitRepositoryLink {
/// Allows clients to store small amounts of arbitrary data.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// Git Clone URI.
///
/// Required.
core.String? cloneUri;
/// Create timestamp
///
/// Output only.
core.String? createTime;
/// Delete timestamp
///
/// Output only.
core.String? deleteTime;
/// This checksum is computed by the server based on the value of other
/// fields, and may be sent on update and delete requests to ensure the client
/// has an up-to-date value before proceeding.
///
/// Optional.
core.String? etag;
/// URI to access the linked repository through the Git Proxy.
///
/// This field is only populated if the git proxy is enabled for the
/// connection.
///
/// Output only.
core.String? gitProxyUri;
/// Labels as key value pairs
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// Resource name of the repository, in the format `projects / * /locations /
/// * /connections / * /gitRepositoryLinks / * `.
core.String? name;
/// Set to true when the connection is being set up or updated in the
/// background.
///
/// Output only.
core.bool? reconciling;
/// A system-assigned unique identifier for the GitRepositoryLink.
///
/// Output only.
core.String? uid;
/// Update timestamp
///
/// Output only.
core.String? updateTime;
/// External ID of the webhook created for the repository.
///
/// Output only.
core.String? webhookId;
GitRepositoryLink({
this.annotations,
this.cloneUri,
this.createTime,
this.deleteTime,
this.etag,
this.gitProxyUri,
this.labels,
this.name,
this.reconciling,
this.uid,
this.updateTime,
this.webhookId,
});
GitRepositoryLink.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
cloneUri: json_['cloneUri'] as core.String?,
createTime: json_['createTime'] as core.String?,
deleteTime: json_['deleteTime'] as core.String?,
etag: json_['etag'] as core.String?,
gitProxyUri: json_['gitProxyUri'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
reconciling: json_['reconciling'] as core.bool?,
uid: json_['uid'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
webhookId: json_['webhookId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final cloneUri = this.cloneUri;
final createTime = this.createTime;
final deleteTime = this.deleteTime;
final etag = this.etag;
final gitProxyUri = this.gitProxyUri;
final labels = this.labels;
final name = this.name;
final reconciling = this.reconciling;
final uid = this.uid;
final updateTime = this.updateTime;
final webhookId = this.webhookId;
return {
'annotations': ?annotations,
'cloneUri': ?cloneUri,
'createTime': ?createTime,
'deleteTime': ?deleteTime,
'etag': ?etag,
'gitProxyUri': ?gitProxyUri,
'labels': ?labels,
'name': ?name,
'reconciling': ?reconciling,
'uid': ?uid,
'updateTime': ?updateTime,
'webhookId': ?webhookId,
};
}
}
/// Google Artifact Analysis configurations.
class GoogleArtifactAnalysis {
/// The project id of the project where the provenance is stored.
///
/// Required.
core.String? projectId;
GoogleArtifactAnalysis({this.projectId});
GoogleArtifactAnalysis.fromJson(core.Map json_)
: this(projectId: json_['projectId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final projectId = this.projectId;
return {'projectId': ?projectId};
}
}
/// Google Artifact Registry configurations.
class GoogleArtifactRegistry {
/// The name of the artifact registry package.
///
/// Required. Immutable.
core.String? artifactRegistryPackage;
/// The host project of Artifact Registry.
///
/// Required.
core.String? projectId;
GoogleArtifactRegistry({this.artifactRegistryPackage, this.projectId});
GoogleArtifactRegistry.fromJson(core.Map json_)
: this(
artifactRegistryPackage:
json_['artifactRegistryPackage'] as core.String?,
projectId: json_['projectId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final artifactRegistryPackage = this.artifactRegistryPackage;
final projectId = this.projectId;
return {
'artifactRegistryPackage': ?artifactRegistryPackage,
'projectId': ?projectId,
};
}
}
/// GoogleCloudRun represents the Cloud Run runtime.
class GoogleCloudRun {
/// The name of the Cloud Run service.
///
/// Format: `projects/{project}/locations/{location}/services/{service}`.
///
/// Required. Immutable.
core.String? serviceUri;
GoogleCloudRun({this.serviceUri});
GoogleCloudRun.fromJson(core.Map json_)
: this(serviceUri: json_['serviceUri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final serviceUri = this.serviceUri;
return {'serviceUri': ?serviceUri};
}
}
/// Message that represents an arbitrary HTTP body.
///
/// It should only be used for payload formats that can't be represented as
/// JSON, such as raw binary or an HTML page. This message can be used both in
/// streaming and non-streaming API methods in the request as well as the
/// response. It can be used as a top-level request field, which is convenient
/// if one wants to extract parameters from either the URL or HTTP template into
/// the request fields and also want access to the raw HTTP body. Example:
/// message GetResourceRequest { // A unique request id. string request_id = 1;
/// // The raw HTTP body is bound to this field. google.api.HttpBody http_body =
/// 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns
/// (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns
/// (google.protobuf.Empty); } Example with streaming methods: service
/// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream
/// google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns
/// (stream google.api.HttpBody); } Use of this type only changes how the
/// request and response bodies are handled, all other features will continue to
/// work unchanged.
typedef HttpBody = $HttpBody;
/// The InsightsConfig resource is the core configuration object to capture
/// events from your Software Development Lifecycle.
///
/// It acts as the central hub for managing how Developer Connect understands
/// your application, its runtime environments, and the artifacts deployed
/// within them.
class InsightsConfig {
/// User specified annotations.
///
/// See https://google.aip.dev/148#annotations for more details such as format
/// and size limitations.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// The name of the App Hub Application.
///
/// Format: projects/{project}/locations/{location}/applications/{application}
///
/// Optional.
core.String? appHubApplication;
/// The artifact configurations of the artifacts that are deployed.
///
/// Optional.
core.List<ArtifactConfig>? artifactConfigs;
/// Create timestamp.
///
/// Output only.
core.String? createTime;
/// Any errors that occurred while setting up the InsightsConfig.
///
/// Each error will be in the format: `field_name: error_message`, e.g.
/// GetAppHubApplication: Permission denied while getting App Hub application.
/// Please grant permissions to the P4SA.
///
/// Output only.
core.List<Status>? errors;
/// Set of labels associated with an InsightsConfig.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// Identifier.
///
/// The name of the InsightsConfig. Format:
/// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
core.String? name;
/// The projects to track with the InsightsConfig.
///
/// Optional.
Projects? projects;
/// Reconciling (https://google.aip.dev/128#reconciliation).
///
/// Set to true if the current state of InsightsConfig does not match the
/// user's intended state, and the service is actively updating the resource
/// to reconcile them. This can happen due to user-triggered updates or system
/// actions like failover or maintenance.
///
/// Output only.
core.bool? reconciling;
/// The runtime configurations where the application is deployed.
///
/// Output only.
core.List<RuntimeConfig>? runtimeConfigs;
/// The state of the InsightsConfig.
///
/// Optional. Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : No state specified.
/// - "PENDING" : The InsightsConfig is pending application discovery/runtime
/// discovery.
/// - "COMPLETE" : The initial discovery process is complete.
/// - "ERROR" : The InsightsConfig is in an error state.
core.String? state;
/// Update timestamp.
///
/// Output only.
core.String? updateTime;
InsightsConfig({
this.annotations,
this.appHubApplication,
this.artifactConfigs,
this.createTime,
this.errors,
this.labels,
this.name,
this.projects,
this.reconciling,
this.runtimeConfigs,
this.state,
this.updateTime,
});
InsightsConfig.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
appHubApplication: json_['appHubApplication'] as core.String?,
artifactConfigs: (json_['artifactConfigs'] as core.List?)
?.map(
(value) => ArtifactConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
createTime: json_['createTime'] as core.String?,
errors: (json_['errors'] as core.List?)
?.map(
(value) =>
Status.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
name: json_['name'] as core.String?,
projects: json_.containsKey('projects')
? Projects.fromJson(
json_['projects'] as core.Map<core.String, core.dynamic>,
)
: null,
reconciling: json_['reconciling'] as core.bool?,
runtimeConfigs: (json_['runtimeConfigs'] as core.List?)
?.map(
(value) => RuntimeConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
state: json_['state'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final appHubApplication = this.appHubApplication;
final artifactConfigs = this.artifactConfigs;
final createTime = this.createTime;
final errors = this.errors;
final labels = this.labels;
final name = this.name;
final projects = this.projects;
final reconciling = this.reconciling;
final runtimeConfigs = this.runtimeConfigs;
final state = this.state;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'appHubApplication': ?appHubApplication,
'artifactConfigs': ?artifactConfigs,
'createTime': ?createTime,
'errors': ?errors,
'labels': ?labels,
'name': ?name,
'projects': ?projects,
'reconciling': ?reconciling,
'runtimeConfigs': ?runtimeConfigs,
'state': ?state,
'updateTime': ?updateTime,
};
}
}
/// Represents an installation of the GitHub App.
class Installation {
/// ID of the installation in GitHub.
core.String? id;
/// Name of the GitHub user or organization that owns this installation.
core.String? name;
/// Either "user" or "organization".
core.String? type;
Installation({this.id, this.name, this.type});
Installation.fromJson(core.Map json_)
: this(
id: json_['id'] as core.String?,
name: json_['name'] as core.String?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final id = this.id;
final name = this.name;
final type = this.type;
return {'id': ?id, 'name': ?name, 'type': ?type};
}
}
/// Describes stage and necessary actions to be taken by the user to complete
/// the installation.
///
/// Used for GitHub and GitHub Enterprise based connections.
typedef InstallationState = $InstallationState;
/// LinkableGitRepository represents a git repository that can be linked to a
/// connection.
class LinkableGitRepository {
/// The clone uri of the repository.
core.String? cloneUri;
LinkableGitRepository({this.cloneUri});
LinkableGitRepository.fromJson(core.Map json_)
: this(cloneUri: json_['cloneUri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final cloneUri = this.cloneUri;
return {'cloneUri': ?cloneUri};
}
}
/// Message for response to listing AccountConnectors
class ListAccountConnectorsResponse {
/// The list of AccountConnectors
core.List<AccountConnector>? accountConnectors;
/// A token identifying a page of results the server should return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListAccountConnectorsResponse({
this.accountConnectors,
this.nextPageToken,
this.unreachable,
});
ListAccountConnectorsResponse.fromJson(core.Map json_)
: this(
accountConnectors: (json_['accountConnectors'] as core.List?)
?.map(
(value) => AccountConnector.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final accountConnectors = this.accountConnectors;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'accountConnectors': ?accountConnectors,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Message for response to listing Connections
class ListConnectionsResponse {
/// The list of Connection
core.List<Connection>? connections;
/// A token identifying a page of results the server should return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListConnectionsResponse({
this.connections,
this.nextPageToken,
this.unreachable,
});
ListConnectionsResponse.fromJson(core.Map json_)
: this(
connections: (json_['connections'] as core.List?)
?.map(
(value) => Connection.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final connections = this.connections;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'connections': ?connections,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Response to listing DeploymentEvents.
class ListDeploymentEventsResponse {
/// The list of DeploymentEvents.
core.List<DeploymentEvent>? deploymentEvents;
/// A token, which can be sent as `page_token` to retrieve the next page.
///
/// If this field is omitted, there are no subsequent pages.
core.String? nextPageToken;
ListDeploymentEventsResponse({this.deploymentEvents, this.nextPageToken});
ListDeploymentEventsResponse.fromJson(core.Map json_)
: this(
deploymentEvents: (json_['deploymentEvents'] as core.List?)
?.map(
(value) => DeploymentEvent.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final deploymentEvents = this.deploymentEvents;
final nextPageToken = this.nextPageToken;
return {
'deploymentEvents': ?deploymentEvents,
'nextPageToken': ?nextPageToken,
};
}
}
/// Message for response to listing GitRepositoryLinks
class ListGitRepositoryLinksResponse {
/// The list of GitRepositoryLinks
core.List<GitRepositoryLink>? gitRepositoryLinks;
/// A token identifying a page of results the server should return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListGitRepositoryLinksResponse({
this.gitRepositoryLinks,
this.nextPageToken,
this.unreachable,
});
ListGitRepositoryLinksResponse.fromJson(core.Map json_)
: this(
gitRepositoryLinks: (json_['gitRepositoryLinks'] as core.List?)
?.map(
(value) => GitRepositoryLink.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final gitRepositoryLinks = this.gitRepositoryLinks;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'gitRepositoryLinks': ?gitRepositoryLinks,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Request for response to listing InsightsConfigs.
class ListInsightsConfigsResponse {
/// The list of InsightsConfigs.
core.List<InsightsConfig>? insightsConfigs;
/// A token identifying a page of results the server should return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
ListInsightsConfigsResponse({
this.insightsConfigs,
this.nextPageToken,
this.unreachable,
});
ListInsightsConfigsResponse.fromJson(core.Map json_)
: this(
insightsConfigs: (json_['insightsConfigs'] as core.List?)
?.map(
(value) => InsightsConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final insightsConfigs = this.insightsConfigs;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'insightsConfigs': ?insightsConfigs,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// The response message for Locations.ListLocations.
class ListLocationsResponse {
/// A list of locations that matches the specified filter in the request.
core.List<Location>? locations;
/// The standard List next-page token.
core.String? nextPageToken;
ListLocationsResponse({this.locations, this.nextPageToken});
ListLocationsResponse.fromJson(core.Map json_)
: this(
locations: (json_['locations'] as core.List?)
?.map(
(value) => Location.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final locations = this.locations;
final nextPageToken = this.nextPageToken;
return {'locations': ?locations, 'nextPageToken': ?nextPageToken};
}
}
/// The response message for Operations.ListOperations.
class ListOperationsResponse {
/// The standard List next-page token.
core.String? nextPageToken;
/// A list of operations that matches the specified filter in the request.
core.List<Operation>? operations;
/// Unordered list.
///
/// Unreachable resources. Populated when the request sets
/// `ListOperationsRequest.return_partial_success` and reads across
/// collections. For example, when attempting to list all resources across all
/// supported locations.
core.List<core.String>? unreachable;
ListOperationsResponse({
this.nextPageToken,
this.operations,
this.unreachable,
});
ListOperationsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
operations: (json_['operations'] as core.List?)
?.map(
(value) => Operation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final operations = this.operations;
final unreachable = this.unreachable;
return {
'nextPageToken': ?nextPageToken,
'operations': ?operations,
'unreachable': ?unreachable,
};
}
}
/// Message for response to listing Users
class ListUsersResponse {
/// A token identifying a page of results the server should return.
core.String? nextPageToken;
/// Locations that could not be reached.
core.List<core.String>? unreachable;
/// The list of Users
core.List<User>? users;
ListUsersResponse({this.nextPageToken, this.unreachable, this.users});
ListUsersResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
users: (json_['users'] as core.List?)
?.map(
(value) =>
User.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
final users = this.users;
return {
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
'users': ?users,
};
}
}
/// A resource that represents a Google Cloud location.
typedef Location = $Location00;
/// Represents an OAuth token of the account that authorized the Connection, and
/// associated metadata.
class OAuthCredential {
/// A SecretManager resource containing the OAuth token that authorizes the
/// connection.
///
/// Format: `projects / * /secrets / * /versions / * ` or `projects / *
/// /locations / * /secrets / * /versions / * ` (if regional secrets are
/// supported in that location).
///
/// Required.
core.String? oauthTokenSecretVersion;
/// The username associated with this token.
///
/// Output only.
core.String? username;
OAuthCredential({this.oauthTokenSecretVersion, this.username});
OAuthCredential.fromJson(core.Map json_)
: this(
oauthTokenSecretVersion:
json_['oauthTokenSecretVersion'] as core.String?,
username: json_['username'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final oauthTokenSecretVersion = this.oauthTokenSecretVersion;
final username = this.username;
return {
'oauthTokenSecretVersion': ?oauthTokenSecretVersion,
'username': ?username,
};
}
}
/// This resource represents a long-running operation that is the result of a
/// network API call.
class Operation {
/// If the value is `false`, it means the operation is still in progress.
///
/// If `true`, the operation is completed, and either `error` or `response` is
/// available.
core.bool? done;
/// The error result of the operation in case of failure or cancellation.
Status? error;
/// Service-specific metadata associated with the operation.
///
/// It typically contains progress information and common metadata such as
/// create time. Some services might not provide such metadata. Any method
/// that returns a long-running operation should document the metadata type,
/// if any.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object?>? metadata;
/// The server-assigned name, which is only unique within the same service
/// that originally returns it.
///
/// If you use the default HTTP mapping, the `name` should be a resource name
/// ending with `operations/{unique_id}`.
core.String? name;
/// The normal, successful response of the operation.
///
/// If the original method returns no data on success, such as `Delete`, the
/// response is `google.protobuf.Empty`. If the original method is standard
/// `Get`/`Create`/`Update`, the response should be the resource. For other
/// methods, the response should have the type `XxxResponse`, where `Xxx` is
/// the original method name. For example, if the original method name is
/// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object?>? response;
Operation({this.done, this.error, this.metadata, this.name, this.response});
Operation.fromJson(core.Map json_)
: this(
done: json_['done'] as core.bool?,
error: json_.containsKey('error')
? Status.fromJson(
json_['error'] as core.Map<core.String, core.dynamic>,
)
: null,
metadata: json_.containsKey('metadata')
? json_['metadata'] as core.Map<core.String, core.dynamic>
: null,
name: json_['name'] as core.String?,
response: json_.containsKey('response')
? json_['response'] as core.Map<core.String, core.dynamic>
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final done = this.done;
final error = this.error;
final metadata = this.metadata;
final name = this.name;
final response = this.response;
return {
'done': ?done,
'error': ?error,
'metadata': ?metadata,
'name': ?name,
'response': ?response,
};
}
}
/// RPC request object accepted by the ProcessBitbucketCloudWebhook RPC method.
class ProcessBitbucketCloudWebhookRequest {
/// HTTP request body.
///
/// Required.
HttpBody? body;
ProcessBitbucketCloudWebhookRequest({this.body});
ProcessBitbucketCloudWebhookRequest.fromJson(core.Map json_)
: this(
body: json_.containsKey('body')
? HttpBody.fromJson(
json_['body'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final body = this.body;
return {'body': ?body};
}
}
/// RPC request object accepted by the ProcessBitbucketDataCenterWebhook RPC
/// method.
class ProcessBitbucketDataCenterWebhookRequest {
/// HTTP request body.
///
/// Required.
HttpBody? body;
ProcessBitbucketDataCenterWebhookRequest({this.body});
ProcessBitbucketDataCenterWebhookRequest.fromJson(core.Map json_)
: this(
body: json_.containsKey('body')
? HttpBody.fromJson(
json_['body'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final body = this.body;
return {'body': ?body};
}
}
/// RPC request object accepted by the ProcessGitHubEnterpriseWebhook RPC
/// method.
class ProcessGitHubEnterpriseWebhookRequest {
/// HTTP request body.
///
/// Required.
HttpBody? body;
ProcessGitHubEnterpriseWebhookRequest({this.body});
ProcessGitHubEnterpriseWebhookRequest.fromJson(core.Map json_)
: this(
body: json_.containsKey('body')
? HttpBody.fromJson(
json_['body'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final body = this.body;
return {'body': ?body};
}
}
/// RPC request object accepted by the ProcessGitLabEnterpriseWebhook RPC
/// method.
class ProcessGitLabEnterpriseWebhookRequest {
/// HTTP request body.
///
/// Required.
HttpBody? body;
ProcessGitLabEnterpriseWebhookRequest({this.body});
ProcessGitLabEnterpriseWebhookRequest.fromJson(core.Map json_)
: this(
body: json_.containsKey('body')
? HttpBody.fromJson(
json_['body'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final body = this.body;
return {'body': ?body};
}
}
/// RPC request object accepted by the ProcessGitLabWebhook RPC method.
class ProcessGitLabWebhookRequest {
/// HTTP request body.
///
/// Required.
HttpBody? body;
ProcessGitLabWebhookRequest({this.body});
ProcessGitLabWebhookRequest.fromJson(core.Map json_)
: this(
body: json_.containsKey('body')
? HttpBody.fromJson(
json_['body'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final body = this.body;
return {'body': ?body};
}
}
/// Projects represents the projects to track with the InsightsConfig.
class Projects {
/// The project IDs.
///
/// Format: {project}
///
/// Optional.
core.List<core.String>? projectIds;
Projects({this.projectIds});
Projects.fromJson(core.Map json_)
: this(
projectIds: (json_['projectIds'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final projectIds = this.projectIds;
return {'projectIds': ?projectIds};
}
}
/// ProviderOAuthConfig is the OAuth config for a provider.
class ProviderOAuthConfig {
/// User selected scopes to apply to the Oauth config In the event of changing
/// scopes, user records under AccountConnector will be deleted and users will
/// re-auth again.
///
/// Required.
core.List<core.String>? scopes;
/// Developer Connect provided OAuth.
///
/// Optional. Immutable.
/// Possible string values are:
/// - "SYSTEM_PROVIDER_UNSPECIFIED" : No system provider specified.
/// - "GITHUB" : GitHub provider. Scopes can be found at
/// https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes
/// - "GITLAB" : GitLab provider. Scopes can be found at
/// https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes
/// - "GOOGLE" : Deprecated: This provider is no longer supported. Google
/// provider. Recommended scopes:
/// "https://www.googleapis.com/auth/drive.readonly",
/// "https://www.googleapis.com/auth/documents.readonly"
/// - "SENTRY" : Deprecated: This provider is no longer supported. Sentry
/// provider. Scopes can be found at https://docs.sentry.io/api/permissions/
/// - "ROVO" : Deprecated: This provider is no longer supported. Rovo
/// provider. Must select the "rovo" scope.
/// - "NEW_RELIC" : Deprecated: This provider is no longer supported. New
/// Relic provider. No scopes are allowed.
/// - "DATASTAX" : Deprecated: This provider is no longer supported. Datastax
/// provider. No scopes are allowed.
/// - "DYNATRACE" : Deprecated: This provider is no longer supported.
/// Dynatrace provider.
core.String? systemProviderId;
ProviderOAuthConfig({this.scopes, this.systemProviderId});
ProviderOAuthConfig.fromJson(core.Map json_)
: this(
scopes: (json_['scopes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
systemProviderId: json_['systemProviderId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final scopes = this.scopes;
final systemProviderId = this.systemProviderId;
return {'scopes': ?scopes, 'systemProviderId': ?systemProviderId};
}
}
/// RuntimeConfig represents the runtimes where the application is deployed.
class RuntimeConfig {
/// App Hub Service.
///
/// Output only.
AppHubService? appHubService;
/// App Hub Workload.
///
/// Output only.
AppHubWorkload? appHubWorkload;
/// Google Kubernetes Engine runtime.
///
/// Output only.
GKEWorkload? gkeWorkload;
/// Cloud Run runtime.
///
/// Output only.
GoogleCloudRun? googleCloudRun;
/// The state of the Runtime.
///
/// Output only.
/// Possible string values are:
/// - "STATE_UNSPECIFIED" : No state specified.
/// - "LINKED" : The runtime configuration has been linked to the
/// InsightsConfig.
/// - "UNLINKED" : The runtime configuration has been unlinked to the
/// InsightsConfig.
core.String? state;
/// The URI of the runtime configuration.
///
/// For GKE, this is the cluster name. For Cloud Run, this is the service
/// name.
///
/// Required. Immutable.
core.String? uri;
RuntimeConfig({
this.appHubService,
this.appHubWorkload,
this.gkeWorkload,
this.googleCloudRun,
this.state,
this.uri,
});
RuntimeConfig.fromJson(core.Map json_)
: this(
appHubService: json_.containsKey('appHubService')
? AppHubService.fromJson(
json_['appHubService'] as core.Map<core.String, core.dynamic>,
)
: null,
appHubWorkload: json_.containsKey('appHubWorkload')
? AppHubWorkload.fromJson(
json_['appHubWorkload'] as core.Map<core.String, core.dynamic>,
)
: null,
gkeWorkload: json_.containsKey('gkeWorkload')
? GKEWorkload.fromJson(
json_['gkeWorkload'] as core.Map<core.String, core.dynamic>,
)
: null,
googleCloudRun: json_.containsKey('googleCloudRun')
? GoogleCloudRun.fromJson(
json_['googleCloudRun'] as core.Map<core.String, core.dynamic>,
)
: null,
state: json_['state'] as core.String?,
uri: json_['uri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final appHubService = this.appHubService;
final appHubWorkload = this.appHubWorkload;
final gkeWorkload = this.gkeWorkload;
final googleCloudRun = this.googleCloudRun;
final state = this.state;
final uri = this.uri;
return {
'appHubService': ?appHubService,
'appHubWorkload': ?appHubWorkload,
'gkeWorkload': ?gkeWorkload,
'googleCloudRun': ?googleCloudRun,
'state': ?state,
'uri': ?uri,
};
}
}
/// Configuration for connections to SSM instance
class SecureSourceManagerInstanceConfig {
/// SSM instance resource, formatted as `projects / * /locations / *
/// /instances / * `
///
/// Required. Immutable.
core.String? instance;
SecureSourceManagerInstanceConfig({this.instance});
SecureSourceManagerInstanceConfig.fromJson(core.Map json_)
: this(instance: json_['instance'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final instance = this.instance;
return {'instance': ?instance};
}
}
/// ServiceDirectoryConfig represents Service Directory configuration for a
/// connection.
typedef ServiceDirectoryConfig = $ServiceDirectoryConfig;
/// Message for responding to starting an OAuth flow.
class StartOAuthResponse {
/// The authorization server URL to the OAuth flow of the service provider.
core.String? authUri;
/// The client ID to the OAuth App of the service provider.
core.String? clientId;
/// Please refer to https://datatracker.ietf.org/doc/html/rfc7636#section-4.1
core.String? codeChallenge;
/// Please refer to https://datatracker.ietf.org/doc/html/rfc7636#section-4.2
core.String? codeChallengeMethod;
/// The list of scopes requested by the application.
core.List<core.String>? scopes;
/// The ID of the system provider.
/// Possible string values are:
/// - "SYSTEM_PROVIDER_UNSPECIFIED" : No system provider specified.
/// - "GITHUB" : GitHub provider. Scopes can be found at
/// https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes
/// - "GITLAB" : GitLab provider. Scopes can be found at
/// https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes
/// - "GOOGLE" : Deprecated: This provider is no longer supported. Google
/// provider. Recommended scopes:
/// "https://www.googleapis.com/auth/drive.readonly",
/// "https://www.googleapis.com/auth/documents.readonly"
/// - "SENTRY" : Deprecated: This provider is no longer supported. Sentry
/// provider. Scopes can be found at https://docs.sentry.io/api/permissions/
/// - "ROVO" : Deprecated: This provider is no longer supported. Rovo
/// provider. Must select the "rovo" scope.
/// - "NEW_RELIC" : Deprecated: This provider is no longer supported. New
/// Relic provider. No scopes are allowed.
/// - "DATASTAX" : Deprecated: This provider is no longer supported. Datastax
/// provider. No scopes are allowed.
/// - "DYNATRACE" : Deprecated: This provider is no longer supported.
/// Dynatrace provider.
core.String? systemProviderId;
/// The ticket to be used for post processing the callback from the service
/// provider.
core.String? ticket;
StartOAuthResponse({
this.authUri,
this.clientId,
this.codeChallenge,
this.codeChallengeMethod,
this.scopes,
this.systemProviderId,
this.ticket,
});
StartOAuthResponse.fromJson(core.Map json_)
: this(
authUri: json_['authUri'] as core.String?,
clientId: json_['clientId'] as core.String?,
codeChallenge: json_['codeChallenge'] as core.String?,
codeChallengeMethod: json_['codeChallengeMethod'] as core.String?,
scopes: (json_['scopes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
systemProviderId: json_['systemProviderId'] as core.String?,
ticket: json_['ticket'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final authUri = this.authUri;
final clientId = this.clientId;
final codeChallenge = this.codeChallenge;
final codeChallengeMethod = this.codeChallengeMethod;
final scopes = this.scopes;
final systemProviderId = this.systemProviderId;
final ticket = this.ticket;
return {
'authUri': ?authUri,
'clientId': ?clientId,
'codeChallenge': ?codeChallenge,
'codeChallengeMethod': ?codeChallengeMethod,
'scopes': ?scopes,
'systemProviderId': ?systemProviderId,
'ticket': ?ticket,
};
}
}
/// The `Status` type defines a logical error model that is suitable for
/// different programming environments, including REST APIs and RPC APIs.
///
/// It is used by [gRPC](https://github.com/grpc). Each `Status` message
/// contains three pieces of data: error code, error message, and error details.
/// You can find out more about this error model and how to work with it in the
/// [API Design Guide](https://cloud.google.com/apis/design/errors).
typedef Status = $Status00;
/// User represents a user connected to the service providers through a
/// AccountConnector.
class User {
/// The timestamp when the user was created.
///
/// Output only.
core.String? createTime;
/// Developer Connect automatically converts user identity to some human
/// readable description, e.g., email address.
///
/// Output only.
core.String? displayName;
/// The timestamp when the token was last requested.
///
/// Output only.
core.String? lastTokenRequestTime;
/// Identifier.
///
/// Resource name of the user, in the format `projects / * /locations / *
/// /accountConnectors / * /users / * `.
core.String? name;
User({
this.createTime,
this.displayName,
this.lastTokenRequestTime,
this.name,
});
User.fromJson(core.Map json_)
: this(
createTime: json_['createTime'] as core.String?,
displayName: json_['displayName'] as core.String?,
lastTokenRequestTime: json_['lastTokenRequestTime'] as core.String?,
name: json_['name'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final createTime = this.createTime;
final displayName = this.displayName;
final lastTokenRequestTime = this.lastTokenRequestTime;
final name = this.name;
return {
'createTime': ?createTime,
'displayName': ?displayName,
'lastTokenRequestTime': ?lastTokenRequestTime,
'name': ?name,
};
}
}
/// Represents a personal access token that authorized the Connection, and
/// associated metadata.
class UserCredential {
/// A SecretManager resource containing the user token that authorizes the
/// Developer Connect connection.
///
/// Format: `projects / * /secrets / * /versions / * ` or `projects / *
/// /locations / * /secrets / * /versions / * ` (if regional secrets are
/// supported in that location).
///
/// Required.
core.String? userTokenSecretVersion;
/// The username associated with this token.
///
/// Output only.
core.String? username;
UserCredential({this.userTokenSecretVersion, this.username});
UserCredential.fromJson(core.Map json_)
: this(
userTokenSecretVersion: json_['userTokenSecretVersion'] as core.String?,
username: json_['username'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final userTokenSecretVersion = this.userTokenSecretVersion;
final username = this.username;
return {
'userTokenSecretVersion': ?userTokenSecretVersion,
'username': ?username,
};
}
}