googleapis
Version:
Google APIs Client Library for Node.js
188 lines (187 loc) • 7.97 kB
TypeScript
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace publicca_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Public Certificate Authority API
*
* The Public Certificate Authority API may be used to create and manage ACME external account binding keys associated with Google Trust Services' publicly trusted certificate authority.
*
* @example
* ```js
* const {google} = require('googleapis');
* const publicca = google.publicca('v1');
* ```
*/
export class Publicca {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* A representation of an ExternalAccountKey used for [external account binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) within ACME.
*/
export interface Schema$ExternalAccountKey {
/**
* Output only. Base64-URL-encoded HS256 key. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created
*/
b64MacKey?: string | null;
/**
* Output only. Key ID. It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created
*/
keyId?: string | null;
/**
* Output only. Resource name. projects/{project\}/locations/{location\}/externalAccountKeys/{key_id\}
*/
name?: string | null;
}
export class Resource$Projects {
context: APIRequestContext;
locations: Resource$Projects$Locations;
constructor(context: APIRequestContext);
}
export class Resource$Projects$Locations {
context: APIRequestContext;
externalAccountKeys: Resource$Projects$Locations$Externalaccountkeys;
constructor(context: APIRequestContext);
}
export class Resource$Projects$Locations$Externalaccountkeys {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Creates a new ExternalAccountKey bound to the project.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/publicca.googleapis.com
* // - Login into gcloud by running:
* // ```sh
* // $ gcloud auth application-default login
* // ```
* // - Install the npm module by running:
* // ```sh
* // $ npm install googleapis
* // ```
*
* const {google} = require('googleapis');
* const publicca = google.publicca('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await publicca.projects.locations.externalAccountKeys.create({
* // Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the "global" location is supported.
* parent: 'projects/my-project/locations/my-location',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "b64MacKey": "my_b64MacKey",
* // "keyId": "my_keyId",
* // "name": "my_name"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "b64MacKey": "my_b64MacKey",
* // "keyId": "my_keyId",
* // "name": "my_name"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Projects$Locations$Externalaccountkeys$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
create(params?: Params$Resource$Projects$Locations$Externalaccountkeys$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ExternalAccountKey>>;
create(params: Params$Resource$Projects$Locations$Externalaccountkeys$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Projects$Locations$Externalaccountkeys$Create, options: MethodOptions | BodyResponseCallback<Schema$ExternalAccountKey>, callback: BodyResponseCallback<Schema$ExternalAccountKey>): void;
create(params: Params$Resource$Projects$Locations$Externalaccountkeys$Create, callback: BodyResponseCallback<Schema$ExternalAccountKey>): void;
create(callback: BodyResponseCallback<Schema$ExternalAccountKey>): void;
}
export interface Params$Resource$Projects$Locations$Externalaccountkeys$Create extends StandardParameters {
/**
* Required. The parent resource where this external_account_key will be created. Format: projects/[project_id]/locations/[location]. At present only the "global" location is supported.
*/
parent?: string;
/**
* Request body metadata
*/
requestBody?: Schema$ExternalAccountKey;
}
export {};
}