blob: 088cc9bd37ac7de8388c6c05a18c8f9d69af33bc [file] [edit]
// Copyright 2021 Google LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// This is a generated file (see the discoveryapis_generator project).
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: doc_directive_unknown
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: unintended_html_in_doc_comment
// ignore_for_file: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_string_interpolations
/// Artifact Registry API - v1
///
/// Store and manage build artifacts in a scalable and integrated service built
/// on Google infrastructure.
///
/// For more information, see <https://cloud.google.com/artifacts/docs/>
///
/// Create an instance of [ArtifactRegistryApi] to access these resources:
///
/// - [ProjectsResource]
/// - [ProjectsLocationsResource]
/// - [ProjectsLocationsOperationsResource]
/// - [ProjectsLocationsRepositoriesResource]
/// - [ProjectsLocationsRepositoriesAptArtifactsResource]
/// - [ProjectsLocationsRepositoriesAttachmentsResource]
/// - [ProjectsLocationsRepositoriesDockerImagesResource]
/// - [ProjectsLocationsRepositoriesFilesResource]
/// - [ProjectsLocationsRepositoriesGenericArtifactsResource]
/// - [ProjectsLocationsRepositoriesGoModulesResource]
/// - [ProjectsLocationsRepositoriesGoogetArtifactsResource]
/// - [ProjectsLocationsRepositoriesKfpArtifactsResource]
/// - [ProjectsLocationsRepositoriesMavenArtifactsResource]
/// - [ProjectsLocationsRepositoriesNpmPackagesResource]
/// - [ProjectsLocationsRepositoriesPackagesResource]
/// - [ProjectsLocationsRepositoriesPackagesTagsResource]
/// - [ProjectsLocationsRepositoriesPackagesVersionsResource]
/// - [ProjectsLocationsRepositoriesPythonPackagesResource]
/// - [ProjectsLocationsRepositoriesRulesResource]
/// - [ProjectsLocationsRepositoriesYumArtifactsResource]
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,
ByteRange,
DetailedApiRequestError,
DownloadOptions,
Media,
PartialDownloadOptions,
ResumableUploadOptions,
UploadOptions;
/// Store and manage build artifacts in a scalable and integrated service built
/// on Google infrastructure.
class ArtifactRegistryApi {
/// See, edit, configure, and delete your Google Cloud data and see the email
/// address for your Google Account.
static const cloudPlatformScope =
'https://www.googleapis.com/auth/cloud-platform';
/// View your data across Google Cloud services and see the email address of
/// your Google Account
static const cloudPlatformReadOnlyScope =
'https://www.googleapis.com/auth/cloud-platform.read-only';
final commons.ApiRequester _requester;
ProjectsResource get projects => ProjectsResource(_requester);
ArtifactRegistryApi(
http.Client client, {
core.String rootUrl = 'https://artifactregistry.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;
/// Retrieves the Settings for the Project.
///
/// Request parameters:
///
/// [name] - Required. The name of the projectSettings resource.
/// Value must have pattern `^projects/\[^/\]+/projectSettings$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ProjectSettings].
///
/// 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<ProjectSettings> getProjectSettings(
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 ProjectSettings.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the Settings for the Project.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the project's settings. Always of the form:
/// projects/{project-id}/projectSettings In update request: never set In
/// response: always set
/// Value must have pattern `^projects/\[^/\]+/projectSettings$`.
///
/// [updateMask] - Field mask to support partial updates.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ProjectSettings].
///
/// 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<ProjectSettings> updateProjectSettings(
ProjectSettings request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return ProjectSettings.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsResource {
final commons.ApiRequester _requester;
ProjectsLocationsOperationsResource get operations =>
ProjectsLocationsOperationsResource(_requester);
ProjectsLocationsRepositoriesResource get repositories =>
ProjectsLocationsRepositoriesResource(_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>);
}
/// Retrieves the project configuration.
///
/// Request parameters:
///
/// [name] - Required. The name of the project's logging configuration:
/// projects/{project}/locations/{location}/projectConfig
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/projectConfig$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ProjectConfig].
///
/// 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<ProjectConfig> getProjectConfig(
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 ProjectConfig.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Retrieves the VPCSC Config for the Project.
///
/// Request parameters:
///
/// [name] - Required. The name of the VPCSCConfig resource.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/vpcscConfig$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [VPCSCConfig].
///
/// 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<VPCSCConfig> getVpcscConfig(
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 VPCSCConfig.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists information about the supported locations for this service.
///
/// This method lists locations based on the resource scope provided in the
/// \[ListLocationsRequest.name\] field: * **Global locations**: If `name` is
/// empty, the method lists the public locations available to all projects. *
/// **Project-specific locations**: If `name` follows the format
/// `projects/{project}`, the method lists locations visible to that specific
/// project. This includes public, private, or other project-specific
/// locations enabled for the project. For gRPC and client library
/// implementations, the resource name is passed as the `name` field. For
/// direct service calls, the resource name is incorporated into the request
/// path based on the specific service implementation and version.
///
/// Request parameters:
///
/// [name] - The resource that owns the locations collection, if applicable.
/// Value must have pattern `^projects/\[^/\]+$`.
///
/// [extraLocationTypes] - Optional. Do not use this field. It is unsupported
/// and is ignored unless explicitly documented otherwise. This is primarily
/// for internal usage.
///
/// [filter] - A filter to narrow down results to a preferred subset. The
/// filtering language accepts strings like `"displayName=tokyo"`, and is
/// documented in more detail in \[AIP-160\](https://google.aip.dev/160).
///
/// [pageSize] - The maximum number of results to return. If not set, the
/// service selects a default.
///
/// [pageToken] - A page token received from the `next_page_token` field in
/// the response. Send that page token to receive the subsequent page.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListLocationsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ListLocationsResponse> list(
core.String name, {
core.List<core.String>? extraLocationTypes,
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'extraLocationTypes': ?extraLocationTypes,
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/locations';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListLocationsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the project configuration.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - Identifier. The name of the project's configuration. Always of
/// the form: projects/{project}/locations/{location}/projectConfig
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/projectConfig$`.
///
/// [updateMask] - Optional. Field mask to support partial updates. See
/// https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask for
/// more details.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ProjectConfig].
///
/// 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<ProjectConfig> updateProjectConfig(
ProjectConfig request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return ProjectConfig.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the VPCSC Config for the Project.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the project's VPC SC Config. Always of the form:
/// projects/{projectID}/locations/{location}/vpcscConfig In update request:
/// never set In response: always set
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/vpcscConfig$`.
///
/// [updateMask] - Field mask to support partial updates.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [VPCSCConfig].
///
/// 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<VPCSCConfig> updateVpcscConfig(
VPCSCConfig request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return VPCSCConfig.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>);
}
/// 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>);
}
}
class ProjectsLocationsRepositoriesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesAptArtifactsResource get aptArtifacts =>
ProjectsLocationsRepositoriesAptArtifactsResource(_requester);
ProjectsLocationsRepositoriesAttachmentsResource get attachments =>
ProjectsLocationsRepositoriesAttachmentsResource(_requester);
ProjectsLocationsRepositoriesDockerImagesResource get dockerImages =>
ProjectsLocationsRepositoriesDockerImagesResource(_requester);
ProjectsLocationsRepositoriesFilesResource get files =>
ProjectsLocationsRepositoriesFilesResource(_requester);
ProjectsLocationsRepositoriesGenericArtifactsResource get genericArtifacts =>
ProjectsLocationsRepositoriesGenericArtifactsResource(_requester);
ProjectsLocationsRepositoriesGoModulesResource get goModules =>
ProjectsLocationsRepositoriesGoModulesResource(_requester);
ProjectsLocationsRepositoriesGoogetArtifactsResource get googetArtifacts =>
ProjectsLocationsRepositoriesGoogetArtifactsResource(_requester);
ProjectsLocationsRepositoriesKfpArtifactsResource get kfpArtifacts =>
ProjectsLocationsRepositoriesKfpArtifactsResource(_requester);
ProjectsLocationsRepositoriesMavenArtifactsResource get mavenArtifacts =>
ProjectsLocationsRepositoriesMavenArtifactsResource(_requester);
ProjectsLocationsRepositoriesNpmPackagesResource get npmPackages =>
ProjectsLocationsRepositoriesNpmPackagesResource(_requester);
ProjectsLocationsRepositoriesPackagesResource get packages =>
ProjectsLocationsRepositoriesPackagesResource(_requester);
ProjectsLocationsRepositoriesPythonPackagesResource get pythonPackages =>
ProjectsLocationsRepositoriesPythonPackagesResource(_requester);
ProjectsLocationsRepositoriesRulesResource get rules =>
ProjectsLocationsRepositoriesRulesResource(_requester);
ProjectsLocationsRepositoriesYumArtifactsResource get yumArtifacts =>
ProjectsLocationsRepositoriesYumArtifactsResource(_requester);
ProjectsLocationsRepositoriesResource(commons.ApiRequester client)
: _requester = client;
/// Creates a repository.
///
/// The returned Operation will finish once the repository has been created.
/// Its response will be the created Repository.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource where the repository
/// will be created.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [repositoryId] - Required. The repository id to use for this repository.
///
/// [$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(
Repository request,
core.String parent, {
core.String? repositoryId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'repositoryId': ?repositoryId == null ? null : [repositoryId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/repositories';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a repository and all of its contents.
///
/// The returned Operation will finish once the repository has been deleted.
/// It will not have any Operation metadata and will return a
/// google.protobuf.Empty response.
///
/// Request parameters:
///
/// [name] - Required. The name of the repository to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Exports an artifact to a Cloud Storage bucket.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [repository] - Required. The repository of the artifact to export. Format:
/// projects/{project}/locations/{location}/repositories/{repository}
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$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> exportArtifact(
ExportArtifactRequest request,
core.String repository, {
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('$repository') + ':exportArtifact';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets a repository.
///
/// Request parameters:
///
/// [name] - Required. The name of the repository to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Repository].
///
/// 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<Repository> 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 Repository.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the IAM policy for a given resource.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [options_requestedPolicyVersion] - Optional. The maximum policy version
/// that will be used to format the policy. Valid values are 0, 1, and 3.
/// Requests specifying an invalid value will be rejected. Requests for
/// policies with any conditional role bindings must specify version 3.
/// Policies with no conditional role bindings may specify any valid value or
/// leave the field unset. The policy in the response might use the policy
/// version that you specified, or it might use a lower policy version. For
/// example, if you specify version 3, but the policy has no conditional role
/// bindings, the response uses version 1. To learn which resources support
/// conditions in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> getIamPolicy(
core.String resource, {
core.int? options_requestedPolicyVersion,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'options.requestedPolicyVersion': ?options_requestedPolicyVersion == null
? null
: ['${options_requestedPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists repositories.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose repositories
/// will be listed.
/// Value must have pattern `^projects/\[^/\]+/locations/\[^/\]+$`.
///
/// [filter] - Optional. An expression for filtering the results of the
/// request. Filter rules are case insensitive. The fields eligible for
/// filtering are: * `name` Examples of using a filter: To filter the results
/// of your request to repositories with the name `my-repo` in project
/// `my-project` in the `us-central` region, append the following filter
/// expression to your request: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo"`
/// You can also use wildcards to match any number of characters before or
/// after the value: *
/// `name="projects/my-project/locations/us-central1/repositories/my-*"` *
/// `name="projects/my-project/locations/us-central1/repositories / * repo"` *
/// `name="projects/my-project/locations/us-central1/repositories / * repo*"`
///
/// [orderBy] - Optional. The field to order the results by.
///
/// [pageSize] - The maximum number of repositories to return. Maximum page
/// size is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRepositoriesResponse].
///
/// 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<ListRepositoriesResponse> 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') + '/repositories';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRepositoriesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a repository.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the repository, for example:
/// `projects/p1/locations/us-central1/repositories/repo1`. For each location
/// in a project, repository names must be unique.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [updateMask] - The update mask applies to the resource. For the
/// `FieldMask` definition, see
/// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Repository].
///
/// 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<Repository> patch(
Repository request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Repository.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates the IAM policy for a given resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Tests if the caller has a list of permissions on a resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesAptArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesAptArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Imports Apt artifacts.
///
/// The returned Operation will complete once the resources are imported.
/// Package, Version, and File resources are created based on the imported
/// artifacts. Imported artifacts that conflict with existing resources are
/// ignored.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the artifacts will be
/// imported.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$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> import(
ImportAptArtifactsRequest 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') + '/aptArtifacts:import';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Directly uploads an Apt artifact.
///
/// The returned Operation will complete once the resources are uploaded.
/// Package, Version, and File resources are created based on the imported
/// artifact. Imported artifacts that conflict with existing resources are
/// ignored.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the artifacts will be
/// uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// Completes with a [UploadAptArtifactMediaResponse].
///
/// 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<UploadAptArtifactMediaResponse> upload(
UploadAptArtifactRequest request,
core.String parent, {
core.String? $fields,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/aptArtifacts:create';
} else {
url_ =
'/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/aptArtifacts:create';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: commons.UploadOptions.defaultOptions,
);
return UploadAptArtifactMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesAttachmentsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesAttachmentsResource(commons.ApiRequester client)
: _requester = client;
/// Creates an attachment.
///
/// The returned Operation will finish once the attachment has been created.
/// Its response will be the created attachment.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource where the attachment
/// will be created.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [attachmentId] - Required. The attachment id to use for this attachment.
///
/// [$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(
Attachment request,
core.String parent, {
core.String? attachmentId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'attachmentId': ?attachmentId == null ? null : [attachmentId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/attachments';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes an attachment.
///
/// The returned Operation will finish once the attachments has been deleted.
/// It will not have any Operation metadata and will return a
/// `google.protobuf.Empty` response.
///
/// Request parameters:
///
/// [name] - Required. The name of the attachment to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/attachments/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets an attachment.
///
/// Request parameters:
///
/// [name] - Required. The name of the attachment to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/attachments/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Attachment].
///
/// 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<Attachment> 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 Attachment.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists attachments.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose attachments
/// will be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [filter] - Optional. An expression for filtering the results of the
/// request. Filter rules are case insensitive. The fields eligible for
/// filtering are: * `target` * `type` * `attachment_namespace`
///
/// [pageSize] - The maximum number of attachments to return. Maximum page
/// size is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListAttachmentsResponse].
///
/// 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<ListAttachmentsResponse> 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') + '/attachments';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListAttachmentsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesDockerImagesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesDockerImagesResource(commons.ApiRequester client)
: _requester = client;
/// Gets a docker image.
///
/// Request parameters:
///
/// [name] - Required. The name of the docker images.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/dockerImages/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [DockerImage].
///
/// 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<DockerImage> 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 DockerImage.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists docker images.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose docker images
/// will be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [orderBy] - The field to order the results by.
///
/// [pageSize] - The maximum number of artifacts to return. Maximum page size
/// is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListDockerImagesResponse].
///
/// 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<ListDockerImagesResponse> list(
core.String parent, {
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'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') + '/dockerImages';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListDockerImagesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesFilesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesFilesResource(commons.ApiRequester client)
: _requester = client;
/// Deletes a file and all of its content.
///
/// It is only allowed on generic repositories. The returned operation will
/// complete once the file has been deleted.
///
/// Request parameters:
///
/// [name] - Required. The name of the file to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/files/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Download a file.
///
/// Request parameters:
///
/// [name] - Required. The name of the file to download.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/files/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [downloadOptions] - Options for downloading. A download can be either a
/// Metadata (default) or Media download. Partial Media downloads are possible
/// as well.
///
/// Completes with a
///
/// - [DownloadFileResponse] for Metadata downloads (see [downloadOptions]).
///
/// - [commons.Media] for Media downloads (see [downloadOptions]).
///
/// 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<core.Object> download(
core.String name, {
core.String? $fields,
commons.DownloadOptions downloadOptions = commons.DownloadOptions.metadata,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':download';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
downloadOptions: downloadOptions,
);
if (downloadOptions.isMetadataDownload) {
return DownloadFileResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
} else {
return response_ as commons.Media;
}
}
/// Gets a file.
///
/// Request parameters:
///
/// [name] - Required. The name of the file to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/files/.*$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleDevtoolsArtifactregistryV1File].
///
/// 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<GoogleDevtoolsArtifactregistryV1File> 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 GoogleDevtoolsArtifactregistryV1File.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists files.
///
/// Request parameters:
///
/// [parent] - Required. The name of the repository whose files will be
/// listed. For example: "projects/p1/locations/us-central1/repositories/repo1
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [filter] - An expression for filtering the results of the request. Filter
/// rules are case insensitive. The fields eligible for filtering are: *
/// `name` * `owner` * `annotations` Examples of using a filter: To filter the
/// results of your request to files with the name `my_file.txt` in project
/// `my-project` in the `us-central` region, in repository `my-repo`, append
/// the following filter expression to your request: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"`
/// You can also use wildcards to match any number of characters before or
/// after the value: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"`
/// *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/files
/// / * file.txt"` *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/files
/// / * file*"` To filter the results of your request to files owned by the
/// version `1.0` in package `pkg1`, append the following filter expression to
/// your request: *
/// `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"`
/// To filter the results of your request to files with the annotation
/// key-value pair \[`external_link`: `external_link_value`\], append the
/// following filter expression to your request: *
/// `"annotations.external_link:external_link_value"` To filter just for a
/// specific annotation key `external_link`, append the following filter
/// expression to your request: * `"annotations.external_link"` If the
/// annotation key or value contains special characters, you can escape them
/// by surrounding the value with backticks. For example, to filter the
/// results of your request to files with the annotation key-value pair
/// \[`external.link`:`https://example.com/my-file`\], append the following
/// filter expression to your request: * ``
/// "annotations.`external.link`:`https://example.com/my-file`" `` You can
/// also filter with annotations with a wildcard to match any number of
/// characters before or after the value: * ``
/// "annotations.*_link:`*example.com*`" ``
///
/// [orderBy] - The field to order the results by.
///
/// [pageSize] - The maximum number of files to return. Maximum page size is
/// 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListFilesResponse].
///
/// 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<ListFilesResponse> 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') + '/files';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListFilesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a file.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the file, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`.
/// If the file ID part contains slashes, they are escaped.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/files/\[^/\]+$`.
///
/// [updateMask] - Required. The update mask applies to the resource. For the
/// `FieldMask` definition, see
/// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleDevtoolsArtifactregistryV1File].
///
/// 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<GoogleDevtoolsArtifactregistryV1File> patch(
GoogleDevtoolsArtifactregistryV1File request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleDevtoolsArtifactregistryV1File.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Directly uploads a file to a repository.
///
/// The returned Operation will complete once the resources are uploaded.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The resource name of the repository where the file
/// will be uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// [uploadOptions] - Options for the media upload. Streaming Media without
/// the length being known ahead of time is only supported via resumable
/// uploads.
///
/// Completes with a [UploadFileMediaResponse].
///
/// 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<UploadFileMediaResponse> upload(
UploadFileRequest request,
core.String parent, {
core.String? $fields,
commons.UploadOptions uploadOptions = commons.UploadOptions.defaultOptions,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/files:upload';
} else if (uploadOptions is commons.ResumableUploadOptions) {
url_ =
'/resumable/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/files:upload';
} else {
url_ = '/upload/v1/' + core.Uri.encodeFull('$parent') + '/files:upload';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: uploadOptions,
);
return UploadFileMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesGenericArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesGenericArtifactsResource(
commons.ApiRequester client,
) : _requester = client;
/// Directly uploads a Generic artifact.
///
/// The returned operation will complete once the resources are uploaded.
/// Package, version, and file resources are created based on the uploaded
/// artifact. Uploaded artifacts that conflict with existing resources will
/// raise an `ALREADY_EXISTS` error.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The resource name of the repository where the generic artifact
/// will be uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// [uploadOptions] - Options for the media upload. Streaming Media without
/// the length being known ahead of time is only supported via resumable
/// uploads.
///
/// Completes with a [UploadGenericArtifactMediaResponse].
///
/// 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<UploadGenericArtifactMediaResponse> upload(
UploadGenericArtifactRequest request,
core.String parent, {
core.String? $fields,
commons.UploadOptions uploadOptions = commons.UploadOptions.defaultOptions,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ =
'v1/' + core.Uri.encodeFull('$parent') + '/genericArtifacts:create';
} else if (uploadOptions is commons.ResumableUploadOptions) {
url_ =
'/resumable/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/genericArtifacts:create';
} else {
url_ =
'/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/genericArtifacts:create';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: uploadOptions,
);
return UploadGenericArtifactMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesGoModulesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesGoModulesResource(commons.ApiRequester client)
: _requester = client;
/// Directly uploads a Go module.
///
/// The returned Operation will complete once the Go module is uploaded.
/// Package, Version, and File resources are created based on the uploaded Go
/// module.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The resource name of the repository where the Go module will be
/// uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// Completes with a [UploadGoModuleMediaResponse].
///
/// 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<UploadGoModuleMediaResponse> upload(
UploadGoModuleRequest request,
core.String parent, {
core.String? $fields,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/goModules:create';
} else {
url_ =
'/upload/v1/' + core.Uri.encodeFull('$parent') + '/goModules:create';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: commons.UploadOptions.defaultOptions,
);
return UploadGoModuleMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesGoogetArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesGoogetArtifactsResource(
commons.ApiRequester client,
) : _requester = client;
/// Imports GooGet artifacts.
///
/// The returned Operation will complete once the resources are imported.
/// Package, Version, and File resources are created based on the imported
/// artifacts. Imported artifacts that conflict with existing resources are
/// ignored.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the artifacts will be
/// imported.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$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> import(
ImportGoogetArtifactsRequest 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') + '/googetArtifacts:import';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Directly uploads a GooGet artifact.
///
/// The returned Operation will complete once the resources are uploaded.
/// Package, Version, and File resources are created based on the imported
/// artifact. Imported artifacts that conflict with existing resources are
/// ignored.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the artifacts will be
/// uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// Completes with a [UploadGoogetArtifactMediaResponse].
///
/// 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<UploadGoogetArtifactMediaResponse> upload(
UploadGoogetArtifactRequest request,
core.String parent, {
core.String? $fields,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/googetArtifacts:create';
} else {
url_ =
'/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/googetArtifacts:create';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: commons.UploadOptions.defaultOptions,
);
return UploadGoogetArtifactMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesKfpArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesKfpArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Directly uploads a KFP artifact.
///
/// The returned Operation will complete once the resource is uploaded.
/// Package, Version, and File resources will be created based on the uploaded
/// artifact. Uploaded artifacts that conflict with existing resources will be
/// overwritten.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The resource name of the repository where the KFP artifact will
/// be uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// Completes with a [UploadKfpArtifactMediaResponse].
///
/// 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<UploadKfpArtifactMediaResponse> upload(
UploadKfpArtifactRequest request,
core.String parent, {
core.String? $fields,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/kfpArtifacts:create';
} else {
url_ =
'/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/kfpArtifacts:create';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: commons.UploadOptions.defaultOptions,
);
return UploadKfpArtifactMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesMavenArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesMavenArtifactsResource(
commons.ApiRequester client,
) : _requester = client;
/// Gets a maven artifact.
///
/// Request parameters:
///
/// [name] - Required. The name of the maven artifact.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/mavenArtifacts/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [MavenArtifact].
///
/// 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<MavenArtifact> 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 MavenArtifact.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists maven artifacts.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose maven artifacts
/// will be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [pageSize] - The maximum number of artifacts to return. Maximum page size
/// is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListMavenArtifactsResponse].
///
/// 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<ListMavenArtifactsResponse> list(
core.String parent, {
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('$parent') + '/mavenArtifacts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListMavenArtifactsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesNpmPackagesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesNpmPackagesResource(commons.ApiRequester client)
: _requester = client;
/// Gets a npm package.
///
/// Request parameters:
///
/// [name] - Required. The name of the npm package.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/npmPackages/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [NpmPackage].
///
/// 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<NpmPackage> 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 NpmPackage.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists npm packages.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose npm packages
/// will be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [pageSize] - The maximum number of artifacts to return. Maximum page size
/// is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListNpmPackagesResponse].
///
/// 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<ListNpmPackagesResponse> list(
core.String parent, {
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('$parent') + '/npmPackages';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListNpmPackagesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesPackagesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesPackagesTagsResource get tags =>
ProjectsLocationsRepositoriesPackagesTagsResource(_requester);
ProjectsLocationsRepositoriesPackagesVersionsResource get versions =>
ProjectsLocationsRepositoriesPackagesVersionsResource(_requester);
ProjectsLocationsRepositoriesPackagesResource(commons.ApiRequester client)
: _requester = client;
/// Deletes a package and all of its versions and tags.
///
/// The returned operation will complete once the package has been deleted.
///
/// Request parameters:
///
/// [name] - Required. The name of the package to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Operation].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Operation> delete(
core.String name, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets a package.
///
/// Request parameters:
///
/// [name] - Required. The name of the package to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Package].
///
/// 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<Package> 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 Package.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists packages.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose packages will
/// be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [filter] - Optional. An expression for filtering the results of the
/// request. Filter rules are case insensitive. The fields eligible for
/// filtering are: * `name` * `annotations` Examples of using a filter: To
/// filter the results of your request to packages with the name `my-package`
/// in project `my-project` in the `us-central` region, in repository
/// `my-repo`, append the following filter expression to your request: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"`
/// You can also use wildcards to match any number of characters before or
/// after the value: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"`
/// *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages
/// / * package"` *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages
/// / * pack*"` To filter the results of your request to packages with the
/// annotation key-value pair \[`external_link`: `external_link_value`\],
/// append the following filter expression to your request": *
/// `"annotations.external_link:external_link_value"` To filter the results
/// just for a specific annotation key `external_link`, append the following
/// filter expression to your request: * `"annotations.external_link"` If the
/// annotation key or value contains special characters, you can escape them
/// by surrounding the value with backticks. For example, to filter the
/// results of your request to packages with the annotation key-value pair
/// \[`external.link`:`https://example.com/my-package`\], append the following
/// filter expression to your request: * ``
/// "annotations.`external.link`:`https://example.com/my-package`" `` You can
/// also filter with annotations with a wildcard to match any number of
/// characters before or after the value: * ``
/// "annotations.*_link:`*example.com*`" ``
///
/// [orderBy] - Optional. The field to order the results by.
///
/// [pageSize] - The maximum number of packages to return. Maximum page size
/// is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListPackagesResponse].
///
/// 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<ListPackagesResponse> 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') + '/packages';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListPackagesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a package.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the package, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`. If
/// the package ID part contains slashes, the slashes are escaped.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [updateMask] - The update mask applies to the resource. For the
/// `FieldMask` definition, see
/// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Package].
///
/// 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<Package> patch(
Package request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Package.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsRepositoriesPackagesTagsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesPackagesTagsResource(commons.ApiRequester client)
: _requester = client;
/// Creates a tag.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the tag will be created.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [tagId] - The tag id to use for this repository.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Tag].
///
/// 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<Tag> create(
Tag request,
core.String parent, {
core.String? tagId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'tagId': ?tagId == null ? null : [tagId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/tags';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Tag.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a tag.
///
/// Request parameters:
///
/// [name] - The name of the tag to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/tags/\[^/\]+$`.
///
/// [$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 a tag.
///
/// Request parameters:
///
/// [name] - The name of the tag to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/tags/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Tag].
///
/// 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<Tag> 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 Tag.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists tags.
///
/// Request parameters:
///
/// [parent] - The name of the parent package whose tags will be listed. For
/// example:
/// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [filter] - An expression for filtering the results of the request. Filter
/// rules are case insensitive. The fields eligible for filtering are: *
/// `name` * `version` Examples of using a filter: To filter the results of
/// your request to tags with the name `my-tag` in package `my-package` in
/// repository `my-repo` in project "`y-project` in the us-central region,
/// append the following filter expression to your request: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"`
/// You can also use wildcards to match any number of characters before or
/// after the value: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"`
/// *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags
/// / * tag"` *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags
/// / * tag*"` To filter the results of your request to tags applied to the
/// version `1.0` in package `my-package`, append the following filter
/// expression to your request: *
/// `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"`
///
/// [pageSize] - The maximum number of tags to return. Maximum page size is
/// 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListTagsResponse].
///
/// 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<ListTagsResponse> 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') + '/tags';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListTagsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a tag.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the tag, for example:
/// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1".
/// If the package part contains slashes, the slashes are escaped. The tag
/// part can only have characters in \[a-zA-Z0-9\-._~:@\], anything else must
/// be URL encoded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/tags/\[^/\]+$`.
///
/// [updateMask] - The update mask applies to the resource. For the
/// `FieldMask` definition, see
/// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Tag].
///
/// 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<Tag> patch(
Tag request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Tag.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsRepositoriesPackagesVersionsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesPackagesVersionsResource(
commons.ApiRequester client,
) : _requester = client;
/// Deletes multiple versions across a repository.
///
/// The returned operation will complete once the versions have been deleted.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the repository holding all requested versions.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [$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> batchDelete(
BatchDeleteVersionsRequest 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') + '/versions:batchDelete';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Deletes a version and all of its content.
///
/// The returned operation will complete once the version has been deleted.
///
/// Request parameters:
///
/// [name] - The name of the version to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/versions/\[^/\]+$`.
///
/// [force] - By default, a version that is tagged may not be deleted. If
/// force=true, the version and any tags pointing to the version are deleted.
///
/// [$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.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'force': ?force == null ? null : ['${force}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets a version
///
/// Request parameters:
///
/// [name] - The name of the version to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/versions/\[^/\]+$`.
///
/// [view] - The view that should be returned in the response.
/// Possible string values are:
/// - "VERSION_VIEW_UNSPECIFIED" : The default / unset value. The API will
/// default to the BASIC view.
/// - "BASIC" : Includes basic information about the version, but not any
/// related tags.
/// - "FULL" : Include everything.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Version].
///
/// 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<Version> get(
core.String name, {
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'view': ?view == null ? null : [view],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Version.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists versions.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource whose versions will be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+$`.
///
/// [filter] - Optional. An expression for filtering the results of the
/// request. Filter rules are case insensitive. The fields eligible for
/// filtering are: * `name` * `annotations` Examples of using a filter: To
/// filter the results of your request to versions with the name `my-version`
/// in project `my-project` in the `us-central` region, in repository
/// `my-repo`, append the following filter expression to your request: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"`
/// You can also use wildcards to match any number of characters before or
/// after the value: *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions
/// / * version"` *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"`
/// *
/// `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions
/// / * version*"` To filter the results of your request to versions with the
/// annotation key-value pair \[`external_link`: `external_link_value`\],
/// append the following filter expression to your request: *
/// `"annotations.external_link:external_link_value"` To filter just for a
/// specific annotation key `external_link`, append the following filter
/// expression to your request: * `"annotations.external_link"` If the
/// annotation key or value contains special characters, you can escape them
/// by surrounding the value with backticks. For example, to filter the
/// results of your request to versions with the annotation key-value pair
/// \[`external.link`:`https://example.com/my-version`\], append the following
/// filter expression to your request: * ``
/// "annotations.`external.link`:`https://example.com/my-version`" `` You can
/// also filter with annotations with a wildcard to match any number of
/// characters before or after the value: * ``
/// "annotations.*_link:`*example.com*`" ``
///
/// [orderBy] - Optional. The field to order the results by.
///
/// [pageSize] - The maximum number of versions to return. Maximum page size
/// is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [view] - The view that should be returned in the response.
/// Possible string values are:
/// - "VERSION_VIEW_UNSPECIFIED" : The default / unset value. The API will
/// default to the BASIC view.
/// - "BASIC" : Includes basic information about the version, but not any
/// related tags.
/// - "FULL" : Include everything.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListVersionsResponse].
///
/// 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<ListVersionsResponse> list(
core.String parent, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.String? view,
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],
'view': ?view == null ? null : [view],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/versions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListVersionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a version.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the version, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`.
/// If the package or version ID parts contain slashes, the slashes are
/// escaped.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/packages/\[^/\]+/versions/\[^/\]+$`.
///
/// [updateMask] - The update mask applies to the resource. For the
/// `FieldMask` definition, see
/// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Version].
///
/// 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<Version> patch(
Version request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Version.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsLocationsRepositoriesPythonPackagesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesPythonPackagesResource(
commons.ApiRequester client,
) : _requester = client;
/// Gets a python package.
///
/// Request parameters:
///
/// [name] - Required. The name of the python package.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/pythonPackages/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [PythonPackage].
///
/// 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<PythonPackage> 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 PythonPackage.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists python packages.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource whose python packages
/// will be listed.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [pageSize] - The maximum number of artifacts to return. Maximum page size
/// is 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListPythonPackagesResponse].
///
/// 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<ListPythonPackagesResponse> list(
core.String parent, {
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('$parent') + '/pythonPackages';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListPythonPackagesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesRulesResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesRulesResource(commons.ApiRequester client)
: _requester = client;
/// Creates a rule.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent resource where the rule will
/// be created.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [ruleId] - The rule id to use for this repository.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleDevtoolsArtifactregistryV1Rule].
///
/// 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<GoogleDevtoolsArtifactregistryV1Rule> create(
GoogleDevtoolsArtifactregistryV1Rule request,
core.String parent, {
core.String? ruleId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'ruleId': ?ruleId == null ? null : [ruleId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/rules';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleDevtoolsArtifactregistryV1Rule.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Deletes a rule.
///
/// Request parameters:
///
/// [name] - Required. The name of the rule to delete.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/rules/\[^/\]+$`.
///
/// [$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 a rule.
///
/// Request parameters:
///
/// [name] - Required. The name of the rule to retrieve.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/rules/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleDevtoolsArtifactregistryV1Rule].
///
/// 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<GoogleDevtoolsArtifactregistryV1Rule> 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 GoogleDevtoolsArtifactregistryV1Rule.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists rules.
///
/// Request parameters:
///
/// [parent] - Required. The name of the parent repository whose rules will be
/// listed. For example:
/// `projects/p1/locations/us-central1/repositories/repo1`.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [pageSize] - The maximum number of rules to return. Maximum page size is
/// 1,000.
///
/// [pageToken] - The next_page_token value returned from a previous list
/// request, if any.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRulesResponse].
///
/// 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<ListRulesResponse> list(
core.String parent, {
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('$parent') + '/rules';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRulesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a rule.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [name] - The name of the rule, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+/rules/\[^/\]+$`.
///
/// [updateMask] - The update mask applies to the resource. For the
/// `FieldMask` definition, see
/// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GoogleDevtoolsArtifactregistryV1Rule].
///
/// 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<GoogleDevtoolsArtifactregistryV1Rule> patch(
GoogleDevtoolsArtifactregistryV1Rule request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleDevtoolsArtifactregistryV1Rule.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ProjectsLocationsRepositoriesYumArtifactsResource {
final commons.ApiRequester _requester;
ProjectsLocationsRepositoriesYumArtifactsResource(commons.ApiRequester client)
: _requester = client;
/// Imports Yum (RPM) artifacts.
///
/// The returned Operation will complete once the resources are imported.
/// Package, Version, and File resources are created based on the imported
/// artifacts. Imported artifacts that conflict with existing resources are
/// ignored.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the artifacts will be
/// imported.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$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> import(
ImportYumArtifactsRequest 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') + '/yumArtifacts:import';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Directly uploads a Yum artifact.
///
/// The returned Operation will complete once the resources are uploaded.
/// Package, Version, and File resources are created based on the imported
/// artifact. Imported artifacts that conflict with existing resources are
/// ignored.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - The name of the parent resource where the artifacts will be
/// uploaded.
/// Value must have pattern
/// `^projects/\[^/\]+/locations/\[^/\]+/repositories/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// Completes with a [UploadYumArtifactMediaResponse].
///
/// 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<UploadYumArtifactMediaResponse> upload(
UploadYumArtifactRequest request,
core.String parent, {
core.String? $fields,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/yumArtifacts:create';
} else {
url_ =
'/upload/v1/' +
core.Uri.encodeFull('$parent') +
'/yumArtifacts:create';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: commons.UploadOptions.defaultOptions,
);
return UploadYumArtifactMediaResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
/// Configuration for an Apt remote repository.
class AptRepository {
/// Customer-specified remote repository.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository?
customRepository;
/// One of the publicly available Apt repositories supported by Artifact
/// Registry.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository?
publicRepository;
AptRepository({this.customRepository, this.publicRepository});
AptRepository.fromJson(core.Map json_)
: this(
customRepository: json_.containsKey('customRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository.fromJson(
json_['customRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
publicRepository: json_.containsKey('publicRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository.fromJson(
json_['publicRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final customRepository = this.customRepository;
final publicRepository = this.publicRepository;
return {
'customRepository': ?customRepository,
'publicRepository': ?publicRepository,
};
}
}
/// An Attachment refers to additional metadata that can be attached to
/// artifacts in Artifact Registry.
///
/// An attachment consists of one or more files.
class Attachment {
/// User annotations.
///
/// These attributes can only be set and used by the user, and not by Artifact
/// Registry. See https://google.aip.dev/128#annotations for more details such
/// as format and size limitations.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// The namespace this attachment belongs to.
///
/// E.g. If an attachment is created by artifact analysis, namespace is set to
/// `artifactanalysis.googleapis.com`.
core.String? attachmentNamespace;
/// The time when the attachment was created.
///
/// Output only.
core.String? createTime;
/// The files that belong to this attachment.
///
/// If the file ID part contains slashes, they are escaped. E.g.
/// `projects/p1/locations/us-central1/repositories/repo1/files/sha:`.
///
/// Required.
core.List<core.String>? files;
/// The name of the attachment.
///
/// E.g. `projects/p1/locations/us/repositories/repo/attachments/sbom`.
core.String? name;
/// The name of the OCI version that this attachment created.
///
/// Only populated for Docker attachments. E.g.
/// `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
///
/// Output only.
core.String? ociVersionName;
/// The target the attachment is for, can be a Version, Package or Repository.
///
/// E.g.
/// `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`.
///
/// Required.
core.String? target;
/// Type of attachment.
///
/// E.g. `application/vnd.spdx+json`
core.String? type;
/// The time when the attachment was last updated.
///
/// Output only.
core.String? updateTime;
Attachment({
this.annotations,
this.attachmentNamespace,
this.createTime,
this.files,
this.name,
this.ociVersionName,
this.target,
this.type,
this.updateTime,
});
Attachment.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),
),
attachmentNamespace: json_['attachmentNamespace'] as core.String?,
createTime: json_['createTime'] as core.String?,
files: (json_['files'] as core.List?)
?.map((value) => value as core.String)
.toList(),
name: json_['name'] as core.String?,
ociVersionName: json_['ociVersionName'] as core.String?,
target: json_['target'] as core.String?,
type: json_['type'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final attachmentNamespace = this.attachmentNamespace;
final createTime = this.createTime;
final files = this.files;
final name = this.name;
final ociVersionName = this.ociVersionName;
final target = this.target;
final type = this.type;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'attachmentNamespace': ?attachmentNamespace,
'createTime': ?createTime,
'files': ?files,
'name': ?name,
'ociVersionName': ?ociVersionName,
'target': ?target,
'type': ?type,
'updateTime': ?updateTime,
};
}
}
/// The request to delete multiple versions across a repository.
class BatchDeleteVersionsRequest {
/// The names of the versions to delete.
///
/// The maximum number of versions deleted per batch is determined by the
/// service and is dependent on the available resources in the region.
///
/// Required.
core.List<core.String>? names;
/// If true, the request is performed without deleting data, following
/// AIP-163.
core.bool? validateOnly;
BatchDeleteVersionsRequest({this.names, this.validateOnly});
BatchDeleteVersionsRequest.fromJson(core.Map json_)
: this(
names: (json_['names'] as core.List?)
?.map((value) => value as core.String)
.toList(),
validateOnly: json_['validateOnly'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final names = this.names;
final validateOnly = this.validateOnly;
return {'names': ?names, 'validateOnly': ?validateOnly};
}
}
/// Associates `members`, or principals, with a `role`.
class Binding {
/// The condition that is associated with this binding.
///
/// If the condition evaluates to `true`, then this binding applies to the
/// current request. If the condition evaluates to `false`, then this binding
/// does not apply to the current request. However, a different role binding
/// might grant the same role to one or more of the principals in this
/// binding. To learn which resources support conditions in their IAM
/// policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Expr? condition;
/// Specifies the principals requesting access for a Google Cloud resource.
///
/// `members` can have the following values: * `allUsers`: A special
/// identifier that represents anyone who is on the internet; with or without
/// a Google account. * `allAuthenticatedUsers`: A special identifier that
/// represents anyone who is authenticated with a Google account or a service
/// account. Does not include identities that come from external identity
/// providers (IdPs) through identity federation. * `user:{emailid}`: An email
/// address that represents a specific Google account. For example,
/// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
/// represents a Google service account. For example,
/// `my-other-app@appspot.gserviceaccount.com`. *
/// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
/// identifier for a
/// [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
/// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
/// `group:{emailid}`: An email address that represents a Google group. For
/// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
/// (primary) that represents all the users of that domain. For example,
/// `google.com` or `example.com`. *
/// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`:
/// A single identity in a workforce identity pool. *
/// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`:
/// All workforce identities in a group. *
/// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`:
/// All workforce identities with a specific attribute value. *
/// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}
/// / * `: All identities in a workforce identity pool. *
/// `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`:
/// A single identity in a workload identity pool. *
/// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`:
/// A workload identity pool group. *
/// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`:
/// All identities in a workload identity pool with a certain attribute. *
/// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}
/// / * `: All identities in a workload identity pool. *
/// `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
/// identifier) representing a user that has been recently deleted. For
/// example, `alice@example.com?uid=123456789012345678901`. If the user is
/// recovered, this value reverts to `user:{emailid}` and the recovered user
/// retains the role in the binding. *
/// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
/// unique identifier) representing a service account that has been recently
/// deleted. For example,
/// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If
/// the service account is undeleted, this value reverts to
/// `serviceAccount:{emailid}` and the undeleted service account retains the
/// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
/// address (plus unique identifier) representing a Google group that has been
/// recently deleted. For example,
/// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
/// this value reverts to `group:{emailid}` and the recovered group retains
/// the role in the binding. *
/// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`:
/// Deleted single identity in a workforce identity pool. For example,
/// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
core.List<core.String>? members;
/// Role that is assigned to the list of `members`, or principals.
///
/// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an
/// overview of the IAM roles and permissions, see the
/// [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For
/// a list of the available pre-defined roles, see
/// [here](https://cloud.google.com/iam/docs/understanding-roles).
core.String? role;
Binding({this.condition, this.members, this.role});
Binding.fromJson(core.Map json_)
: this(
condition: json_.containsKey('condition')
? Expr.fromJson(
json_['condition'] as core.Map<core.String, core.dynamic>,
)
: null,
members: (json_['members'] as core.List?)
?.map((value) => value as core.String)
.toList(),
role: json_['role'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final condition = this.condition;
final members = this.members;
final role = this.role;
return {'condition': ?condition, 'members': ?members, 'role': ?role};
}
}
/// The request message for Operations.CancelOperation.
typedef CancelOperationRequest = $Empty;
/// Artifact policy configuration for repository cleanup policies.
class CleanupPolicy {
/// Policy action.
/// Possible string values are:
/// - "ACTION_UNSPECIFIED" : Action not specified.
/// - "DELETE" : Delete action.
/// - "KEEP" : Keep action.
core.String? action;
/// Policy condition for matching versions.
CleanupPolicyCondition? condition;
/// The user-provided ID of the cleanup policy.
core.String? id;
/// Policy condition for retaining a minimum number of versions.
///
/// May only be specified with a Keep action.
CleanupPolicyMostRecentVersions? mostRecentVersions;
CleanupPolicy({
this.action,
this.condition,
this.id,
this.mostRecentVersions,
});
CleanupPolicy.fromJson(core.Map json_)
: this(
action: json_['action'] as core.String?,
condition: json_.containsKey('condition')
? CleanupPolicyCondition.fromJson(
json_['condition'] as core.Map<core.String, core.dynamic>,
)
: null,
id: json_['id'] as core.String?,
mostRecentVersions: json_.containsKey('mostRecentVersions')
? CleanupPolicyMostRecentVersions.fromJson(
json_['mostRecentVersions']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final action = this.action;
final condition = this.condition;
final id = this.id;
final mostRecentVersions = this.mostRecentVersions;
return {
'action': ?action,
'condition': ?condition,
'id': ?id,
'mostRecentVersions': ?mostRecentVersions,
};
}
}
/// CleanupPolicyCondition is a set of conditions attached to a CleanupPolicy.
///
/// If multiple entries are set, all must be satisfied for the condition to be
/// satisfied.
class CleanupPolicyCondition {
/// Match versions newer than a duration.
core.String? newerThan;
/// Match versions older than a duration.
core.String? olderThan;
/// Match versions by package prefix.
///
/// Applied on any prefix match.
core.List<core.String>? packageNamePrefixes;
/// Match versions by tag prefix.
///
/// Applied on any prefix match.
core.List<core.String>? tagPrefixes;
/// Match versions by tag status.
/// Possible string values are:
/// - "TAG_STATE_UNSPECIFIED" : Tag status not specified.
/// - "TAGGED" : Applies to tagged versions only.
/// - "UNTAGGED" : Applies to untagged versions only.
/// - "ANY" : Applies to all versions.
core.String? tagState;
/// Match versions by version name prefix.
///
/// Applied on any prefix match.
core.List<core.String>? versionNamePrefixes;
CleanupPolicyCondition({
this.newerThan,
this.olderThan,
this.packageNamePrefixes,
this.tagPrefixes,
this.tagState,
this.versionNamePrefixes,
});
CleanupPolicyCondition.fromJson(core.Map json_)
: this(
newerThan: json_['newerThan'] as core.String?,
olderThan: json_['olderThan'] as core.String?,
packageNamePrefixes: (json_['packageNamePrefixes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
tagPrefixes: (json_['tagPrefixes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
tagState: json_['tagState'] as core.String?,
versionNamePrefixes: (json_['versionNamePrefixes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final newerThan = this.newerThan;
final olderThan = this.olderThan;
final packageNamePrefixes = this.packageNamePrefixes;
final tagPrefixes = this.tagPrefixes;
final tagState = this.tagState;
final versionNamePrefixes = this.versionNamePrefixes;
return {
'newerThan': ?newerThan,
'olderThan': ?olderThan,
'packageNamePrefixes': ?packageNamePrefixes,
'tagPrefixes': ?tagPrefixes,
'tagState': ?tagState,
'versionNamePrefixes': ?versionNamePrefixes,
};
}
}
/// CleanupPolicyMostRecentVersions is an alternate condition of a CleanupPolicy
/// for retaining a minimum number of versions.
class CleanupPolicyMostRecentVersions {
/// Minimum number of versions to keep.
core.int? keepCount;
/// List of package name prefixes that will apply this rule.
core.List<core.String>? packageNamePrefixes;
CleanupPolicyMostRecentVersions({this.keepCount, this.packageNamePrefixes});
CleanupPolicyMostRecentVersions.fromJson(core.Map json_)
: this(
keepCount: json_['keepCount'] as core.int?,
packageNamePrefixes: (json_['packageNamePrefixes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final keepCount = this.keepCount;
final packageNamePrefixes = this.packageNamePrefixes;
return {
'keepCount': ?keepCount,
'packageNamePrefixes': ?packageNamePrefixes,
};
}
}
/// Common remote repository settings type.
class CommonRemoteRepository {
/// A common public repository base for remote repository.
///
/// Required.
core.String? uri;
CommonRemoteRepository({this.uri});
CommonRemoteRepository.fromJson(core.Map json_)
: this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// DockerImage represents a docker artifact.
///
/// The following fields are returned as untyped metadata in the Version
/// resource, using camelcase keys (i.e. metadata.imageSizeBytes): *
/// imageSizeBytes * mediaType * buildTime
class DockerImage {
/// ArtifactType of this image, e.g. "application/vnd.example+type".
///
/// If the `subject_digest` is set and no `artifact_type` is given, the
/// `media_type` will be considered as the `artifact_type`. This field is
/// returned as the `metadata.artifactType` field in the Version resource.
core.String? artifactType;
/// The time this image was built.
///
/// This field is returned as the 'metadata.buildTime' field in the Version
/// resource. The build time is returned to the client as an RFC 3339 string,
/// which can be easily used with the JavaScript Date constructor.
core.String? buildTime;
/// For multi-arch images (manifest lists), this field contains the list of
/// image manifests.
///
/// Optional.
core.List<ImageManifest>? imageManifests;
/// Calculated size of the image.
///
/// This field is returned as the 'metadata.imageSizeBytes' field in the
/// Version resource.
core.String? imageSizeBytes;
/// Media type of this image, e.g.
/// "application/vnd.docker.distribution.manifest.v2+json".
///
/// This field is returned as the 'metadata.mediaType' field in the Version
/// resource.
core.String? mediaType;
/// registry_location, project_id, repository_name and image id forms a unique
/// image name:`projects//locations//repositories//dockerImages/`.
///
/// For example,
/// "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
/// nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
/// where "us-west4" is the registry_location, "test-project" is the
/// project_id, "test-repo" is the repository_name and
/// "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
/// is the image's digest.
///
/// Required.
core.String? name;
/// Tags attached to this image.
core.List<core.String>? tags;
/// The time when the docker image was last updated.
///
/// Output only.
core.String? updateTime;
/// Time the image was uploaded.
core.String? uploadTime;
/// URL to access the image.
///
/// Example:
/// us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
///
/// Required.
core.String? uri;
DockerImage({
this.artifactType,
this.buildTime,
this.imageManifests,
this.imageSizeBytes,
this.mediaType,
this.name,
this.tags,
this.updateTime,
this.uploadTime,
this.uri,
});
DockerImage.fromJson(core.Map json_)
: this(
artifactType: json_['artifactType'] as core.String?,
buildTime: json_['buildTime'] as core.String?,
imageManifests: (json_['imageManifests'] as core.List?)
?.map(
(value) => ImageManifest.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
imageSizeBytes: json_['imageSizeBytes'] as core.String?,
mediaType: json_['mediaType'] as core.String?,
name: json_['name'] as core.String?,
tags: (json_['tags'] as core.List?)
?.map((value) => value as core.String)
.toList(),
updateTime: json_['updateTime'] as core.String?,
uploadTime: json_['uploadTime'] as core.String?,
uri: json_['uri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final artifactType = this.artifactType;
final buildTime = this.buildTime;
final imageManifests = this.imageManifests;
final imageSizeBytes = this.imageSizeBytes;
final mediaType = this.mediaType;
final name = this.name;
final tags = this.tags;
final updateTime = this.updateTime;
final uploadTime = this.uploadTime;
final uri = this.uri;
return {
'artifactType': ?artifactType,
'buildTime': ?buildTime,
'imageManifests': ?imageManifests,
'imageSizeBytes': ?imageSizeBytes,
'mediaType': ?mediaType,
'name': ?name,
'tags': ?tags,
'updateTime': ?updateTime,
'uploadTime': ?uploadTime,
'uri': ?uri,
};
}
}
/// Configuration for a Docker remote repository.
class DockerRepository {
/// Customer-specified remote repository.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository?
customRepository;
/// One of the publicly available Docker repositories supported by Artifact
/// Registry.
/// Possible string values are:
/// - "PUBLIC_REPOSITORY_UNSPECIFIED" : Unspecified repository.
/// - "DOCKER_HUB" : Docker Hub.
core.String? publicRepository;
DockerRepository({this.customRepository, this.publicRepository});
DockerRepository.fromJson(core.Map json_)
: this(
customRepository: json_.containsKey('customRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository.fromJson(
json_['customRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
publicRepository: json_['publicRepository'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final customRepository = this.customRepository;
final publicRepository = this.publicRepository;
return {
'customRepository': ?customRepository,
'publicRepository': ?publicRepository,
};
}
}
/// DockerRepositoryConfig is docker related repository details.
///
/// Provides additional configuration details for repositories of the docker
/// format type.
class DockerRepositoryConfig {
/// The repository which enabled this flag prevents all tags from being
/// modified, moved or deleted.
///
/// This does not prevent tags from being created.
core.bool? immutableTags;
DockerRepositoryConfig({this.immutableTags});
DockerRepositoryConfig.fromJson(core.Map json_)
: this(immutableTags: json_['immutableTags'] as core.bool?);
core.Map<core.String, core.dynamic> toJson() {
final immutableTags = this.immutableTags;
return {'immutableTags': ?immutableTags};
}
}
/// The response to download a file.
typedef DownloadFileResponse = $Empty;
/// 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;
/// The request for exporting an artifact to a destination.
class ExportArtifactRequest {
/// The Cloud Storage path to export the artifact to.
///
/// Should start with the bucket name, and optionally have a directory path.
/// Examples: `dst_bucket`, `dst_bucket/sub_dir`. Existing objects with the
/// same path will be overwritten.
core.String? gcsPath;
/// The artifact tag to export.
///
/// Format:projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}
core.String? sourceTag;
/// The artifact version to export.
///
/// Format:
/// projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}
core.String? sourceVersion;
ExportArtifactRequest({this.gcsPath, this.sourceTag, this.sourceVersion});
ExportArtifactRequest.fromJson(core.Map json_)
: this(
gcsPath: json_['gcsPath'] as core.String?,
sourceTag: json_['sourceTag'] as core.String?,
sourceVersion: json_['sourceVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final gcsPath = this.gcsPath;
final sourceTag = this.sourceTag;
final sourceVersion = this.sourceVersion;
return {
'gcsPath': ?gcsPath,
'sourceTag': ?sourceTag,
'sourceVersion': ?sourceVersion,
};
}
}
/// Represents a textual expression in the Common Expression Language (CEL)
/// syntax.
///
/// CEL is a C-like expression language. The syntax and semantics of CEL are
/// documented at https://github.com/google/cel-spec. Example (Comparison):
/// title: "Summary size limit" description: "Determines if a summary is less
/// than 100 chars" expression: "document.summary.size() \< 100" Example
/// (Equality): title: "Requestor is owner" description: "Determines if
/// requestor is the document owner" expression: "document.owner ==
/// request.auth.claims.email" Example (Logic): title: "Public documents"
/// description: "Determine whether the document should be publicly visible"
/// expression: "document.type != 'private' && document.type != 'internal'"
/// Example (Data Manipulation): title: "Notification string" description:
/// "Create a notification string with a timestamp." expression: "'New message
/// received at ' + string(document.create_time)" The exact variables and
/// functions that may be referenced within an expression are determined by the
/// service that evaluates it. See the service documentation for additional
/// information.
typedef Expr = $Expr;
/// Files store content that is potentially associated with Packages or
/// Versions.
class GoogleDevtoolsArtifactregistryV1File {
/// Client specified annotations.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// The time when the File was created.
///
/// Output only.
core.String? createTime;
/// The time when the last attempt to refresh the file's data was made.
///
/// Only set when the repository is remote.
///
/// Output only.
core.String? fetchTime;
/// The hashes of the file content.
core.List<Hash>? hashes;
/// The name of the file, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`.
///
/// If the file ID part contains slashes, they are escaped.
core.String? name;
/// The name of the Package or Version that owns this file, if any.
core.String? owner;
/// The size of the File in bytes.
core.String? sizeBytes;
/// The time when the File was last updated.
///
/// Output only.
core.String? updateTime;
GoogleDevtoolsArtifactregistryV1File({
this.annotations,
this.createTime,
this.fetchTime,
this.hashes,
this.name,
this.owner,
this.sizeBytes,
this.updateTime,
});
GoogleDevtoolsArtifactregistryV1File.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?,
fetchTime: json_['fetchTime'] as core.String?,
hashes: (json_['hashes'] as core.List?)
?.map(
(value) =>
Hash.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
name: json_['name'] as core.String?,
owner: json_['owner'] as core.String?,
sizeBytes: json_['sizeBytes'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final createTime = this.createTime;
final fetchTime = this.fetchTime;
final hashes = this.hashes;
final name = this.name;
final owner = this.owner;
final sizeBytes = this.sizeBytes;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'createTime': ?createTime,
'fetchTime': ?fetchTime,
'hashes': ?hashes,
'name': ?name,
'owner': ?owner,
'sizeBytes': ?sizeBytes,
'updateTime': ?updateTime,
};
}
}
/// Customer-specified publicly available remote repository.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository {
/// An http/https uri reference to the upstream remote repository, for ex:
/// "https://my.apt.registry/".
core.String? uri;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository({
this.uri,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository.fromJson(
core.Map json_,
) : this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// Publicly available Apt repositories constructed from a common repository
/// base and a custom repository path.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository {
/// A common public repository base for Apt.
/// Possible string values are:
/// - "REPOSITORY_BASE_UNSPECIFIED" : Unspecified repository base.
/// - "DEBIAN" : Debian.
/// - "UBUNTU" : Ubuntu LTS/Pro.
/// - "DEBIAN_SNAPSHOT" : Archived Debian.
core.String? repositoryBase;
/// A custom field to define a path to a specific repository from the base.
core.String? repositoryPath;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository({
this.repositoryBase,
this.repositoryPath,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository.fromJson(
core.Map json_,
) : this(
repositoryBase: json_['repositoryBase'] as core.String?,
repositoryPath: json_['repositoryPath'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final repositoryBase = this.repositoryBase;
final repositoryPath = this.repositoryPath;
return {
'repositoryBase': ?repositoryBase,
'repositoryPath': ?repositoryPath,
};
}
}
/// Customer-specified publicly available remote repository.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository {
/// An http/https uri reference to the custom remote repository, for ex:
/// "https://registry-1.docker.io".
core.String? uri;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository({
this.uri,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository.fromJson(
core.Map json_,
) : this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// Customer-specified publicly available remote repository.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository {
/// An http/https uri reference to the upstream remote repository, for ex:
/// "https://my.maven.registry/".
core.String? uri;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository({
this.uri,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository.fromJson(
core.Map json_,
) : this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// Customer-specified publicly available remote repository.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository {
/// An http/https uri reference to the upstream remote repository, for ex:
/// "https://my.npm.registry/".
core.String? uri;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository({
this.uri,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository.fromJson(
core.Map json_,
) : this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// Customer-specified publicly available remote repository.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository {
/// An http/https uri reference to the upstream remote repository, for ex:
/// "https://my.python.registry/".
core.String? uri;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository({
this.uri,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository.fromJson(
core.Map json_,
) : this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// Customer-specified publicly available remote repository.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository {
/// An http/https uri reference to the upstream remote repository, for ex:
/// "https://my.yum.registry/".
core.String? uri;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository({
this.uri,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository.fromJson(
core.Map json_,
) : this(uri: json_['uri'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final uri = this.uri;
return {'uri': ?uri};
}
}
/// Publicly available Yum repositories constructed from a common repository
/// base and a custom repository path.
class GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository {
/// A common public repository base for Yum.
/// Possible string values are:
/// - "REPOSITORY_BASE_UNSPECIFIED" : Unspecified repository base.
/// - "CENTOS" : CentOS.
/// - "CENTOS_DEBUG" : CentOS Debug.
/// - "CENTOS_VAULT" : CentOS Vault.
/// - "CENTOS_STREAM" : CentOS Stream.
/// - "ROCKY" : Rocky.
/// - "EPEL" : Fedora Extra Packages for Enterprise Linux (EPEL).
core.String? repositoryBase;
/// A custom field to define a path to a specific repository from the base.
core.String? repositoryPath;
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository({
this.repositoryBase,
this.repositoryPath,
});
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository.fromJson(
core.Map json_,
) : this(
repositoryBase: json_['repositoryBase'] as core.String?,
repositoryPath: json_['repositoryPath'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final repositoryBase = this.repositoryBase;
final repositoryPath = this.repositoryPath;
return {
'repositoryBase': ?repositoryBase,
'repositoryPath': ?repositoryPath,
};
}
}
/// A rule defines the deny or allow action of the operation it applies to and
/// the conditions required for the rule to apply.
///
/// You can set one rule for an entire repository and one rule for each package
/// within.
class GoogleDevtoolsArtifactregistryV1Rule {
/// The action this rule takes.
/// Possible string values are:
/// - "ACTION_UNSPECIFIED" : Action not specified.
/// - "ALLOW" : Allow the operation.
/// - "DENY" : Deny the operation.
core.String? action;
/// A CEL expression for conditions that must be met in order for the rule to
/// apply.
///
/// If not provided, the rule matches all objects.
///
/// Optional.
Expr? condition;
/// The name of the rule, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
core.String? name;
///
/// Possible string values are:
/// - "OPERATION_UNSPECIFIED" : Operation not specified.
/// - "DOWNLOAD" : Download operation.
core.String? operation;
/// The package ID the rule applies to.
///
/// If empty, this rule applies to all packages inside the repository.
core.String? packageId;
GoogleDevtoolsArtifactregistryV1Rule({
this.action,
this.condition,
this.name,
this.operation,
this.packageId,
});
GoogleDevtoolsArtifactregistryV1Rule.fromJson(core.Map json_)
: this(
action: json_['action'] as core.String?,
condition: json_.containsKey('condition')
? Expr.fromJson(
json_['condition'] as core.Map<core.String, core.dynamic>,
)
: null,
name: json_['name'] as core.String?,
operation: json_['operation'] as core.String?,
packageId: json_['packageId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final action = this.action;
final condition = this.condition;
final name = this.name;
final operation = this.operation;
final packageId = this.packageId;
return {
'action': ?action,
'condition': ?condition,
'name': ?name,
'operation': ?operation,
'packageId': ?packageId,
};
}
}
/// A hash of file content.
class Hash {
/// The algorithm used to compute the hash value.
/// Possible string values are:
/// - "HASH_TYPE_UNSPECIFIED" : Unspecified.
/// - "SHA256" : SHA256 hash.
/// - "MD5" : MD5 hash.
/// - "DIRSUM_SHA256" : Dirsum SHA256 hash.
core.String? type;
/// The hash value.
core.String? value;
core.List<core.int> get valueAsBytes => convert.base64.decode(value!);
set valueAsBytes(core.List<core.int> bytes_) {
value = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
Hash({this.type, this.value});
Hash.fromJson(core.Map json_)
: this(
type: json_['type'] as core.String?,
value: json_['value'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final type = this.type;
final value = this.value;
return {'type': ?type, 'value': ?value};
}
}
/// Details of a single image manifest within a multi-arch image.
class ImageManifest {
/// The CPU architecture of the image.
///
/// Values are provided by the Docker client and are not validated by Artifact
/// Registry. Example values include "amd64", "arm64", "ppc64le", "s390x",
/// "riscv64", "mips64le", etc.
///
/// Optional.
core.String? architecture;
/// The manifest digest, in the format "sha256:".
///
/// Optional.
core.String? digest;
/// The media type of the manifest, e.g.,
/// "application/vnd.docker.distribution.manifest.v2+json"
///
/// Optional.
core.String? mediaType;
/// The operating system of the image.
///
/// Values are provided by the Docker client and are not validated by Artifact
/// Registry. Example values include "linux", "windows", "darwin", "aix", etc.
///
/// Optional.
core.String? os;
/// The required OS features for the image, for example on Windows `win32k`.
///
/// Optional.
core.List<core.String>? osFeatures;
/// The OS version of the image, for example on Windows `10.0.14393.1066`.
///
/// Optional.
core.String? osVersion;
/// The variant of the CPU in the image, for example `v7` to specify ARMv7
/// when architecture is `arm`.
///
/// Optional.
core.String? variant;
ImageManifest({
this.architecture,
this.digest,
this.mediaType,
this.os,
this.osFeatures,
this.osVersion,
this.variant,
});
ImageManifest.fromJson(core.Map json_)
: this(
architecture: json_['architecture'] as core.String?,
digest: json_['digest'] as core.String?,
mediaType: json_['mediaType'] as core.String?,
os: json_['os'] as core.String?,
osFeatures: (json_['osFeatures'] as core.List?)
?.map((value) => value as core.String)
.toList(),
osVersion: json_['osVersion'] as core.String?,
variant: json_['variant'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final architecture = this.architecture;
final digest = this.digest;
final mediaType = this.mediaType;
final os = this.os;
final osFeatures = this.osFeatures;
final osVersion = this.osVersion;
final variant = this.variant;
return {
'architecture': ?architecture,
'digest': ?digest,
'mediaType': ?mediaType,
'os': ?os,
'osFeatures': ?osFeatures,
'osVersion': ?osVersion,
'variant': ?variant,
};
}
}
/// Google Cloud Storage location where the artifacts currently reside.
typedef ImportAptArtifactsGcsSource = $ArtifactsGcsSource;
/// The request to import new apt artifacts.
class ImportAptArtifactsRequest {
/// Google Cloud Storage location where input content is located.
ImportAptArtifactsGcsSource? gcsSource;
ImportAptArtifactsRequest({this.gcsSource});
ImportAptArtifactsRequest.fromJson(core.Map json_)
: this(
gcsSource: json_.containsKey('gcsSource')
? ImportAptArtifactsGcsSource.fromJson(
json_['gcsSource'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final gcsSource = this.gcsSource;
return {'gcsSource': ?gcsSource};
}
}
/// Google Cloud Storage location where the artifacts currently reside.
class ImportGoogetArtifactsGcsSource {
/// Cloud Storage paths URI (e.g., `gs://my_bucket/my_object`).
core.List<core.String>? uris;
/// Supports URI wildcards for matching multiple objects from a single URI.
core.bool? useWildcards;
ImportGoogetArtifactsGcsSource({this.uris, this.useWildcards});
ImportGoogetArtifactsGcsSource.fromJson(core.Map json_)
: this(
uris: (json_['uris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
useWildcards: json_['useWildcards'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final uris = this.uris;
final useWildcards = this.useWildcards;
return {'uris': ?uris, 'useWildcards': ?useWildcards};
}
}
/// The request to import new googet artifacts.
class ImportGoogetArtifactsRequest {
/// Google Cloud Storage location where input content is located.
ImportGoogetArtifactsGcsSource? gcsSource;
ImportGoogetArtifactsRequest({this.gcsSource});
ImportGoogetArtifactsRequest.fromJson(core.Map json_)
: this(
gcsSource: json_.containsKey('gcsSource')
? ImportGoogetArtifactsGcsSource.fromJson(
json_['gcsSource'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final gcsSource = this.gcsSource;
return {'gcsSource': ?gcsSource};
}
}
/// Google Cloud Storage location where the artifacts currently reside.
typedef ImportYumArtifactsGcsSource = $ArtifactsGcsSource;
/// The request to import new yum artifacts.
class ImportYumArtifactsRequest {
/// Google Cloud Storage location where input content is located.
ImportYumArtifactsGcsSource? gcsSource;
ImportYumArtifactsRequest({this.gcsSource});
ImportYumArtifactsRequest.fromJson(core.Map json_)
: this(
gcsSource: json_.containsKey('gcsSource')
? ImportYumArtifactsGcsSource.fromJson(
json_['gcsSource'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final gcsSource = this.gcsSource;
return {'gcsSource': ?gcsSource};
}
}
/// The response from listing attachments.
class ListAttachmentsResponse {
/// The attachments returned.
core.List<Attachment>? attachments;
/// The token to retrieve the next page of attachments, or empty if there are
/// no more attachments to return.
core.String? nextPageToken;
ListAttachmentsResponse({this.attachments, this.nextPageToken});
ListAttachmentsResponse.fromJson(core.Map json_)
: this(
attachments: (json_['attachments'] as core.List?)
?.map(
(value) => Attachment.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final attachments = this.attachments;
final nextPageToken = this.nextPageToken;
return {'attachments': ?attachments, 'nextPageToken': ?nextPageToken};
}
}
/// The response from listing docker images.
class ListDockerImagesResponse {
/// The docker images returned.
core.List<DockerImage>? dockerImages;
/// The token to retrieve the next page of artifacts, or empty if there are no
/// more artifacts to return.
core.String? nextPageToken;
ListDockerImagesResponse({this.dockerImages, this.nextPageToken});
ListDockerImagesResponse.fromJson(core.Map json_)
: this(
dockerImages: (json_['dockerImages'] as core.List?)
?.map(
(value) => DockerImage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final dockerImages = this.dockerImages;
final nextPageToken = this.nextPageToken;
return {'dockerImages': ?dockerImages, 'nextPageToken': ?nextPageToken};
}
}
/// The response from listing files.
class ListFilesResponse {
/// The files returned.
core.List<GoogleDevtoolsArtifactregistryV1File>? files;
/// The token to retrieve the next page of files, or empty if there are no
/// more files to return.
core.String? nextPageToken;
ListFilesResponse({this.files, this.nextPageToken});
ListFilesResponse.fromJson(core.Map json_)
: this(
files: (json_['files'] as core.List?)
?.map(
(value) => GoogleDevtoolsArtifactregistryV1File.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final files = this.files;
final nextPageToken = this.nextPageToken;
return {'files': ?files, 'nextPageToken': ?nextPageToken};
}
}
/// The response message for Locations.ListLocations.
class ListLocationsResponse {
/// A list of locations that matches the specified filter in the request.
core.List<Location>? locations;
/// The standard List next-page token.
core.String? nextPageToken;
ListLocationsResponse({this.locations, this.nextPageToken});
ListLocationsResponse.fromJson(core.Map json_)
: this(
locations: (json_['locations'] as core.List?)
?.map(
(value) => Location.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final locations = this.locations;
final nextPageToken = this.nextPageToken;
return {'locations': ?locations, 'nextPageToken': ?nextPageToken};
}
}
/// The response from listing maven artifacts.
class ListMavenArtifactsResponse {
/// The maven artifacts returned.
core.List<MavenArtifact>? mavenArtifacts;
/// The token to retrieve the next page of artifacts, or empty if there are no
/// more artifacts to return.
core.String? nextPageToken;
ListMavenArtifactsResponse({this.mavenArtifacts, this.nextPageToken});
ListMavenArtifactsResponse.fromJson(core.Map json_)
: this(
mavenArtifacts: (json_['mavenArtifacts'] as core.List?)
?.map(
(value) => MavenArtifact.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final mavenArtifacts = this.mavenArtifacts;
final nextPageToken = this.nextPageToken;
return {'mavenArtifacts': ?mavenArtifacts, 'nextPageToken': ?nextPageToken};
}
}
/// The response from listing npm packages.
class ListNpmPackagesResponse {
/// The token to retrieve the next page of artifacts, or empty if there are no
/// more artifacts to return.
core.String? nextPageToken;
/// The npm packages returned.
core.List<NpmPackage>? npmPackages;
ListNpmPackagesResponse({this.nextPageToken, this.npmPackages});
ListNpmPackagesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
npmPackages: (json_['npmPackages'] as core.List?)
?.map(
(value) => NpmPackage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final npmPackages = this.npmPackages;
return {'nextPageToken': ?nextPageToken, 'npmPackages': ?npmPackages};
}
}
/// The response from listing packages.
class ListPackagesResponse {
/// The token to retrieve the next page of packages, or empty if there are no
/// more packages to return.
core.String? nextPageToken;
/// The packages returned.
core.List<Package>? packages;
ListPackagesResponse({this.nextPageToken, this.packages});
ListPackagesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
packages: (json_['packages'] as core.List?)
?.map(
(value) => Package.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final packages = this.packages;
return {'nextPageToken': ?nextPageToken, 'packages': ?packages};
}
}
/// The response from listing python packages.
class ListPythonPackagesResponse {
/// The token to retrieve the next page of artifacts, or empty if there are no
/// more artifacts to return.
core.String? nextPageToken;
/// The python packages returned.
core.List<PythonPackage>? pythonPackages;
ListPythonPackagesResponse({this.nextPageToken, this.pythonPackages});
ListPythonPackagesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
pythonPackages: (json_['pythonPackages'] as core.List?)
?.map(
(value) => PythonPackage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final pythonPackages = this.pythonPackages;
return {'nextPageToken': ?nextPageToken, 'pythonPackages': ?pythonPackages};
}
}
/// The response from listing repositories.
class ListRepositoriesResponse {
/// The token to retrieve the next page of repositories, or empty if there are
/// no more repositories to return.
core.String? nextPageToken;
/// The repositories returned.
core.List<Repository>? repositories;
ListRepositoriesResponse({this.nextPageToken, this.repositories});
ListRepositoriesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
repositories: (json_['repositories'] as core.List?)
?.map(
(value) => Repository.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final repositories = this.repositories;
return {'nextPageToken': ?nextPageToken, 'repositories': ?repositories};
}
}
/// The response from listing rules.
class ListRulesResponse {
/// The token to retrieve the next page of rules, or empty if there are no
/// more rules to return.
core.String? nextPageToken;
/// The rules returned.
core.List<GoogleDevtoolsArtifactregistryV1Rule>? rules;
ListRulesResponse({this.nextPageToken, this.rules});
ListRulesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
rules: (json_['rules'] as core.List?)
?.map(
(value) => GoogleDevtoolsArtifactregistryV1Rule.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final rules = this.rules;
return {'nextPageToken': ?nextPageToken, 'rules': ?rules};
}
}
/// The response from listing tags.
class ListTagsResponse {
/// The token to retrieve the next page of tags, or empty if there are no more
/// tags to return.
core.String? nextPageToken;
/// The tags returned.
core.List<Tag>? tags;
ListTagsResponse({this.nextPageToken, this.tags});
ListTagsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
tags: (json_['tags'] as core.List?)
?.map(
(value) =>
Tag.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final tags = this.tags;
return {'nextPageToken': ?nextPageToken, 'tags': ?tags};
}
}
/// The response from listing versions.
class ListVersionsResponse {
/// The token to retrieve the next page of versions, or empty if there are no
/// more versions to return.
core.String? nextPageToken;
/// The versions returned.
core.List<Version>? versions;
ListVersionsResponse({this.nextPageToken, this.versions});
ListVersionsResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
versions: (json_['versions'] as core.List?)
?.map(
(value) => Version.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final versions = this.versions;
return {'nextPageToken': ?nextPageToken, 'versions': ?versions};
}
}
/// A resource that represents a Google Cloud location.
typedef Location = $Location00;
/// MavenArtifact represents a maven artifact.
class MavenArtifact {
/// Artifact ID for the artifact.
core.String? artifactId;
/// Time the artifact was created.
///
/// Output only.
core.String? createTime;
/// Group ID for the artifact.
///
/// Example: com.google.guava
core.String? groupId;
/// registry_location, project_id, repository_name and maven_artifact forms a
/// unique artifact For example,
/// "projects/test-project/locations/us-west4/repositories/test-repo/mavenArtifacts/
/// com.google.guava:guava:31.0-jre", where "us-west4" is the
/// registry_location, "test-project" is the project_id, "test-repo" is the
/// repository_name and "com.google.guava:guava:31.0-jre" is the maven
/// artifact.
///
/// Required.
core.String? name;
/// URL to access the pom file of the artifact.
///
/// Example:
/// us-west4-maven.pkg.dev/test-project/test-repo/com/google/guava/guava/31.0/guava-31.0.pom
///
/// Required.
core.String? pomUri;
/// Time the artifact was updated.
///
/// Output only.
core.String? updateTime;
/// Version of this artifact.
core.String? version;
MavenArtifact({
this.artifactId,
this.createTime,
this.groupId,
this.name,
this.pomUri,
this.updateTime,
this.version,
});
MavenArtifact.fromJson(core.Map json_)
: this(
artifactId: json_['artifactId'] as core.String?,
createTime: json_['createTime'] as core.String?,
groupId: json_['groupId'] as core.String?,
name: json_['name'] as core.String?,
pomUri: json_['pomUri'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
version: json_['version'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final artifactId = this.artifactId;
final createTime = this.createTime;
final groupId = this.groupId;
final name = this.name;
final pomUri = this.pomUri;
final updateTime = this.updateTime;
final version = this.version;
return {
'artifactId': ?artifactId,
'createTime': ?createTime,
'groupId': ?groupId,
'name': ?name,
'pomUri': ?pomUri,
'updateTime': ?updateTime,
'version': ?version,
};
}
}
/// Configuration for a Maven remote repository.
class MavenRepository {
/// Customer-specified remote repository.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository?
customRepository;
/// One of the publicly available Maven repositories supported by Artifact
/// Registry.
/// Possible string values are:
/// - "PUBLIC_REPOSITORY_UNSPECIFIED" : Unspecified repository.
/// - "MAVEN_CENTRAL" : Maven Central.
core.String? publicRepository;
MavenRepository({this.customRepository, this.publicRepository});
MavenRepository.fromJson(core.Map json_)
: this(
customRepository: json_.containsKey('customRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository.fromJson(
json_['customRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
publicRepository: json_['publicRepository'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final customRepository = this.customRepository;
final publicRepository = this.publicRepository;
return {
'customRepository': ?customRepository,
'publicRepository': ?publicRepository,
};
}
}
/// MavenRepositoryConfig is maven related repository details.
///
/// Provides additional configuration details for repositories of the maven
/// format type.
class MavenRepositoryConfig {
/// The repository with this flag will allow publishing the same snapshot
/// versions.
core.bool? allowSnapshotOverwrites;
/// Version policy defines the versions that the registry will accept.
/// Possible string values are:
/// - "VERSION_POLICY_UNSPECIFIED" : VERSION_POLICY_UNSPECIFIED - the version
/// policy is not defined. When the version policy is not defined, no
/// validation is performed for the versions.
/// - "RELEASE" : RELEASE - repository will accept only Release versions.
/// - "SNAPSHOT" : SNAPSHOT - repository will accept only Snapshot versions.
core.String? versionPolicy;
MavenRepositoryConfig({this.allowSnapshotOverwrites, this.versionPolicy});
MavenRepositoryConfig.fromJson(core.Map json_)
: this(
allowSnapshotOverwrites: json_['allowSnapshotOverwrites'] as core.bool?,
versionPolicy: json_['versionPolicy'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final allowSnapshotOverwrites = this.allowSnapshotOverwrites;
final versionPolicy = this.versionPolicy;
return {
'allowSnapshotOverwrites': ?allowSnapshotOverwrites,
'versionPolicy': ?versionPolicy,
};
}
}
/// NpmPackage represents an npm artifact.
class NpmPackage {
/// Time the package was created.
///
/// Output only.
core.String? createTime;
/// registry_location, project_id, repository_name and npm_package forms a
/// unique package For example,
/// "projects/test-project/locations/us-west4/repositories/test-repo/npmPackages/
/// npm_test:1.0.0", where "us-west4" is the registry_location, "test-project"
/// is the project_id, "test-repo" is the repository_name and npm_test:1.0.0"
/// is the npm package.
///
/// Required.
core.String? name;
/// Package for the artifact.
core.String? packageName;
/// Tags attached to this package.
core.List<core.String>? tags;
/// Time the package was updated.
///
/// Output only.
core.String? updateTime;
/// Version of this package.
core.String? version;
NpmPackage({
this.createTime,
this.name,
this.packageName,
this.tags,
this.updateTime,
this.version,
});
NpmPackage.fromJson(core.Map json_)
: this(
createTime: json_['createTime'] as core.String?,
name: json_['name'] as core.String?,
packageName: json_['packageName'] as core.String?,
tags: (json_['tags'] as core.List?)
?.map((value) => value as core.String)
.toList(),
updateTime: json_['updateTime'] as core.String?,
version: json_['version'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final createTime = this.createTime;
final name = this.name;
final packageName = this.packageName;
final tags = this.tags;
final updateTime = this.updateTime;
final version = this.version;
return {
'createTime': ?createTime,
'name': ?name,
'packageName': ?packageName,
'tags': ?tags,
'updateTime': ?updateTime,
'version': ?version,
};
}
}
/// Configuration for a Npm remote repository.
class NpmRepository {
/// Customer-specified remote repository.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository?
customRepository;
/// One of the publicly available Npm repositories supported by Artifact
/// Registry.
/// Possible string values are:
/// - "PUBLIC_REPOSITORY_UNSPECIFIED" : Unspecified repository.
/// - "NPMJS" : npmjs.
core.String? publicRepository;
NpmRepository({this.customRepository, this.publicRepository});
NpmRepository.fromJson(core.Map json_)
: this(
customRepository: json_.containsKey('customRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository.fromJson(
json_['customRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
publicRepository: json_['publicRepository'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final customRepository = this.customRepository;
final publicRepository = this.publicRepository;
return {
'customRepository': ?customRepository,
'publicRepository': ?publicRepository,
};
}
}
/// 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,
};
}
}
/// Packages are named collections of versions.
class Package {
/// Client specified annotations.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// The time when the package was created.
core.String? createTime;
/// The display name of the package.
core.String? displayName;
/// The name of the package, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`.
///
/// If the package ID part contains slashes, the slashes are escaped.
core.String? name;
/// The time when the package was last updated.
///
/// This includes publishing a new version of the package.
core.String? updateTime;
Package({
this.annotations,
this.createTime,
this.displayName,
this.name,
this.updateTime,
});
Package.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?,
displayName: json_['displayName'] as core.String?,
name: json_['name'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final createTime = this.createTime;
final displayName = this.displayName;
final name = this.name;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'createTime': ?createTime,
'displayName': ?displayName,
'name': ?name,
'updateTime': ?updateTime,
};
}
}
/// The platform logs config for a project or a repository.
class PlatformLogsConfig {
/// The state of the platform logs: enabled or disabled.
///
/// Optional.
/// Possible string values are:
/// - "LOGGING_STATE_UNSPECIFIED" : Platform logs settings for the parent
/// resource haven't been set. This is the default state or when the user
/// clears the settings for the parent.
/// - "ENABLED" : Platform logs are enabled.
/// - "DISABLED" : Platform logs are disabled.
core.String? loggingState;
/// The severity level for the logs.
///
/// Logs will be generated if their severity level is \>= than the value of
/// the severity level mentioned here.
///
/// Optional.
/// Possible string values are:
/// - "SEVERITY_LEVEL_UNSPECIFIED" : No severity level specified, meaning
/// everything is being logged.
/// - "DEBUG" : Debug or trace information.
/// - "INFO" : Routine information, such as ongoing status or performance.
/// - "NOTICE" : Normal but significant events, such as start up, shut down,
/// or a configuration change.
/// - "WARNING" : Warning events that might cause problems.
/// - "ERROR" : Error events that are likely to cause problems.
/// - "CRITICAL" : Critical events that cause more severe problems or outages.
/// - "ALERT" : Alert events that require a person must take an action
/// immediately.
/// - "EMERGENCY" : One or more systems are unusable.
core.String? severityLevel;
PlatformLogsConfig({this.loggingState, this.severityLevel});
PlatformLogsConfig.fromJson(core.Map json_)
: this(
loggingState: json_['loggingState'] as core.String?,
severityLevel: json_['severityLevel'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final loggingState = this.loggingState;
final severityLevel = this.severityLevel;
return {'loggingState': ?loggingState, 'severityLevel': ?severityLevel};
}
}
/// An Identity and Access Management (IAM) policy, which specifies access
/// controls for Google Cloud resources.
///
/// A `Policy` is a collection of `bindings`. A `binding` binds one or more
/// `members`, or principals, to a single `role`. Principals can be user
/// accounts, service accounts, Google groups, and domains (such as G Suite). A
/// `role` is a named list of permissions; each `role` can be an IAM predefined
/// role or a user-created custom role. For some types of Google Cloud
/// resources, a `binding` can also specify a `condition`, which is a logical
/// expression that allows access to a resource only if the expression evaluates
/// to `true`. A condition can add constraints based on attributes of the
/// request, the resource, or both. To learn which resources support conditions
/// in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
/// **JSON example:** ``` { "bindings": [ { "role":
/// "roles/resourcemanager.organizationAdmin", "members": [
/// "user:mike@example.com", "group:admins@example.com", "domain:google.com",
/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
/// "roles/resourcemanager.organizationViewer", "members": [
/// "user:eve@example.com" ], "condition": { "title": "expirable access",
/// "description": "Does not grant access after Sep 2020", "expression":
/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
/// "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
/// members: - user:mike@example.com - group:admins@example.com -
/// domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
/// role: roles/resourcemanager.organizationAdmin - members: -
/// user:eve@example.com role: roles/resourcemanager.organizationViewer
/// condition: title: expirable access description: Does not grant access after
/// Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
/// etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
/// see the [IAM documentation](https://cloud.google.com/iam/docs/).
class Policy {
/// Associates a list of `members`, or principals, with a `role`.
///
/// Optionally, may specify a `condition` that determines how and when the
/// `bindings` are applied. Each of the `bindings` must contain at least one
/// principal. The `bindings` in a `Policy` can refer to up to 1,500
/// principals; up to 250 of these principals can be Google groups. Each
/// occurrence of a principal counts towards these limits. For example, if the
/// `bindings` grant 50 different roles to `user:alice@example.com`, and not
/// to any other principal, then you can add another 1,450 principals to the
/// `bindings` in the `Policy`.
core.List<Binding>? bindings;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a policy from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform policy updates in order to avoid race
/// conditions: An `etag` is returned in the response to `getIamPolicy`, and
/// systems are expected to put that etag in the request to `setIamPolicy` to
/// ensure that their change will be applied to the same version of the
/// policy. **Important:** If you use IAM Conditions, you must include the
/// `etag` field whenever you call `setIamPolicy`. If you omit this field,
/// then IAM allows you to overwrite a version `3` policy with a version `1`
/// policy, and all of the conditions in the version `3` policy are lost.
core.String? etag;
core.List<core.int> get etagAsBytes => convert.base64.decode(etag!);
set etagAsBytes(core.List<core.int> bytes_) {
etag = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// Specifies the format of the policy.
///
/// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
/// are rejected. Any operation that affects conditional role bindings must
/// specify version `3`. This requirement applies to the following operations:
/// * Getting a policy that includes a conditional role binding * Adding a
/// conditional role binding to a policy * Changing a conditional role binding
/// in a policy * Removing any role binding, with or without a condition, from
/// a policy that includes conditions **Important:** If you use IAM
/// Conditions, you must include the `etag` field whenever you call
/// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a
/// version `3` policy with a version `1` policy, and all of the conditions in
/// the version `3` policy are lost. If a policy does not include any
/// conditions, operations on that policy may specify any valid version or
/// leave the field unset. To learn which resources support conditions in
/// their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
core.int? version;
Policy({this.bindings, this.etag, this.version});
Policy.fromJson(core.Map json_)
: this(
bindings: (json_['bindings'] as core.List?)
?.map(
(value) => Binding.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
etag: json_['etag'] as core.String?,
version: json_['version'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final bindings = this.bindings;
final etag = this.etag;
final version = this.version;
return {'bindings': ?bindings, 'etag': ?etag, 'version': ?version};
}
}
/// The Artifact Registry logging configurations that apply to a Project.
class ProjectConfig {
/// Identifier.
///
/// The name of the project's configuration. Always of the form:
/// projects/{project}/locations/{location}/projectConfig
core.String? name;
/// Configuration for platform logs.
///
/// Optional.
PlatformLogsConfig? platformLogsConfig;
ProjectConfig({this.name, this.platformLogsConfig});
ProjectConfig.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
platformLogsConfig: json_.containsKey('platformLogsConfig')
? PlatformLogsConfig.fromJson(
json_['platformLogsConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final platformLogsConfig = this.platformLogsConfig;
return {'name': ?name, 'platformLogsConfig': ?platformLogsConfig};
}
}
/// The Artifact Registry settings that apply to a Project.
class ProjectSettings {
/// The redirection state of the legacy repositories in this project.
/// Possible string values are:
/// - "REDIRECTION_STATE_UNSPECIFIED" : No redirection status has been set.
/// - "REDIRECTION_FROM_GCR_IO_DISABLED" : Redirection is disabled.
/// - "REDIRECTION_FROM_GCR_IO_ENABLED" : Redirection is enabled.
/// - "REDIRECTION_FROM_GCR_IO_FINALIZED" : Redirection is enabled, and has
/// been finalized so cannot be reverted.
/// - "REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING" : Redirection is enabled
/// and missing images are copied from GCR
/// - "REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING" : Redirection is partially
/// enabled and missing images are copied from GCR
core.String? legacyRedirectionState;
/// The name of the project's settings.
///
/// Always of the form: projects/{project-id}/projectSettings In update
/// request: never set In response: always set
core.String? name;
/// The percentage of pull traffic to redirect from GCR to AR when using
/// partial redirection.
core.int? pullPercent;
ProjectSettings({this.legacyRedirectionState, this.name, this.pullPercent});
ProjectSettings.fromJson(core.Map json_)
: this(
legacyRedirectionState: json_['legacyRedirectionState'] as core.String?,
name: json_['name'] as core.String?,
pullPercent: json_['pullPercent'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final legacyRedirectionState = this.legacyRedirectionState;
final name = this.name;
final pullPercent = this.pullPercent;
return {
'legacyRedirectionState': ?legacyRedirectionState,
'name': ?name,
'pullPercent': ?pullPercent,
};
}
}
/// PythonPackage represents a python artifact.
class PythonPackage {
/// Time the package was created.
///
/// Output only.
core.String? createTime;
/// registry_location, project_id, repository_name and python_package forms a
/// unique package name:`projects//locations//repository//pythonPackages/`.
///
/// For example,
/// "projects/test-project/locations/us-west4/repositories/test-repo/pythonPackages/
/// python_package:1.0.0", where "us-west4" is the registry_location,
/// "test-project" is the project_id, "test-repo" is the repository_name and
/// python_package:1.0.0" is the python package.
///
/// Required.
core.String? name;
/// Package for the artifact.
core.String? packageName;
/// Time the package was updated.
///
/// Output only.
core.String? updateTime;
/// URL to access the package.
///
/// Example:
/// us-west4-python.pkg.dev/test-project/test-repo/python_package/file-name-1.0.0.tar.gz
///
/// Required.
core.String? uri;
/// Version of this package.
core.String? version;
PythonPackage({
this.createTime,
this.name,
this.packageName,
this.updateTime,
this.uri,
this.version,
});
PythonPackage.fromJson(core.Map json_)
: this(
createTime: json_['createTime'] as core.String?,
name: json_['name'] as core.String?,
packageName: json_['packageName'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
uri: json_['uri'] as core.String?,
version: json_['version'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final createTime = this.createTime;
final name = this.name;
final packageName = this.packageName;
final updateTime = this.updateTime;
final uri = this.uri;
final version = this.version;
return {
'createTime': ?createTime,
'name': ?name,
'packageName': ?packageName,
'updateTime': ?updateTime,
'uri': ?uri,
'version': ?version,
};
}
}
/// Configuration for a Python remote repository.
class PythonRepository {
/// Customer-specified remote repository.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository?
customRepository;
/// One of the publicly available Python repositories supported by Artifact
/// Registry.
/// Possible string values are:
/// - "PUBLIC_REPOSITORY_UNSPECIFIED" : Unspecified repository.
/// - "PYPI" : PyPI.
core.String? publicRepository;
PythonRepository({this.customRepository, this.publicRepository});
PythonRepository.fromJson(core.Map json_)
: this(
customRepository: json_.containsKey('customRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository.fromJson(
json_['customRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
publicRepository: json_['publicRepository'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final customRepository = this.customRepository;
final publicRepository = this.publicRepository;
return {
'customRepository': ?customRepository,
'publicRepository': ?publicRepository,
};
}
}
/// Remote repository configuration.
class RemoteRepositoryConfig {
/// Specific settings for an Apt remote repository.
AptRepository? aptRepository;
/// Common remote repository settings.
///
/// Used as the remote repository upstream URL.
CommonRemoteRepository? commonRepository;
/// The description of the remote source.
core.String? description;
/// Input only.
///
/// A create/update remote repo option to avoid making a HEAD/GET request to
/// validate a remote repo and any supplied upstream credentials.
core.bool? disableUpstreamValidation;
/// Specific settings for a Docker remote repository.
DockerRepository? dockerRepository;
/// Specific settings for a Maven remote repository.
MavenRepository? mavenRepository;
/// Specific settings for an Npm remote repository.
NpmRepository? npmRepository;
/// Specific settings for a Python remote repository.
PythonRepository? pythonRepository;
/// The credentials used to access the remote repository.
///
/// Optional.
UpstreamCredentials? upstreamCredentials;
/// Specific settings for a Yum remote repository.
YumRepository? yumRepository;
RemoteRepositoryConfig({
this.aptRepository,
this.commonRepository,
this.description,
this.disableUpstreamValidation,
this.dockerRepository,
this.mavenRepository,
this.npmRepository,
this.pythonRepository,
this.upstreamCredentials,
this.yumRepository,
});
RemoteRepositoryConfig.fromJson(core.Map json_)
: this(
aptRepository: json_.containsKey('aptRepository')
? AptRepository.fromJson(
json_['aptRepository'] as core.Map<core.String, core.dynamic>,
)
: null,
commonRepository: json_.containsKey('commonRepository')
? CommonRemoteRepository.fromJson(
json_['commonRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
description: json_['description'] as core.String?,
disableUpstreamValidation:
json_['disableUpstreamValidation'] as core.bool?,
dockerRepository: json_.containsKey('dockerRepository')
? DockerRepository.fromJson(
json_['dockerRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
mavenRepository: json_.containsKey('mavenRepository')
? MavenRepository.fromJson(
json_['mavenRepository'] as core.Map<core.String, core.dynamic>,
)
: null,
npmRepository: json_.containsKey('npmRepository')
? NpmRepository.fromJson(
json_['npmRepository'] as core.Map<core.String, core.dynamic>,
)
: null,
pythonRepository: json_.containsKey('pythonRepository')
? PythonRepository.fromJson(
json_['pythonRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
upstreamCredentials: json_.containsKey('upstreamCredentials')
? UpstreamCredentials.fromJson(
json_['upstreamCredentials']
as core.Map<core.String, core.dynamic>,
)
: null,
yumRepository: json_.containsKey('yumRepository')
? YumRepository.fromJson(
json_['yumRepository'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final aptRepository = this.aptRepository;
final commonRepository = this.commonRepository;
final description = this.description;
final disableUpstreamValidation = this.disableUpstreamValidation;
final dockerRepository = this.dockerRepository;
final mavenRepository = this.mavenRepository;
final npmRepository = this.npmRepository;
final pythonRepository = this.pythonRepository;
final upstreamCredentials = this.upstreamCredentials;
final yumRepository = this.yumRepository;
return {
'aptRepository': ?aptRepository,
'commonRepository': ?commonRepository,
'description': ?description,
'disableUpstreamValidation': ?disableUpstreamValidation,
'dockerRepository': ?dockerRepository,
'mavenRepository': ?mavenRepository,
'npmRepository': ?npmRepository,
'pythonRepository': ?pythonRepository,
'upstreamCredentials': ?upstreamCredentials,
'yumRepository': ?yumRepository,
};
}
}
/// A Repository for storing artifacts with a specific format.
class Repository {
/// Cleanup policies for this repository.
///
/// Cleanup policies indicate when certain package versions can be
/// automatically deleted. Map keys are policy IDs supplied by users during
/// policy creation. They must unique within a repository and be under 128
/// characters in length.
///
/// Optional.
core.Map<core.String, CleanupPolicy>? cleanupPolicies;
/// If true, the cleanup pipeline is prevented from deleting versions in this
/// repository.
///
/// Optional.
core.bool? cleanupPolicyDryRun;
/// The time when the repository was created.
///
/// Output only.
core.String? createTime;
/// The user-provided description of the repository.
core.String? description;
/// If this is true, an unspecified repo type will be treated as error rather
/// than defaulting to standard.
///
/// Optional.
core.bool? disallowUnspecifiedMode;
/// Docker repository config contains repository level configuration for the
/// repositories of docker type.
DockerRepositoryConfig? dockerConfig;
/// The format of packages that are stored in the repository.
///
/// Optional.
/// Possible string values are:
/// - "FORMAT_UNSPECIFIED" : Unspecified package format.
/// - "DOCKER" : Docker package format.
/// - "MAVEN" : Maven package format.
/// - "NPM" : NPM package format.
/// - "APT" : APT package format.
/// - "YUM" : YUM package format.
/// - "GOOGET" : GooGet package format.
/// - "PYTHON" : Python package format.
/// - "KFP" : Kubeflow Pipelines package format.
/// - "GO" : Go package format.
/// - "GENERIC" : Generic package format.
/// - "RUBY" : Ruby package format.
core.String? format;
/// The Cloud KMS resource name of the customer managed encryption key that's
/// used to encrypt the contents of the Repository.
///
/// Has the form:
/// `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
/// This value may not be changed after the Repository has been created.
core.String? kmsKeyName;
/// Labels with user-defined metadata.
///
/// This field may contain up to 64 entries. Label keys and values may be no
/// longer than 63 characters. Label keys must begin with a lowercase letter
/// and may only contain lowercase letters, numeric characters, underscores,
/// and dashes.
core.Map<core.String, core.String>? labels;
/// Maven repository config contains repository level configuration for the
/// repositories of maven type.
MavenRepositoryConfig? mavenConfig;
/// The mode of the repository.
///
/// Optional.
/// Possible string values are:
/// - "MODE_UNSPECIFIED" : Unspecified mode.
/// - "STANDARD_REPOSITORY" : A standard repository storing artifacts.
/// - "VIRTUAL_REPOSITORY" : A virtual repository to serve artifacts from one
/// or more sources.
/// - "REMOTE_REPOSITORY" : A remote repository to serve artifacts from a
/// remote source.
/// - "AOSS_REPOSITORY" : An AOSS repository provides artifacts from AOSS
/// upstreams.
/// - "ASSURED_OSS_REPOSITORY" : Replacement of AOSS_REPOSITORY.
core.String? mode;
/// The name of the repository, for example:
/// `projects/p1/locations/us-central1/repositories/repo1`.
///
/// For each location in a project, repository names must be unique.
core.String? name;
/// Configuration for platform logs.
///
/// Optional.
PlatformLogsConfig? platformLogsConfig;
/// The repository endpoint, for example: `us-docker.pkg.dev/my-proj/my-repo`.
///
/// Output only.
core.String? registryUri;
/// Configuration specific for a Remote Repository.
RemoteRepositoryConfig? remoteRepositoryConfig;
/// Whether or not this repository satisfies PZI.
///
/// Output only.
core.bool? satisfiesPzi;
/// Whether or not this repository satisfies PZS.
///
/// Output only.
core.bool? satisfiesPzs;
/// The size, in bytes, of all artifact storage in this repository.
///
/// Repositories that are generally available or in public preview use this to
/// calculate storage costs.
///
/// Output only.
core.String? sizeBytes;
/// The time when the repository was last updated.
///
/// Output only.
core.String? updateTime;
/// Configuration specific for a Virtual Repository.
VirtualRepositoryConfig? virtualRepositoryConfig;
/// Config and state for vulnerability scanning of resources within this
/// Repository.
///
/// Optional.
VulnerabilityScanningConfig? vulnerabilityScanningConfig;
Repository({
this.cleanupPolicies,
this.cleanupPolicyDryRun,
this.createTime,
this.description,
this.disallowUnspecifiedMode,
this.dockerConfig,
this.format,
this.kmsKeyName,
this.labels,
this.mavenConfig,
this.mode,
this.name,
this.platformLogsConfig,
this.registryUri,
this.remoteRepositoryConfig,
this.satisfiesPzi,
this.satisfiesPzs,
this.sizeBytes,
this.updateTime,
this.virtualRepositoryConfig,
this.vulnerabilityScanningConfig,
});
Repository.fromJson(core.Map json_)
: this(
cleanupPolicies:
(json_['cleanupPolicies'] as core.Map<core.String, core.dynamic>?)
?.map(
(key, value) => core.MapEntry(
key,
CleanupPolicy.fromJson(
value as core.Map<core.String, core.dynamic>,
),
),
),
cleanupPolicyDryRun: json_['cleanupPolicyDryRun'] as core.bool?,
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
disallowUnspecifiedMode: json_['disallowUnspecifiedMode'] as core.bool?,
dockerConfig: json_.containsKey('dockerConfig')
? DockerRepositoryConfig.fromJson(
json_['dockerConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
format: json_['format'] as core.String?,
kmsKeyName: json_['kmsKeyName'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
mavenConfig: json_.containsKey('mavenConfig')
? MavenRepositoryConfig.fromJson(
json_['mavenConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
mode: json_['mode'] as core.String?,
name: json_['name'] as core.String?,
platformLogsConfig: json_.containsKey('platformLogsConfig')
? PlatformLogsConfig.fromJson(
json_['platformLogsConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
registryUri: json_['registryUri'] as core.String?,
remoteRepositoryConfig: json_.containsKey('remoteRepositoryConfig')
? RemoteRepositoryConfig.fromJson(
json_['remoteRepositoryConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
satisfiesPzi: json_['satisfiesPzi'] as core.bool?,
satisfiesPzs: json_['satisfiesPzs'] as core.bool?,
sizeBytes: json_['sizeBytes'] as core.String?,
updateTime: json_['updateTime'] as core.String?,
virtualRepositoryConfig: json_.containsKey('virtualRepositoryConfig')
? VirtualRepositoryConfig.fromJson(
json_['virtualRepositoryConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
vulnerabilityScanningConfig:
json_.containsKey('vulnerabilityScanningConfig')
? VulnerabilityScanningConfig.fromJson(
json_['vulnerabilityScanningConfig']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final cleanupPolicies = this.cleanupPolicies;
final cleanupPolicyDryRun = this.cleanupPolicyDryRun;
final createTime = this.createTime;
final description = this.description;
final disallowUnspecifiedMode = this.disallowUnspecifiedMode;
final dockerConfig = this.dockerConfig;
final format = this.format;
final kmsKeyName = this.kmsKeyName;
final labels = this.labels;
final mavenConfig = this.mavenConfig;
final mode = this.mode;
final name = this.name;
final platformLogsConfig = this.platformLogsConfig;
final registryUri = this.registryUri;
final remoteRepositoryConfig = this.remoteRepositoryConfig;
final satisfiesPzi = this.satisfiesPzi;
final satisfiesPzs = this.satisfiesPzs;
final sizeBytes = this.sizeBytes;
final updateTime = this.updateTime;
final virtualRepositoryConfig = this.virtualRepositoryConfig;
final vulnerabilityScanningConfig = this.vulnerabilityScanningConfig;
return {
'cleanupPolicies': ?cleanupPolicies,
'cleanupPolicyDryRun': ?cleanupPolicyDryRun,
'createTime': ?createTime,
'description': ?description,
'disallowUnspecifiedMode': ?disallowUnspecifiedMode,
'dockerConfig': ?dockerConfig,
'format': ?format,
'kmsKeyName': ?kmsKeyName,
'labels': ?labels,
'mavenConfig': ?mavenConfig,
'mode': ?mode,
'name': ?name,
'platformLogsConfig': ?platformLogsConfig,
'registryUri': ?registryUri,
'remoteRepositoryConfig': ?remoteRepositoryConfig,
'satisfiesPzi': ?satisfiesPzi,
'satisfiesPzs': ?satisfiesPzs,
'sizeBytes': ?sizeBytes,
'updateTime': ?updateTime,
'virtualRepositoryConfig': ?virtualRepositoryConfig,
'vulnerabilityScanningConfig': ?vulnerabilityScanningConfig,
};
}
}
/// Request message for `SetIamPolicy` method.
class SetIamPolicyRequest {
/// REQUIRED: The complete policy to be applied to the `resource`.
///
/// The size of the policy is limited to a few 10s of KB. An empty policy is a
/// valid policy but certain Google Cloud services (such as Projects) might
/// reject them.
Policy? policy;
SetIamPolicyRequest({this.policy});
SetIamPolicyRequest.fromJson(core.Map json_)
: this(
policy: json_.containsKey('policy')
? Policy.fromJson(
json_['policy'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final policy = this.policy;
return {'policy': ?policy};
}
}
/// The `Status` type defines a logical error model that is suitable for
/// different programming environments, including REST APIs and RPC APIs.
///
/// It is used by [gRPC](https://github.com/grpc). Each `Status` message
/// contains three pieces of data: error code, error message, and error details.
/// You can find out more about this error model and how to work with it in the
/// [API Design Guide](https://cloud.google.com/apis/design/errors).
typedef Status = $Status00;
/// Tags point to a version and represent an alternative name that can be used
/// to access the version.
class Tag {
/// The name of the tag, for example:
/// "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1".
///
/// If the package part contains slashes, the slashes are escaped. The tag
/// part can only have characters in \[a-zA-Z0-9\-._~:@\], anything else must
/// be URL encoded.
core.String? name;
/// The name of the version the tag refers to, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811`
/// If the package or version ID parts contain slashes, the slashes are
/// escaped.
core.String? version;
Tag({this.name, this.version});
Tag.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
version: json_['version'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final version = this.version;
return {'name': ?name, 'version': ?version};
}
}
/// Request message for `TestIamPermissions` method.
typedef TestIamPermissionsRequest = $TestIamPermissionsRequest00;
/// Response message for `TestIamPermissions` method.
typedef TestIamPermissionsResponse = $PermissionsResponse;
/// The response to upload an artifact.
class UploadAptArtifactMediaResponse {
/// Operation to be returned to the user.
Operation? operation;
UploadAptArtifactMediaResponse({this.operation});
UploadAptArtifactMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload an artifact.
typedef UploadAptArtifactRequest = $Empty;
/// The response to upload a generic artifact.
class UploadFileMediaResponse {
/// Operation that will be returned to the user.
Operation? operation;
UploadFileMediaResponse({this.operation});
UploadFileMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload a file.
class UploadFileRequest {
/// The ID of the file.
///
/// If left empty will default to sha256 digest of the content uploaded.
///
/// Optional.
core.String? fileId;
UploadFileRequest({this.fileId});
UploadFileRequest.fromJson(core.Map json_)
: this(fileId: json_['fileId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final fileId = this.fileId;
return {'fileId': ?fileId};
}
}
/// The response to upload a generic artifact.
class UploadGenericArtifactMediaResponse {
/// Operation that will be returned to the user.
Operation? operation;
UploadGenericArtifactMediaResponse({this.operation});
UploadGenericArtifactMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload a generic artifact.
///
/// The created GenericArtifact will have the resource name
/// {parent}/genericArtifacts/package_id:version_id. The created file will have
/// the resource name {parent}/files/package_id:version_id:filename.
class UploadGenericArtifactRequest {
/// The name of the file of the generic artifact to be uploaded.
///
/// E.g. `example-file.zip` The filename is limited to letters, numbers, and
/// url safe characters, i.e. \[a-zA-Z0-9-_.~@\].
core.String? filename;
/// The ID of the package of the generic artifact.
///
/// If the package does not exist, a new package will be created. The
/// `package_id` should start and end with a letter or number, only contain
/// letters, numbers, hyphens, underscores, and periods, and not exceed 256
/// characters.
core.String? packageId;
/// The ID of the version of the generic artifact.
///
/// If the version does not exist, a new version will be created. The
/// version_id must start and end with a letter or number, can only contain
/// lowercase letters, numbers, the following characters \[-.+~:\],
/// i.e.\[a-z0-9-.+~:\] and cannot exceed a total of 128 characters. Creating
/// a version called `latest` is not allowed.
core.String? versionId;
UploadGenericArtifactRequest({this.filename, this.packageId, this.versionId});
UploadGenericArtifactRequest.fromJson(core.Map json_)
: this(
filename: json_['filename'] as core.String?,
packageId: json_['packageId'] as core.String?,
versionId: json_['versionId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final filename = this.filename;
final packageId = this.packageId;
final versionId = this.versionId;
return {
'filename': ?filename,
'packageId': ?packageId,
'versionId': ?versionId,
};
}
}
/// The response to upload a Go module.
class UploadGoModuleMediaResponse {
/// Operation to be returned to the user.
Operation? operation;
UploadGoModuleMediaResponse({this.operation});
UploadGoModuleMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload a Go module.
typedef UploadGoModuleRequest = $Empty;
/// The response to upload an artifact.
class UploadGoogetArtifactMediaResponse {
/// Operation to be returned to the user.
Operation? operation;
UploadGoogetArtifactMediaResponse({this.operation});
UploadGoogetArtifactMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload an artifact.
typedef UploadGoogetArtifactRequest = $Empty;
/// The response to upload an artifact.
class UploadKfpArtifactMediaResponse {
/// Operation that will be returned to the user.
Operation? operation;
UploadKfpArtifactMediaResponse({this.operation});
UploadKfpArtifactMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload an artifact.
class UploadKfpArtifactRequest {
/// Description of the package version.
core.String? description;
/// Tags to be created with the version.
core.List<core.String>? tags;
UploadKfpArtifactRequest({this.description, this.tags});
UploadKfpArtifactRequest.fromJson(core.Map json_)
: this(
description: json_['description'] as core.String?,
tags: (json_['tags'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final description = this.description;
final tags = this.tags;
return {'description': ?description, 'tags': ?tags};
}
}
/// The response to upload an artifact.
class UploadYumArtifactMediaResponse {
/// Operation to be returned to the user.
Operation? operation;
UploadYumArtifactMediaResponse({this.operation});
UploadYumArtifactMediaResponse.fromJson(core.Map json_)
: this(
operation: json_.containsKey('operation')
? Operation.fromJson(
json_['operation'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final operation = this.operation;
return {'operation': ?operation};
}
}
/// The request to upload an artifact.
typedef UploadYumArtifactRequest = $Empty;
/// The credentials to access the remote repository.
class UpstreamCredentials {
/// Use username and password to access the remote repository.
UsernamePasswordCredentials? usernamePasswordCredentials;
UpstreamCredentials({this.usernamePasswordCredentials});
UpstreamCredentials.fromJson(core.Map json_)
: this(
usernamePasswordCredentials:
json_.containsKey('usernamePasswordCredentials')
? UsernamePasswordCredentials.fromJson(
json_['usernamePasswordCredentials']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final usernamePasswordCredentials = this.usernamePasswordCredentials;
return {'usernamePasswordCredentials': ?usernamePasswordCredentials};
}
}
/// Artifact policy configuration for the repository contents.
class UpstreamPolicy {
/// The user-provided ID of the upstream policy.
core.String? id;
/// Entries with a greater priority value take precedence in the pull order.
core.int? priority;
/// A reference to the repository resource, for example:
/// `projects/p1/locations/us-central1/repositories/repo1`.
core.String? repository;
UpstreamPolicy({this.id, this.priority, this.repository});
UpstreamPolicy.fromJson(core.Map json_)
: this(
id: json_['id'] as core.String?,
priority: json_['priority'] as core.int?,
repository: json_['repository'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final id = this.id;
final priority = this.priority;
final repository = this.repository;
return {'id': ?id, 'priority': ?priority, 'repository': ?repository};
}
}
/// Username and password credentials.
class UsernamePasswordCredentials {
/// The Secret Manager key version that holds the password to access the
/// remote repository.
///
/// Must be in the format of
/// `projects/{project}/secrets/{secret}/versions/{version}`.
core.String? passwordSecretVersion;
/// The username to access the remote repository.
core.String? username;
UsernamePasswordCredentials({this.passwordSecretVersion, this.username});
UsernamePasswordCredentials.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,
};
}
}
/// The Artifact Registry VPC SC config that apply to a Project.
class VPCSCConfig {
/// The name of the project's VPC SC Config.
///
/// Always of the form: projects/{projectID}/locations/{location}/vpcscConfig
/// In update request: never set In response: always set
core.String? name;
/// The project per location VPC SC policy that defines the VPC SC behavior
/// for the Remote Repository (Allow/Deny).
/// Possible string values are:
/// - "VPCSC_POLICY_UNSPECIFIED" : VPCSC_POLICY_UNSPECIFIED - the VPS SC
/// policy is not defined. When VPS SC policy is not defined - the Service
/// will use the default behavior (VPCSC_DENY).
/// - "DENY" : VPCSC_DENY - repository will block the requests to the
/// Upstreams for the Remote Repositories if the resource is in the perimeter.
/// - "ALLOW" : VPCSC_ALLOW - repository will allow the requests to the
/// Upstreams for the Remote Repositories if the resource is in the perimeter.
core.String? vpcscPolicy;
VPCSCConfig({this.name, this.vpcscPolicy});
VPCSCConfig.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
vpcscPolicy: json_['vpcscPolicy'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final vpcscPolicy = this.vpcscPolicy;
return {'name': ?name, 'vpcscPolicy': ?vpcscPolicy};
}
}
/// The body of a version resource.
///
/// A version resource represents a collection of components, such as files and
/// other data. This may correspond to a version in many package management
/// schemes.
class Version {
/// Client specified annotations.
///
/// Optional.
core.Map<core.String, core.String>? annotations;
/// The time when the version was created.
core.String? createTime;
/// Description of the version, as specified in its metadata.
///
/// Optional.
core.String? description;
/// Immutable reference for the version, calculated based on the version's
/// content.
///
/// Currently we only support dirsum_sha256 hash algorithm. Additional hash
/// algorithms may be added in the future.
///
/// Output only.
core.List<Hash>? fingerprints;
/// Repository-specific Metadata stored against this version.
///
/// The fields returned are defined by the underlying repository-specific
/// resource. Currently, the resources could be: DockerImage MavenArtifact
///
/// Output only.
///
/// 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 name of the version, for example:
/// `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`.
///
/// If the package or version ID parts contain slashes, the slashes are
/// escaped.
core.String? name;
/// A list of related tags.
///
/// Will contain up to 100 tags that reference this version.
///
/// Output only.
core.List<Tag>? relatedTags;
/// The time when the version was last updated.
core.String? updateTime;
Version({
this.annotations,
this.createTime,
this.description,
this.fingerprints,
this.metadata,
this.name,
this.relatedTags,
this.updateTime,
});
Version.fromJson(core.Map json_)
: this(
annotations:
(json_['annotations'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
createTime: json_['createTime'] as core.String?,
description: json_['description'] as core.String?,
fingerprints: (json_['fingerprints'] as core.List?)
?.map(
(value) =>
Hash.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
metadata: json_.containsKey('metadata')
? json_['metadata'] as core.Map<core.String, core.dynamic>
: null,
name: json_['name'] as core.String?,
relatedTags: (json_['relatedTags'] as core.List?)
?.map(
(value) =>
Tag.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
updateTime: json_['updateTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final annotations = this.annotations;
final createTime = this.createTime;
final description = this.description;
final fingerprints = this.fingerprints;
final metadata = this.metadata;
final name = this.name;
final relatedTags = this.relatedTags;
final updateTime = this.updateTime;
return {
'annotations': ?annotations,
'createTime': ?createTime,
'description': ?description,
'fingerprints': ?fingerprints,
'metadata': ?metadata,
'name': ?name,
'relatedTags': ?relatedTags,
'updateTime': ?updateTime,
};
}
}
/// Virtual repository configuration.
class VirtualRepositoryConfig {
/// Policies that configure the upstream artifacts distributed by the Virtual
/// Repository.
///
/// Upstream policies cannot be set on a standard repository.
core.List<UpstreamPolicy>? upstreamPolicies;
VirtualRepositoryConfig({this.upstreamPolicies});
VirtualRepositoryConfig.fromJson(core.Map json_)
: this(
upstreamPolicies: (json_['upstreamPolicies'] as core.List?)
?.map(
(value) => UpstreamPolicy.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final upstreamPolicies = this.upstreamPolicies;
return {'upstreamPolicies': ?upstreamPolicies};
}
}
/// Config on whether to perform vulnerability scanning for resources in this
/// repository, as well as output fields describing current state.
class VulnerabilityScanningConfig {
/// Config for whether this repository has vulnerability scanning disabled.
///
/// Optional.
/// Possible string values are:
/// - "ENABLEMENT_CONFIG_UNSPECIFIED" : Not set. This will be treated as
/// INHERITED for Docker repositories and DISABLED for non-Docker
/// repositories.
/// - "INHERITED" : Scanning is Enabled, but dependent on API enablement.
/// - "DISABLED" : No automatic vulnerability scanning will be performed for
/// this repository.
core.String? enablementConfig;
/// State of feature enablement, combining repository enablement config and
/// API enablement state.
///
/// Output only.
/// Possible string values are:
/// - "ENABLEMENT_STATE_UNSPECIFIED" : Enablement state is unclear.
/// - "SCANNING_UNSUPPORTED" : Repository does not support vulnerability
/// scanning.
/// - "SCANNING_DISABLED" : Vulnerability scanning is disabled for this
/// repository.
/// - "SCANNING_ACTIVE" : Vulnerability scanning is active for this
/// repository.
core.String? enablementState;
/// Reason for the repository state.
///
/// Output only.
core.String? enablementStateReason;
/// The last time this repository config was enabled.
///
/// Output only.
core.String? lastEnableTime;
VulnerabilityScanningConfig({
this.enablementConfig,
this.enablementState,
this.enablementStateReason,
this.lastEnableTime,
});
VulnerabilityScanningConfig.fromJson(core.Map json_)
: this(
enablementConfig: json_['enablementConfig'] as core.String?,
enablementState: json_['enablementState'] as core.String?,
enablementStateReason: json_['enablementStateReason'] as core.String?,
lastEnableTime: json_['lastEnableTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final enablementConfig = this.enablementConfig;
final enablementState = this.enablementState;
final enablementStateReason = this.enablementStateReason;
final lastEnableTime = this.lastEnableTime;
return {
'enablementConfig': ?enablementConfig,
'enablementState': ?enablementState,
'enablementStateReason': ?enablementStateReason,
'lastEnableTime': ?lastEnableTime,
};
}
}
/// Configuration for a Yum remote repository.
class YumRepository {
/// Customer-specified remote repository.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository?
customRepository;
/// One of the publicly available Yum repositories supported by Artifact
/// Registry.
GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository?
publicRepository;
YumRepository({this.customRepository, this.publicRepository});
YumRepository.fromJson(core.Map json_)
: this(
customRepository: json_.containsKey('customRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository.fromJson(
json_['customRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
publicRepository: json_.containsKey('publicRepository')
? GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository.fromJson(
json_['publicRepository']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final customRepository = this.customRepository;
final publicRepository = this.publicRepository;
return {
'customRepository': ?customRepository,
'publicRepository': ?publicRepository,
};
}
}