src/apis/privateca/v1.ts
Properties |
|
$.xgafv |
$.xgafv:
|
Type : string
|
Optional |
V1 error format. |
access_token |
access_token:
|
Type : string
|
Optional |
OAuth access token. |
alt |
alt:
|
Type : string
|
Optional |
Data format for response. |
callback |
callback:
|
Type : string
|
Optional |
JSONP |
fields |
fields:
|
Type : string
|
Optional |
Selector specifying which fields to include in a partial response. |
key |
key:
|
Type : string
|
Optional |
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. |
oauth_token |
oauth_token:
|
Type : string
|
Optional |
OAuth 2.0 token for the current user. |
prettyPrint |
prettyPrint:
|
Type : boolean
|
Optional |
Returns response with indentations and line breaks. |
quotaUser |
quotaUser:
|
Type : string
|
Optional |
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. |
upload_protocol |
upload_protocol:
|
Type : string
|
Optional |
Upload protocol for media (e.g. "raw", "multipart"). |
uploadType |
uploadType:
|
Type : string
|
Optional |
Legacy upload protocol for media (e.g. "media", "multipart"). |
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosPromise,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace privateca_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;
}
/**
* Certificate Authority API
*
* The Certificate Authority Service API is a highly-available, scalable service that enables you to simplify and automate the management of private certificate authorities (CAs) while staying in control of your private keys."
*
* @example
* ```js
* const {google} = require('googleapis');
* const privateca = google.privateca('v1');
* ```
*/
export class Privateca {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.projects = new Resource$Projects(this.context);
}
}
/**
* URLs where a CertificateAuthority will publish content.
*/
export interface Schema$AccessUrls {
/**
* The URL where this CertificateAuthority's CA certificate is published. This will only be set for CAs that have been activated.
*/
caCertificateAccessUrl?: string | null;
/**
* The URLs where this CertificateAuthority's CRLs are published. This will only be set for CAs that have been activated.
*/
crlAccessUrls?: string[] | null;
}
/**
* Request message for CertificateAuthorityService.ActivateCertificateAuthority.
*/
export interface Schema$ActivateCertificateAuthorityRequest {
/**
* Required. The signed CA certificate issued from FetchCertificateAuthorityCsrResponse.pem_csr.
*/
pemCaCertificate?: string | null;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string | null;
/**
* Required. Must include information about the issuer of 'pem_ca_certificate', and any further issuers until the self-signed CA.
*/
subordinateConfig?: Schema$SubordinateConfig;
}
/**
* Describes a "type" of key that may be used in a Certificate issued from a CaPool. Note that a single AllowedKeyType may refer to either a fully-qualified key algorithm, such as RSA 4096, or a family of key algorithms, such as any RSA key.
*/
export interface Schema$AllowedKeyType {
/**
* Represents an allowed Elliptic Curve key type.
*/
ellipticCurve?: Schema$EcKeyType;
/**
* Represents an allowed RSA key type.
*/
rsa?: Schema$RsaKeyType;
}
/**
* 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:jose@example.com" ] \}, { "log_type": "DATA_WRITE" \}, { "log_type": "ADMIN_READ" \} ] \}, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" \}, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] \} ] \} ] \} For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
*/
export interface Schema$AuditConfig {
/**
* The configuration for logging of each type of permission.
*/
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 | null;
}
/**
* Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] \}, { "log_type": "DATA_WRITE" \} ] \} This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.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[] | null;
/**
* The log type that this config enables.
*/
logType?: string | null;
}
/**
* Associates `members` with a `role`.
*/
export interface Schema$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 members 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).
*/
condition?: Schema$Expr;
/**
* 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@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`. * `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. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
*/
members?: string[] | null;
/**
* Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
*/
role?: string | null;
}
/**
* The request message for Operations.CancelOperation.
*/
export interface Schema$CancelOperationRequest {}
/**
* Describes values that are relevant in a CA certificate.
*/
export interface Schema$CaOptions {
/**
* Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this value is missing, the extension will be omitted from the CA certificate.
*/
isCa?: boolean | null;
/**
* Optional. Refers to the path length restriction X.509 extension. For a CA certificate, this value describes the depth of subordinate CA certificates that are allowed. If this value is less than 0, the request will fail. If this value is missing, the max path length will be omitted from the CA certificate.
*/
maxIssuerPathLength?: number | null;
}
/**
* A CaPool represents a group of CertificateAuthorities that form a trust anchor. A CaPool can be used to manage issuance policies for one or more CertificateAuthority resources and to rotate CA certificates in and out of the trust anchor.
*/
export interface Schema$CaPool {
/**
* Optional. The IssuancePolicy to control how Certificates will be issued from this CaPool.
*/
issuancePolicy?: Schema$IssuancePolicy;
/**
* Optional. Labels with user-defined metadata.
*/
labels?: {[key: string]: string} | null;
/**
* Output only. The resource name for this CaPool in the format `projects/x/locations/x/caPools/x`.
*/
name?: string | null;
/**
* Optional. The PublishingOptions to follow when issuing Certificates from any CertificateAuthority in this CaPool.
*/
publishingOptions?: Schema$PublishingOptions;
/**
* Required. Immutable. The Tier of this CaPool.
*/
tier?: string | null;
}
export interface Schema$CertChain {
/**
* The certificates that form the CA chain, from leaf to root order.
*/
certificates?: string[] | null;
}
/**
* A Certificate corresponds to a signed X.509 certificate issued by a CertificateAuthority.
*/
export interface Schema$Certificate {
/**
* Output only. A structured description of the issued X.509 certificate.
*/
certificateDescription?: Schema$CertificateDescription;
/**
* Immutable. The resource name for a CertificateTemplate used to issue this certificate, in the format `projects/x/locations/x/certificateTemplates/x`. If this is specified, the caller must have the necessary permission to use this template. If this is omitted, no template will be used. This template must be in the same location as the Certificate.
*/
certificateTemplate?: string | null;
/**
* Immutable. A description of the certificate and key that does not require X.509 or ASN.1.
*/
config?: Schema$CertificateConfig;
/**
* Output only. The time at which this Certificate was created.
*/
createTime?: string | null;
/**
* Output only. The resource name of the issuing CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
issuerCertificateAuthority?: string | null;
/**
* Optional. Labels with user-defined metadata.
*/
labels?: {[key: string]: string} | null;
/**
* Required. Immutable. The desired lifetime of a certificate. Used to create the "not_before_time" and "not_after_time" fields inside an X.509 certificate. Note that the lifetime may be truncated if it would extend past the life of any certificate authority in the issuing chain.
*/
lifetime?: string | null;
/**
* Output only. The resource name for this Certificate in the format `projects/x/locations/x/caPools/x/certificates/x`.
*/
name?: string | null;
/**
* Output only. The pem-encoded, signed X.509 certificate.
*/
pemCertificate?: string | null;
/**
* Output only. The chain that may be used to verify the X.509 certificate. Expected to be in issuer-to-root order according to RFC 5246.
*/
pemCertificateChain?: string[] | null;
/**
* Immutable. A pem-encoded X.509 certificate signing request (CSR).
*/
pemCsr?: string | null;
/**
* Output only. Details regarding the revocation of this Certificate. This Certificate is considered revoked if and only if this field is present.
*/
revocationDetails?: Schema$RevocationDetails;
/**
* Immutable. Specifies how the Certificate's identity fields are to be decided. If this is omitted, the `DEFAULT` subject mode will be used.
*/
subjectMode?: string | null;
/**
* Output only. The time at which this Certificate was updated.
*/
updateTime?: string | null;
}
/**
* A CertificateAuthority represents an individual Certificate Authority. A CertificateAuthority can be used to create Certificates.
*/
export interface Schema$CertificateAuthority {
/**
* Output only. URLs for accessing content published by this CA, such as the CA certificate and CRLs.
*/
accessUrls?: Schema$AccessUrls;
/**
* Output only. A structured description of this CertificateAuthority's CA certificate and its issuers. Ordered as self-to-root.
*/
caCertificateDescriptions?: Schema$CertificateDescription[];
/**
* Required. Immutable. The config used to create a self-signed X.509 certificate or CSR.
*/
config?: Schema$CertificateConfig;
/**
* Output only. The time at which this CertificateAuthority was created.
*/
createTime?: string | null;
/**
* Output only. The time at which this CertificateAuthority was soft deleted, if it is in the DELETED state.
*/
deleteTime?: string | null;
/**
* Output only. The time at which this CertificateAuthority will be permanently purged, if it is in the DELETED state.
*/
expireTime?: string | null;
/**
* Immutable. The name of a Cloud Storage bucket where this CertificateAuthority will publish content, such as the CA certificate and CRLs. This must be a bucket name, without any prefixes (such as `gs://`) or suffixes (such as `.googleapis.com`). For example, to use a bucket named `my-bucket`, you would simply specify `my-bucket`. If not specified, a managed bucket will be created.
*/
gcsBucket?: string | null;
/**
* Required. Immutable. Used when issuing certificates for this CertificateAuthority. If this CertificateAuthority is a self-signed CertificateAuthority, this key is also used to sign the self-signed CA certificate. Otherwise, it is used to sign a CSR.
*/
keySpec?: Schema$KeyVersionSpec;
/**
* Optional. Labels with user-defined metadata.
*/
labels?: {[key: string]: string} | null;
/**
* Required. Immutable. The desired lifetime of the CA certificate. Used to create the "not_before_time" and "not_after_time" fields inside an X.509 certificate.
*/
lifetime?: string | null;
/**
* Output only. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string | null;
/**
* Output only. This CertificateAuthority's certificate chain, including the current CertificateAuthority's certificate. Ordered such that the root issuer is the final element (consistent with RFC 5246). For a self-signed CA, this will only list the current CertificateAuthority's certificate.
*/
pemCaCertificates?: string[] | null;
/**
* Output only. The State for this CertificateAuthority.
*/
state?: string | null;
/**
* Optional. If this is a subordinate CertificateAuthority, this field will be set with the subordinate configuration, which describes its issuers. This may be updated, but this CertificateAuthority must continue to validate.
*/
subordinateConfig?: Schema$SubordinateConfig;
/**
* Output only. The CaPool.Tier of the CaPool that includes this CertificateAuthority.
*/
tier?: string | null;
/**
* Required. Immutable. The Type of this CertificateAuthority.
*/
type?: string | null;
/**
* Output only. The time at which this CertificateAuthority was last updated.
*/
updateTime?: string | null;
}
/**
* A CertificateConfig describes an X.509 certificate or CSR that is to be created, as an alternative to using ASN.1.
*/
export interface Schema$CertificateConfig {
/**
* Optional. The public key that corresponds to this config. This is, for example, used when issuing Certificates, but not when creating a self-signed CertificateAuthority or CertificateAuthority CSR.
*/
publicKey?: Schema$PublicKey;
/**
* Required. Specifies some of the values in a certificate that are related to the subject.
*/
subjectConfig?: Schema$SubjectConfig;
/**
* Required. Describes how some of the technical X.509 fields in a certificate should be populated.
*/
x509Config?: Schema$X509Parameters;
}
/**
* A CertificateDescription describes an X.509 certificate or CSR that has been issued, as an alternative to using ASN.1 / X.509.
*/
export interface Schema$CertificateDescription {
/**
* Describes lists of issuer CA certificate URLs that appear in the "Authority Information Access" extension in the certificate.
*/
aiaIssuingCertificateUrls?: string[] | null;
/**
* Identifies the subject_key_id of the parent certificate, per https://tools.ietf.org/html/rfc5280#section-4.2.1.1
*/
authorityKeyId?: Schema$KeyId;
/**
* The hash of the x.509 certificate.
*/
certFingerprint?: Schema$CertificateFingerprint;
/**
* Describes a list of locations to obtain CRL information, i.e. the DistributionPoint.fullName described by https://tools.ietf.org/html/rfc5280#section-4.2.1.13
*/
crlDistributionPoints?: string[] | null;
/**
* The public key that corresponds to an issued certificate.
*/
publicKey?: Schema$PublicKey;
/**
* Describes some of the values in a certificate that are related to the subject and lifetime.
*/
subjectDescription?: Schema$SubjectDescription;
/**
* Provides a means of identifiying certificates that contain a particular public key, per https://tools.ietf.org/html/rfc5280#section-4.2.1.2.
*/
subjectKeyId?: Schema$KeyId;
/**
* Describes some of the technical X.509 fields in a certificate.
*/
x509Description?: Schema$X509Parameters;
}
/**
* Describes a set of X.509 extensions that may be part of some certificate issuance controls.
*/
export interface Schema$CertificateExtensionConstraints {
/**
* Optional. A set of ObjectIds identifying custom X.509 extensions. Will be combined with known_extensions to determine the full set of X.509 extensions.
*/
additionalExtensions?: Schema$ObjectId[];
/**
* Optional. A set of named X.509 extensions. Will be combined with additional_extensions to determine the full set of X.509 extensions.
*/
knownExtensions?: string[] | null;
}
/**
* A group of fingerprints for the x509 certificate.
*/
export interface Schema$CertificateFingerprint {
/**
* The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate.
*/
sha256Hash?: string | null;
}
/**
* Describes constraints on a Certificate's Subject and SubjectAltNames.
*/
export interface Schema$CertificateIdentityConstraints {
/**
* Required. If this is true, the SubjectAltNames extension may be copied from a certificate request into the signed certificate. Otherwise, the requested SubjectAltNames will be discarded.
*/
allowSubjectAltNamesPassthrough?: boolean | null;
/**
* Required. If this is true, the Subject field may be copied from a certificate request into the signed certificate. Otherwise, the requested Subject will be discarded.
*/
allowSubjectPassthrough?: boolean | null;
/**
* Optional. A CEL expression that may be used to validate the resolved X.509 Subject and/or Subject Alternative Name before a certificate is signed. To see the full allowed syntax and some examples, see https://cloud.google.com/certificate-authority-service/docs/using-cel
*/
celExpression?: Schema$Expr;
}
/**
* A CertificateRevocationList corresponds to a signed X.509 certificate Revocation List (CRL). A CRL contains the serial numbers of certificates that should no longer be trusted.
*/
export interface Schema$CertificateRevocationList {
/**
* Output only. The location where 'pem_crl' can be accessed.
*/
accessUrl?: string | null;
/**
* Output only. The time at which this CertificateRevocationList was created.
*/
createTime?: string | null;
/**
* Optional. Labels with user-defined metadata.
*/
labels?: {[key: string]: string} | null;
/**
* Output only. The resource name for this CertificateRevocationList in the format `projects/x/locations/x/caPools/xcertificateAuthorities/x/ certificateRevocationLists/x`.
*/
name?: string | null;
/**
* Output only. The PEM-encoded X.509 CRL.
*/
pemCrl?: string | null;
/**
* Output only. The revision ID of this CertificateRevocationList. A new revision is committed whenever a new CRL is published. The format is an 8-character hexadecimal string.
*/
revisionId?: string | null;
/**
* Output only. The revoked serial numbers that appear in pem_crl.
*/
revokedCertificates?: Schema$RevokedCertificate[];
/**
* Output only. The CRL sequence number that appears in pem_crl.
*/
sequenceNumber?: string | null;
/**
* Output only. The State for this CertificateRevocationList.
*/
state?: string | null;
/**
* Output only. The time at which this CertificateRevocationList was updated.
*/
updateTime?: string | null;
}
/**
* A CertificateTemplate refers to a managed template for certificate issuance.
*/
export interface Schema$CertificateTemplate {
/**
* Output only. The time at which this CertificateTemplate was created.
*/
createTime?: string | null;
/**
* Optional. A human-readable description of scenarios this template is intended for.
*/
description?: string | null;
/**
* Optional. Describes constraints on identities that may be appear in Certificates issued using this template. If this is omitted, then this template will not add restrictions on a certificate's identity.
*/
identityConstraints?: Schema$CertificateIdentityConstraints;
/**
* Optional. Labels with user-defined metadata.
*/
labels?: {[key: string]: string} | null;
/**
* Output only. The resource name for this CertificateTemplate in the format `projects/x/locations/x/certificateTemplates/x`.
*/
name?: string | null;
/**
* Optional. Describes the set of X.509 extensions that may appear in a Certificate issued using this CertificateTemplate. If a certificate request sets extensions that don't appear in the passthrough_extensions, those extensions will be dropped. If the issuing CaPool's IssuancePolicy defines baseline_values that don't appear here, the certificate issuance request will fail. If this is omitted, then this template will not add restrictions on a certificate's X.509 extensions. These constraints do not apply to X.509 extensions set in this CertificateTemplate's predefined_values.
*/
passthroughExtensions?: Schema$CertificateExtensionConstraints;
/**
* Optional. A set of X.509 values that will be applied to all issued certificates that use this template. If the certificate request includes conflicting values for the same properties, they will be overwritten by the values defined here. If the issuing CaPool's IssuancePolicy defines conflicting baseline_values for the same properties, the certificate issuance request will fail.
*/
predefinedValues?: Schema$X509Parameters;
/**
* Output only. The time at which this CertificateTemplate was updated.
*/
updateTime?: string | null;
}
/**
* Request message for CertificateAuthorityService.DisableCertificateAuthority.
*/
export interface Schema$DisableCertificateAuthorityRequest {
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string | null;
}
/**
* Describes an Elliptic Curve key that may be used in a Certificate issued from a CaPool.
*/
export interface Schema$EcKeyType {
/**
* Optional. A signature algorithm that must be used. If this is omitted, any EC-based signature algorithm will be allowed.
*/
signatureAlgorithm?: string | null;
}
/**
* 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 {}
/**
* Request message for CertificateAuthorityService.EnableCertificateAuthority.
*/
export interface Schema$EnableCertificateAuthorityRequest {
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string | null;
}
/**
* 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.
*/
export interface Schema$Expr {
/**
* Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
*/
description?: string | null;
/**
* Textual representation of an expression in Common Expression Language syntax.
*/
expression?: string | null;
/**
* Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
*/
location?: string | null;
/**
* Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
*/
title?: string | null;
}
/**
* KeyUsage.ExtendedKeyUsageOptions has fields that correspond to certain common OIDs that could be specified as an extended key usage value.
*/
export interface Schema$ExtendedKeyUsageOptions {
/**
* Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW client authentication", though regularly used for non-WWW TLS.
*/
clientAuth?: boolean | null;
/**
* Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of downloadable executable code client authentication".
*/
codeSigning?: boolean | null;
/**
* Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email protection".
*/
emailProtection?: boolean | null;
/**
* Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing OCSP responses".
*/
ocspSigning?: boolean | null;
/**
* Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW server authentication", though regularly used for non-WWW TLS.
*/
serverAuth?: boolean | null;
/**
* Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding the hash of an object to a time".
*/
timeStamping?: boolean | null;
}
/**
* Request message for CertificateAuthorityService.FetchCaCerts.
*/
export interface Schema$FetchCaCertsRequest {
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string | null;
}
/**
* Response message for CertificateAuthorityService.FetchCaCerts.
*/
export interface Schema$FetchCaCertsResponse {
/**
* The PEM encoded CA certificate chains of all ACTIVE CertificateAuthority resources in this CaPool.
*/
caCerts?: Schema$CertChain[];
}
/**
* Response message for CertificateAuthorityService.FetchCertificateAuthorityCsr.
*/
export interface Schema$FetchCertificateAuthorityCsrResponse {
/**
* Output only. The PEM-encoded signed certificate signing request (CSR).
*/
pemCsr?: string | null;
}
/**
* IssuanceModes specifies the allowed ways in which Certificates may be requested from this CaPool.
*/
export interface Schema$IssuanceModes {
/**
* Optional. When true, allows callers to create Certificates by specifying a CertificateConfig.
*/
allowConfigBasedIssuance?: boolean | null;
/**
* Optional. When true, allows callers to create Certificates by specifying a CSR.
*/
allowCsrBasedIssuance?: boolean | null;
}
/**
* Defines controls over all certificate issuance within a CaPool.
*/
export interface Schema$IssuancePolicy {
/**
* Optional. If specified, then only methods allowed in the IssuanceModes may be used to issue Certificates.
*/
allowedIssuanceModes?: Schema$IssuanceModes;
/**
* Optional. If any AllowedKeyType is specified, then the certificate request's public key must match one of the key types listed here. Otherwise, any key may be used.
*/
allowedKeyTypes?: Schema$AllowedKeyType[];
/**
* Optional. A set of X.509 values that will be applied to all certificates issued through this CaPool. If a certificate request includes conflicting values for the same properties, they will be overwritten by the values defined here. If a certificate request uses a CertificateTemplate that defines conflicting predefined_values for the same properties, the certificate issuance request will fail.
*/
baselineValues?: Schema$X509Parameters;
/**
* Optional. Describes constraints on identities that may appear in Certificates issued through this CaPool. If this is omitted, then this CaPool will not add restrictions on a certificate's identity.
*/
identityConstraints?: Schema$CertificateIdentityConstraints;
/**
* Optional. The maximum lifetime allowed for issued Certificates. Note that if the issuing CertificateAuthority expires before a Certificate's requested maximum_lifetime, the effective lifetime will be explicitly truncated to match it.
*/
maximumLifetime?: string | null;
/**
* Optional. Describes the set of X.509 extensions that may appear in a Certificate issued through this CaPool. If a certificate request sets extensions that don't appear in the passthrough_extensions, those extensions will be dropped. If a certificate request uses a CertificateTemplate with predefined_values that don't appear here, the certificate issuance request will fail. If this is omitted, then this CaPool will not add restrictions on a certificate's X.509 extensions. These constraints do not apply to X.509 extensions set in this CaPool's baseline_values.
*/
passthroughExtensions?: Schema$CertificateExtensionConstraints;
}
/**
* A KeyId identifies a specific public key, usually by hashing the public key.
*/
export interface Schema$KeyId {
/**
* Optional. The value of this KeyId encoded in lowercase hexadecimal. This is most likely the 160 bit SHA-1 hash of the public key.
*/
keyId?: string | null;
}
/**
* A KeyUsage describes key usage values that may appear in an X.509 certificate.
*/
export interface Schema$KeyUsage {
/**
* Describes high-level ways in which a key may be used.
*/
baseKeyUsage?: Schema$KeyUsageOptions;
/**
* Detailed scenarios in which a key may be used.
*/
extendedKeyUsage?: Schema$ExtendedKeyUsageOptions;
/**
* Used to describe extended key usages that are not listed in the KeyUsage.ExtendedKeyUsageOptions message.
*/
unknownExtendedKeyUsages?: Schema$ObjectId[];
}
/**
* KeyUsage.KeyUsageOptions corresponds to the key usage values described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3.
*/
export interface Schema$KeyUsageOptions {
/**
* The key may be used to sign certificates.
*/
certSign?: boolean | null;
/**
* The key may be used for cryptographic commitments. Note that this may also be referred to as "non-repudiation".
*/
contentCommitment?: boolean | null;
/**
* The key may be used sign certificate revocation lists.
*/
crlSign?: boolean | null;
/**
* The key may be used to encipher data.
*/
dataEncipherment?: boolean | null;
/**
* The key may be used to decipher only.
*/
decipherOnly?: boolean | null;
/**
* The key may be used for digital signatures.
*/
digitalSignature?: boolean | null;
/**
* The key may be used to encipher only.
*/
encipherOnly?: boolean | null;
/**
* The key may be used in a key agreement protocol.
*/
keyAgreement?: boolean | null;
/**
* The key may be used to encipher other keys.
*/
keyEncipherment?: boolean | null;
}
/**
* A Cloud KMS key configuration that a CertificateAuthority will use.
*/
export interface Schema$KeyVersionSpec {
/**
* The algorithm to use for creating a managed Cloud KMS key for a for a simplified experience. All managed keys will be have their ProtectionLevel as `HSM`.
*/
algorithm?: string | null;
/**
* The resource name for an existing Cloud KMS CryptoKeyVersion in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x/cryptoKeyVersions/x`. This option enables full flexibility in the key's capabilities and properties.
*/
cloudKmsKeyVersion?: string | null;
}
/**
* Response message for CertificateAuthorityService.ListCaPools.
*/
export interface Schema$ListCaPoolsResponse {
/**
* The list of CaPools.
*/
caPools?: Schema$CaPool[];
/**
* A token to retrieve next page of results. Pass this value in ListCertificateAuthoritiesRequest.next_page_token to retrieve the next page of results.
*/
nextPageToken?: string | null;
/**
* A list of locations (e.g. "us-west1") that could not be reached.
*/
unreachable?: string[] | null;
}
/**
* Response message for CertificateAuthorityService.ListCertificateAuthorities.
*/
export interface Schema$ListCertificateAuthoritiesResponse {
/**
* The list of CertificateAuthorities.
*/
certificateAuthorities?: Schema$CertificateAuthority[];
/**
* A token to retrieve next page of results. Pass this value in ListCertificateAuthoritiesRequest.next_page_token to retrieve the next page of results.
*/
nextPageToken?: string | null;
/**
* A list of locations (e.g. "us-west1") that could not be reached.
*/
unreachable?: string[] | null;
}
/**
* Response message for CertificateAuthorityService.ListCertificateRevocationLists.
*/
export interface Schema$ListCertificateRevocationListsResponse {
/**
* The list of CertificateRevocationLists.
*/
certificateRevocationLists?: Schema$CertificateRevocationList[];
/**
* A token to retrieve next page of results. Pass this value in ListCertificateRevocationListsRequest.next_page_token to retrieve the next page of results.
*/
nextPageToken?: string | null;
/**
* A list of locations (e.g. "us-west1") that could not be reached.
*/
unreachable?: string[] | null;
}
/**
* Response message for CertificateAuthorityService.ListCertificates.
*/
export interface Schema$ListCertificatesResponse {
/**
* The list of Certificates.
*/
certificates?: Schema$Certificate[];
/**
* A token to retrieve next page of results. Pass this value in ListCertificatesRequest.next_page_token to retrieve the next page of results.
*/
nextPageToken?: string | null;
/**
* A list of locations (e.g. "us-west1") that could not be reached.
*/
unreachable?: string[] | null;
}
/**
* Response message for CertificateAuthorityService.ListCertificateTemplates.
*/
export interface Schema$ListCertificateTemplatesResponse {
/**
* The list of CertificateTemplates.
*/
certificateTemplates?: Schema$CertificateTemplate[];
/**
* A token to retrieve next page of results. Pass this value in ListCertificateTemplatesRequest.next_page_token to retrieve the next page of results.
*/
nextPageToken?: string | null;
/**
* A list of locations (e.g. "us-west1") that could not be reached.
*/
unreachable?: string[] | null;
}
/**
* The response message for Locations.ListLocations.
*/
export interface Schema$ListLocationsResponse {
/**
* A list of locations that matches the specified filter in the request.
*/
locations?: Schema$Location[];
/**
* The standard List next-page token.
*/
nextPageToken?: string | null;
}
/**
* The response message for Operations.ListOperations.
*/
export interface Schema$ListOperationsResponse {
/**
* The standard List next-page token.
*/
nextPageToken?: string | null;
/**
* A list of operations that matches the specified filter in the request.
*/
operations?: Schema$Operation[];
}
/**
* A resource that represents Google Cloud Platform location.
*/
export interface Schema$Location {
/**
* The friendly name for this location, typically a nearby city name. For example, "Tokyo".
*/
displayName?: string | null;
/**
* Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"\}
*/
labels?: {[key: string]: string} | null;
/**
* The canonical id for this location. For example: `"us-east1"`.
*/
locationId?: string | null;
/**
* Service-specific metadata. For example the available capacity at the given location.
*/
metadata?: {[key: string]: any} | null;
/**
* Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`
*/
name?: string | null;
}
/**
* An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages.
*/
export interface Schema$ObjectId {
/**
* Required. The parts of an OID path. The most significant parts of the path come first.
*/
objectIdPath?: number[] | null;
}
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
export interface Schema$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.
*/
done?: boolean | null;
/**
* The error result of the operation in case of failure or cancellation.
*/
error?: Schema$Status;
/**
* 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.
*/
metadata?: {[key: string]: any} | null;
/**
* 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\}`.
*/
name?: string | null;
/**
* The normal response of the operation in case of success. 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`.
*/
response?: {[key: string]: any} | null;
}
/**
* Represents the metadata of the long-running operation.
*/
export interface Schema$OperationMetadata {
/**
* Output only. API version used to start the operation.
*/
apiVersion?: string | null;
/**
* Output only. The time the operation was created.
*/
createTime?: string | null;
/**
* Output only. The time the operation finished running.
*/
endTime?: string | null;
/**
* Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
*/
requestedCancellation?: boolean | null;
/**
* Output only. Human-readable status of the operation, if any.
*/
statusMessage?: string | null;
/**
* Output only. Server-defined resource path for the target of the operation.
*/
target?: string | null;
/**
* Output only. Name of the verb executed by the operation.
*/
verb?: string | null;
}
/**
* 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` to a single `role`. Members 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/).
*/
export interface Schema$Policy {
/**
* Specifies cloud audit logging configuration for this policy.
*/
auditConfigs?: Schema$AuditConfig[];
/**
* Associates a list of `members` to 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 member.
*/
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. **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.
*/
etag?: string | null;
/**
* 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).
*/
version?: number | null;
}
/**
* A PublicKey describes a public key.
*/
export interface Schema$PublicKey {
/**
* Required. The format of the public key.
*/
format?: string | null;
/**
* Required. A public key. The padding and encoding must match with the `KeyFormat` value specified for the `format` field.
*/
key?: string | null;
}
/**
* Options relating to the publication of each CertificateAuthority's CA certificate and CRLs and their inclusion as extensions in issued Certificates. The options set here apply to certificates issued by any CertificateAuthority in the CaPool.
*/
export interface Schema$PublishingOptions {
/**
* Optional. When true, publishes each CertificateAuthority's CA certificate and includes its URL in the "Authority Information Access" X.509 extension in all issued Certificates. If this is false, the CA certificate will not be published and the corresponding X.509 extension will not be written in issued certificates.
*/
publishCaCert?: boolean | null;
/**
* Optional. When true, publishes each CertificateAuthority's CRL and includes its URL in the "CRL Distribution Points" X.509 extension in all issued Certificates. If this is false, CRLs will not be published and the corresponding X.509 extension will not be written in issued certificates. CRLs will expire 7 days from their creation. However, we will rebuild daily. CRLs are also rebuilt shortly after a certificate is revoked.
*/
publishCrl?: boolean | null;
}
/**
* Operation metadata returned by the CLH during resource state reconciliation.
*/
export interface Schema$ReconciliationOperationMetadata {
/**
* DEPRECATED. Use exclusive_action instead.
*/
deleteResource?: boolean | null;
exclusiveAction?: string | null;
}
/**
* Describes fields that are relavent to the revocation of a Certificate.
*/
export interface Schema$RevocationDetails {
/**
* Indicates why a Certificate was revoked.
*/
revocationState?: string | null;
/**
* The time at which this Certificate was revoked.
*/
revocationTime?: string | null;
}
/**
* Request message for CertificateAuthorityService.RevokeCertificate.
*/
export interface Schema$RevokeCertificateRequest {
/**
* Required. The RevocationReason for revoking this certificate.
*/
reason?: string | null;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string | null;
}
/**
* Describes a revoked Certificate.
*/
export interface Schema$RevokedCertificate {
/**
* The resource name for the Certificate in the format `projects/x/locations/x/caPools/x/certificates/x`.
*/
certificate?: string | null;
/**
* The serial number of the Certificate.
*/
hexSerialNumber?: string | null;
/**
* The reason the Certificate was revoked.
*/
revocationReason?: string | null;
}
/**
* Describes an RSA key that may be used in a Certificate issued from a CaPool.
*/
export interface Schema$RsaKeyType {
/**
* Optional. The maximum allowed RSA modulus size, in bits. If this is not set, or if set to zero, the service will not enforce an explicit upper bound on RSA modulus sizes.
*/
maxModulusSize?: string | null;
/**
* Optional. The minimum allowed RSA modulus size, in bits. If this is not set, or if set to zero, the service-level min RSA modulus size will continue to apply.
*/
minModulusSize?: string | null;
}
/**
* 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"`
*/
updateMask?: string | null;
}
/**
* 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).
*/
export interface Schema$Status {
/**
* The status code, which should be an enum value of google.rpc.Code.
*/
code?: number | null;
/**
* A list of messages that carry the error details. There is a common set of message types for APIs to use.
*/
details?: Array<{[key: string]: any}> | null;
/**
* A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
*/
message?: string | null;
}
/**
* Subject describes parts of a distinguished name that, in turn, describes the subject of the certificate.
*/
export interface Schema$Subject {
/**
* The "common name" of the subject.
*/
commonName?: string | null;
/**
* The country code of the subject.
*/
countryCode?: string | null;
/**
* The locality or city of the subject.
*/
locality?: string | null;
/**
* The organization of the subject.
*/
organization?: string | null;
/**
* The organizational_unit of the subject.
*/
organizationalUnit?: string | null;
/**
* The postal code of the subject.
*/
postalCode?: string | null;
/**
* The province, territory, or regional state of the subject.
*/
province?: string | null;
/**
* The street address of the subject.
*/
streetAddress?: string | null;
}
/**
* SubjectAltNames corresponds to a more modern way of listing what the asserted identity is in a certificate (i.e., compared to the "common name" in the distinguished name).
*/
export interface Schema$SubjectAltNames {
/**
* Contains additional subject alternative name values.
*/
customSans?: Schema$X509Extension[];
/**
* Contains only valid, fully-qualified host names.
*/
dnsNames?: string[] | null;
/**
* Contains only valid RFC 2822 E-mail addresses.
*/
emailAddresses?: string[] | null;
/**
* Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
*/
ipAddresses?: string[] | null;
/**
* Contains only valid RFC 3986 URIs.
*/
uris?: string[] | null;
}
/**
* These values are used to create the distinguished name and subject alternative name fields in an X.509 certificate.
*/
export interface Schema$SubjectConfig {
/**
* Required. Contains distinguished name fields such as the common name, location and organization.
*/
subject?: Schema$Subject;
/**
* Optional. The subject alternative name fields.
*/
subjectAltName?: Schema$SubjectAltNames;
}
/**
* These values describe fields in an issued X.509 certificate such as the distinguished name, subject alternative names, serial number, and lifetime.
*/
export interface Schema$SubjectDescription {
/**
* The serial number encoded in lowercase hexadecimal.
*/
hexSerialNumber?: string | null;
/**
* For convenience, the actual lifetime of an issued certificate.
*/
lifetime?: string | null;
/**
* The time after which the certificate is expired. Per RFC 5280, the validity period for a certificate is the period of time from not_before_time through not_after_time, inclusive. Corresponds to 'not_before_time' + 'lifetime' - 1 second.
*/
notAfterTime?: string | null;
/**
* The time at which the certificate becomes valid.
*/
notBeforeTime?: string | null;
/**
* Contains distinguished name fields such as the common name, location and / organization.
*/
subject?: Schema$Subject;
/**
* The subject alternative name fields.
*/
subjectAltName?: Schema$SubjectAltNames;
}
/**
* Describes a subordinate CA's issuers. This is either a resource name to a known issuing CertificateAuthority, or a PEM issuer certificate chain.
*/
export interface Schema$SubordinateConfig {
/**
* Required. This can refer to a CertificateAuthority that was used to create a subordinate CertificateAuthority. This field is used for information and usability purposes only. The resource name is in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
certificateAuthority?: string | null;
/**
* Required. Contains the PEM certificate chain for the issuers of this CertificateAuthority, but not pem certificate for this CA itself.
*/
pemIssuerChain?: Schema$SubordinateConfigChain;
}
/**
* This message describes a subordinate CA's issuer certificate chain. This wrapper exists for compatibility reasons.
*/
export interface Schema$SubordinateConfigChain {
/**
* Required. Expected to be in leaf-to-root order according to RFC 5246.
*/
pemCertificates?: string[] | null;
}
/**
* 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[] | null;
}
/**
* Response message for `TestIamPermissions` method.
*/
export interface Schema$TestIamPermissionsResponse {
/**
* A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
*/
permissions?: string[] | null;
}
/**
* Request message for CertificateAuthorityService.UndeleteCertificateAuthority.
*/
export interface Schema$UndeleteCertificateAuthorityRequest {
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string | null;
}
/**
* An X509Extension specifies an X.509 extension, which may be used in different parts of X.509 objects like certificates, CSRs, and CRLs.
*/
export interface Schema$X509Extension {
/**
* Optional. Indicates whether or not this extension is critical (i.e., if the client does not know how to handle this extension, the client should consider this to be an error).
*/
critical?: boolean | null;
/**
* Required. The OID for this X.509 extension.
*/
objectId?: Schema$ObjectId;
/**
* Required. The value of this X.509 extension.
*/
value?: string | null;
}
/**
* An X509Parameters is used to describe certain fields of an X.509 certificate, such as the key usage fields, fields specific to CA certificates, certificate policy extensions and custom extensions.
*/
export interface Schema$X509Parameters {
/**
* Optional. Describes custom X.509 extensions.
*/
additionalExtensions?: Schema$X509Extension[];
/**
* Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses that appear in the "Authority Information Access" extension in the certificate.
*/
aiaOcspServers?: string[] | null;
/**
* Optional. Describes options in this X509Parameters that are relevant in a CA certificate.
*/
caOptions?: Schema$CaOptions;
/**
* Optional. Indicates the intended use for keys that correspond to a certificate.
*/
keyUsage?: Schema$KeyUsage;
/**
* Optional. Describes the X.509 certificate policy object identifiers, per https://tools.ietf.org/html/rfc5280#section-4.2.1.4.
*/
policyIds?: Schema$ObjectId[];
}
export class Resource$Projects {
context: APIRequestContext;
locations: Resource$Projects$Locations;
constructor(context: APIRequestContext) {
this.context = context;
this.locations = new Resource$Projects$Locations(this.context);
}
}
export class Resource$Projects$Locations {
context: APIRequestContext;
caPools: Resource$Projects$Locations$Capools;
certificateTemplates: Resource$Projects$Locations$Certificatetemplates;
operations: Resource$Projects$Locations$Operations;
constructor(context: APIRequestContext) {
this.context = context;
this.caPools = new Resource$Projects$Locations$Capools(this.context);
this.certificateTemplates =
new Resource$Projects$Locations$Certificatetemplates(this.context);
this.operations = new Resource$Projects$Locations$Operations(
this.context
);
}
/**
* Gets information about a location.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.get({
* // Resource name for the location.
* name: 'projects/my-project/locations/my-location',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "displayName": "my_displayName",
* // "labels": {},
* // "locationId": "my_locationId",
* // "metadata": {},
* // "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.
*/
get(
params: Params$Resource$Projects$Locations$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Get,
options?: MethodOptions
): GaxiosPromise<Schema$Location>;
get(
params: Params$Resource$Projects$Locations$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Get,
options: MethodOptions | BodyResponseCallback<Schema$Location>,
callback: BodyResponseCallback<Schema$Location>
): void;
get(
params: Params$Resource$Projects$Locations$Get,
callback: BodyResponseCallback<Schema$Location>
): void;
get(callback: BodyResponseCallback<Schema$Location>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Get
| BodyResponseCallback<Schema$Location>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Location>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Location>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Location> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Location>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Location>(parameters);
}
}
/**
* Lists information about the supported locations for this service.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.list({
* // 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).
* filter: 'placeholder-value',
* // The resource that owns the locations collection, if applicable.
* name: 'projects/my-project',
* // The maximum number of results to return. If not set, the service selects a default.
* pageSize: 'placeholder-value',
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
* pageToken: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "locations": [],
* // "nextPageToken": "my_nextPageToken"
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListLocationsResponse>;
list(
params: Params$Resource$Projects$Locations$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$List,
options:
| MethodOptions
| BodyResponseCallback<Schema$ListLocationsResponse>,
callback: BodyResponseCallback<Schema$ListLocationsResponse>
): void;
list(
params: Params$Resource$Projects$Locations$List,
callback: BodyResponseCallback<Schema$ListLocationsResponse>
): void;
list(callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$List
| BodyResponseCallback<Schema$ListLocationsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListLocationsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListLocationsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListLocationsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}/locations').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListLocationsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListLocationsResponse>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Get
extends StandardParameters {
/**
* Resource name for the location.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$List
extends StandardParameters {
/**
* 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).
*/
filter?: string;
/**
* The resource that owns the locations collection, if applicable.
*/
name?: string;
/**
* The maximum number of results to return. If not set, the service selects a default.
*/
pageSize?: number;
/**
* A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
*/
pageToken?: string;
}
export class Resource$Projects$Locations$Capools {
context: APIRequestContext;
certificateAuthorities: Resource$Projects$Locations$Capools$Certificateauthorities;
certificates: Resource$Projects$Locations$Capools$Certificates;
constructor(context: APIRequestContext) {
this.context = context;
this.certificateAuthorities =
new Resource$Projects$Locations$Capools$Certificateauthorities(
this.context
);
this.certificates = new Resource$Projects$Locations$Capools$Certificates(
this.context
);
}
/**
* Create a CaPool.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.create({
* // Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`
* caPoolId: 'placeholder-value',
* // Required. The resource name of the location associated with the CaPool, in the format `projects/x/locations/x`.
* parent: 'projects/my-project/locations/my-location',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "issuancePolicy": {},
* // "labels": {},
* // "name": "my_name",
* // "publishingOptions": {},
* // "tier": "my_tier"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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$Capools$Create,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
create(
params?: Params$Resource$Projects$Locations$Capools$Create,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
create(
params: Params$Resource$Projects$Locations$Capools$Create,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
create(
params: Params$Resource$Projects$Locations$Capools$Create,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
create(
params: Params$Resource$Projects$Locations$Capools$Create,
callback: BodyResponseCallback<Schema$Operation>
): void;
create(callback: BodyResponseCallback<Schema$Operation>): void;
create(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Create
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Create;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Create;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/caPools').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Delete a CaPool.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.delete({
* // Required. The resource name for this CaPool in the format `projects/x/locations/x/caPools/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
delete(
params: Params$Resource$Projects$Locations$Capools$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Projects$Locations$Capools$Delete,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
delete(
params: Params$Resource$Projects$Locations$Capools$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Projects$Locations$Capools$Delete,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
delete(
params: Params$Resource$Projects$Locations$Capools$Delete,
callback: BodyResponseCallback<Schema$Operation>
): void;
delete(callback: BodyResponseCallback<Schema$Operation>): void;
delete(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Delete
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* FetchCaCerts returns the current trust anchor for the CaPool. This will include CA certificate chains for all ACTIVE CertificateAuthority resources in the CaPool.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.fetchCaCerts({
* // Required. The resource name for the CaPool in the format `projects/x/locations/x/caPools/x`.
* caPool: 'projects/my-project/locations/my-location/caPools/my-caPool',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "requestId": "my_requestId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "caCerts": []
* // }
* }
*
* 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.
*/
fetchCaCerts(
params: Params$Resource$Projects$Locations$Capools$Fetchcacerts,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
fetchCaCerts(
params?: Params$Resource$Projects$Locations$Capools$Fetchcacerts,
options?: MethodOptions
): GaxiosPromise<Schema$FetchCaCertsResponse>;
fetchCaCerts(
params: Params$Resource$Projects$Locations$Capools$Fetchcacerts,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
fetchCaCerts(
params: Params$Resource$Projects$Locations$Capools$Fetchcacerts,
options:
| MethodOptions
| BodyResponseCallback<Schema$FetchCaCertsResponse>,
callback: BodyResponseCallback<Schema$FetchCaCertsResponse>
): void;
fetchCaCerts(
params: Params$Resource$Projects$Locations$Capools$Fetchcacerts,
callback: BodyResponseCallback<Schema$FetchCaCertsResponse>
): void;
fetchCaCerts(
callback: BodyResponseCallback<Schema$FetchCaCertsResponse>
): void;
fetchCaCerts(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Fetchcacerts
| BodyResponseCallback<Schema$FetchCaCertsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$FetchCaCertsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$FetchCaCertsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$FetchCaCertsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Fetchcacerts;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Fetchcacerts;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+caPool}:fetchCaCerts').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['caPool'],
pathParams: ['caPool'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$FetchCaCertsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$FetchCaCertsResponse>(parameters);
}
}
/**
* Returns a CaPool.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.get({
* // Required. The name of the CaPool to get.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "issuancePolicy": {},
* // "labels": {},
* // "name": "my_name",
* // "publishingOptions": {},
* // "tier": "my_tier"
* // }
* }
*
* 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.
*/
get(
params: Params$Resource$Projects$Locations$Capools$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Capools$Get,
options?: MethodOptions
): GaxiosPromise<Schema$CaPool>;
get(
params: Params$Resource$Projects$Locations$Capools$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Get,
options: MethodOptions | BodyResponseCallback<Schema$CaPool>,
callback: BodyResponseCallback<Schema$CaPool>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Get,
callback: BodyResponseCallback<Schema$CaPool>
): void;
get(callback: BodyResponseCallback<Schema$CaPool>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Get
| BodyResponseCallback<Schema$CaPool>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$CaPool>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$CaPool>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$CaPool> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$CaPool>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$CaPool>(parameters);
}
}
/**
* Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.getIamPolicy({
* // Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value 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).
* 'options.requestedPolicyVersion': 'placeholder-value',
* // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
* resource: 'projects/my-project/locations/my-location/caPools/my-caPool',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "auditConfigs": [],
* // "bindings": [],
* // "etag": "my_etag",
* // "version": 0
* // }
* }
*
* 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.
*/
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Getiampolicy,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
getIamPolicy(
params?: Params$Resource$Projects$Locations$Capools$Getiampolicy,
options?: MethodOptions
): GaxiosPromise<Schema$Policy>;
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Getiampolicy,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Getiampolicy,
options: MethodOptions | BodyResponseCallback<Schema$Policy>,
callback: BodyResponseCallback<Schema$Policy>
): void;
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Getiampolicy,
callback: BodyResponseCallback<Schema$Policy>
): void;
getIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
getIamPolicy(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Getiampolicy
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Getiampolicy;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Getiampolicy;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Policy>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Policy>(parameters);
}
}
/**
* Lists CaPools.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.list({
* // Optional. Only include resources that match the filter in the response.
* filter: 'placeholder-value',
* // Optional. Specify how the results should be sorted.
* orderBy: 'placeholder-value',
* // Optional. Limit on the number of CaPools to include in the response. Further CaPools can subsequently be obtained by including the ListCaPoolsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
* pageSize: 'placeholder-value',
* // Optional. Pagination token, returned earlier via ListCaPoolsResponse.next_page_token.
* pageToken: 'placeholder-value',
* // Required. The resource name of the location associated with the CaPools, in the format `projects/x/locations/x`.
* parent: 'projects/my-project/locations/my-location',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "caPools": [],
* // "nextPageToken": "my_nextPageToken",
* // "unreachable": []
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$Capools$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$Capools$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListCaPoolsResponse>;
list(
params: Params$Resource$Projects$Locations$Capools$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$List,
options: MethodOptions | BodyResponseCallback<Schema$ListCaPoolsResponse>,
callback: BodyResponseCallback<Schema$ListCaPoolsResponse>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$List,
callback: BodyResponseCallback<Schema$ListCaPoolsResponse>
): void;
list(callback: BodyResponseCallback<Schema$ListCaPoolsResponse>): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$List
| BodyResponseCallback<Schema$ListCaPoolsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListCaPoolsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListCaPoolsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListCaPoolsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/caPools').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListCaPoolsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListCaPoolsResponse>(parameters);
}
}
/**
* Update a CaPool.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.patch({
* // Output only. The resource name for this CaPool in the format `projects/x/locations/x/caPools/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* // Required. A list of fields to be updated in this request.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "issuancePolicy": {},
* // "labels": {},
* // "name": "my_name",
* // "publishingOptions": {},
* // "tier": "my_tier"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
patch(
params: Params$Resource$Projects$Locations$Capools$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Projects$Locations$Capools$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
patch(
params: Params$Resource$Projects$Locations$Capools$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Patch,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(callback: BodyResponseCallback<Schema$Operation>): void;
patch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Patch
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.setIamPolicy({
* // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
* resource: 'projects/my-project/locations/my-location/caPools/my-caPool',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "policy": {},
* // "updateMask": "my_updateMask"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "auditConfigs": [],
* // "bindings": [],
* // "etag": "my_etag",
* // "version": 0
* // }
* }
*
* 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.
*/
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Setiampolicy,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
setIamPolicy(
params?: Params$Resource$Projects$Locations$Capools$Setiampolicy,
options?: MethodOptions
): GaxiosPromise<Schema$Policy>;
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Setiampolicy,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Setiampolicy,
options: MethodOptions | BodyResponseCallback<Schema$Policy>,
callback: BodyResponseCallback<Schema$Policy>
): void;
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Setiampolicy,
callback: BodyResponseCallback<Schema$Policy>
): void;
setIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
setIamPolicy(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Setiampolicy
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Setiampolicy;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Capools$Setiampolicy;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Policy>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Policy>(parameters);
}
}
/**
* 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. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.testIamPermissions({
* // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
* resource: 'projects/my-project/locations/my-location/caPools/my-caPool',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "permissions": []
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "permissions": []
* // }
* }
*
* 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.
*/
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Testiampermissions,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
testIamPermissions(
params?: Params$Resource$Projects$Locations$Capools$Testiampermissions,
options?: MethodOptions
): GaxiosPromise<Schema$TestIamPermissionsResponse>;
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Testiampermissions,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Testiampermissions,
options:
| MethodOptions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>,
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Testiampermissions,
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Testiampermissions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$TestIamPermissionsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Testiampermissions;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Testiampermissions;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TestIamPermissionsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TestIamPermissionsResponse>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Capools$Create
extends StandardParameters {
/**
* Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`
*/
caPoolId?: string;
/**
* Required. The resource name of the location associated with the CaPool, in the format `projects/x/locations/x`.
*/
parent?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CaPool;
}
export interface Params$Resource$Projects$Locations$Capools$Delete
extends StandardParameters {
/**
* Required. The resource name for this CaPool in the format `projects/x/locations/x/caPools/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Fetchcacerts
extends StandardParameters {
/**
* Required. The resource name for the CaPool in the format `projects/x/locations/x/caPools/x`.
*/
caPool?: string;
/**
* Request body metadata
*/
requestBody?: Schema$FetchCaCertsRequest;
}
export interface Params$Resource$Projects$Locations$Capools$Get
extends StandardParameters {
/**
* Required. The name of the CaPool to get.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Getiampolicy
extends StandardParameters {
/**
* Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value 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).
*/
'options.requestedPolicyVersion'?: number;
/**
* REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
}
export interface Params$Resource$Projects$Locations$Capools$List
extends StandardParameters {
/**
* Optional. Only include resources that match the filter in the response.
*/
filter?: string;
/**
* Optional. Specify how the results should be sorted.
*/
orderBy?: string;
/**
* Optional. Limit on the number of CaPools to include in the response. Further CaPools can subsequently be obtained by including the ListCaPoolsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
*/
pageSize?: number;
/**
* Optional. Pagination token, returned earlier via ListCaPoolsResponse.next_page_token.
*/
pageToken?: string;
/**
* Required. The resource name of the location associated with the CaPools, in the format `projects/x/locations/x`.
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Patch
extends StandardParameters {
/**
* Output only. The resource name for this CaPool in the format `projects/x/locations/x/caPools/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Required. A list of fields to be updated in this request.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CaPool;
}
export interface Params$Resource$Projects$Locations$Capools$Setiampolicy
extends StandardParameters {
/**
* REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
/**
* Request body metadata
*/
requestBody?: Schema$SetIamPolicyRequest;
}
export interface Params$Resource$Projects$Locations$Capools$Testiampermissions
extends StandardParameters {
/**
* REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
/**
* Request body metadata
*/
requestBody?: Schema$TestIamPermissionsRequest;
}
export class Resource$Projects$Locations$Capools$Certificateauthorities {
context: APIRequestContext;
certificateRevocationLists: Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists;
constructor(context: APIRequestContext) {
this.context = context;
this.certificateRevocationLists =
new Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists(
this.context
);
}
/**
* Activate a CertificateAuthority that is in state AWAITING_USER_ACTIVATION and is of type SUBORDINATE. After the parent Certificate Authority signs a certificate signing request from FetchCertificateAuthorityCsr, this method can complete the activation process.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.activate({
* // Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "pemCaCertificate": "my_pemCaCertificate",
* // "requestId": "my_requestId",
* // "subordinateConfig": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
activate(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
activate(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
activate(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
activate(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
activate(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate,
callback: BodyResponseCallback<Schema$Operation>
): void;
activate(callback: BodyResponseCallback<Schema$Operation>): void;
activate(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:activate').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Create a new CertificateAuthority in a given Project and Location.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.create({
* // Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`
* certificateAuthorityId: 'placeholder-value',
* // Required. The resource name of the CaPool associated with the CertificateAuthorities, in the format `projects/x/locations/x/caPools/x`.
* parent: 'projects/my-project/locations/my-location/caPools/my-caPool',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "accessUrls": {},
* // "caCertificateDescriptions": [],
* // "config": {},
* // "createTime": "my_createTime",
* // "deleteTime": "my_deleteTime",
* // "expireTime": "my_expireTime",
* // "gcsBucket": "my_gcsBucket",
* // "keySpec": {},
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCaCertificates": [],
* // "state": "my_state",
* // "subordinateConfig": {},
* // "tier": "my_tier",
* // "type": "my_type",
* // "updateTime": "my_updateTime"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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$Capools$Certificateauthorities$Create,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
create(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
create(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
create(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
create(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create,
callback: BodyResponseCallback<Schema$Operation>
): void;
create(callback: BodyResponseCallback<Schema$Operation>): void;
create(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificateAuthorities').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Delete a CertificateAuthority.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.delete({
* // Optional. This field allows the CA to be deleted even if the CA has active certs. Active certs include both unrevoked and unexpired certs.
* ignoreActiveCertificates: 'placeholder-value',
* // Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
delete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
delete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
delete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete,
callback: BodyResponseCallback<Schema$Operation>
): void;
delete(callback: BodyResponseCallback<Schema$Operation>): void;
delete(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Disable a CertificateAuthority.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.disable({
* // Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "requestId": "my_requestId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
disable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
disable(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
disable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
disable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
disable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable,
callback: BodyResponseCallback<Schema$Operation>
): void;
disable(callback: BodyResponseCallback<Schema$Operation>): void;
disable(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:disable').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Enable a CertificateAuthority.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.enable({
* // Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "requestId": "my_requestId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
enable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
enable(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
enable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
enable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
enable(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable,
callback: BodyResponseCallback<Schema$Operation>
): void;
enable(callback: BodyResponseCallback<Schema$Operation>): void;
enable(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:enable').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Fetch a certificate signing request (CSR) from a CertificateAuthority that is in state AWAITING_USER_ACTIVATION and is of type SUBORDINATE. The CSR must then be signed by the desired parent Certificate Authority, which could be another CertificateAuthority resource, or could be an on-prem certificate authority. See also ActivateCertificateAuthority.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.fetch({
* // Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "pemCsr": "my_pemCsr"
* // }
* }
*
* 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.
*/
fetch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
fetch(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch,
options?: MethodOptions
): GaxiosPromise<Schema$FetchCertificateAuthorityCsrResponse>;
fetch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
fetch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch,
options:
| MethodOptions
| BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>,
callback: BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>
): void;
fetch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch,
callback: BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>
): void;
fetch(
callback: BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>
): void;
fetch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch
| BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$FetchCertificateAuthorityCsrResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$FetchCertificateAuthorityCsrResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:fetch').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$FetchCertificateAuthorityCsrResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$FetchCertificateAuthorityCsrResponse>(
parameters
);
}
}
/**
* Returns a CertificateAuthority.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.get({
* // Required. The name of the CertificateAuthority to get.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "accessUrls": {},
* // "caCertificateDescriptions": [],
* // "config": {},
* // "createTime": "my_createTime",
* // "deleteTime": "my_deleteTime",
* // "expireTime": "my_expireTime",
* // "gcsBucket": "my_gcsBucket",
* // "keySpec": {},
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCaCertificates": [],
* // "state": "my_state",
* // "subordinateConfig": {},
* // "tier": "my_tier",
* // "type": "my_type",
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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.
*/
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get,
options?: MethodOptions
): GaxiosPromise<Schema$CertificateAuthority>;
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get,
options:
| MethodOptions
| BodyResponseCallback<Schema$CertificateAuthority>,
callback: BodyResponseCallback<Schema$CertificateAuthority>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get,
callback: BodyResponseCallback<Schema$CertificateAuthority>
): void;
get(callback: BodyResponseCallback<Schema$CertificateAuthority>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get
| BodyResponseCallback<Schema$CertificateAuthority>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$CertificateAuthority>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$CertificateAuthority>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$CertificateAuthority>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$CertificateAuthority>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$CertificateAuthority>(parameters);
}
}
/**
* Lists CertificateAuthorities.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.list({
* // Optional. Only include resources that match the filter in the response.
* filter: 'placeholder-value',
* // Optional. Specify how the results should be sorted.
* orderBy: 'placeholder-value',
* // Optional. Limit on the number of CertificateAuthorities to include in the response. Further CertificateAuthorities can subsequently be obtained by including the ListCertificateAuthoritiesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
* pageSize: 'placeholder-value',
* // Optional. Pagination token, returned earlier via ListCertificateAuthoritiesResponse.next_page_token.
* pageToken: 'placeholder-value',
* // Required. The resource name of the CaPool associated with the CertificateAuthorities, in the format `projects/x/locations/x/caPools/x`.
* parent: 'projects/my-project/locations/my-location/caPools/my-caPool',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificateAuthorities": [],
* // "nextPageToken": "my_nextPageToken",
* // "unreachable": []
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListCertificateAuthoritiesResponse>;
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$List,
options:
| MethodOptions
| BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>,
callback: BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$List,
callback: BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>
): void;
list(
callback: BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>
): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$List
| BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListCertificateAuthoritiesResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListCertificateAuthoritiesResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificateAuthorities').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListCertificateAuthoritiesResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListCertificateAuthoritiesResponse>(
parameters
);
}
}
/**
* Update a CertificateAuthority.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.patch({
* // Output only. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* // Required. A list of fields to be updated in this request.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "accessUrls": {},
* // "caCertificateDescriptions": [],
* // "config": {},
* // "createTime": "my_createTime",
* // "deleteTime": "my_deleteTime",
* // "expireTime": "my_expireTime",
* // "gcsBucket": "my_gcsBucket",
* // "keySpec": {},
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCaCertificates": [],
* // "state": "my_state",
* // "subordinateConfig": {},
* // "tier": "my_tier",
* // "type": "my_type",
* // "updateTime": "my_updateTime"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(callback: BodyResponseCallback<Schema$Operation>): void;
patch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Undelete a CertificateAuthority that has been deleted.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.undelete({
* // Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "requestId": "my_requestId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
undelete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
undelete(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
undelete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
undelete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
undelete(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete,
callback: BodyResponseCallback<Schema$Operation>
): void;
undelete(callback: BodyResponseCallback<Schema$Operation>): void;
undelete(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:undelete').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Activate
extends StandardParameters {
/**
* Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$ActivateCertificateAuthorityRequest;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Create
extends StandardParameters {
/**
* Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`
*/
certificateAuthorityId?: string;
/**
* Required. The resource name of the CaPool associated with the CertificateAuthorities, in the format `projects/x/locations/x/caPools/x`.
*/
parent?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CertificateAuthority;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Delete
extends StandardParameters {
/**
* Optional. This field allows the CA to be deleted even if the CA has active certs. Active certs include both unrevoked and unexpired certs.
*/
ignoreActiveCertificates?: boolean;
/**
* Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Disable
extends StandardParameters {
/**
* Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$DisableCertificateAuthorityRequest;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Enable
extends StandardParameters {
/**
* Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$EnableCertificateAuthorityRequest;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Fetch
extends StandardParameters {
/**
* Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Get
extends StandardParameters {
/**
* Required. The name of the CertificateAuthority to get.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$List
extends StandardParameters {
/**
* Optional. Only include resources that match the filter in the response.
*/
filter?: string;
/**
* Optional. Specify how the results should be sorted.
*/
orderBy?: string;
/**
* Optional. Limit on the number of CertificateAuthorities to include in the response. Further CertificateAuthorities can subsequently be obtained by including the ListCertificateAuthoritiesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
*/
pageSize?: number;
/**
* Optional. Pagination token, returned earlier via ListCertificateAuthoritiesResponse.next_page_token.
*/
pageToken?: string;
/**
* Required. The resource name of the CaPool associated with the CertificateAuthorities, in the format `projects/x/locations/x/caPools/x`.
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Patch
extends StandardParameters {
/**
* Output only. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Required. A list of fields to be updated in this request.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CertificateAuthority;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Undelete
extends StandardParameters {
/**
* Required. The resource name for this CertificateAuthority in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$UndeleteCertificateAuthorityRequest;
}
export class Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
/**
* Returns a CertificateRevocationList.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.certificateRevocationLists.get(
* {
* // Required. The name of the CertificateRevocationList to get.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie/certificateRevocationLists/my-certificateRevocationList',
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "accessUrl": "my_accessUrl",
* // "createTime": "my_createTime",
* // "labels": {},
* // "name": "my_name",
* // "pemCrl": "my_pemCrl",
* // "revisionId": "my_revisionId",
* // "revokedCertificates": [],
* // "sequenceNumber": "my_sequenceNumber",
* // "state": "my_state",
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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.
*/
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get,
options?: MethodOptions
): GaxiosPromise<Schema$CertificateRevocationList>;
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get,
options:
| MethodOptions
| BodyResponseCallback<Schema$CertificateRevocationList>,
callback: BodyResponseCallback<Schema$CertificateRevocationList>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get,
callback: BodyResponseCallback<Schema$CertificateRevocationList>
): void;
get(callback: BodyResponseCallback<Schema$CertificateRevocationList>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get
| BodyResponseCallback<Schema$CertificateRevocationList>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$CertificateRevocationList>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$CertificateRevocationList>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$CertificateRevocationList>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$CertificateRevocationList>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$CertificateRevocationList>(parameters);
}
}
/**
* Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.certificateRevocationLists.getIamPolicy(
* {
* // Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value 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).
* 'options.requestedPolicyVersion': 'placeholder-value',
* // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
* resource:
* 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie/certificateRevocationLists/my-certificateRevocationList',
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "auditConfigs": [],
* // "bindings": [],
* // "etag": "my_etag",
* // "version": 0
* // }
* }
*
* 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.
*/
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
getIamPolicy(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy,
options?: MethodOptions
): GaxiosPromise<Schema$Policy>;
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy,
options: MethodOptions | BodyResponseCallback<Schema$Policy>,
callback: BodyResponseCallback<Schema$Policy>
): void;
getIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy,
callback: BodyResponseCallback<Schema$Policy>
): void;
getIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
getIamPolicy(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Policy>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Policy>(parameters);
}
}
/**
* Lists CertificateRevocationLists.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.certificateRevocationLists.list(
* {
* // Optional. Only include resources that match the filter in the response.
* filter: 'placeholder-value',
* // Optional. Specify how the results should be sorted.
* orderBy: 'placeholder-value',
* // Optional. Limit on the number of CertificateRevocationLists to include in the response. Further CertificateRevocationLists can subsequently be obtained by including the ListCertificateRevocationListsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
* pageSize: 'placeholder-value',
* // Optional. Pagination token, returned earlier via ListCertificateRevocationListsResponse.next_page_token.
* pageToken: 'placeholder-value',
* // Required. The resource name of the location associated with the CertificateRevocationLists, in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
* parent:
* 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie',
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "certificateRevocationLists": [],
* // "nextPageToken": "my_nextPageToken",
* // "unreachable": []
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListCertificateRevocationListsResponse>;
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List,
options:
| MethodOptions
| BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>,
callback: BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List,
callback: BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>
): void;
list(
callback: BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>
): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List
| BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListCertificateRevocationListsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListCertificateRevocationListsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificateRevocationLists').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListCertificateRevocationListsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListCertificateRevocationListsResponse>(
parameters
);
}
}
/**
* Update a CertificateRevocationList.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.certificateRevocationLists.patch(
* {
* // Output only. The resource name for this CertificateRevocationList in the format `projects/x/locations/x/caPools/xcertificateAuthorities/x/ certificateRevocationLists/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie/certificateRevocationLists/my-certificateRevocationList',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* // Required. A list of fields to be updated in this request.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "accessUrl": "my_accessUrl",
* // "createTime": "my_createTime",
* // "labels": {},
* // "name": "my_name",
* // "pemCrl": "my_pemCrl",
* // "revisionId": "my_revisionId",
* // "revokedCertificates": [],
* // "sequenceNumber": "my_sequenceNumber",
* // "state": "my_state",
* // "updateTime": "my_updateTime"
* // }
* },
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(callback: BodyResponseCallback<Schema$Operation>): void;
patch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.certificateRevocationLists.setIamPolicy(
* {
* // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
* resource:
* 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie/certificateRevocationLists/my-certificateRevocationList',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "policy": {},
* // "updateMask": "my_updateMask"
* // }
* },
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "auditConfigs": [],
* // "bindings": [],
* // "etag": "my_etag",
* // "version": 0
* // }
* }
*
* 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.
*/
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
setIamPolicy(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy,
options?: MethodOptions
): GaxiosPromise<Schema$Policy>;
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy,
options: MethodOptions | BodyResponseCallback<Schema$Policy>,
callback: BodyResponseCallback<Schema$Policy>
): void;
setIamPolicy(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy,
callback: BodyResponseCallback<Schema$Policy>
): void;
setIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
setIamPolicy(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Policy>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Policy>(parameters);
}
}
/**
* 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. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificateAuthorities.certificateRevocationLists.testIamPermissions(
* {
* // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
* resource:
* 'projects/my-project/locations/my-location/caPools/my-caPool/certificateAuthorities/my-certificateAuthoritie/certificateRevocationLists/my-certificateRevocationList',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "permissions": []
* // }
* },
* }
* );
* console.log(res.data);
*
* // Example response
* // {
* // "permissions": []
* // }
* }
*
* 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.
*/
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
testIamPermissions(
params?: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions,
options?: MethodOptions
): GaxiosPromise<Schema$TestIamPermissionsResponse>;
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions,
options:
| MethodOptions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>,
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
params: Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions,
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$TestIamPermissionsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TestIamPermissionsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TestIamPermissionsResponse>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Get
extends StandardParameters {
/**
* Required. The name of the CertificateRevocationList to get.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Getiampolicy
extends StandardParameters {
/**
* Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value 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).
*/
'options.requestedPolicyVersion'?: number;
/**
* REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$List
extends StandardParameters {
/**
* Optional. Only include resources that match the filter in the response.
*/
filter?: string;
/**
* Optional. Specify how the results should be sorted.
*/
orderBy?: string;
/**
* Optional. Limit on the number of CertificateRevocationLists to include in the response. Further CertificateRevocationLists can subsequently be obtained by including the ListCertificateRevocationListsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
*/
pageSize?: number;
/**
* Optional. Pagination token, returned earlier via ListCertificateRevocationListsResponse.next_page_token.
*/
pageToken?: string;
/**
* Required. The resource name of the location associated with the CertificateRevocationLists, in the format `projects/x/locations/x/caPools/x/certificateAuthorities/x`.
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Patch
extends StandardParameters {
/**
* Output only. The resource name for this CertificateRevocationList in the format `projects/x/locations/x/caPools/xcertificateAuthorities/x/ certificateRevocationLists/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Required. A list of fields to be updated in this request.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CertificateRevocationList;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Setiampolicy
extends StandardParameters {
/**
* REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
/**
* Request body metadata
*/
requestBody?: Schema$SetIamPolicyRequest;
}
export interface Params$Resource$Projects$Locations$Capools$Certificateauthorities$Certificaterevocationlists$Testiampermissions
extends StandardParameters {
/**
* REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
/**
* Request body metadata
*/
requestBody?: Schema$TestIamPermissionsRequest;
}
export class Resource$Projects$Locations$Capools$Certificates {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
/**
* Create a new Certificate in a given Project, Location from a particular CaPool.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificates.create({
* // Optional. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`. This field is required when using a CertificateAuthority in the Enterprise CertificateAuthority.Tier, but is optional and its value is ignored otherwise.
* certificateId: 'placeholder-value',
* // Optional. The resource ID of the CertificateAuthority that should issue the certificate. This optional field will ignore the load-balancing scheme of the Pool and directly issue the certificate from the CA with the specified ID, contained in the same CaPool referenced by `parent`. Per-CA quota rules apply. If left empty, a CertificateAuthority will be chosen from the CaPool by the service. For example, to issue a Certificate from a Certificate Authority with resource name "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", you can set the parent to "projects/my-project/locations/us-central1/caPools/my-pool" and the issuing_certificate_authority_id to "my-ca".
* issuingCertificateAuthorityId: 'placeholder-value',
* // Required. The resource name of the CaPool associated with the Certificate, in the format `projects/x/locations/x/caPools/x`.
* parent: 'projects/my-project/locations/my-location/caPools/my-caPool',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* // Optional. If this is true, no Certificate resource will be persisted regardless of the CaPool's tier, and the returned Certificate will not contain the pem_certificate field.
* validateOnly: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "certificateDescription": {},
* // "certificateTemplate": "my_certificateTemplate",
* // "config": {},
* // "createTime": "my_createTime",
* // "issuerCertificateAuthority": "my_issuerCertificateAuthority",
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCertificate": "my_pemCertificate",
* // "pemCertificateChain": [],
* // "pemCsr": "my_pemCsr",
* // "revocationDetails": {},
* // "subjectMode": "my_subjectMode",
* // "updateTime": "my_updateTime"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificateDescription": {},
* // "certificateTemplate": "my_certificateTemplate",
* // "config": {},
* // "createTime": "my_createTime",
* // "issuerCertificateAuthority": "my_issuerCertificateAuthority",
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCertificate": "my_pemCertificate",
* // "pemCertificateChain": [],
* // "pemCsr": "my_pemCsr",
* // "revocationDetails": {},
* // "subjectMode": "my_subjectMode",
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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$Capools$Certificates$Create,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
create(
params?: Params$Resource$Projects$Locations$Capools$Certificates$Create,
options?: MethodOptions
): GaxiosPromise<Schema$Certificate>;
create(
params: Params$Resource$Projects$Locations$Capools$Certificates$Create,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
create(
params: Params$Resource$Projects$Locations$Capools$Certificates$Create,
options: MethodOptions | BodyResponseCallback<Schema$Certificate>,
callback: BodyResponseCallback<Schema$Certificate>
): void;
create(
params: Params$Resource$Projects$Locations$Capools$Certificates$Create,
callback: BodyResponseCallback<Schema$Certificate>
): void;
create(callback: BodyResponseCallback<Schema$Certificate>): void;
create(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificates$Create
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Certificate> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificates$Create;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificates$Create;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificates').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Certificate>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Certificate>(parameters);
}
}
/**
* Returns a Certificate.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificates.get({
* // Required. The name of the Certificate to get.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificates/my-certificate',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificateDescription": {},
* // "certificateTemplate": "my_certificateTemplate",
* // "config": {},
* // "createTime": "my_createTime",
* // "issuerCertificateAuthority": "my_issuerCertificateAuthority",
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCertificate": "my_pemCertificate",
* // "pemCertificateChain": [],
* // "pemCsr": "my_pemCsr",
* // "revocationDetails": {},
* // "subjectMode": "my_subjectMode",
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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.
*/
get(
params: Params$Resource$Projects$Locations$Capools$Certificates$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Capools$Certificates$Get,
options?: MethodOptions
): GaxiosPromise<Schema$Certificate>;
get(
params: Params$Resource$Projects$Locations$Capools$Certificates$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Certificates$Get,
options: MethodOptions | BodyResponseCallback<Schema$Certificate>,
callback: BodyResponseCallback<Schema$Certificate>
): void;
get(
params: Params$Resource$Projects$Locations$Capools$Certificates$Get,
callback: BodyResponseCallback<Schema$Certificate>
): void;
get(callback: BodyResponseCallback<Schema$Certificate>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificates$Get
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Certificate> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificates$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificates$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Certificate>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Certificate>(parameters);
}
}
/**
* Lists Certificates.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificates.list({
* // Optional. Only include resources that match the filter in the response. For details on supported filters and syntax, see [Certificates Filtering documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
* filter: 'placeholder-value',
* // Optional. Specify how the results should be sorted. For details on supported fields and syntax, see [Certificates Sorting documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
* orderBy: 'placeholder-value',
* // Optional. Limit on the number of Certificates to include in the response. Further Certificates can subsequently be obtained by including the ListCertificatesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
* pageSize: 'placeholder-value',
* // Optional. Pagination token, returned earlier via ListCertificatesResponse.next_page_token.
* pageToken: 'placeholder-value',
* // Required. The resource name of the location associated with the Certificates, in the format `projects/x/locations/x/caPools/x`.
* parent: 'projects/my-project/locations/my-location/caPools/my-caPool',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificates": [],
* // "nextPageToken": "my_nextPageToken",
* // "unreachable": []
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$Capools$Certificates$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$Capools$Certificates$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListCertificatesResponse>;
list(
params: Params$Resource$Projects$Locations$Capools$Certificates$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$Certificates$List,
options:
| MethodOptions
| BodyResponseCallback<Schema$ListCertificatesResponse>,
callback: BodyResponseCallback<Schema$ListCertificatesResponse>
): void;
list(
params: Params$Resource$Projects$Locations$Capools$Certificates$List,
callback: BodyResponseCallback<Schema$ListCertificatesResponse>
): void;
list(callback: BodyResponseCallback<Schema$ListCertificatesResponse>): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificates$List
| BodyResponseCallback<Schema$ListCertificatesResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListCertificatesResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListCertificatesResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListCertificatesResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificates$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificates$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificates').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListCertificatesResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListCertificatesResponse>(parameters);
}
}
/**
* Update a Certificate. Currently, the only field you can update is the labels field.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificates.patch({
* // Output only. The resource name for this Certificate in the format `projects/x/locations/x/caPools/x/certificates/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificates/my-certificate',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* // Required. A list of fields to be updated in this request.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "certificateDescription": {},
* // "certificateTemplate": "my_certificateTemplate",
* // "config": {},
* // "createTime": "my_createTime",
* // "issuerCertificateAuthority": "my_issuerCertificateAuthority",
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCertificate": "my_pemCertificate",
* // "pemCertificateChain": [],
* // "pemCsr": "my_pemCsr",
* // "revocationDetails": {},
* // "subjectMode": "my_subjectMode",
* // "updateTime": "my_updateTime"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificateDescription": {},
* // "certificateTemplate": "my_certificateTemplate",
* // "config": {},
* // "createTime": "my_createTime",
* // "issuerCertificateAuthority": "my_issuerCertificateAuthority",
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCertificate": "my_pemCertificate",
* // "pemCertificateChain": [],
* // "pemCsr": "my_pemCsr",
* // "revocationDetails": {},
* // "subjectMode": "my_subjectMode",
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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.
*/
patch(
params: Params$Resource$Projects$Locations$Capools$Certificates$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Projects$Locations$Capools$Certificates$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Certificate>;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificates$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificates$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Certificate>,
callback: BodyResponseCallback<Schema$Certificate>
): void;
patch(
params: Params$Resource$Projects$Locations$Capools$Certificates$Patch,
callback: BodyResponseCallback<Schema$Certificate>
): void;
patch(callback: BodyResponseCallback<Schema$Certificate>): void;
patch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificates$Patch
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Certificate> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificates$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificates$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Certificate>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Certificate>(parameters);
}
}
/**
* Revoke a Certificate.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.caPools.certificates.revoke({
* // Required. The resource name for this Certificate in the format `projects/x/locations/x/caPools/x/certificates/x`.
* name: 'projects/my-project/locations/my-location/caPools/my-caPool/certificates/my-certificate',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "reason": "my_reason",
* // "requestId": "my_requestId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificateDescription": {},
* // "certificateTemplate": "my_certificateTemplate",
* // "config": {},
* // "createTime": "my_createTime",
* // "issuerCertificateAuthority": "my_issuerCertificateAuthority",
* // "labels": {},
* // "lifetime": "my_lifetime",
* // "name": "my_name",
* // "pemCertificate": "my_pemCertificate",
* // "pemCertificateChain": [],
* // "pemCsr": "my_pemCsr",
* // "revocationDetails": {},
* // "subjectMode": "my_subjectMode",
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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.
*/
revoke(
params: Params$Resource$Projects$Locations$Capools$Certificates$Revoke,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
revoke(
params?: Params$Resource$Projects$Locations$Capools$Certificates$Revoke,
options?: MethodOptions
): GaxiosPromise<Schema$Certificate>;
revoke(
params: Params$Resource$Projects$Locations$Capools$Certificates$Revoke,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
revoke(
params: Params$Resource$Projects$Locations$Capools$Certificates$Revoke,
options: MethodOptions | BodyResponseCallback<Schema$Certificate>,
callback: BodyResponseCallback<Schema$Certificate>
): void;
revoke(
params: Params$Resource$Projects$Locations$Capools$Certificates$Revoke,
callback: BodyResponseCallback<Schema$Certificate>
): void;
revoke(callback: BodyResponseCallback<Schema$Certificate>): void;
revoke(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Capools$Certificates$Revoke
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Certificate>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Certificate> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Capools$Certificates$Revoke;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Capools$Certificates$Revoke;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:revoke').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Certificate>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Certificate>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Capools$Certificates$Create
extends StandardParameters {
/**
* Optional. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`. This field is required when using a CertificateAuthority in the Enterprise CertificateAuthority.Tier, but is optional and its value is ignored otherwise.
*/
certificateId?: string;
/**
* Optional. The resource ID of the CertificateAuthority that should issue the certificate. This optional field will ignore the load-balancing scheme of the Pool and directly issue the certificate from the CA with the specified ID, contained in the same CaPool referenced by `parent`. Per-CA quota rules apply. If left empty, a CertificateAuthority will be chosen from the CaPool by the service. For example, to issue a Certificate from a Certificate Authority with resource name "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca", you can set the parent to "projects/my-project/locations/us-central1/caPools/my-pool" and the issuing_certificate_authority_id to "my-ca".
*/
issuingCertificateAuthorityId?: string;
/**
* Required. The resource name of the CaPool associated with the Certificate, in the format `projects/x/locations/x/caPools/x`.
*/
parent?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Optional. If this is true, no Certificate resource will be persisted regardless of the CaPool's tier, and the returned Certificate will not contain the pem_certificate field.
*/
validateOnly?: boolean;
/**
* Request body metadata
*/
requestBody?: Schema$Certificate;
}
export interface Params$Resource$Projects$Locations$Capools$Certificates$Get
extends StandardParameters {
/**
* Required. The name of the Certificate to get.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificates$List
extends StandardParameters {
/**
* Optional. Only include resources that match the filter in the response. For details on supported filters and syntax, see [Certificates Filtering documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
*/
filter?: string;
/**
* Optional. Specify how the results should be sorted. For details on supported fields and syntax, see [Certificates Sorting documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
*/
orderBy?: string;
/**
* Optional. Limit on the number of Certificates to include in the response. Further Certificates can subsequently be obtained by including the ListCertificatesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
*/
pageSize?: number;
/**
* Optional. Pagination token, returned earlier via ListCertificatesResponse.next_page_token.
*/
pageToken?: string;
/**
* Required. The resource name of the location associated with the Certificates, in the format `projects/x/locations/x/caPools/x`.
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Capools$Certificates$Patch
extends StandardParameters {
/**
* Output only. The resource name for this Certificate in the format `projects/x/locations/x/caPools/x/certificates/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Required. A list of fields to be updated in this request.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$Certificate;
}
export interface Params$Resource$Projects$Locations$Capools$Certificates$Revoke
extends StandardParameters {
/**
* Required. The resource name for this Certificate in the format `projects/x/locations/x/caPools/x/certificates/x`.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$RevokeCertificateRequest;
}
export class Resource$Projects$Locations$Certificatetemplates {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
/**
* Create a new CertificateTemplate in a given Project and Location.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.create({
* // Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`
* certificateTemplateId: 'placeholder-value',
* // Required. The resource name of the location associated with the CertificateTemplate, in the format `projects/x/locations/x`.
* parent: 'projects/my-project/locations/my-location',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "createTime": "my_createTime",
* // "description": "my_description",
* // "identityConstraints": {},
* // "labels": {},
* // "name": "my_name",
* // "passthroughExtensions": {},
* // "predefinedValues": {},
* // "updateTime": "my_updateTime"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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$Certificatetemplates$Create,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
create(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Create,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
create(
params: Params$Resource$Projects$Locations$Certificatetemplates$Create,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
create(
params: Params$Resource$Projects$Locations$Certificatetemplates$Create,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
create(
params: Params$Resource$Projects$Locations$Certificatetemplates$Create,
callback: BodyResponseCallback<Schema$Operation>
): void;
create(callback: BodyResponseCallback<Schema$Operation>): void;
create(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Create
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Create;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Create;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificateTemplates').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* DeleteCertificateTemplate deletes a CertificateTemplate.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.delete({
* // Required. The resource name for this CertificateTemplate in the format `projects/x/locations/x/certificateTemplates/x`.
* name: 'projects/my-project/locations/my-location/certificateTemplates/my-certificateTemplate',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
delete(
params: Params$Resource$Projects$Locations$Certificatetemplates$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Delete,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
delete(
params: Params$Resource$Projects$Locations$Certificatetemplates$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Projects$Locations$Certificatetemplates$Delete,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
delete(
params: Params$Resource$Projects$Locations$Certificatetemplates$Delete,
callback: BodyResponseCallback<Schema$Operation>
): void;
delete(callback: BodyResponseCallback<Schema$Operation>): void;
delete(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Delete
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Returns a CertificateTemplate.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.get({
* // Required. The name of the CertificateTemplate to get.
* name: 'projects/my-project/locations/my-location/certificateTemplates/my-certificateTemplate',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "createTime": "my_createTime",
* // "description": "my_description",
* // "identityConstraints": {},
* // "labels": {},
* // "name": "my_name",
* // "passthroughExtensions": {},
* // "predefinedValues": {},
* // "updateTime": "my_updateTime"
* // }
* }
*
* 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.
*/
get(
params: Params$Resource$Projects$Locations$Certificatetemplates$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Get,
options?: MethodOptions
): GaxiosPromise<Schema$CertificateTemplate>;
get(
params: Params$Resource$Projects$Locations$Certificatetemplates$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Certificatetemplates$Get,
options: MethodOptions | BodyResponseCallback<Schema$CertificateTemplate>,
callback: BodyResponseCallback<Schema$CertificateTemplate>
): void;
get(
params: Params$Resource$Projects$Locations$Certificatetemplates$Get,
callback: BodyResponseCallback<Schema$CertificateTemplate>
): void;
get(callback: BodyResponseCallback<Schema$CertificateTemplate>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Get
| BodyResponseCallback<Schema$CertificateTemplate>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$CertificateTemplate>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$CertificateTemplate>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$CertificateTemplate>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$CertificateTemplate>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$CertificateTemplate>(parameters);
}
}
/**
* Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.getIamPolicy({
* // Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value 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).
* 'options.requestedPolicyVersion': 'placeholder-value',
* // REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
* resource:
* 'projects/my-project/locations/my-location/certificateTemplates/my-certificateTemplate',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "auditConfigs": [],
* // "bindings": [],
* // "etag": "my_etag",
* // "version": 0
* // }
* }
*
* 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.
*/
getIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
getIamPolicy(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy,
options?: MethodOptions
): GaxiosPromise<Schema$Policy>;
getIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
getIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy,
options: MethodOptions | BodyResponseCallback<Schema$Policy>,
callback: BodyResponseCallback<Schema$Policy>
): void;
getIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy,
callback: BodyResponseCallback<Schema$Policy>
): void;
getIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
getIamPolicy(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Policy>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Policy>(parameters);
}
}
/**
* Lists CertificateTemplates.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.list({
* // Optional. Only include resources that match the filter in the response.
* filter: 'placeholder-value',
* // Optional. Specify how the results should be sorted.
* orderBy: 'placeholder-value',
* // Optional. Limit on the number of CertificateTemplates to include in the response. Further CertificateTemplates can subsequently be obtained by including the ListCertificateTemplatesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
* pageSize: 'placeholder-value',
* // Optional. Pagination token, returned earlier via ListCertificateTemplatesResponse.next_page_token.
* pageToken: 'placeholder-value',
* // Required. The resource name of the location associated with the CertificateTemplates, in the format `projects/x/locations/x`.
* parent: 'projects/my-project/locations/my-location',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "certificateTemplates": [],
* // "nextPageToken": "my_nextPageToken",
* // "unreachable": []
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$Certificatetemplates$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$Certificatetemplates$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListCertificateTemplatesResponse>;
list(
params: Params$Resource$Projects$Locations$Certificatetemplates$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$Certificatetemplates$List,
options:
| MethodOptions
| BodyResponseCallback<Schema$ListCertificateTemplatesResponse>,
callback: BodyResponseCallback<Schema$ListCertificateTemplatesResponse>
): void;
list(
params: Params$Resource$Projects$Locations$Certificatetemplates$List,
callback: BodyResponseCallback<Schema$ListCertificateTemplatesResponse>
): void;
list(
callback: BodyResponseCallback<Schema$ListCertificateTemplatesResponse>
): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$List
| BodyResponseCallback<Schema$ListCertificateTemplatesResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListCertificateTemplatesResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListCertificateTemplatesResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListCertificateTemplatesResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+parent}/certificateTemplates').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['parent'],
pathParams: ['parent'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListCertificateTemplatesResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListCertificateTemplatesResponse>(
parameters
);
}
}
/**
* Update a CertificateTemplate.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.patch({
* // Output only. The resource name for this CertificateTemplate in the format `projects/x/locations/x/certificateTemplates/x`.
* name: 'projects/my-project/locations/my-location/certificateTemplates/my-certificateTemplate',
* // Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
* requestId: 'placeholder-value',
* // Required. A list of fields to be updated in this request.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "createTime": "my_createTime",
* // "description": "my_description",
* // "identityConstraints": {},
* // "labels": {},
* // "name": "my_name",
* // "passthroughExtensions": {},
* // "predefinedValues": {},
* // "updateTime": "my_updateTime"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
patch(
params: Params$Resource$Projects$Locations$Certificatetemplates$Patch,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
patch(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
patch(
params: Params$Resource$Projects$Locations$Certificatetemplates$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Projects$Locations$Certificatetemplates$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(
params: Params$Resource$Projects$Locations$Certificatetemplates$Patch,
callback: BodyResponseCallback<Schema$Operation>
): void;
patch(callback: BodyResponseCallback<Schema$Operation>): void;
patch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Patch
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Patch;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Patch;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.setIamPolicy({
* // REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
* resource:
* 'projects/my-project/locations/my-location/certificateTemplates/my-certificateTemplate',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "policy": {},
* // "updateMask": "my_updateMask"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "auditConfigs": [],
* // "bindings": [],
* // "etag": "my_etag",
* // "version": 0
* // }
* }
*
* 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.
*/
setIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
setIamPolicy(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy,
options?: MethodOptions
): GaxiosPromise<Schema$Policy>;
setIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
setIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy,
options: MethodOptions | BodyResponseCallback<Schema$Policy>,
callback: BodyResponseCallback<Schema$Policy>
): void;
setIamPolicy(
params: Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy,
callback: BodyResponseCallback<Schema$Policy>
): void;
setIamPolicy(callback: BodyResponseCallback<Schema$Policy>): void;
setIamPolicy(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Policy>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Policy> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Policy>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Policy>(parameters);
}
}
/**
* 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. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.certificateTemplates.testIamPermissions({
* // REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
* resource:
* 'projects/my-project/locations/my-location/certificateTemplates/my-certificateTemplate',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "permissions": []
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "permissions": []
* // }
* }
*
* 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.
*/
testIamPermissions(
params: Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
testIamPermissions(
params?: Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions,
options?: MethodOptions
): GaxiosPromise<Schema$TestIamPermissionsResponse>;
testIamPermissions(
params: Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
testIamPermissions(
params: Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions,
options:
| MethodOptions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>,
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
params: Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions,
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
callback: BodyResponseCallback<Schema$TestIamPermissionsResponse>
): void;
testIamPermissions(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$TestIamPermissionsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$TestIamPermissionsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['resource'],
pathParams: ['resource'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$TestIamPermissionsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$TestIamPermissionsResponse>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Create
extends StandardParameters {
/**
* Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`
*/
certificateTemplateId?: string;
/**
* Required. The resource name of the location associated with the CertificateTemplate, in the format `projects/x/locations/x`.
*/
parent?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CertificateTemplate;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Delete
extends StandardParameters {
/**
* Required. The resource name for this CertificateTemplate in the format `projects/x/locations/x/certificateTemplates/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Get
extends StandardParameters {
/**
* Required. The name of the CertificateTemplate to get.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Getiampolicy
extends StandardParameters {
/**
* Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value 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).
*/
'options.requestedPolicyVersion'?: number;
/**
* REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$List
extends StandardParameters {
/**
* Optional. Only include resources that match the filter in the response.
*/
filter?: string;
/**
* Optional. Specify how the results should be sorted.
*/
orderBy?: string;
/**
* Optional. Limit on the number of CertificateTemplates to include in the response. Further CertificateTemplates can subsequently be obtained by including the ListCertificateTemplatesResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
*/
pageSize?: number;
/**
* Optional. Pagination token, returned earlier via ListCertificateTemplatesResponse.next_page_token.
*/
pageToken?: string;
/**
* Required. The resource name of the location associated with the CertificateTemplates, in the format `projects/x/locations/x`.
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Patch
extends StandardParameters {
/**
* Output only. The resource name for this CertificateTemplate in the format `projects/x/locations/x/certificateTemplates/x`.
*/
name?: string;
/**
* Optional. An ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
*/
requestId?: string;
/**
* Required. A list of fields to be updated in this request.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CertificateTemplate;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Setiampolicy
extends StandardParameters {
/**
* REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
/**
* Request body metadata
*/
requestBody?: Schema$SetIamPolicyRequest;
}
export interface Params$Resource$Projects$Locations$Certificatetemplates$Testiampermissions
extends StandardParameters {
/**
* REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
*/
resource?: string;
/**
* Request body metadata
*/
requestBody?: Schema$TestIamPermissionsRequest;
}
export class Resource$Projects$Locations$Operations {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
/**
* 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`.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.operations.cancel({
* // The name of the operation resource to be cancelled.
* name: 'projects/my-project/locations/my-location/operations/my-operation',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {}
* },
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* 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.
*/
cancel(
params: Params$Resource$Projects$Locations$Operations$Cancel,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
cancel(
params?: Params$Resource$Projects$Locations$Operations$Cancel,
options?: MethodOptions
): GaxiosPromise<Schema$Empty>;
cancel(
params: Params$Resource$Projects$Locations$Operations$Cancel,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
cancel(
params: Params$Resource$Projects$Locations$Operations$Cancel,
options: MethodOptions | BodyResponseCallback<Schema$Empty>,
callback: BodyResponseCallback<Schema$Empty>
): void;
cancel(
params: Params$Resource$Projects$Locations$Operations$Cancel,
callback: BodyResponseCallback<Schema$Empty>
): void;
cancel(callback: BodyResponseCallback<Schema$Empty>): void;
cancel(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Operations$Cancel
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Operations$Cancel;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Operations$Cancel;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Empty>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Empty>(parameters);
}
}
/**
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.operations.delete({
* // The name of the operation resource to be deleted.
* name: 'projects/my-project/locations/my-location/operations/my-operation',
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* 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.
*/
delete(
params: Params$Resource$Projects$Locations$Operations$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Projects$Locations$Operations$Delete,
options?: MethodOptions
): GaxiosPromise<Schema$Empty>;
delete(
params: Params$Resource$Projects$Locations$Operations$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Projects$Locations$Operations$Delete,
options: MethodOptions | BodyResponseCallback<Schema$Empty>,
callback: BodyResponseCallback<Schema$Empty>
): void;
delete(
params: Params$Resource$Projects$Locations$Operations$Delete,
callback: BodyResponseCallback<Schema$Empty>
): void;
delete(callback: BodyResponseCallback<Schema$Empty>): void;
delete(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Operations$Delete
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Operations$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Operations$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Empty>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Empty>(parameters);
}
}
/**
* 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.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.operations.get({
* // The name of the operation resource.
* name: 'projects/my-project/locations/my-location/operations/my-operation',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "done": false,
* // "error": {},
* // "metadata": {},
* // "name": "my_name",
* // "response": {}
* // }
* }
*
* 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.
*/
get(
params: Params$Resource$Projects$Locations$Operations$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Projects$Locations$Operations$Get,
options?: MethodOptions
): GaxiosPromise<Schema$Operation>;
get(
params: Params$Resource$Projects$Locations$Operations$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Projects$Locations$Operations$Get,
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
callback: BodyResponseCallback<Schema$Operation>
): void;
get(
params: Params$Resource$Projects$Locations$Operations$Get,
callback: BodyResponseCallback<Schema$Operation>
): void;
get(callback: BodyResponseCallback<Schema$Operation>): void;
get(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Operations$Get
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Operation>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Operations$Get;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Operations$Get;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Operation>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Operation>(parameters);
}
}
/**
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x\}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/privateca.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const privateca = google.privateca('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 privateca.projects.locations.operations.list({
* // The standard list filter.
* filter: 'placeholder-value',
* // The name of the operation's parent resource.
* name: 'projects/my-project/locations/my-location',
* // The standard list page size.
* pageSize: 'placeholder-value',
* // The standard list page token.
* pageToken: 'placeholder-value',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "nextPageToken": "my_nextPageToken",
* // "operations": []
* // }
* }
*
* 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.
*/
list(
params: Params$Resource$Projects$Locations$Operations$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Projects$Locations$Operations$List,
options?: MethodOptions
): GaxiosPromise<Schema$ListOperationsResponse>;
list(
params: Params$Resource$Projects$Locations$Operations$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Projects$Locations$Operations$List,
options:
| MethodOptions
| BodyResponseCallback<Schema$ListOperationsResponse>,
callback: BodyResponseCallback<Schema$ListOperationsResponse>
): void;
list(
params: Params$Resource$Projects$Locations$Operations$List,
callback: BodyResponseCallback<Schema$ListOperationsResponse>
): void;
list(callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
list(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Operations$List
| BodyResponseCallback<Schema$ListOperationsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ListOperationsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ListOperationsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ListOperationsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Operations$List;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Locations$Operations$List;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://privateca.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}/operations').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'GET',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ListOperationsResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ListOperationsResponse>(parameters);
}
}
}
export interface Params$Resource$Projects$Locations$Operations$Cancel
extends StandardParameters {
/**
* The name of the operation resource to be cancelled.
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$CancelOperationRequest;
}
export interface Params$Resource$Projects$Locations$Operations$Delete
extends StandardParameters {
/**
* The name of the operation resource to be deleted.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Operations$Get
extends StandardParameters {
/**
* The name of the operation resource.
*/
name?: string;
}
export interface Params$Resource$Projects$Locations$Operations$List
extends StandardParameters {
/**
* The standard list filter.
*/
filter?: string;
/**
* The name of the operation's parent resource.
*/
name?: string;
/**
* The standard list page size.
*/
pageSize?: number;
/**
* The standard list page token.
*/
pageToken?: string;
}
}