1078 lines
55 KiB
JavaScript
1078 lines
55 KiB
JavaScript
"use strict";
|
|
/**
|
|
* 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.
|
|
*/
|
|
/* jshint maxlen: false */
|
|
const apirequest_1 = require("../../lib/apirequest");
|
|
/**
|
|
* Google Identity and Access Management (IAM) API
|
|
*
|
|
* Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.
|
|
*
|
|
* @example
|
|
* const google = require('googleapis');
|
|
* const iam = google.iam('v1');
|
|
*
|
|
* @namespace iam
|
|
* @type {Function}
|
|
* @version v1
|
|
* @variation v1
|
|
* @param {object=} options Options for Iam
|
|
*/
|
|
function Iam(options) {
|
|
const self = this;
|
|
self._options = options || {};
|
|
self.organizations = {
|
|
roles: {
|
|
/**
|
|
* iam.organizations.roles.create
|
|
*
|
|
* @desc Creates a new Role.
|
|
*
|
|
* @alias iam.organizations.roles.create
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.parent The resource name of the parent resource in one of the following formats: `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}`
|
|
* @param {iam(v1).CreateRoleRequest} 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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{parent}/roles').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['parent'],
|
|
pathParams: ['parent'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.organizations.roles.delete
|
|
*
|
|
* @desc Soft deletes a role. The role is suspended and cannot be used to create new IAM Policy Bindings. The Role will not be included in `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The Role contains the deleted boolean set. Existing Bindings remains, but are inactive. The Role can be undeleted within 7 days. After 7 days the Role is deleted and all Bindings associated with the role are removed.
|
|
*
|
|
* @alias iam.organizations.roles.delete
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string=} params.etag Used to perform a consistent read-modify-write.
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'DELETE'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.organizations.roles.get
|
|
*
|
|
* @desc Gets a Role definition.
|
|
*
|
|
* @alias iam.organizations.roles.get
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.organizations.roles.list
|
|
*
|
|
* @desc Lists the Roles defined on a resource.
|
|
*
|
|
* @alias iam.organizations.roles.list
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {integer=} params.pageSize Optional limit on the number of roles to include in the response.
|
|
* @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse.
|
|
* @param {string} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}`
|
|
* @param {boolean=} params.showDeleted Include Roles that have been deleted.
|
|
* @param {string=} params.view Optional view for the returned Role objects.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{parent}/roles').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['parent'],
|
|
pathParams: ['parent'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.organizations.roles.patch
|
|
*
|
|
* @desc Updates a Role definition.
|
|
*
|
|
* @alias iam.organizations.roles.patch
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @param {string=} params.updateMask A mask describing which fields in the Role have changed.
|
|
* @param {iam(v1).Role} 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
|
|
*/
|
|
patch: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'PATCH'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.organizations.roles.undelete
|
|
*
|
|
* @desc Undelete a Role, bringing it back in its previous state.
|
|
*
|
|
* @alias iam.organizations.roles.undelete
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @param {iam(v1).UndeleteRoleRequest} 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
|
|
*/
|
|
undelete: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}:undelete').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
}
|
|
}
|
|
};
|
|
self.permissions = {
|
|
/**
|
|
* iam.permissions.queryTestablePermissions
|
|
*
|
|
* @desc Lists the permissions testable on a resource. A permission is testable if it can be tested for an identity on a resource.
|
|
*
|
|
* @alias iam.permissions.queryTestablePermissions
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {iam(v1).QueryTestablePermissionsRequest} 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
|
|
*/
|
|
queryTestablePermissions: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/permissions:queryTestablePermissions').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: [],
|
|
pathParams: [],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
}
|
|
};
|
|
self.projects = {
|
|
roles: {
|
|
/**
|
|
* iam.projects.roles.create
|
|
*
|
|
* @desc Creates a new Role.
|
|
*
|
|
* @alias iam.projects.roles.create
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.parent The resource name of the parent resource in one of the following formats: `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}`
|
|
* @param {iam(v1).CreateRoleRequest} 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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{parent}/roles').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['parent'],
|
|
pathParams: ['parent'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.roles.delete
|
|
*
|
|
* @desc Soft deletes a role. The role is suspended and cannot be used to create new IAM Policy Bindings. The Role will not be included in `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The Role contains the deleted boolean set. Existing Bindings remains, but are inactive. The Role can be undeleted within 7 days. After 7 days the Role is deleted and all Bindings associated with the role are removed.
|
|
*
|
|
* @alias iam.projects.roles.delete
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string=} params.etag Used to perform a consistent read-modify-write.
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'DELETE'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.roles.get
|
|
*
|
|
* @desc Gets a Role definition.
|
|
*
|
|
* @alias iam.projects.roles.get
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.roles.list
|
|
*
|
|
* @desc Lists the Roles defined on a resource.
|
|
*
|
|
* @alias iam.projects.roles.list
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {integer=} params.pageSize Optional limit on the number of roles to include in the response.
|
|
* @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse.
|
|
* @param {string} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}`
|
|
* @param {boolean=} params.showDeleted Include Roles that have been deleted.
|
|
* @param {string=} params.view Optional view for the returned Role objects.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{parent}/roles').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['parent'],
|
|
pathParams: ['parent'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.roles.patch
|
|
*
|
|
* @desc Updates a Role definition.
|
|
*
|
|
* @alias iam.projects.roles.patch
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @param {string=} params.updateMask A mask describing which fields in the Role have changed.
|
|
* @param {iam(v1).Role} 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
|
|
*/
|
|
patch: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'PATCH'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.roles.undelete
|
|
*
|
|
* @desc Undelete a Role, bringing it back in its previous state.
|
|
*
|
|
* @alias iam.projects.roles.undelete
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @param {iam(v1).UndeleteRoleRequest} 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
|
|
*/
|
|
undelete: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}:undelete').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
}
|
|
},
|
|
serviceAccounts: {
|
|
/**
|
|
* iam.projects.serviceAccounts.create
|
|
*
|
|
* @desc Creates a ServiceAccount and returns it.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.create
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`.
|
|
* @param {iam(v1).CreateServiceAccountRequest} 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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}/serviceAccounts').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.delete
|
|
*
|
|
* @desc Deletes a ServiceAccount.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.delete
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'DELETE'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.get
|
|
*
|
|
* @desc Gets a ServiceAccount.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.get
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.getIamPolicy
|
|
*
|
|
* @desc Returns the IAM access control policy for a ServiceAccount.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.getIamPolicy
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{resource}:getIamPolicy').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['resource'],
|
|
pathParams: ['resource'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.list
|
|
*
|
|
* @desc Lists ServiceAccounts for a project.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.list
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`.
|
|
* @param {integer=} params.pageSize Optional limit on the number of service accounts to include in the response. Further accounts can subsequently be obtained by including the ListServiceAccountsResponse.next_page_token in a subsequent request.
|
|
* @param {string=} params.pageToken Optional pagination token returned in an earlier ListServiceAccountsResponse.next_page_token.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}/serviceAccounts').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.setIamPolicy
|
|
*
|
|
* @desc Sets the IAM access control policy for a ServiceAccount.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.setIamPolicy
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @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 {iam(v1).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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{resource}:setIamPolicy').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['resource'],
|
|
pathParams: ['resource'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.signBlob
|
|
*
|
|
* @desc Signs a blob using a service account's system-managed private key.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.signBlob
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @param {iam(v1).SignBlobRequest} 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
|
|
*/
|
|
signBlob: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}:signBlob').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.signJwt
|
|
*
|
|
* @desc Signs a JWT using a service account's system-managed private key. If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an an expiry time of one hour by default. If you request an expiry time of more than one hour, the request will fail.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.signJwt
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @param {iam(v1).SignJwtRequest} 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
|
|
*/
|
|
signJwt: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}:signJwt').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.testIamPermissions
|
|
*
|
|
* @desc Tests the specified permissions against the IAM access control policy for a ServiceAccount.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.testIamPermissions
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @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 {iam(v1).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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{resource}:testIamPermissions').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['resource'],
|
|
pathParams: ['resource'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.update
|
|
*
|
|
* @desc Updates a ServiceAccount. Currently, only the following fields are updatable: `display_name` . The `etag` is mandatory.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.update
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Requests using `-` as a wildcard for the project will infer the project from the `account` and the `account` value can be the `email` address or the `unique_id` of the service account. In responses the resource name will always be in the format `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.
|
|
* @param {iam(v1).ServiceAccount} 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
|
|
*/
|
|
update: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'PUT'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
keys: {
|
|
/**
|
|
* iam.projects.serviceAccounts.keys.create
|
|
*
|
|
* @desc Creates a ServiceAccountKey and returns it.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.keys.create
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @param {iam(v1).CreateServiceAccountKeyRequest} 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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}/keys').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.keys.delete
|
|
*
|
|
* @desc Deletes a ServiceAccountKey.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.keys.delete
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'DELETE'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.keys.get
|
|
*
|
|
* @desc Gets the ServiceAccountKey by key id.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.keys.get
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @param {string=} params.publicKeyType The output format of the public key requested. X509_PEM is the default output format.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.projects.serviceAccounts.keys.list
|
|
*
|
|
* @desc Lists ServiceAccountKeys.
|
|
*
|
|
* @alias iam.projects.serviceAccounts.keys.list
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string=} params.keyTypes Filters the types of keys the user wants to include in the list response. Duplicate key types are not allowed. If no key type is provided, all keys are returned.
|
|
* @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project, will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the service account.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}/keys').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
self.roles = {
|
|
/**
|
|
* iam.roles.get
|
|
*
|
|
* @desc Gets a Role definition.
|
|
*
|
|
* @alias iam.roles.get
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}`
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/{name}').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: ['name'],
|
|
pathParams: ['name'],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.roles.list
|
|
*
|
|
* @desc Lists the Roles defined on a resource.
|
|
*
|
|
* @alias iam.roles.list
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {integer=} params.pageSize Optional limit on the number of roles to include in the response.
|
|
* @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse.
|
|
* @param {string=} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}`
|
|
* @param {boolean=} params.showDeleted Include Roles that have been deleted.
|
|
* @param {string=} params.view Optional view for the returned Role objects.
|
|
* @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: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/roles').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'GET'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: [],
|
|
pathParams: [],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
},
|
|
/**
|
|
* iam.roles.queryGrantableRoles
|
|
*
|
|
* @desc Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy for that resource.
|
|
*
|
|
* @alias iam.roles.queryGrantableRoles
|
|
* @memberOf! iam(v1)
|
|
*
|
|
* @param {object} params Parameters for request
|
|
* @param {iam(v1).QueryGrantableRolesRequest} 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
|
|
*/
|
|
queryGrantableRoles: function (params, options, callback) {
|
|
if (typeof options === 'function') {
|
|
callback = options;
|
|
options = {};
|
|
}
|
|
options || (options = {});
|
|
const rootUrl = options.rootUrl || 'https://iam.googleapis.com/';
|
|
const parameters = {
|
|
options: Object.assign({
|
|
url: (rootUrl + '/v1/roles:queryGrantableRoles').replace(/([^:]\/)\/+/g, '$1'),
|
|
method: 'POST'
|
|
}, options),
|
|
params: params,
|
|
requiredParams: [],
|
|
pathParams: [],
|
|
context: self
|
|
};
|
|
return apirequest_1.default(parameters, callback);
|
|
}
|
|
};
|
|
}
|
|
module.exports = Iam;
|
|
//# sourceMappingURL=v1.js.map
|