From b6b24c645a6c0b1001d20298a72acfe0da38a754 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Tue, 7 May 2024 01:33:39 +0000 Subject: [PATCH] feat(cloudkms): update the API #### cloudkms:v1 The following keys were added: - resources.folders.methods.getAutokeyConfig.description - resources.folders.methods.getAutokeyConfig.flatPath - resources.folders.methods.getAutokeyConfig.httpMethod - resources.folders.methods.getAutokeyConfig.id - resources.folders.methods.getAutokeyConfig.parameterOrder - resources.folders.methods.getAutokeyConfig.parameters.name.description - resources.folders.methods.getAutokeyConfig.parameters.name.location - resources.folders.methods.getAutokeyConfig.parameters.name.pattern - resources.folders.methods.getAutokeyConfig.parameters.name.required - resources.folders.methods.getAutokeyConfig.parameters.name.type - resources.folders.methods.getAutokeyConfig.path - resources.folders.methods.getAutokeyConfig.response.$ref - resources.folders.methods.getAutokeyConfig.scopes - resources.folders.methods.updateAutokeyConfig.description - resources.folders.methods.updateAutokeyConfig.flatPath - resources.folders.methods.updateAutokeyConfig.httpMethod - resources.folders.methods.updateAutokeyConfig.id - resources.folders.methods.updateAutokeyConfig.parameterOrder - resources.folders.methods.updateAutokeyConfig.parameters.name.description - resources.folders.methods.updateAutokeyConfig.parameters.name.location - resources.folders.methods.updateAutokeyConfig.parameters.name.pattern - resources.folders.methods.updateAutokeyConfig.parameters.name.required - resources.folders.methods.updateAutokeyConfig.parameters.name.type - resources.folders.methods.updateAutokeyConfig.parameters.updateMask.description - resources.folders.methods.updateAutokeyConfig.parameters.updateMask.format - resources.folders.methods.updateAutokeyConfig.parameters.updateMask.location - resources.folders.methods.updateAutokeyConfig.parameters.updateMask.type - resources.folders.methods.updateAutokeyConfig.path - resources.folders.methods.updateAutokeyConfig.request.$ref - resources.folders.methods.updateAutokeyConfig.response.$ref - resources.folders.methods.updateAutokeyConfig.scopes - resources.projects.methods.showEffectiveAutokeyConfig.description - resources.projects.methods.showEffectiveAutokeyConfig.flatPath - resources.projects.methods.showEffectiveAutokeyConfig.httpMethod - resources.projects.methods.showEffectiveAutokeyConfig.id - resources.projects.methods.showEffectiveAutokeyConfig.parameterOrder - resources.projects.methods.showEffectiveAutokeyConfig.parameters.parent.description - resources.projects.methods.showEffectiveAutokeyConfig.parameters.parent.location - resources.projects.methods.showEffectiveAutokeyConfig.parameters.parent.pattern - resources.projects.methods.showEffectiveAutokeyConfig.parameters.parent.required - resources.projects.methods.showEffectiveAutokeyConfig.parameters.parent.type - resources.projects.methods.showEffectiveAutokeyConfig.path - resources.projects.methods.showEffectiveAutokeyConfig.response.$ref - resources.projects.methods.showEffectiveAutokeyConfig.scopes - resources.projects.resources.locations.resources.keyHandles.methods.create.description - resources.projects.resources.locations.resources.keyHandles.methods.create.flatPath - resources.projects.resources.locations.resources.keyHandles.methods.create.httpMethod - resources.projects.resources.locations.resources.keyHandles.methods.create.id - resources.projects.resources.locations.resources.keyHandles.methods.create.parameterOrder - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.keyHandleId.description - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.keyHandleId.location - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.keyHandleId.type - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.parent.description - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.parent.location - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.parent.pattern - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.parent.required - resources.projects.resources.locations.resources.keyHandles.methods.create.parameters.parent.type - resources.projects.resources.locations.resources.keyHandles.methods.create.path - resources.projects.resources.locations.resources.keyHandles.methods.create.request.$ref - resources.projects.resources.locations.resources.keyHandles.methods.create.response.$ref - resources.projects.resources.locations.resources.keyHandles.methods.create.scopes - resources.projects.resources.locations.resources.keyHandles.methods.get.description - resources.projects.resources.locations.resources.keyHandles.methods.get.flatPath - resources.projects.resources.locations.resources.keyHandles.methods.get.httpMethod - resources.projects.resources.locations.resources.keyHandles.methods.get.id - resources.projects.resources.locations.resources.keyHandles.methods.get.parameterOrder - resources.projects.resources.locations.resources.keyHandles.methods.get.parameters.name.description - resources.projects.resources.locations.resources.keyHandles.methods.get.parameters.name.location - resources.projects.resources.locations.resources.keyHandles.methods.get.parameters.name.pattern - resources.projects.resources.locations.resources.keyHandles.methods.get.parameters.name.required - resources.projects.resources.locations.resources.keyHandles.methods.get.parameters.name.type - resources.projects.resources.locations.resources.keyHandles.methods.get.path - resources.projects.resources.locations.resources.keyHandles.methods.get.response.$ref - resources.projects.resources.locations.resources.keyHandles.methods.get.scopes - resources.projects.resources.locations.resources.keyHandles.methods.list.description - resources.projects.resources.locations.resources.keyHandles.methods.list.flatPath - resources.projects.resources.locations.resources.keyHandles.methods.list.httpMethod - resources.projects.resources.locations.resources.keyHandles.methods.list.id - resources.projects.resources.locations.resources.keyHandles.methods.list.parameterOrder - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.filter.description - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.filter.location - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.filter.type - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.parent.description - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.parent.location - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.parent.pattern - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.parent.required - resources.projects.resources.locations.resources.keyHandles.methods.list.parameters.parent.type - resources.projects.resources.locations.resources.keyHandles.methods.list.path - resources.projects.resources.locations.resources.keyHandles.methods.list.response.$ref - resources.projects.resources.locations.resources.keyHandles.methods.list.scopes - resources.projects.resources.locations.resources.operations.methods.get.description - resources.projects.resources.locations.resources.operations.methods.get.flatPath - resources.projects.resources.locations.resources.operations.methods.get.httpMethod - resources.projects.resources.locations.resources.operations.methods.get.id - resources.projects.resources.locations.resources.operations.methods.get.parameterOrder - resources.projects.resources.locations.resources.operations.methods.get.parameters.name.description - resources.projects.resources.locations.resources.operations.methods.get.parameters.name.location - resources.projects.resources.locations.resources.operations.methods.get.parameters.name.pattern - resources.projects.resources.locations.resources.operations.methods.get.parameters.name.required - resources.projects.resources.locations.resources.operations.methods.get.parameters.name.type - resources.projects.resources.locations.resources.operations.methods.get.path - resources.projects.resources.locations.resources.operations.methods.get.response.$ref - resources.projects.resources.locations.resources.operations.methods.get.scopes - schemas.AutokeyConfig.description - schemas.AutokeyConfig.id - schemas.AutokeyConfig.properties.keyProject.description - schemas.AutokeyConfig.properties.keyProject.type - schemas.AutokeyConfig.properties.name.description - schemas.AutokeyConfig.properties.name.type - schemas.AutokeyConfig.type - schemas.KeyHandle.description - schemas.KeyHandle.id - schemas.KeyHandle.properties.kmsKey.description - schemas.KeyHandle.properties.kmsKey.readOnly - schemas.KeyHandle.properties.kmsKey.type - schemas.KeyHandle.properties.name.description - schemas.KeyHandle.properties.name.readOnly - schemas.KeyHandle.properties.name.type - schemas.KeyHandle.properties.resourceTypeSelector.description - schemas.KeyHandle.properties.resourceTypeSelector.type - schemas.KeyHandle.type - schemas.ListKeyHandlesResponse.description - schemas.ListKeyHandlesResponse.id - schemas.ListKeyHandlesResponse.properties.keyHandles.description - schemas.ListKeyHandlesResponse.properties.keyHandles.items.$ref - schemas.ListKeyHandlesResponse.properties.keyHandles.type - schemas.ListKeyHandlesResponse.type - schemas.Operation.description - schemas.Operation.id - schemas.Operation.properties.done.description - schemas.Operation.properties.done.type - schemas.Operation.properties.error.$ref - schemas.Operation.properties.error.description - schemas.Operation.properties.metadata.additionalProperties.description - schemas.Operation.properties.metadata.additionalProperties.type - schemas.Operation.properties.metadata.description - schemas.Operation.properties.metadata.type - schemas.Operation.properties.name.description - schemas.Operation.properties.name.type - schemas.Operation.properties.response.additionalProperties.description - schemas.Operation.properties.response.additionalProperties.type - schemas.Operation.properties.response.description - schemas.Operation.properties.response.type - schemas.Operation.type - schemas.ShowEffectiveAutokeyConfigResponse.description - schemas.ShowEffectiveAutokeyConfigResponse.id - schemas.ShowEffectiveAutokeyConfigResponse.properties.keyProject.description - schemas.ShowEffectiveAutokeyConfigResponse.properties.keyProject.type - schemas.ShowEffectiveAutokeyConfigResponse.type - schemas.Status.description - schemas.Status.id - schemas.Status.properties.code.description - schemas.Status.properties.code.format - schemas.Status.properties.code.type - schemas.Status.properties.details.description - schemas.Status.properties.details.items.additionalProperties.description - schemas.Status.properties.details.items.additionalProperties.type - schemas.Status.properties.details.items.type - schemas.Status.properties.details.type - schemas.Status.properties.message.description - schemas.Status.properties.message.type - schemas.Status.type The following keys were changed: - schemas.CryptoKeyVersion.properties.algorithm.enum - schemas.CryptoKeyVersion.properties.algorithm.enumDescriptions - schemas.CryptoKeyVersionTemplate.properties.algorithm.enum - schemas.CryptoKeyVersionTemplate.properties.algorithm.enumDescriptions - schemas.ImportCryptoKeyVersionRequest.properties.algorithm.enum - schemas.ImportCryptoKeyVersionRequest.properties.algorithm.enumDescriptions - schemas.PublicKey.properties.algorithm.enum - schemas.PublicKey.properties.algorithm.enumDescriptions --- discovery/cloudkms-v1.json | 351 +++++- src/apis/cloudkms/v1.ts | 2166 +++++++++++++++++++++++++----------- 2 files changed, 1842 insertions(+), 675 deletions(-) diff --git a/discovery/cloudkms-v1.json b/discovery/cloudkms-v1.json index a5726689d3..591f4de311 100644 --- a/discovery/cloudkms-v1.json +++ b/discovery/cloudkms-v1.json @@ -125,7 +125,100 @@ }, "protocol": "rest", "resources": { + "folders": { + "methods": { + "getAutokeyConfig": { + "description": "Returns the AutokeyConfig for a folder.", + "flatPath": "v1/folders/{foldersId}/autokeyConfig", + "httpMethod": "GET", + "id": "cloudkms.folders.getAutokeyConfig", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.", + "location": "path", + "pattern": "^folders/[^/]+/autokeyConfig$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "AutokeyConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + }, + "updateAutokeyConfig": { + "description": "Updates the AutokeyConfig for a folder. The caller must have both `cloudkms.autokeyConfigs.update` permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` permission on the provided key project. An empty key project may be provided to clear the configuration.", + "flatPath": "v1/folders/{foldersId}/autokeyConfig", + "httpMethod": "PATCH", + "id": "cloudkms.folders.updateAutokeyConfig", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.", + "location": "path", + "pattern": "^folders/[^/]+/autokeyConfig$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. Masks which fields of the AutokeyConfig to update, e.g. `keyProject`.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "AutokeyConfig" + }, + "response": { + "$ref": "AutokeyConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + } + } + }, "projects": { + "methods": { + "showEffectiveAutokeyConfig": { + "description": "Returns the effective Cloud KMS Autokey configuration for a given project.", + "flatPath": "v1/projects/{projectsId}:showEffectiveAutokeyConfig", + "httpMethod": "GET", + "id": "cloudkms.projects.showEffectiveAutokeyConfig", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Name of the resource project to the show effective Cloud KMS Autokey configuration for. This may be helpful for interrogating the effect of nested folder configurations on a given resource project.", + "location": "path", + "pattern": "^projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}:showEffectiveAutokeyConfig", + "response": { + "$ref": "ShowEffectiveAutokeyConfigResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + } + }, "resources": { "locations": { "methods": { @@ -645,6 +738,101 @@ } } }, + "keyHandles": { + "methods": { + "create": { + "description": "Creates a new KeyHandle, triggering the provisioning of a new CryptoKey for CMEK use with the given resource type in the configured key project and the same location. GetOperation should be used to resolve the resulting long-running operation and get the resulting KeyHandle and CryptoKey.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyHandles", + "httpMethod": "POST", + "id": "cloudkms.projects.locations.keyHandles.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "keyHandleId": { + "description": "Optional. Id of the KeyHandle. Must be unique to the resource project and location. If not provided by the caller, a new UUID is used.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the resource project and location to create the KeyHandle in, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/keyHandles", + "request": { + "$ref": "KeyHandle" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + }, + "get": { + "description": "Returns the KeyHandle.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyHandles/{keyHandlesId}", + "httpMethod": "GET", + "id": "cloudkms.projects.locations.keyHandles.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Name of the KeyHandle resource, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/keyHandles/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "KeyHandle" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + }, + "list": { + "description": "Lists KeyHandles.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/keyHandles", + "httpMethod": "GET", + "id": "cloudkms.projects.locations.keyHandles.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. Filter to apply when listing KeyHandles, e.g. `resource_type_selector=\"{SERVICE}.googleapis.com/{TYPE}\"`.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. Name of the resource project and location from which to list KeyHandles, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/keyHandles", + "response": { + "$ref": "ListKeyHandlesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + } + } + }, "keyRings": { "methods": { "create": { @@ -1832,13 +2020,43 @@ } } } + }, + "operations": { + "methods": { + "get": { + "description": "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.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "cloudkms.projects.locations.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloudkms" + ] + } + } } } } } } }, - "revision": "20240418", + "revision": "20240425", "rootUrl": "https://cloudkms.googleapis.com/", "schemas": { "AsymmetricDecryptRequest": { @@ -2018,6 +2236,21 @@ }, "type": "object" }, + "AutokeyConfig": { + "description": "Cloud KMS Autokey configuration for a folder.", + "id": "AutokeyConfig", + "properties": { + "keyProject": { + "description": "Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision new CryptoKeys. On UpdateAutokeyConfig, the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on this key project. Once configured, for Cloud KMS Autokey to function properly, this key project must have the Cloud KMS API activated and the Cloud KMS Service Agent for this key project must be granted the `cloudkms.admin` role (or pertinent permissions).", + "type": "string" + }, + "name": { + "description": "Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig`.", + "type": "string" + } + }, + "type": "object" + }, "Binding": { "description": "Associates `members`, or principals, with a `role`.", "id": "Binding", @@ -2238,6 +2471,7 @@ "EC_SIGN_P256_SHA256", "EC_SIGN_P384_SHA384", "EC_SIGN_SECP256K1_SHA256", + "EC_SIGN_ED25519", "HMAC_SHA256", "HMAC_SHA1", "HMAC_SHA384", @@ -2275,6 +2509,7 @@ "ECDSA on the NIST P-256 curve with a SHA256 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the NIST P-384 curve with a SHA384 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the non-NIST secp256k1 curve. This curve is only supported for HSM protection level. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", + "EdDSA on the Curve25519 in pure mode (taking data as input).", "HMAC-SHA256 signing with a 256 bit key.", "HMAC-SHA1 signing with a 160 bit key.", "HMAC-SHA384 signing with a 384 bit key.", @@ -2442,6 +2677,7 @@ "EC_SIGN_P256_SHA256", "EC_SIGN_P384_SHA384", "EC_SIGN_SECP256K1_SHA256", + "EC_SIGN_ED25519", "HMAC_SHA256", "HMAC_SHA1", "HMAC_SHA384", @@ -2479,6 +2715,7 @@ "ECDSA on the NIST P-256 curve with a SHA256 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the NIST P-384 curve with a SHA384 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the non-NIST secp256k1 curve. This curve is only supported for HSM protection level. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", + "EdDSA on the Curve25519 in pure mode (taking data as input).", "HMAC-SHA256 signing with a 256 bit key.", "HMAC-SHA1 signing with a 160 bit key.", "HMAC-SHA384 signing with a 384 bit key.", @@ -2861,6 +3098,7 @@ "EC_SIGN_P256_SHA256", "EC_SIGN_P384_SHA384", "EC_SIGN_SECP256K1_SHA256", + "EC_SIGN_ED25519", "HMAC_SHA256", "HMAC_SHA1", "HMAC_SHA384", @@ -2898,6 +3136,7 @@ "ECDSA on the NIST P-256 curve with a SHA256 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the NIST P-384 curve with a SHA384 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the non-NIST secp256k1 curve. This curve is only supported for HSM protection level. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", + "EdDSA on the Curve25519 in pure mode (taking data as input).", "HMAC-SHA256 signing with a 256 bit key.", "HMAC-SHA1 signing with a 160 bit key.", "HMAC-SHA384 signing with a 384 bit key.", @@ -3031,6 +3270,27 @@ }, "type": "object" }, + "KeyHandle": { + "description": "Resource-oriented representation of a request to Cloud KMS Autokey and the resulting provisioning of a CryptoKey.", + "id": "KeyHandle", + "properties": { + "kmsKey": { + "description": "Output only. Name of a CryptoKey that has been provisioned for Customer Managed Encryption Key (CMEK) use in the KeyHandle's project and location for the requested resource type.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Identifier. Name of the [KeyHandle] resource, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`.", + "readOnly": true, + "type": "string" + }, + "resourceTypeSelector": { + "description": "Required. Indicates the resource type that the resulting CryptoKey is meant to protect, e.g. `{SERVICE}.googleapis.com/{TYPE}`. See documentation for supported resource types.", + "type": "string" + } + }, + "type": "object" + }, "KeyOperationAttestation": { "description": "Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key).", "id": "KeyOperationAttestation", @@ -3174,6 +3434,20 @@ }, "type": "object" }, + "ListKeyHandlesResponse": { + "description": "Response message for Autokey.ListKeyHandles.", + "id": "ListKeyHandlesResponse", + "properties": { + "keyHandles": { + "description": "Resulting KeyHandles.", + "items": { + "$ref": "KeyHandle" + }, + "type": "array" + } + }, + "type": "object" + }, "ListKeyRingsResponse": { "description": "Response message for KeyManagementService.ListKeyRings.", "id": "ListKeyRingsResponse", @@ -3396,6 +3670,41 @@ }, "type": "object" }, + "Operation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "id": "Operation", + "properties": { + "done": { + "description": "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.", + "type": "boolean" + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "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.", + "type": "object" + }, + "name": { + "description": "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}`.", + "type": "string" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "type": "object" + } + }, + "type": "object" + }, "Policy": { "description": "An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { \"bindings\": [ { \"role\": \"roles/resourcemanager.organizationAdmin\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-project-id@appspot.gserviceaccount.com\" ] }, { \"role\": \"roles/resourcemanager.organizationViewer\", \"members\": [ \"user:eve@example.com\" ], \"condition\": { \"title\": \"expirable access\", \"description\": \"Does not grant access after Sep 2020\", \"expression\": \"request.time < timestamp('2020-10-01T00:00:00.000Z')\", } } ], \"etag\": \"BwWWja0YfJA=\", \"version\": 3 } ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).", "id": "Policy", @@ -3463,6 +3772,7 @@ "EC_SIGN_P256_SHA256", "EC_SIGN_P384_SHA384", "EC_SIGN_SECP256K1_SHA256", + "EC_SIGN_ED25519", "HMAC_SHA256", "HMAC_SHA1", "HMAC_SHA384", @@ -3500,6 +3810,7 @@ "ECDSA on the NIST P-256 curve with a SHA256 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the NIST P-384 curve with a SHA384 digest. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", "ECDSA on the non-NIST secp256k1 curve. This curve is only supported for HSM protection level. Other hash functions can also be used: https://cloud.google.com/kms/docs/create-validate-signatures#ecdsa_support_for_other_hash_algorithms", + "EdDSA on the Curve25519 in pure mode (taking data as input).", "HMAC-SHA256 signing with a 256 bit key.", "HMAC-SHA1 signing with a 160 bit key.", "HMAC-SHA384 signing with a 384 bit key.", @@ -3783,6 +4094,44 @@ }, "type": "object" }, + "ShowEffectiveAutokeyConfigResponse": { + "description": "Response message for ShowEffectiveAutokeyConfig.", + "id": "ShowEffectiveAutokeyConfigResponse", + "properties": { + "keyProject": { + "description": "Name of the key project configured in the resource project's folder ancestry.", + "type": "string" + } + }, + "type": "object" + }, + "Status": { + "description": "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).", + "id": "Status", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "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.", + "type": "string" + } + }, + "type": "object" + }, "TestIamPermissionsRequest": { "description": "Request message for `TestIamPermissions` method.", "id": "TestIamPermissionsRequest", diff --git a/src/apis/cloudkms/v1.ts b/src/apis/cloudkms/v1.ts index 33adc4fea7..e7c7ac3ba8 100644 --- a/src/apis/cloudkms/v1.ts +++ b/src/apis/cloudkms/v1.ts @@ -112,6 +112,7 @@ export namespace cloudkms_v1 { */ export class Cloudkms { context: APIRequestContext; + folders: Resource$Folders; projects: Resource$Projects; constructor(options: GlobalOptions, google?: GoogleConfigurable) { @@ -120,6 +121,7 @@ export namespace cloudkms_v1 { google, }; + this.folders = new Resource$Folders(this.context); this.projects = new Resource$Projects(this.context); } } @@ -234,6 +236,19 @@ export namespace cloudkms_v1 { */ logType?: string | null; } + /** + * Cloud KMS Autokey configuration for a folder. + */ + export interface Schema$AutokeyConfig { + /** + * Optional. Name of the key project, e.g. `projects/{PROJECT_ID\}` or `projects/{PROJECT_NUMBER\}`, where Cloud KMS Autokey will provision new CryptoKeys. On UpdateAutokeyConfig, the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on this key project. Once configured, for Cloud KMS Autokey to function properly, this key project must have the Cloud KMS API activated and the Cloud KMS Service Agent for this key project must be granted the `cloudkms.admin` role (or pertinent permissions). + */ + keyProject?: string | null; + /** + * Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER\}/autokeyConfig`. + */ + name?: string | null; + } /** * Associates `members`, or principals, with a `role`. */ @@ -725,6 +740,23 @@ export namespace cloudkms_v1 { */ state?: string | null; } + /** + * Resource-oriented representation of a request to Cloud KMS Autokey and the resulting provisioning of a CryptoKey. + */ + export interface Schema$KeyHandle { + /** + * Output only. Name of a CryptoKey that has been provisioned for Customer Managed Encryption Key (CMEK) use in the KeyHandle's project and location for the requested resource type. + */ + kmsKey?: string | null; + /** + * Output only. Identifier. Name of the [KeyHandle] resource, e.g. `projects/{PROJECT_ID\}/locations/{LOCATION\}/keyHandles/{KEY_HANDLE_ID\}`. + */ + name?: string | null; + /** + * Required. Indicates the resource type that the resulting CryptoKey is meant to protect, e.g. `{SERVICE\}.googleapis.com/{TYPE\}`. See documentation for supported resource types. + */ + resourceTypeSelector?: string | null; + } /** * Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). */ @@ -823,6 +855,15 @@ export namespace cloudkms_v1 { */ totalSize?: number | null; } + /** + * Response message for Autokey.ListKeyHandles. + */ + export interface Schema$ListKeyHandlesResponse { + /** + * Resulting KeyHandles. + */ + keyHandles?: Schema$KeyHandle[]; + } /** * Response message for KeyManagementService.ListKeyRings. */ @@ -979,6 +1020,31 @@ export namespace cloudkms_v1 { */ verifiedSuccessIntegrity?: boolean | 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, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response?: {[key: string]: any} | 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`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] \}, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", \} \} ], "etag": "BwWWja0YfJA=", "version": 3 \} ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). */ @@ -1199,6 +1265,32 @@ export namespace cloudkms_v1 { */ updateMask?: string | null; } + /** + * Response message for ShowEffectiveAutokeyConfig. + */ + export interface Schema$ShowEffectiveAutokeyConfigResponse { + /** + * Name of the key project configured in the resource project's folder ancestry. + */ + keyProject?: 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; + } /** * Request message for `TestIamPermissions` method. */ @@ -1240,88 +1332,66 @@ export namespace cloudkms_v1 { pem?: string | null; } - 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 { + export class Resource$Folders { context: APIRequestContext; - ekmConfig: Resource$Projects$Locations$Ekmconfig; - ekmConnections: Resource$Projects$Locations$Ekmconnections; - keyRings: Resource$Projects$Locations$Keyrings; constructor(context: APIRequestContext) { this.context = context; - this.ekmConfig = new Resource$Projects$Locations$Ekmconfig(this.context); - this.ekmConnections = new Resource$Projects$Locations$Ekmconnections( - this.context - ); - this.keyRings = new Resource$Projects$Locations$Keyrings(this.context); } /** - * Generate random bytes using the Cloud KMS randomness source in the provided location. + * Returns the AutokeyConfig for a folder. * * @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. */ - generateRandomBytes( - params: Params$Resource$Projects$Locations$Generaterandombytes, + getAutokeyConfig( + params: Params$Resource$Folders$Getautokeyconfig, options: StreamMethodOptions ): GaxiosPromise; - generateRandomBytes( - params?: Params$Resource$Projects$Locations$Generaterandombytes, + getAutokeyConfig( + params?: Params$Resource$Folders$Getautokeyconfig, options?: MethodOptions - ): GaxiosPromise; - generateRandomBytes( - params: Params$Resource$Projects$Locations$Generaterandombytes, + ): GaxiosPromise; + getAutokeyConfig( + params: Params$Resource$Folders$Getautokeyconfig, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - generateRandomBytes( - params: Params$Resource$Projects$Locations$Generaterandombytes, - options: - | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback + getAutokeyConfig( + params: Params$Resource$Folders$Getautokeyconfig, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - generateRandomBytes( - params: Params$Resource$Projects$Locations$Generaterandombytes, - callback: BodyResponseCallback + getAutokeyConfig( + params: Params$Resource$Folders$Getautokeyconfig, + callback: BodyResponseCallback ): void; - generateRandomBytes( - callback: BodyResponseCallback + getAutokeyConfig( + callback: BodyResponseCallback ): void; - generateRandomBytes( + getAutokeyConfig( paramsOrCallback?: - | Params$Resource$Projects$Locations$Generaterandombytes - | BodyResponseCallback + | Params$Resource$Folders$Getautokeyconfig + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): - | void - | GaxiosPromise - | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Generaterandombytes; + {}) as Params$Resource$Folders$Getautokeyconfig; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Generaterandombytes; + params = {} as Params$Resource$Folders$Getautokeyconfig; options = {}; } @@ -1334,82 +1404,81 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+location}:generateRandomBytes').replace( - /([^:]\/)\/+/g, - '$1' - ), - method: 'POST', + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', apiVersion: '', }, options ), params, - requiredParams: ['location'], - pathParams: ['location'], + requiredParams: ['name'], + pathParams: ['name'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Gets information about a location. + * Updates the AutokeyConfig for a folder. The caller must have both `cloudkms.autokeyConfigs.update` permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` permission on the provided key project. An empty key project may be provided to clear the configuration. * * @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, + updateAutokeyConfig( + params: Params$Resource$Folders$Updateautokeyconfig, options: StreamMethodOptions ): GaxiosPromise; - get( - params?: Params$Resource$Projects$Locations$Get, + updateAutokeyConfig( + params?: Params$Resource$Folders$Updateautokeyconfig, options?: MethodOptions - ): GaxiosPromise; - get( - params: Params$Resource$Projects$Locations$Get, + ): GaxiosPromise; + updateAutokeyConfig( + params: Params$Resource$Folders$Updateautokeyconfig, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - get( - params: Params$Resource$Projects$Locations$Get, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + updateAutokeyConfig( + params: Params$Resource$Folders$Updateautokeyconfig, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - get( - params: Params$Resource$Projects$Locations$Get, - callback: BodyResponseCallback + updateAutokeyConfig( + params: Params$Resource$Folders$Updateautokeyconfig, + callback: BodyResponseCallback ): void; - get(callback: BodyResponseCallback): void; - get( + updateAutokeyConfig( + callback: BodyResponseCallback + ): void; + updateAutokeyConfig( paramsOrCallback?: - | Params$Resource$Projects$Locations$Get - | BodyResponseCallback + | Params$Resource$Folders$Updateautokeyconfig + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Get; + {}) as Params$Resource$Folders$Updateautokeyconfig; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Get; + params = {} as Params$Resource$Folders$Updateautokeyconfig; options = {}; } @@ -1423,7 +1492,7 @@ export namespace cloudkms_v1 { options: Object.assign( { url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET', + method: 'PATCH', apiVersion: '', }, options @@ -1434,67 +1503,107 @@ export namespace cloudkms_v1 { context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } + } + + export interface Params$Resource$Folders$Getautokeyconfig + extends StandardParameters { + /** + * Required. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER\}/autokeyConfig`. + */ + name?: string; + } + export interface Params$Resource$Folders$Updateautokeyconfig + extends StandardParameters { + /** + * Identifier. Name of the AutokeyConfig resource, e.g. `folders/{FOLDER_NUMBER\}/autokeyConfig`. + */ + name?: string; + /** + * Required. Masks which fields of the AutokeyConfig to update, e.g. `keyProject`. + */ + updateMask?: string; /** - * Returns the EkmConfig singleton resource for a given project and location. + * Request body metadata + */ + requestBody?: Schema$AutokeyConfig; + } + + export class Resource$Projects { + context: APIRequestContext; + locations: Resource$Projects$Locations; + constructor(context: APIRequestContext) { + this.context = context; + this.locations = new Resource$Projects$Locations(this.context); + } + + /** + * Returns the effective Cloud KMS Autokey configuration for a given project. * * @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. */ - getEkmConfig( - params: Params$Resource$Projects$Locations$Getekmconfig, + showEffectiveAutokeyConfig( + params: Params$Resource$Projects$Showeffectiveautokeyconfig, options: StreamMethodOptions ): GaxiosPromise; - getEkmConfig( - params?: Params$Resource$Projects$Locations$Getekmconfig, + showEffectiveAutokeyConfig( + params?: Params$Resource$Projects$Showeffectiveautokeyconfig, options?: MethodOptions - ): GaxiosPromise; - getEkmConfig( - params: Params$Resource$Projects$Locations$Getekmconfig, + ): GaxiosPromise; + showEffectiveAutokeyConfig( + params: Params$Resource$Projects$Showeffectiveautokeyconfig, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - getEkmConfig( - params: Params$Resource$Projects$Locations$Getekmconfig, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + showEffectiveAutokeyConfig( + params: Params$Resource$Projects$Showeffectiveautokeyconfig, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback ): void; - getEkmConfig( - params: Params$Resource$Projects$Locations$Getekmconfig, - callback: BodyResponseCallback + showEffectiveAutokeyConfig( + params: Params$Resource$Projects$Showeffectiveautokeyconfig, + callback: BodyResponseCallback ): void; - getEkmConfig(callback: BodyResponseCallback): void; - getEkmConfig( + showEffectiveAutokeyConfig( + callback: BodyResponseCallback + ): void; + showEffectiveAutokeyConfig( paramsOrCallback?: - | Params$Resource$Projects$Locations$Getekmconfig - | BodyResponseCallback + | Params$Resource$Projects$Showeffectiveautokeyconfig + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): + | void + | GaxiosPromise + | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Getekmconfig; + {}) as Params$Resource$Projects$Showeffectiveautokeyconfig; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Getekmconfig; + params = {} as Params$Resource$Projects$Showeffectiveautokeyconfig; options = {}; } @@ -1507,84 +1616,122 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + url: (rootUrl + '/v1/{+parent}:showEffectiveAutokeyConfig').replace( + /([^:]\/)\/+/g, + '$1' + ), method: 'GET', apiVersion: '', }, options ), params, - requiredParams: ['name'], - pathParams: ['name'], + requiredParams: ['parent'], + pathParams: ['parent'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest( + parameters + ); } } + } + export interface Params$Resource$Projects$Showeffectiveautokeyconfig + extends StandardParameters { /** - * Lists information about the supported locations for this service. + * Required. Name of the resource project to the show effective Cloud KMS Autokey configuration for. This may be helpful for interrogating the effect of nested folder configurations on a given resource project. + */ + parent?: string; + } + + export class Resource$Projects$Locations { + context: APIRequestContext; + ekmConfig: Resource$Projects$Locations$Ekmconfig; + ekmConnections: Resource$Projects$Locations$Ekmconnections; + keyHandles: Resource$Projects$Locations$Keyhandles; + keyRings: Resource$Projects$Locations$Keyrings; + operations: Resource$Projects$Locations$Operations; + constructor(context: APIRequestContext) { + this.context = context; + this.ekmConfig = new Resource$Projects$Locations$Ekmconfig(this.context); + this.ekmConnections = new Resource$Projects$Locations$Ekmconnections( + this.context + ); + this.keyHandles = new Resource$Projects$Locations$Keyhandles( + this.context + ); + this.keyRings = new Resource$Projects$Locations$Keyrings(this.context); + this.operations = new Resource$Projects$Locations$Operations( + this.context + ); + } + + /** + * Generate random bytes using the Cloud KMS randomness source in the provided location. * * @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, + generateRandomBytes( + params: Params$Resource$Projects$Locations$Generaterandombytes, options: StreamMethodOptions ): GaxiosPromise; - list( - params?: Params$Resource$Projects$Locations$List, + generateRandomBytes( + params?: Params$Resource$Projects$Locations$Generaterandombytes, options?: MethodOptions - ): GaxiosPromise; - list( - params: Params$Resource$Projects$Locations$List, + ): GaxiosPromise; + generateRandomBytes( + params: Params$Resource$Projects$Locations$Generaterandombytes, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - list( - params: Params$Resource$Projects$Locations$List, + generateRandomBytes( + params: Params$Resource$Projects$Locations$Generaterandombytes, options: | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback + | BodyResponseCallback, + callback: BodyResponseCallback ): void; - list( - params: Params$Resource$Projects$Locations$List, - callback: BodyResponseCallback + generateRandomBytes( + params: Params$Resource$Projects$Locations$Generaterandombytes, + callback: BodyResponseCallback ): void; - list(callback: BodyResponseCallback): void; - list( + generateRandomBytes( + callback: BodyResponseCallback + ): void; + generateRandomBytes( paramsOrCallback?: - | Params$Resource$Projects$Locations$List - | BodyResponseCallback + | Params$Resource$Projects$Locations$Generaterandombytes + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback ): | void - | GaxiosPromise + | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$List; + {}) as Params$Resource$Projects$Locations$Generaterandombytes; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$List; + params = {} as Params$Resource$Projects$Locations$Generaterandombytes; options = {}; } @@ -1597,82 +1744,82 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+name}/locations').replace( + url: (rootUrl + '/v1/{+location}:generateRandomBytes').replace( /([^:]\/)\/+/g, '$1' ), - method: 'GET', + method: 'POST', apiVersion: '', }, options ), params, - requiredParams: ['name'], - pathParams: ['name'], + requiredParams: ['location'], + pathParams: ['location'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Updates the EkmConfig singleton resource for a given project and location. + * Gets information about a location. * * @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. */ - updateEkmConfig( - params: Params$Resource$Projects$Locations$Updateekmconfig, + get( + params: Params$Resource$Projects$Locations$Get, options: StreamMethodOptions ): GaxiosPromise; - updateEkmConfig( - params?: Params$Resource$Projects$Locations$Updateekmconfig, + get( + params?: Params$Resource$Projects$Locations$Get, options?: MethodOptions - ): GaxiosPromise; - updateEkmConfig( - params: Params$Resource$Projects$Locations$Updateekmconfig, + ): GaxiosPromise; + get( + params: Params$Resource$Projects$Locations$Get, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - updateEkmConfig( - params: Params$Resource$Projects$Locations$Updateekmconfig, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + get( + params: Params$Resource$Projects$Locations$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - updateEkmConfig( - params: Params$Resource$Projects$Locations$Updateekmconfig, - callback: BodyResponseCallback + get( + params: Params$Resource$Projects$Locations$Get, + callback: BodyResponseCallback ): void; - updateEkmConfig(callback: BodyResponseCallback): void; - updateEkmConfig( + get(callback: BodyResponseCallback): void; + get( paramsOrCallback?: - | Params$Resource$Projects$Locations$Updateekmconfig - | BodyResponseCallback + | Params$Resource$Projects$Locations$Get + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Updateekmconfig; + {}) as Params$Resource$Projects$Locations$Get; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Updateekmconfig; + params = {} as Params$Resource$Projects$Locations$Get; options = {}; } @@ -1686,7 +1833,7 @@ export namespace cloudkms_v1 { options: Object.assign( { url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH', + method: 'GET', apiVersion: '', }, options @@ -1697,137 +1844,67 @@ export namespace cloudkms_v1 { context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } - } - - export interface Params$Resource$Projects$Locations$Generaterandombytes - extends StandardParameters { - /** - * The project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1". - */ - location?: string; - - /** - * Request body metadata - */ - requestBody?: Schema$GenerateRandomBytesRequest; - } - export interface Params$Resource$Projects$Locations$Get - extends StandardParameters { - /** - * Resource name for the location. - */ - name?: string; - } - export interface Params$Resource$Projects$Locations$Getekmconfig - extends StandardParameters { - /** - * Required. The name of the EkmConfig to get. - */ - 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 interface Params$Resource$Projects$Locations$Updateekmconfig - extends StandardParameters { - /** - * Output only. The resource name for the EkmConfig in the format `projects/x/locations/x/ekmConfig`. - */ - name?: string; - /** - * Required. List of fields to be updated in this request. - */ - updateMask?: string; - - /** - * Request body metadata - */ - requestBody?: Schema$EkmConfig; - } - - export class Resource$Projects$Locations$Ekmconfig { - context: APIRequestContext; - constructor(context: APIRequestContext) { - this.context = context; - } /** - * Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * Returns the EkmConfig singleton resource for a given project and location. * * @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$Ekmconfig$Getiampolicy, + getEkmConfig( + params: Params$Resource$Projects$Locations$Getekmconfig, options: StreamMethodOptions ): GaxiosPromise; - getIamPolicy( - params?: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, + getEkmConfig( + params?: Params$Resource$Projects$Locations$Getekmconfig, options?: MethodOptions - ): GaxiosPromise; - getIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, + ): GaxiosPromise; + getEkmConfig( + params: Params$Resource$Projects$Locations$Getekmconfig, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - getIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + getEkmConfig( + params: Params$Resource$Projects$Locations$Getekmconfig, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - getIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, - callback: BodyResponseCallback + getEkmConfig( + params: Params$Resource$Projects$Locations$Getekmconfig, + callback: BodyResponseCallback ): void; - getIamPolicy(callback: BodyResponseCallback): void; - getIamPolicy( + getEkmConfig(callback: BodyResponseCallback): void; + getEkmConfig( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy - | BodyResponseCallback + | Params$Resource$Projects$Locations$Getekmconfig + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy; + {}) as Params$Resource$Projects$Locations$Getekmconfig; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = - {} as Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy; + params = {} as Params$Resource$Projects$Locations$Getekmconfig; options = {}; } @@ -1840,83 +1917,84 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace( - /([^:]\/)\/+/g, - '$1' - ), + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), method: 'GET', apiVersion: '', }, options ), params, - requiredParams: ['resource'], - pathParams: ['resource'], + requiredParams: ['name'], + pathParams: ['name'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * Lists information about the supported locations for this service. * * @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$Ekmconfig$Setiampolicy, + list( + params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions ): GaxiosPromise; - setIamPolicy( - params?: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, + list( + params?: Params$Resource$Projects$Locations$List, options?: MethodOptions - ): GaxiosPromise; - setIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, + ): GaxiosPromise; + list( + params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - setIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + list( + params: Params$Resource$Projects$Locations$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback ): void; - setIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, - callback: BodyResponseCallback + list( + params: Params$Resource$Projects$Locations$List, + callback: BodyResponseCallback ): void; - setIamPolicy(callback: BodyResponseCallback): void; - setIamPolicy( + list(callback: BodyResponseCallback): void; + list( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy - | BodyResponseCallback + | Params$Resource$Projects$Locations$List + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): + | void + | GaxiosPromise + | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy; + {}) as Params$Resource$Projects$Locations$List; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = - {} as Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy; + params = {} as Params$Resource$Projects$Locations$List; options = {}; } @@ -1929,90 +2007,82 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace( + url: (rootUrl + '/v1/{+name}/locations').replace( /([^:]\/)\/+/g, '$1' ), - method: 'POST', + method: 'GET', apiVersion: '', }, options ), params, - requiredParams: ['resource'], - pathParams: ['resource'], + requiredParams: ['name'], + pathParams: ['name'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(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. + * Updates the EkmConfig singleton resource for a given project and location. * * @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$Ekmconfig$Testiampermissions, + updateEkmConfig( + params: Params$Resource$Projects$Locations$Updateekmconfig, options: StreamMethodOptions ): GaxiosPromise; - testIamPermissions( - params?: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, + updateEkmConfig( + params?: Params$Resource$Projects$Locations$Updateekmconfig, options?: MethodOptions - ): GaxiosPromise; - testIamPermissions( - params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, + ): GaxiosPromise; + updateEkmConfig( + params: Params$Resource$Projects$Locations$Updateekmconfig, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - testIamPermissions( - params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, - options: - | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - testIamPermissions( - params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, - callback: BodyResponseCallback + updateEkmConfig( + params: Params$Resource$Projects$Locations$Updateekmconfig, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - testIamPermissions( - callback: BodyResponseCallback + updateEkmConfig( + params: Params$Resource$Projects$Locations$Updateekmconfig, + callback: BodyResponseCallback ): void; - testIamPermissions( + updateEkmConfig(callback: BodyResponseCallback): void; + updateEkmConfig( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions - | BodyResponseCallback + | Params$Resource$Projects$Locations$Updateekmconfig + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): - | void - | GaxiosPromise - | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions; + {}) as Params$Resource$Projects$Locations$Updateekmconfig; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = - {} as Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions; + params = {} as Params$Resource$Projects$Locations$Updateekmconfig; options = {}; } @@ -2025,125 +2095,149 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace( - /([^:]\/)\/+/g, - '$1' - ), - method: 'POST', + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH', apiVersion: '', }, options ), params, - requiredParams: ['resource'], - pathParams: ['resource'], + requiredParams: ['name'], + pathParams: ['name'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } } - export interface Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy + export interface Params$Resource$Projects$Locations$Generaterandombytes extends StandardParameters { /** - * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * The project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1". */ - 'options.requestedPolicyVersion'?: number; + location?: string; + /** - * REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + * Request body metadata */ - resource?: string; + requestBody?: Schema$GenerateRandomBytesRequest; } - export interface Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy + export interface Params$Resource$Projects$Locations$Get extends StandardParameters { /** - * REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + * Resource name for the location. */ - resource?: string; - + name?: string; + } + export interface Params$Resource$Projects$Locations$Getekmconfig + extends StandardParameters { /** - * Request body metadata + * Required. The name of the EkmConfig to get. */ - requestBody?: Schema$SetIamPolicyRequest; + name?: string; } - export interface Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions + export interface Params$Resource$Projects$Locations$List extends StandardParameters { /** - * REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + * 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). */ - resource?: string; + 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 interface Params$Resource$Projects$Locations$Updateekmconfig + extends StandardParameters { + /** + * Output only. The resource name for the EkmConfig in the format `projects/x/locations/x/ekmConfig`. + */ + name?: string; + /** + * Required. List of fields to be updated in this request. + */ + updateMask?: string; /** * Request body metadata */ - requestBody?: Schema$TestIamPermissionsRequest; + requestBody?: Schema$EkmConfig; } - export class Resource$Projects$Locations$Ekmconnections { + export class Resource$Projects$Locations$Ekmconfig { context: APIRequestContext; constructor(context: APIRequestContext) { this.context = context; } /** - * Creates a new EkmConnection in a given Project and Location. + * Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * * @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$Ekmconnections$Create, + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, options: StreamMethodOptions ): GaxiosPromise; - create( - params?: Params$Resource$Projects$Locations$Ekmconnections$Create, + getIamPolicy( + params?: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, options?: MethodOptions - ): GaxiosPromise; - create( - params: Params$Resource$Projects$Locations$Ekmconnections$Create, + ): GaxiosPromise; + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - create( - params: Params$Resource$Projects$Locations$Ekmconnections$Create, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - create( - params: Params$Resource$Projects$Locations$Ekmconnections$Create, - callback: BodyResponseCallback + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy, + callback: BodyResponseCallback ): void; - create(callback: BodyResponseCallback): void; - create( + getIamPolicy(callback: BodyResponseCallback): void; + getIamPolicy( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Create - | BodyResponseCallback + | Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Create; + {}) as Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Ekmconnections$Create; + params = + {} as Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy; options = {}; } @@ -2156,82 +2250,83 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+parent}/ekmConnections').replace( + url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace( /([^:]\/)\/+/g, '$1' ), - method: 'POST', + method: 'GET', apiVersion: '', }, options ), params, - requiredParams: ['parent'], - pathParams: ['parent'], + requiredParams: ['resource'], + pathParams: ['resource'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Returns metadata for a given EkmConnection. + * Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * * @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$Ekmconnections$Get, + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, options: StreamMethodOptions ): GaxiosPromise; - get( - params?: Params$Resource$Projects$Locations$Ekmconnections$Get, + setIamPolicy( + params?: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, options?: MethodOptions - ): GaxiosPromise; - get( - params: Params$Resource$Projects$Locations$Ekmconnections$Get, + ): GaxiosPromise; + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - get( - params: Params$Resource$Projects$Locations$Ekmconnections$Get, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - get( - params: Params$Resource$Projects$Locations$Ekmconnections$Get, - callback: BodyResponseCallback + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - get(callback: BodyResponseCallback): void; - get( + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy, + callback: BodyResponseCallback + ): void; + setIamPolicy(callback: BodyResponseCallback): void; + setIamPolicy( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Get - | BodyResponseCallback + | Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Get; + {}) as Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Ekmconnections$Get; + params = + {} as Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy; options = {}; } @@ -2244,80 +2339,90 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET', + url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', apiVersion: '', }, options ), params, - requiredParams: ['name'], - pathParams: ['name'], + requiredParams: ['resource'], + pathParams: ['resource'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + * 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. * * @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$Ekmconnections$Getiampolicy, + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, options: StreamMethodOptions ): GaxiosPromise; - getIamPolicy( - params?: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, + testIamPermissions( + params?: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, options?: MethodOptions - ): GaxiosPromise; - getIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, + ): GaxiosPromise; + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - getIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, - options: MethodOptions | BodyResponseCallback, - callback: BodyResponseCallback + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback ): void; - getIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, - callback: BodyResponseCallback + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions, + callback: BodyResponseCallback ): void; - getIamPolicy(callback: BodyResponseCallback): void; - getIamPolicy( + testIamPermissions( + callback: BodyResponseCallback + ): void; + testIamPermissions( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy - | BodyResponseCallback + | Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): void | GaxiosPromise | GaxiosPromise { + ): + | void + | GaxiosPromise + | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy; + {}) as Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = - {} as Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy; + {} as Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions; options = {}; } @@ -2330,11 +2435,11 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace( + url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace( /([^:]\/)\/+/g, '$1' ), - method: 'GET', + method: 'POST', apiVersion: '', }, options @@ -2345,74 +2450,110 @@ export namespace cloudkms_v1 { context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } + } + export interface Params$Resource$Projects$Locations$Ekmconfig$Getiampolicy + extends StandardParameters { /** - * Lists EkmConnections. + * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + */ + 'options.requestedPolicyVersion'?: number; + /** + * REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + */ + resource?: string; + } + export interface Params$Resource$Projects$Locations$Ekmconfig$Setiampolicy + extends StandardParameters { + /** + * REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + */ + resource?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$SetIamPolicyRequest; + } + export interface Params$Resource$Projects$Locations$Ekmconfig$Testiampermissions + extends StandardParameters { + /** + * REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + */ + resource?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$TestIamPermissionsRequest; + } + + export class Resource$Projects$Locations$Ekmconnections { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * Creates a new EkmConnection in a given Project and Location. * * @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$Ekmconnections$List, + create( + params: Params$Resource$Projects$Locations$Ekmconnections$Create, options: StreamMethodOptions ): GaxiosPromise; - list( - params?: Params$Resource$Projects$Locations$Ekmconnections$List, + create( + params?: Params$Resource$Projects$Locations$Ekmconnections$Create, options?: MethodOptions - ): GaxiosPromise; - list( - params: Params$Resource$Projects$Locations$Ekmconnections$List, + ): GaxiosPromise; + create( + params: Params$Resource$Projects$Locations$Ekmconnections$Create, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - list( - params: Params$Resource$Projects$Locations$Ekmconnections$List, - options: - | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - list( - params: Params$Resource$Projects$Locations$Ekmconnections$List, - callback: BodyResponseCallback + create( + params: Params$Resource$Projects$Locations$Ekmconnections$Create, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - list( - callback: BodyResponseCallback + create( + params: Params$Resource$Projects$Locations$Ekmconnections$Create, + callback: BodyResponseCallback ): void; - list( + create(callback: BodyResponseCallback): void; + create( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$List - | BodyResponseCallback + | Params$Resource$Projects$Locations$Ekmconnections$Create + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): - | void - | GaxiosPromise - | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$List; + {}) as Params$Resource$Projects$Locations$Ekmconnections$Create; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Ekmconnections$List; + params = {} as Params$Resource$Projects$Locations$Ekmconnections$Create; options = {}; } @@ -2429,7 +2570,7 @@ export namespace cloudkms_v1 { /([^:]\/)\/+/g, '$1' ), - method: 'GET', + method: 'POST', apiVersion: '', }, options @@ -2440,49 +2581,49 @@ export namespace cloudkms_v1 { context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Updates an EkmConnection's metadata. + * Returns metadata for a given EkmConnection. * * @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$Ekmconnections$Patch, + get( + params: Params$Resource$Projects$Locations$Ekmconnections$Get, options: StreamMethodOptions ): GaxiosPromise; - patch( - params?: Params$Resource$Projects$Locations$Ekmconnections$Patch, + get( + params?: Params$Resource$Projects$Locations$Ekmconnections$Get, options?: MethodOptions ): GaxiosPromise; - patch( - params: Params$Resource$Projects$Locations$Ekmconnections$Patch, + get( + params: Params$Resource$Projects$Locations$Ekmconnections$Get, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - patch( - params: Params$Resource$Projects$Locations$Ekmconnections$Patch, + get( + params: Params$Resource$Projects$Locations$Ekmconnections$Get, options: MethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - patch( - params: Params$Resource$Projects$Locations$Ekmconnections$Patch, + get( + params: Params$Resource$Projects$Locations$Ekmconnections$Get, callback: BodyResponseCallback ): void; - patch(callback: BodyResponseCallback): void; - patch( + get(callback: BodyResponseCallback): void; + get( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Patch + | Params$Resource$Projects$Locations$Ekmconnections$Get | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: @@ -2495,12 +2636,12 @@ export namespace cloudkms_v1 { | BodyResponseCallback ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Patch; + {}) as Params$Resource$Projects$Locations$Ekmconnections$Get; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = {} as Params$Resource$Projects$Locations$Ekmconnections$Patch; + params = {} as Params$Resource$Projects$Locations$Ekmconnections$Get; options = {}; } @@ -2514,7 +2655,7 @@ export namespace cloudkms_v1 { options: Object.assign( { url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH', + method: 'GET', apiVersion: '', }, options @@ -2535,39 +2676,39 @@ export namespace cloudkms_v1 { } /** - * Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. * * @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$Ekmconnections$Setiampolicy, + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, options: StreamMethodOptions ): GaxiosPromise; - setIamPolicy( - params?: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + getIamPolicy( + params?: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, options?: MethodOptions ): GaxiosPromise; - setIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - setIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, options: MethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - setIamPolicy( - params: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + getIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy, callback: BodyResponseCallback ): void; - setIamPolicy(callback: BodyResponseCallback): void; - setIamPolicy( + getIamPolicy(callback: BodyResponseCallback): void; + getIamPolicy( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy + | Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: @@ -2580,13 +2721,674 @@ export namespace cloudkms_v1 { | BodyResponseCallback ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy; + {}) as Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; params = - {} as Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy; + {} as Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Lists EkmConnections. + * + * @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$Ekmconnections$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Projects$Locations$Ekmconnections$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Projects$Locations$Ekmconnections$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Projects$Locations$Ekmconnections$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Projects$Locations$Ekmconnections$List, + callback: BodyResponseCallback + ): void; + list( + callback: BodyResponseCallback + ): void; + list( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Ekmconnections$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Ekmconnections$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Ekmconnections$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/ekmConnections').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Updates an EkmConnection's metadata. + * + * @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$Ekmconnections$Patch, + options: StreamMethodOptions + ): GaxiosPromise; + patch( + params?: Params$Resource$Projects$Locations$Ekmconnections$Patch, + options?: MethodOptions + ): GaxiosPromise; + patch( + params: Params$Resource$Projects$Locations$Ekmconnections$Patch, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Projects$Locations$Ekmconnections$Patch, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Projects$Locations$Ekmconnections$Patch, + callback: BodyResponseCallback + ): void; + patch(callback: BodyResponseCallback): void; + patch( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Ekmconnections$Patch + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Ekmconnections$Patch; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Ekmconnections$Patch; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + * @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$Ekmconnections$Setiampolicy, + options: StreamMethodOptions + ): GaxiosPromise; + setIamPolicy( + params?: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + options?: MethodOptions + ): GaxiosPromise; + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + setIamPolicy( + params: Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy, + callback: BodyResponseCallback + ): void; + setIamPolicy(callback: BodyResponseCallback): void; + setIamPolicy( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(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. + * + * @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$Ekmconnections$Testiampermissions, + options: StreamMethodOptions + ): GaxiosPromise; + testIamPermissions( + params?: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, + options?: MethodOptions + ): GaxiosPromise; + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + testIamPermissions( + params: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, + callback: BodyResponseCallback + ): void; + testIamPermissions( + callback: BodyResponseCallback + ): void; + testIamPermissions( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Verifies that Cloud KMS can successfully connect to the external key manager specified by an EkmConnection. If there is an error connecting to the EKM, this method returns a FAILED_PRECONDITION status containing structured information as described at https://cloud.google.com/kms/docs/reference/ekm_errors. + * + * @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. + */ + verifyConnectivity( + params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + options: StreamMethodOptions + ): GaxiosPromise; + verifyConnectivity( + params?: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + options?: MethodOptions + ): GaxiosPromise; + verifyConnectivity( + params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + verifyConnectivity( + params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + verifyConnectivity( + params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + callback: BodyResponseCallback + ): void; + verifyConnectivity( + callback: BodyResponseCallback + ): void; + verifyConnectivity( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:verifyConnectivity').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Projects$Locations$Ekmconnections$Create + extends StandardParameters { + /** + * Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`. + */ + ekmConnectionId?: string; + /** + * Required. The resource name of the location associated with the EkmConnection, in the format `projects/x/locations/x`. + */ + parent?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$EkmConnection; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$Get + extends StandardParameters { + /** + * Required. The name of the EkmConnection to get. + */ + name?: string; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy + extends StandardParameters { + /** + * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + */ + 'options.requestedPolicyVersion'?: number; + /** + * REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + */ + resource?: string; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$List + extends StandardParameters { + /** + * Optional. Only include resources that match the filter in the response. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering). + */ + filter?: string; + /** + * Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering). + */ + orderBy?: string; + /** + * Optional. Optional limit on the number of EkmConnections to include in the response. Further EkmConnections can subsequently be obtained by including the ListEkmConnectionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional. Optional pagination token, returned earlier via ListEkmConnectionsResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the location associated with the EkmConnections to list, in the format `projects/x/locations/x`. + */ + parent?: string; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$Patch + extends StandardParameters { + /** + * Output only. The resource name for the EkmConnection in the format `projects/x/locations/x/ekmConnections/x`. + */ + name?: string; + /** + * Required. List of fields to be updated in this request. + */ + updateMask?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$EkmConnection; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy + extends StandardParameters { + /** + * REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + */ + resource?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$SetIamPolicyRequest; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions + extends StandardParameters { + /** + * REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. + */ + resource?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$TestIamPermissionsRequest; + } + export interface Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity + extends StandardParameters { + /** + * Required. The name of the EkmConnection to verify. + */ + name?: string; + } + + export class Resource$Projects$Locations$Keyhandles { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * Creates a new KeyHandle, triggering the provisioning of a new CryptoKey for CMEK use with the given resource type in the configured key project and the same location. GetOperation should be used to resolve the resulting long-running operation and get the resulting KeyHandle and CryptoKey. + * + * @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$Keyhandles$Create, + options: StreamMethodOptions + ): GaxiosPromise; + create( + params?: Params$Resource$Projects$Locations$Keyhandles$Create, + options?: MethodOptions + ): GaxiosPromise; + create( + params: Params$Resource$Projects$Locations$Keyhandles$Create, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Projects$Locations$Keyhandles$Create, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + create( + params: Params$Resource$Projects$Locations$Keyhandles$Create, + callback: BodyResponseCallback + ): void; + create(callback: BodyResponseCallback): void; + create( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Keyhandles$Create + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Keyhandles$Create; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Locations$Keyhandles$Create; options = {}; } @@ -2599,7 +3401,7 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+resource}:setIamPolicy').replace( + url: (rootUrl + '/v1/{+parent}/keyHandles').replace( /([^:]\/)\/+/g, '$1' ), @@ -2609,80 +3411,72 @@ export namespace cloudkms_v1 { options ), params, - requiredParams: ['resource'], - pathParams: ['resource'], + requiredParams: ['parent'], + pathParams: ['parent'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(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. + * Returns the KeyHandle. * * @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$Ekmconnections$Testiampermissions, + get( + params: Params$Resource$Projects$Locations$Keyhandles$Get, options: StreamMethodOptions ): GaxiosPromise; - testIamPermissions( - params?: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, + get( + params?: Params$Resource$Projects$Locations$Keyhandles$Get, options?: MethodOptions - ): GaxiosPromise; - testIamPermissions( - params: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, + ): GaxiosPromise; + get( + params: Params$Resource$Projects$Locations$Keyhandles$Get, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - testIamPermissions( - params: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, - options: - | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - testIamPermissions( - params: Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions, - callback: BodyResponseCallback + get( + params: Params$Resource$Projects$Locations$Keyhandles$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback ): void; - testIamPermissions( - callback: BodyResponseCallback + get( + params: Params$Resource$Projects$Locations$Keyhandles$Get, + callback: BodyResponseCallback ): void; - testIamPermissions( + get(callback: BodyResponseCallback): void; + get( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions - | BodyResponseCallback + | Params$Resource$Projects$Locations$Keyhandles$Get + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback - ): - | void - | GaxiosPromise - | GaxiosPromise { + ): void | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions; + {}) as Params$Resource$Projects$Locations$Keyhandles$Get; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = - {} as Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions; + params = {} as Params$Resource$Projects$Locations$Keyhandles$Get; options = {}; } @@ -2695,90 +3489,84 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+resource}:testIamPermissions').replace( - /([^:]\/)\/+/g, - '$1' - ), - method: 'POST', + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', apiVersion: '', }, options ), params, - requiredParams: ['resource'], - pathParams: ['resource'], + requiredParams: ['name'], + pathParams: ['name'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } /** - * Verifies that Cloud KMS can successfully connect to the external key manager specified by an EkmConnection. If there is an error connecting to the EKM, this method returns a FAILED_PRECONDITION status containing structured information as described at https://cloud.google.com/kms/docs/reference/ekm_errors. + * Lists KeyHandles. * * @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. */ - verifyConnectivity( - params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + list( + params: Params$Resource$Projects$Locations$Keyhandles$List, options: StreamMethodOptions ): GaxiosPromise; - verifyConnectivity( - params?: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + list( + params?: Params$Resource$Projects$Locations$Keyhandles$List, options?: MethodOptions - ): GaxiosPromise; - verifyConnectivity( - params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + ): GaxiosPromise; + list( + params: Params$Resource$Projects$Locations$Keyhandles$List, options: StreamMethodOptions | BodyResponseCallback, callback: BodyResponseCallback ): void; - verifyConnectivity( - params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, + list( + params: Params$Resource$Projects$Locations$Keyhandles$List, options: | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - verifyConnectivity( - params: Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity, - callback: BodyResponseCallback + | BodyResponseCallback, + callback: BodyResponseCallback ): void; - verifyConnectivity( - callback: BodyResponseCallback + list( + params: Params$Resource$Projects$Locations$Keyhandles$List, + callback: BodyResponseCallback ): void; - verifyConnectivity( + list(callback: BodyResponseCallback): void; + list( paramsOrCallback?: - | Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity - | BodyResponseCallback + | Params$Resource$Projects$Locations$Keyhandles$List + | BodyResponseCallback | BodyResponseCallback, optionsOrCallback?: | MethodOptions | StreamMethodOptions - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback, callback?: - | BodyResponseCallback + | BodyResponseCallback | BodyResponseCallback ): | void - | GaxiosPromise + | GaxiosPromise | GaxiosPromise { let params = (paramsOrCallback || - {}) as Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity; + {}) as Params$Resource$Projects$Locations$Keyhandles$List; let options = (optionsOrCallback || {}) as MethodOptions; if (typeof paramsOrCallback === 'function') { callback = paramsOrCallback; - params = - {} as Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity; + params = {} as Params$Resource$Projects$Locations$Keyhandles$List; options = {}; } @@ -2791,7 +3579,7 @@ export namespace cloudkms_v1 { const parameters = { options: Object.assign( { - url: (rootUrl + '/v1/{+name}:verifyConnectivity').replace( + url: (rootUrl + '/v1/{+parent}/keyHandles').replace( /([^:]\/)\/+/g, '$1' ), @@ -2801,125 +3589,55 @@ export namespace cloudkms_v1 { options ), params, - requiredParams: ['name'], - pathParams: ['name'], + requiredParams: ['parent'], + pathParams: ['parent'], context: this.context, }; if (callback) { - createAPIRequest( + createAPIRequest( parameters, callback as BodyResponseCallback ); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } } - export interface Params$Resource$Projects$Locations$Ekmconnections$Create + export interface Params$Resource$Projects$Locations$Keyhandles$Create extends StandardParameters { /** - * Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63\}`. + * Optional. Id of the KeyHandle. Must be unique to the resource project and location. If not provided by the caller, a new UUID is used. */ - ekmConnectionId?: string; + keyHandleId?: string; /** - * Required. The resource name of the location associated with the EkmConnection, in the format `projects/x/locations/x`. + * Required. Name of the resource project and location to create the KeyHandle in, e.g. `projects/{PROJECT_ID\}/locations/{LOCATION\}`. */ parent?: string; /** * Request body metadata */ - requestBody?: Schema$EkmConnection; + requestBody?: Schema$KeyHandle; } - export interface Params$Resource$Projects$Locations$Ekmconnections$Get + export interface Params$Resource$Projects$Locations$Keyhandles$Get extends StandardParameters { /** - * Required. The name of the EkmConnection to get. + * Required. Name of the KeyHandle resource, e.g. `projects/{PROJECT_ID\}/locations/{LOCATION\}/keyHandles/{KEY_HANDLE_ID\}`. */ name?: string; } - export interface Params$Resource$Projects$Locations$Ekmconnections$Getiampolicy - extends StandardParameters { - /** - * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - */ - 'options.requestedPolicyVersion'?: number; - /** - * REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. - */ - resource?: string; - } - export interface Params$Resource$Projects$Locations$Ekmconnections$List + export interface Params$Resource$Projects$Locations$Keyhandles$List extends StandardParameters { /** - * Optional. Only include resources that match the filter in the response. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering). + * Optional. Filter to apply when listing KeyHandles, e.g. `resource_type_selector="{SERVICE\}.googleapis.com/{TYPE\}"`. */ filter?: string; /** - * Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering). - */ - orderBy?: string; - /** - * Optional. Optional limit on the number of EkmConnections to include in the response. Further EkmConnections can subsequently be obtained by including the ListEkmConnectionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. - */ - pageSize?: number; - /** - * Optional. Optional pagination token, returned earlier via ListEkmConnectionsResponse.next_page_token. - */ - pageToken?: string; - /** - * Required. The resource name of the location associated with the EkmConnections to list, in the format `projects/x/locations/x`. + * Required. Name of the resource project and location from which to list KeyHandles, e.g. `projects/{PROJECT_ID\}/locations/{LOCATION\}`. */ parent?: string; } - export interface Params$Resource$Projects$Locations$Ekmconnections$Patch - extends StandardParameters { - /** - * Output only. The resource name for the EkmConnection in the format `projects/x/locations/x/ekmConnections/x`. - */ - name?: string; - /** - * Required. List of fields to be updated in this request. - */ - updateMask?: string; - - /** - * Request body metadata - */ - requestBody?: Schema$EkmConnection; - } - export interface Params$Resource$Projects$Locations$Ekmconnections$Setiampolicy - extends StandardParameters { - /** - * REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. - */ - resource?: string; - - /** - * Request body metadata - */ - requestBody?: Schema$SetIamPolicyRequest; - } - export interface Params$Resource$Projects$Locations$Ekmconnections$Testiampermissions - extends StandardParameters { - /** - * REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. - */ - resource?: string; - - /** - * Request body metadata - */ - requestBody?: Schema$TestIamPermissionsRequest; - } - export interface Params$Resource$Projects$Locations$Ekmconnections$Verifyconnectivity - extends StandardParameters { - /** - * Required. The name of the EkmConnection to verify. - */ - name?: string; - } export class Resource$Projects$Locations$Keyrings { context: APIRequestContext; @@ -6696,4 +7414,104 @@ export namespace cloudkms_v1 { */ requestBody?: Schema$TestIamPermissionsRequest; } + + export class Resource$Projects$Locations$Operations { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * 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. + * + * @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; + get( + params?: Params$Resource$Projects$Locations$Operations$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Projects$Locations$Operations$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Projects$Locations$Operations$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Projects$Locations$Operations$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Operations$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + 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://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Projects$Locations$Operations$Get + extends StandardParameters { + /** + * The name of the operation resource. + */ + name?: string; + } }