googleapis
Version:
Google APIs Client Library for Node.js
399 lines (398 loc) • 18.6 kB
TypeScript
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AxiosPromise } from 'axios';
import { GoogleApis } from '../..';
import { BodyResponseCallback, GlobalOptions, MethodOptions } from '../../lib/api';
/**
* Cloud Source Repositories API
*
* Access source code repositories hosted by Google.
*
* @example
* const google = require('googleapis');
* const sourcerepo = google.sourcerepo('v1');
*
* @namespace sourcerepo
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Sourcerepo
*/
export declare class Sourcerepo {
_options: GlobalOptions;
google: GoogleApis;
root: this;
projects: Resource$Projects;
constructor(options: GlobalOptions, google: GoogleApis);
getRoot(): this;
}
/**
* Specifies the audit configuration for a service. The configuration determines
* which permission types are logged, and what identities, if any, are exempted
* from logging. An AuditConfig must have one or more AuditLogConfigs. If there
* are AuditConfigs for both `allServices` and a specific service, the union of
* the two AuditConfigs is used for that service: the log_types specified in
* each AuditConfig are enabled, and the exempted_members in each AuditLogConfig
* are exempted. Example Policy with multiple AuditConfigs: {
* "audit_configs": [ { "service":
* "allServices" "audit_log_configs": [ {
* "log_type": "DATA_READ", "exempted_members": [
* "user:foo@gmail.com" ] }, {
* "log_type": "DATA_WRITE", }, {
* "log_type": "ADMIN_READ", } ] }, {
* "service": "fooservice.googleapis.com"
* "audit_log_configs": [ { "log_type":
* "DATA_READ", }, { "log_type":
* "DATA_WRITE", "exempted_members": [
* "user:bar@gmail.com" ] } ] } ]
* } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
* logging. It also exempts foo@gmail.com from DATA_READ logging, and
* bar@gmail.com from DATA_WRITE logging.
*/
export interface Schema$AuditConfig {
/**
* The configuration for logging of each type of permission. Next ID: 4
*/
auditLogConfigs: Schema$AuditLogConfig[];
/**
* Specifies a service that will be enabled for audit logging. For example,
* `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a
* special value that covers all services.
*/
service: string;
}
/**
* Provides the configuration for logging a type of permissions. Example: {
* "audit_log_configs": [ { "log_type":
* "DATA_READ", "exempted_members": [
* "user:foo@gmail.com" ] }, {
* "log_type": "DATA_WRITE", } ] } This
* enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
* foo@gmail.com from DATA_READ logging.
*/
export interface Schema$AuditLogConfig {
/**
* Specifies the identities that do not cause logging for this type of
* permission. Follows the same format of Binding.members.
*/
exemptedMembers: string[];
/**
* The log type that this config enables.
*/
logType: string;
}
/**
* Associates `members` with a `role`.
*/
export interface Schema$Binding {
/**
* Specifies the identities requesting access for a Cloud Platform resource.
* `members` can have the following values: * `allUsers`: A special
* identifier that represents anyone who is on the internet; with or
* without a Google account. * `allAuthenticatedUsers`: A special identifier
* that represents anyone who is authenticated with a Google account or a
* service account. * `user:{emailid}`: An email address that represents a
* specific Google account. For example, `alice@gmail.com` or
* `joe@example.com`. * `serviceAccount:{emailid}`: An email address that
* represents a service account. For example,
* `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email
* address that represents a Google group. For example,
* `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that
* represents all the users of that domain. For example, `google.com` or
* `example.com`.
*/
members: string[];
/**
* Role that is assigned to `members`. For example, `roles/viewer`,
* `roles/editor`, or `roles/owner`. Required
*/
role: string;
}
/**
* A generic empty message that you can re-use to avoid defining duplicated
* empty messages in your APIs. A typical example is to use it as the request or
* the response type of an API method. For instance: service Foo { rpc
* Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON
* representation for `Empty` is empty JSON object `{}`.
*/
export interface Schema$Empty {
}
/**
* Response for ListRepos. The size is not set in the returned repositories.
*/
export interface Schema$ListReposResponse {
/**
* If non-empty, additional repositories exist within the project. These can
* be retrieved by including this value in the next ListReposRequest's
* page_token field.
*/
nextPageToken: string;
/**
* The listed repos.
*/
repos: Schema$Repo[];
}
/**
* Configuration to automatically mirror a repository from another hosting
* service, for example GitHub or Bitbucket.
*/
export interface Schema$MirrorConfig {
/**
* ID of the SSH deploy key at the other hosting service. Removing this key
* from the other service would deauthorize Google Cloud Source Repositories
* from mirroring.
*/
deployKeyId: string;
/**
* URL of the main repository at the other hosting service.
*/
url: string;
/**
* ID of the webhook listening to updates to trigger mirroring. Removing this
* webhook from the other hosting service will stop Google Cloud Source
* Repositories from receiving notifications, and thereby disabling mirroring.
*/
webhookId: string;
}
/**
* Defines an Identity and Access Management (IAM) policy. It is used to specify
* access control policies for Cloud Platform resources. A `Policy` consists
* of a list of `bindings`. A `Binding` binds a list of `members` to a `role`,
* where the members can be user accounts, Google groups, Google domains, and
* service accounts. A `role` is a named list of permissions defined by IAM.
* **Example** { "bindings": [ { "role":
* "roles/owner", "members": [
* "user:mike@example.com", "group:admins@example.com",
* "domain:google.com",
* "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, {
* "role": "roles/viewer", "members":
* ["user:sean@example.com"] } ] } For a
* description of IAM and its features, see the [IAM developer's
* guide](https://cloud.google.com/iam/docs).
*/
export interface Schema$Policy {
/**
* Specifies cloud audit logging configuration for this policy.
*/
auditConfigs: Schema$AuditConfig[];
/**
* Associates a list of `members` to a `role`. `bindings` with no members will
* result in an error.
*/
bindings: Schema$Binding[];
/**
* `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.
* If no `etag` is provided in the call to `setIamPolicy`, then the existing
* policy is overwritten blindly.
*/
etag: string;
/**
* Deprecated.
*/
version: number;
}
/**
* A repository (or repo) is a Git repository storing versioned source content.
*/
export interface Schema$Repo {
/**
* How this repository mirrors a repository managed by another service.
* Read-only field.
*/
mirrorConfig: Schema$MirrorConfig;
/**
* Resource name of the repository, of the form
* `projects/<project>/repos/<repo>`. The repo name may contain
* slashes. eg, `projects/myproject/repos/name/with/slash`
*/
name: string;
/**
* The disk usage of the repo, in bytes. Read-only field. Size is only
* returned by GetRepo.
*/
size: string;
/**
* URL to clone the repository from Google Cloud Source Repositories.
* Read-only field.
*/
url: string;
}
/**
* Request message for `SetIamPolicy` method.
*/
export interface Schema$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 Cloud Platform services (such as Projects) might reject them.
*/
policy: Schema$Policy;
/**
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
* the fields in the mask will be modified. If no mask is provided, the
* following default mask is used: paths: "bindings, etag" This
* field is only used by Cloud IAM.
*/
updateMask: string;
}
/**
* Request message for `TestIamPermissions` method.
*/
export interface Schema$TestIamPermissionsRequest {
/**
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For
* more information see [IAM
* Overview](https://cloud.google.com/iam/docs/overview#permissions).
*/
permissions: string[];
}
/**
* Response message for `TestIamPermissions` method.
*/
export interface Schema$TestIamPermissionsResponse {
/**
* A subset of `TestPermissionsRequest.permissions` that the caller is
* allowed.
*/
permissions: string[];
}
export declare class Resource$Projects {
root: Sourcerepo;
repos: Resource$Projects$Repos;
constructor(root: Sourcerepo);
getRoot(): Sourcerepo;
}
export declare class Resource$Projects$Repos {
root: Sourcerepo;
constructor(root: Sourcerepo);
getRoot(): Sourcerepo;
/**
* sourcerepo.projects.repos.create
* @desc Creates a repo in the given project with the given name. If the
* named repository already exists, `CreateRepo` returns `ALREADY_EXISTS`.
* @alias sourcerepo.projects.repos.create
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.parent The project in which to create the repo. Values are of the form `projects/<project>`.
* @param {().Repo} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create(params?: any, options?: MethodOptions): AxiosPromise<Schema$Repo>;
create(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Repo>, callback?: BodyResponseCallback<Schema$Repo>): void;
/**
* sourcerepo.projects.repos.delete
* @desc Deletes a repo.
* @alias sourcerepo.projects.repos.delete
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the repo to delete. Values are of the form `projects/<project>/repos/<repo>`.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
delete(params?: any, options?: MethodOptions): AxiosPromise<Schema$Empty>;
delete(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Empty>, callback?: BodyResponseCallback<Schema$Empty>): void;
/**
* sourcerepo.projects.repos.get
* @desc Returns information about a repo.
* @alias sourcerepo.projects.repos.get
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.name The name of the requested repository. Values are of the form `projects/<project>/repos/<repo>`.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get(params?: any, options?: MethodOptions): AxiosPromise<Schema$Repo>;
get(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Repo>, callback?: BodyResponseCallback<Schema$Repo>): void;
/**
* sourcerepo.projects.repos.getIamPolicy
* @desc Gets the access control policy for a resource. Returns an empty
* policy if the resource exists and does not have a policy set.
* @alias sourcerepo.projects.repos.getIamPolicy
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getIamPolicy(params?: any, options?: MethodOptions): AxiosPromise<Schema$Policy>;
getIamPolicy(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Policy>, callback?: BodyResponseCallback<Schema$Policy>): void;
/**
* sourcerepo.projects.repos.list
* @desc Returns all repos belonging to a project. The sizes of the repos are
* not set by ListRepos. To get the size of a repo, use GetRepo.
* @alias sourcerepo.projects.repos.list
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.name The project ID whose repos should be listed. Values are of the form `projects/<project>`.
* @param {integer=} params.pageSize Maximum number of repositories to return; between 1 and 500. If not set or zero, defaults to 100 at the server.
* @param {string=} params.pageToken Resume listing repositories where a prior ListReposResponse left off. This is an opaque token that must be obtained from a recent, prior ListReposResponse's next_page_token field.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(params?: any, options?: MethodOptions): AxiosPromise<Schema$ListReposResponse>;
list(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$ListReposResponse>, callback?: BodyResponseCallback<Schema$ListReposResponse>): void;
/**
* sourcerepo.projects.repos.setIamPolicy
* @desc Sets the access control policy on the specified resource. Replaces
* any existing policy.
* @alias sourcerepo.projects.repos.setIamPolicy
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
* @param {().SetIamPolicyRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
setIamPolicy(params?: any, options?: MethodOptions): AxiosPromise<Schema$Policy>;
setIamPolicy(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Policy>, callback?: BodyResponseCallback<Schema$Policy>): void;
/**
* sourcerepo.projects.repos.testIamPermissions
* @desc Returns permissions that a caller has on the specified resource. If
* the resource does not exist, this will return an empty set of permissions,
* not a NOT_FOUND error.
* @alias sourcerepo.projects.repos.testIamPermissions
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
* @param {().TestIamPermissionsRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
testIamPermissions(params?: any, options?: MethodOptions): AxiosPromise<Schema$TestIamPermissionsResponse>;
testIamPermissions(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$TestIamPermissionsResponse>, callback?: BodyResponseCallback<Schema$TestIamPermissionsResponse>): void;
}