diff --git a/packages/google-cloud-config/.jsdoc.js b/packages/google-cloud-config/.jsdoc.js index c452fde79c0..a73893518ad 100644 --- a/packages/google-cloud-config/.jsdoc.js +++ b/packages/google-cloud-config/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2025 Google LLC', + copyright: 'Copyright 2026 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/config', diff --git a/packages/google-cloud-config/.mocharc.js b/packages/google-cloud-config/.mocharc.js index 24e9d15257f..5eb34e86c87 100644 --- a/packages/google-cloud-config/.mocharc.js +++ b/packages/google-cloud-config/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/.prettierrc.js b/packages/google-cloud-config/.prettierrc.js index d89a632f90b..7649ee3c254 100644 --- a/packages/google-cloud-config/.prettierrc.js +++ b/packages/google-cloud-config/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/README.md b/packages/google-cloud-config/README.md index abf8cf622db..9c68b737b98 100644 --- a/packages/google-cloud-config/README.md +++ b/packages/google-cloud-config/README.md @@ -67,6 +67,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | export lock info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.export_lock_info.js) | | export preview result | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.export_preview_result.js) | | export revision statefile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.export_revision_statefile.js) | +| get auto migration config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_auto_migration_config.js) | | get deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_deployment.js) | | get preview | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_preview.js) | | get resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_resource.js) | @@ -84,6 +85,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | list terraform versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js) | | lock deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js) | | unlock deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js) | +| update auto migration config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.update_auto_migration_config.js) | | update deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.update_deployment.js) | | cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json) | diff --git a/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto b/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto index aa8a629c10b..c45d7e95e38 100644 --- a/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto +++ b/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -322,6 +322,29 @@ service Config { }; option (google.api.method_signature) = "name"; } + + // Get the AutoMigrationConfig for a given project and location. + rpc GetAutoMigrationConfig(GetAutoMigrationConfigRequest) + returns (AutoMigrationConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/autoMigrationConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the AutoMigrationConfig for a given project and location. + rpc UpdateAutoMigrationConfig(UpdateAutoMigrationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{auto_migration_config.name=projects/*/locations/*/autoMigrationConfig}" + body: "auto_migration_config" + }; + option (google.api.method_signature) = "auto_migration_config,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AutoMigrationConfig" + metadata_type: "OperationMetadata" + }; + } } // Enum values to control quota checks for resources in terraform @@ -402,6 +425,9 @@ message Deployment { // Cloud Storage bucket creation failed due to an issue unrelated to // permissions. BUCKET_CREATION_FAILED = 8; + + // Failed to import values from an external source. + EXTERNAL_VALUE_SOURCE_IMPORT_FAILED = 10; } // Possible lock states of a deployment. @@ -965,6 +991,9 @@ message Revision { // quota validation failed for one or more resources in terraform // configuration files. QUOTA_VALIDATION_FAILED = 7; + + // Failed to import values from an external source. + EXTERNAL_VALUE_SOURCE_IMPORT_FAILED = 8; } // Blueprint that was deployed. @@ -1529,6 +1558,9 @@ message Preview { // Preview created a build but build failed and logs were generated. PREVIEW_BUILD_RUN_FAILED = 6; + + // Failed to import values from an external source. + EXTERNAL_VALUE_SOURCE_IMPORT_FAILED = 7; } // Blueprint to preview. @@ -2275,3 +2307,50 @@ message ProviderConfig { optional ProviderSource source_type = 1 [(google.api.field_behavior) = OPTIONAL]; } + +// The request message for the GetAutoMigrationConfig method. +message GetAutoMigrationConfigRequest { + // Required. The name of the AutoMigrationConfig. + // Format: + // 'projects/{project_id}/locations/{location}/AutoMigrationConfig'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "config.googleapis.com/AutoMigrationConfig" + } + ]; +} + +// AutoMigrationConfig contains the automigration configuration for a project. +message AutoMigrationConfig { + option (google.api.resource) = { + type: "config.googleapis.com/AutoMigrationConfig" + pattern: "projects/{project}/locations/{location}/autoMigrationConfig" + plural: "autoMigrationConfigs" + singular: "autoMigrationConfig" + }; + + // Identifier. The name of the AutoMigrationConfig. + // Format: + // 'projects/{project_id}/locations/{location}/AutoMigrationConfig'. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Time the AutoMigrationConfig was last updated. + google.protobuf.Timestamp update_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Whether the auto migration is enabled for the project. + bool auto_migration_enabled = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for the UpdateAutoMigrationConfig method. +message UpdateAutoMigrationConfigRequest { + // Optional. The update mask applies to the resource. See + // [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The AutoMigrationConfig to update. + AutoMigrationConfig auto_migration_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-config/protos/protos.d.ts b/packages/google-cloud-config/protos/protos.d.ts index 6efa9fb34aa..28500e566ce 100644 --- a/packages/google-cloud-config/protos/protos.d.ts +++ b/packages/google-cloud-config/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -423,6 +423,34 @@ export namespace google { * @returns Promise */ public getResourceDrift(request: google.cloud.config.v1.IGetResourceDriftRequest): Promise; + + /** + * Calls GetAutoMigrationConfig. + * @param request GetAutoMigrationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutoMigrationConfig + */ + public getAutoMigrationConfig(request: google.cloud.config.v1.IGetAutoMigrationConfigRequest, callback: google.cloud.config.v1.Config.GetAutoMigrationConfigCallback): void; + + /** + * Calls GetAutoMigrationConfig. + * @param request GetAutoMigrationConfigRequest message or plain object + * @returns Promise + */ + public getAutoMigrationConfig(request: google.cloud.config.v1.IGetAutoMigrationConfigRequest): Promise; + + /** + * Calls UpdateAutoMigrationConfig. + * @param request UpdateAutoMigrationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAutoMigrationConfig(request: google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, callback: google.cloud.config.v1.Config.UpdateAutoMigrationConfigCallback): void; + + /** + * Calls UpdateAutoMigrationConfig. + * @param request UpdateAutoMigrationConfigRequest message or plain object + * @returns Promise + */ + public updateAutoMigrationConfig(request: google.cloud.config.v1.IUpdateAutoMigrationConfigRequest): Promise; } namespace Config { @@ -615,6 +643,20 @@ export namespace google { * @param [response] ResourceDrift */ type GetResourceDriftCallback = (error: (Error|null), response?: google.cloud.config.v1.ResourceDrift) => void; + + /** + * Callback as used by {@link google.cloud.config.v1.Config|getAutoMigrationConfig}. + * @param error Error, if any + * @param [response] AutoMigrationConfig + */ + type GetAutoMigrationConfigCallback = (error: (Error|null), response?: google.cloud.config.v1.AutoMigrationConfig) => void; + + /** + * Callback as used by {@link google.cloud.config.v1.Config|updateAutoMigrationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAutoMigrationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** QuotaValidation enum. */ @@ -884,7 +926,8 @@ export namespace google { DELETE_BUILD_API_FAILED = 5, DELETE_BUILD_RUN_FAILED = 6, BUCKET_CREATION_PERMISSION_DENIED = 7, - BUCKET_CREATION_FAILED = 8 + BUCKET_CREATION_FAILED = 8, + EXTERNAL_VALUE_SOURCE_IMPORT_FAILED = 10 } /** LockState enum. */ @@ -2715,7 +2758,8 @@ export namespace google { CLOUD_BUILD_PERMISSION_DENIED = 1, APPLY_BUILD_API_FAILED = 4, APPLY_BUILD_RUN_FAILED = 5, - QUOTA_VALIDATION_FAILED = 7 + QUOTA_VALIDATION_FAILED = 7, + EXTERNAL_VALUE_SOURCE_IMPORT_FAILED = 8 } } @@ -4936,7 +4980,8 @@ export namespace google { BUCKET_CREATION_FAILED = 3, DEPLOYMENT_LOCK_ACQUIRE_FAILED = 4, PREVIEW_BUILD_API_FAILED = 5, - PREVIEW_BUILD_RUN_FAILED = 6 + PREVIEW_BUILD_RUN_FAILED = 6, + EXTERNAL_VALUE_SOURCE_IMPORT_FAILED = 7 } } @@ -7951,6 +7996,315 @@ export namespace google { SERVICE_MAINTAINED = 1 } } + + /** Properties of a GetAutoMigrationConfigRequest. */ + interface IGetAutoMigrationConfigRequest { + + /** GetAutoMigrationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetAutoMigrationConfigRequest. */ + class GetAutoMigrationConfigRequest implements IGetAutoMigrationConfigRequest { + + /** + * Constructs a new GetAutoMigrationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.config.v1.IGetAutoMigrationConfigRequest); + + /** GetAutoMigrationConfigRequest name. */ + public name: string; + + /** + * Creates a new GetAutoMigrationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAutoMigrationConfigRequest instance + */ + public static create(properties?: google.cloud.config.v1.IGetAutoMigrationConfigRequest): google.cloud.config.v1.GetAutoMigrationConfigRequest; + + /** + * Encodes the specified GetAutoMigrationConfigRequest message. Does not implicitly {@link google.cloud.config.v1.GetAutoMigrationConfigRequest.verify|verify} messages. + * @param message GetAutoMigrationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.config.v1.IGetAutoMigrationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAutoMigrationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.config.v1.GetAutoMigrationConfigRequest.verify|verify} messages. + * @param message GetAutoMigrationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.config.v1.IGetAutoMigrationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAutoMigrationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.config.v1.GetAutoMigrationConfigRequest; + + /** + * Decodes a GetAutoMigrationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.config.v1.GetAutoMigrationConfigRequest; + + /** + * Verifies a GetAutoMigrationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAutoMigrationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAutoMigrationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.config.v1.GetAutoMigrationConfigRequest; + + /** + * Creates a plain object from a GetAutoMigrationConfigRequest message. Also converts values to other types if specified. + * @param message GetAutoMigrationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.config.v1.GetAutoMigrationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAutoMigrationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAutoMigrationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMigrationConfig. */ + interface IAutoMigrationConfig { + + /** AutoMigrationConfig name */ + name?: (string|null); + + /** AutoMigrationConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AutoMigrationConfig autoMigrationEnabled */ + autoMigrationEnabled?: (boolean|null); + } + + /** Represents an AutoMigrationConfig. */ + class AutoMigrationConfig implements IAutoMigrationConfig { + + /** + * Constructs a new AutoMigrationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.config.v1.IAutoMigrationConfig); + + /** AutoMigrationConfig name. */ + public name: string; + + /** AutoMigrationConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AutoMigrationConfig autoMigrationEnabled. */ + public autoMigrationEnabled: boolean; + + /** + * Creates a new AutoMigrationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMigrationConfig instance + */ + public static create(properties?: google.cloud.config.v1.IAutoMigrationConfig): google.cloud.config.v1.AutoMigrationConfig; + + /** + * Encodes the specified AutoMigrationConfig message. Does not implicitly {@link google.cloud.config.v1.AutoMigrationConfig.verify|verify} messages. + * @param message AutoMigrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.config.v1.IAutoMigrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMigrationConfig message, length delimited. Does not implicitly {@link google.cloud.config.v1.AutoMigrationConfig.verify|verify} messages. + * @param message AutoMigrationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.config.v1.IAutoMigrationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMigrationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMigrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.config.v1.AutoMigrationConfig; + + /** + * Decodes an AutoMigrationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMigrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.config.v1.AutoMigrationConfig; + + /** + * Verifies an AutoMigrationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMigrationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMigrationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.config.v1.AutoMigrationConfig; + + /** + * Creates a plain object from an AutoMigrationConfig message. Also converts values to other types if specified. + * @param message AutoMigrationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.config.v1.AutoMigrationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMigrationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMigrationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAutoMigrationConfigRequest. */ + interface IUpdateAutoMigrationConfigRequest { + + /** UpdateAutoMigrationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAutoMigrationConfigRequest autoMigrationConfig */ + autoMigrationConfig?: (google.cloud.config.v1.IAutoMigrationConfig|null); + } + + /** Represents an UpdateAutoMigrationConfigRequest. */ + class UpdateAutoMigrationConfigRequest implements IUpdateAutoMigrationConfigRequest { + + /** + * Constructs a new UpdateAutoMigrationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.config.v1.IUpdateAutoMigrationConfigRequest); + + /** UpdateAutoMigrationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAutoMigrationConfigRequest autoMigrationConfig. */ + public autoMigrationConfig?: (google.cloud.config.v1.IAutoMigrationConfig|null); + + /** + * Creates a new UpdateAutoMigrationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAutoMigrationConfigRequest instance + */ + public static create(properties?: google.cloud.config.v1.IUpdateAutoMigrationConfigRequest): google.cloud.config.v1.UpdateAutoMigrationConfigRequest; + + /** + * Encodes the specified UpdateAutoMigrationConfigRequest message. Does not implicitly {@link google.cloud.config.v1.UpdateAutoMigrationConfigRequest.verify|verify} messages. + * @param message UpdateAutoMigrationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAutoMigrationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.config.v1.UpdateAutoMigrationConfigRequest.verify|verify} messages. + * @param message UpdateAutoMigrationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAutoMigrationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.config.v1.UpdateAutoMigrationConfigRequest; + + /** + * Decodes an UpdateAutoMigrationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.config.v1.UpdateAutoMigrationConfigRequest; + + /** + * Verifies an UpdateAutoMigrationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAutoMigrationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAutoMigrationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.config.v1.UpdateAutoMigrationConfigRequest; + + /** + * Creates a plain object from an UpdateAutoMigrationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateAutoMigrationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.config.v1.UpdateAutoMigrationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAutoMigrationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAutoMigrationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } } diff --git a/packages/google-cloud-config/protos/protos.js b/packages/google-cloud-config/protos/protos.js index 5799c444444..b818a1c3234 100644 --- a/packages/google-cloud-config/protos/protos.js +++ b/packages/google-cloud-config/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -989,6 +989,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.config.v1.Config|getAutoMigrationConfig}. + * @memberof google.cloud.config.v1.Config + * @typedef GetAutoMigrationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.config.v1.AutoMigrationConfig} [response] AutoMigrationConfig + */ + + /** + * Calls GetAutoMigrationConfig. + * @function getAutoMigrationConfig + * @memberof google.cloud.config.v1.Config + * @instance + * @param {google.cloud.config.v1.IGetAutoMigrationConfigRequest} request GetAutoMigrationConfigRequest message or plain object + * @param {google.cloud.config.v1.Config.GetAutoMigrationConfigCallback} callback Node-style callback called with the error, if any, and AutoMigrationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Config.prototype.getAutoMigrationConfig = function getAutoMigrationConfig(request, callback) { + return this.rpcCall(getAutoMigrationConfig, $root.google.cloud.config.v1.GetAutoMigrationConfigRequest, $root.google.cloud.config.v1.AutoMigrationConfig, request, callback); + }, "name", { value: "GetAutoMigrationConfig" }); + + /** + * Calls GetAutoMigrationConfig. + * @function getAutoMigrationConfig + * @memberof google.cloud.config.v1.Config + * @instance + * @param {google.cloud.config.v1.IGetAutoMigrationConfigRequest} request GetAutoMigrationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.config.v1.Config|updateAutoMigrationConfig}. + * @memberof google.cloud.config.v1.Config + * @typedef UpdateAutoMigrationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAutoMigrationConfig. + * @function updateAutoMigrationConfig + * @memberof google.cloud.config.v1.Config + * @instance + * @param {google.cloud.config.v1.IUpdateAutoMigrationConfigRequest} request UpdateAutoMigrationConfigRequest message or plain object + * @param {google.cloud.config.v1.Config.UpdateAutoMigrationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Config.prototype.updateAutoMigrationConfig = function updateAutoMigrationConfig(request, callback) { + return this.rpcCall(updateAutoMigrationConfig, $root.google.cloud.config.v1.UpdateAutoMigrationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAutoMigrationConfig" }); + + /** + * Calls UpdateAutoMigrationConfig. + * @function updateAutoMigrationConfig + * @memberof google.cloud.config.v1.Config + * @instance + * @param {google.cloud.config.v1.IUpdateAutoMigrationConfigRequest} request UpdateAutoMigrationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Config; })(); @@ -1637,6 +1703,7 @@ case 6: case 7: case 8: + case 10: break; } if (message.deleteResults != null && message.hasOwnProperty("deleteResults")) { @@ -1843,6 +1910,10 @@ case 8: message.errorCode = 8; break; + case "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED": + case 10: + message.errorCode = 10; + break; } if (object.deleteResults != null) { if (typeof object.deleteResults !== "object") @@ -2126,6 +2197,7 @@ * @property {number} DELETE_BUILD_RUN_FAILED=6 DELETE_BUILD_RUN_FAILED value * @property {number} BUCKET_CREATION_PERMISSION_DENIED=7 BUCKET_CREATION_PERMISSION_DENIED value * @property {number} BUCKET_CREATION_FAILED=8 BUCKET_CREATION_FAILED value + * @property {number} EXTERNAL_VALUE_SOURCE_IMPORT_FAILED=10 EXTERNAL_VALUE_SOURCE_IMPORT_FAILED value */ Deployment.ErrorCode = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -2136,6 +2208,7 @@ values[valuesById[6] = "DELETE_BUILD_RUN_FAILED"] = 6; values[valuesById[7] = "BUCKET_CREATION_PERMISSION_DENIED"] = 7; values[valuesById[8] = "BUCKET_CREATION_FAILED"] = 8; + values[valuesById[10] = "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED"] = 10; return values; })(); @@ -6619,6 +6692,7 @@ case 4: case 5: case 7: + case 8: break; } if (message.build != null && message.hasOwnProperty("build")) @@ -6785,6 +6859,10 @@ case 7: message.errorCode = 7; break; + case "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED": + case 8: + message.errorCode = 8; + break; } if (object.build != null) message.build = String(object.build); @@ -7000,6 +7078,7 @@ * @property {number} APPLY_BUILD_API_FAILED=4 APPLY_BUILD_API_FAILED value * @property {number} APPLY_BUILD_RUN_FAILED=5 APPLY_BUILD_RUN_FAILED value * @property {number} QUOTA_VALIDATION_FAILED=7 QUOTA_VALIDATION_FAILED value + * @property {number} EXTERNAL_VALUE_SOURCE_IMPORT_FAILED=8 EXTERNAL_VALUE_SOURCE_IMPORT_FAILED value */ Revision.ErrorCode = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7008,6 +7087,7 @@ values[valuesById[4] = "APPLY_BUILD_API_FAILED"] = 4; values[valuesById[5] = "APPLY_BUILD_RUN_FAILED"] = 5; values[valuesById[7] = "QUOTA_VALIDATION_FAILED"] = 7; + values[valuesById[8] = "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED"] = 8; return values; })(); @@ -12406,6 +12486,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) { @@ -12594,6 +12675,10 @@ case 6: message.errorCode = 6; break; + case "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED": + case 7: + message.errorCode = 7; + break; } if (object.errorStatus != null) { if (typeof object.errorStatus !== "object") @@ -12821,6 +12906,7 @@ * @property {number} DEPLOYMENT_LOCK_ACQUIRE_FAILED=4 DEPLOYMENT_LOCK_ACQUIRE_FAILED value * @property {number} PREVIEW_BUILD_API_FAILED=5 PREVIEW_BUILD_API_FAILED value * @property {number} PREVIEW_BUILD_RUN_FAILED=6 PREVIEW_BUILD_RUN_FAILED value + * @property {number} EXTERNAL_VALUE_SOURCE_IMPORT_FAILED=7 EXTERNAL_VALUE_SOURCE_IMPORT_FAILED value */ Preview.ErrorCode = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -12831,6 +12917,7 @@ values[valuesById[4] = "DEPLOYMENT_LOCK_ACQUIRE_FAILED"] = 4; values[valuesById[5] = "PREVIEW_BUILD_API_FAILED"] = 5; values[valuesById[6] = "PREVIEW_BUILD_RUN_FAILED"] = 6; + values[valuesById[7] = "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED"] = 7; return values; })(); @@ -20320,6 +20407,707 @@ return ProviderConfig; })(); + v1.GetAutoMigrationConfigRequest = (function() { + + /** + * Properties of a GetAutoMigrationConfigRequest. + * @memberof google.cloud.config.v1 + * @interface IGetAutoMigrationConfigRequest + * @property {string|null} [name] GetAutoMigrationConfigRequest name + */ + + /** + * Constructs a new GetAutoMigrationConfigRequest. + * @memberof google.cloud.config.v1 + * @classdesc Represents a GetAutoMigrationConfigRequest. + * @implements IGetAutoMigrationConfigRequest + * @constructor + * @param {google.cloud.config.v1.IGetAutoMigrationConfigRequest=} [properties] Properties to set + */ + function GetAutoMigrationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAutoMigrationConfigRequest name. + * @member {string} name + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @instance + */ + GetAutoMigrationConfigRequest.prototype.name = ""; + + /** + * Creates a new GetAutoMigrationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.IGetAutoMigrationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.config.v1.GetAutoMigrationConfigRequest} GetAutoMigrationConfigRequest instance + */ + GetAutoMigrationConfigRequest.create = function create(properties) { + return new GetAutoMigrationConfigRequest(properties); + }; + + /** + * Encodes the specified GetAutoMigrationConfigRequest message. Does not implicitly {@link google.cloud.config.v1.GetAutoMigrationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.IGetAutoMigrationConfigRequest} message GetAutoMigrationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutoMigrationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAutoMigrationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.config.v1.GetAutoMigrationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.IGetAutoMigrationConfigRequest} message GetAutoMigrationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutoMigrationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAutoMigrationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.config.v1.GetAutoMigrationConfigRequest} GetAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutoMigrationConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.config.v1.GetAutoMigrationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAutoMigrationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.config.v1.GetAutoMigrationConfigRequest} GetAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutoMigrationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAutoMigrationConfigRequest message. + * @function verify + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAutoMigrationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAutoMigrationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.config.v1.GetAutoMigrationConfigRequest} GetAutoMigrationConfigRequest + */ + GetAutoMigrationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.config.v1.GetAutoMigrationConfigRequest) + return object; + var message = new $root.google.cloud.config.v1.GetAutoMigrationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAutoMigrationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.GetAutoMigrationConfigRequest} message GetAutoMigrationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAutoMigrationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAutoMigrationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetAutoMigrationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAutoMigrationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.config.v1.GetAutoMigrationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAutoMigrationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.config.v1.GetAutoMigrationConfigRequest"; + }; + + return GetAutoMigrationConfigRequest; + })(); + + v1.AutoMigrationConfig = (function() { + + /** + * Properties of an AutoMigrationConfig. + * @memberof google.cloud.config.v1 + * @interface IAutoMigrationConfig + * @property {string|null} [name] AutoMigrationConfig name + * @property {google.protobuf.ITimestamp|null} [updateTime] AutoMigrationConfig updateTime + * @property {boolean|null} [autoMigrationEnabled] AutoMigrationConfig autoMigrationEnabled + */ + + /** + * Constructs a new AutoMigrationConfig. + * @memberof google.cloud.config.v1 + * @classdesc Represents an AutoMigrationConfig. + * @implements IAutoMigrationConfig + * @constructor + * @param {google.cloud.config.v1.IAutoMigrationConfig=} [properties] Properties to set + */ + function AutoMigrationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMigrationConfig name. + * @member {string} name + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @instance + */ + AutoMigrationConfig.prototype.name = ""; + + /** + * AutoMigrationConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @instance + */ + AutoMigrationConfig.prototype.updateTime = null; + + /** + * AutoMigrationConfig autoMigrationEnabled. + * @member {boolean} autoMigrationEnabled + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @instance + */ + AutoMigrationConfig.prototype.autoMigrationEnabled = false; + + /** + * Creates a new AutoMigrationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {google.cloud.config.v1.IAutoMigrationConfig=} [properties] Properties to set + * @returns {google.cloud.config.v1.AutoMigrationConfig} AutoMigrationConfig instance + */ + AutoMigrationConfig.create = function create(properties) { + return new AutoMigrationConfig(properties); + }; + + /** + * Encodes the specified AutoMigrationConfig message. Does not implicitly {@link google.cloud.config.v1.AutoMigrationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {google.cloud.config.v1.IAutoMigrationConfig} message AutoMigrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMigrationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoMigrationEnabled != null && Object.hasOwnProperty.call(message, "autoMigrationEnabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.autoMigrationEnabled); + return writer; + }; + + /** + * Encodes the specified AutoMigrationConfig message, length delimited. Does not implicitly {@link google.cloud.config.v1.AutoMigrationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {google.cloud.config.v1.IAutoMigrationConfig} message AutoMigrationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMigrationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMigrationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.config.v1.AutoMigrationConfig} AutoMigrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMigrationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.config.v1.AutoMigrationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.autoMigrationEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMigrationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.config.v1.AutoMigrationConfig} AutoMigrationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMigrationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMigrationConfig message. + * @function verify + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMigrationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.autoMigrationEnabled != null && message.hasOwnProperty("autoMigrationEnabled")) + if (typeof message.autoMigrationEnabled !== "boolean") + return "autoMigrationEnabled: boolean expected"; + return null; + }; + + /** + * Creates an AutoMigrationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.config.v1.AutoMigrationConfig} AutoMigrationConfig + */ + AutoMigrationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.config.v1.AutoMigrationConfig) + return object; + var message = new $root.google.cloud.config.v1.AutoMigrationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.config.v1.AutoMigrationConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.autoMigrationEnabled != null) + message.autoMigrationEnabled = Boolean(object.autoMigrationEnabled); + return message; + }; + + /** + * Creates a plain object from an AutoMigrationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {google.cloud.config.v1.AutoMigrationConfig} message AutoMigrationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMigrationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + object.autoMigrationEnabled = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.autoMigrationEnabled != null && message.hasOwnProperty("autoMigrationEnabled")) + object.autoMigrationEnabled = message.autoMigrationEnabled; + return object; + }; + + /** + * Converts this AutoMigrationConfig to JSON. + * @function toJSON + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @instance + * @returns {Object.} JSON object + */ + AutoMigrationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMigrationConfig + * @function getTypeUrl + * @memberof google.cloud.config.v1.AutoMigrationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMigrationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.config.v1.AutoMigrationConfig"; + }; + + return AutoMigrationConfig; + })(); + + v1.UpdateAutoMigrationConfigRequest = (function() { + + /** + * Properties of an UpdateAutoMigrationConfigRequest. + * @memberof google.cloud.config.v1 + * @interface IUpdateAutoMigrationConfigRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAutoMigrationConfigRequest updateMask + * @property {google.cloud.config.v1.IAutoMigrationConfig|null} [autoMigrationConfig] UpdateAutoMigrationConfigRequest autoMigrationConfig + */ + + /** + * Constructs a new UpdateAutoMigrationConfigRequest. + * @memberof google.cloud.config.v1 + * @classdesc Represents an UpdateAutoMigrationConfigRequest. + * @implements IUpdateAutoMigrationConfigRequest + * @constructor + * @param {google.cloud.config.v1.IUpdateAutoMigrationConfigRequest=} [properties] Properties to set + */ + function UpdateAutoMigrationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAutoMigrationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @instance + */ + UpdateAutoMigrationConfigRequest.prototype.updateMask = null; + + /** + * UpdateAutoMigrationConfigRequest autoMigrationConfig. + * @member {google.cloud.config.v1.IAutoMigrationConfig|null|undefined} autoMigrationConfig + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @instance + */ + UpdateAutoMigrationConfigRequest.prototype.autoMigrationConfig = null; + + /** + * Creates a new UpdateAutoMigrationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.IUpdateAutoMigrationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.config.v1.UpdateAutoMigrationConfigRequest} UpdateAutoMigrationConfigRequest instance + */ + UpdateAutoMigrationConfigRequest.create = function create(properties) { + return new UpdateAutoMigrationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateAutoMigrationConfigRequest message. Does not implicitly {@link google.cloud.config.v1.UpdateAutoMigrationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.IUpdateAutoMigrationConfigRequest} message UpdateAutoMigrationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutoMigrationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoMigrationConfig != null && Object.hasOwnProperty.call(message, "autoMigrationConfig")) + $root.google.cloud.config.v1.AutoMigrationConfig.encode(message.autoMigrationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAutoMigrationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.config.v1.UpdateAutoMigrationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.IUpdateAutoMigrationConfigRequest} message UpdateAutoMigrationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutoMigrationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAutoMigrationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.config.v1.UpdateAutoMigrationConfigRequest} UpdateAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutoMigrationConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.config.v1.UpdateAutoMigrationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoMigrationConfig = $root.google.cloud.config.v1.AutoMigrationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAutoMigrationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.config.v1.UpdateAutoMigrationConfigRequest} UpdateAutoMigrationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutoMigrationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAutoMigrationConfigRequest message. + * @function verify + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAutoMigrationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.autoMigrationConfig != null && message.hasOwnProperty("autoMigrationConfig")) { + var error = $root.google.cloud.config.v1.AutoMigrationConfig.verify(message.autoMigrationConfig); + if (error) + return "autoMigrationConfig." + error; + } + return null; + }; + + /** + * Creates an UpdateAutoMigrationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.config.v1.UpdateAutoMigrationConfigRequest} UpdateAutoMigrationConfigRequest + */ + UpdateAutoMigrationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.config.v1.UpdateAutoMigrationConfigRequest) + return object; + var message = new $root.google.cloud.config.v1.UpdateAutoMigrationConfigRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.config.v1.UpdateAutoMigrationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.autoMigrationConfig != null) { + if (typeof object.autoMigrationConfig !== "object") + throw TypeError(".google.cloud.config.v1.UpdateAutoMigrationConfigRequest.autoMigrationConfig: object expected"); + message.autoMigrationConfig = $root.google.cloud.config.v1.AutoMigrationConfig.fromObject(object.autoMigrationConfig); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAutoMigrationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {google.cloud.config.v1.UpdateAutoMigrationConfigRequest} message UpdateAutoMigrationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAutoMigrationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.autoMigrationConfig = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.autoMigrationConfig != null && message.hasOwnProperty("autoMigrationConfig")) + object.autoMigrationConfig = $root.google.cloud.config.v1.AutoMigrationConfig.toObject(message.autoMigrationConfig, options); + return object; + }; + + /** + * Converts this UpdateAutoMigrationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAutoMigrationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAutoMigrationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.config.v1.UpdateAutoMigrationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAutoMigrationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"; + }; + + return UpdateAutoMigrationConfigRequest; + })(); + return v1; })(); diff --git a/packages/google-cloud-config/protos/protos.json b/packages/google-cloud-config/protos/protos.json index af62ad06368..e5bbde9c1d5 100644 --- a/packages/google-cloud-config/protos/protos.json +++ b/packages/google-cloud-config/protos/protos.json @@ -574,6 +574,52 @@ "(google.api.method_signature)": "name" } ] + }, + "GetAutoMigrationConfig": { + "requestType": "GetAutoMigrationConfigRequest", + "responseType": "AutoMigrationConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/autoMigrationConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/autoMigrationConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAutoMigrationConfig": { + "requestType": "UpdateAutoMigrationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{auto_migration_config.name=projects/*/locations/*/autoMigrationConfig}", + "(google.api.http).body": "auto_migration_config", + "(google.api.method_signature)": "auto_migration_config,update_mask", + "(google.longrunning.operation_info).response_type": "AutoMigrationConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{auto_migration_config.name=projects/*/locations/*/autoMigrationConfig}", + "body": "auto_migration_config" + } + }, + { + "(google.api.method_signature)": "auto_migration_config,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AutoMigrationConfig", + "metadata_type": "OperationMetadata" + } + } + ] } } }, @@ -818,7 +864,8 @@ "DELETE_BUILD_API_FAILED": 5, "DELETE_BUILD_RUN_FAILED": 6, "BUCKET_CREATION_PERMISSION_DENIED": 7, - "BUCKET_CREATION_FAILED": 8 + "BUCKET_CREATION_FAILED": 8, + "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED": 10 } }, "LockState": { @@ -1377,7 +1424,8 @@ "CLOUD_BUILD_PERMISSION_DENIED": 1, "APPLY_BUILD_API_FAILED": 4, "APPLY_BUILD_RUN_FAILED": 5, - "QUOTA_VALIDATION_FAILED": 7 + "QUOTA_VALIDATION_FAILED": 7, + "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED": 8 } } } @@ -2012,7 +2060,8 @@ "BUCKET_CREATION_FAILED": 3, "DEPLOYMENT_LOCK_ACQUIRE_FAILED": 4, "PREVIEW_BUILD_API_FAILED": 5, - "PREVIEW_BUILD_RUN_FAILED": 6 + "PREVIEW_BUILD_RUN_FAILED": 6, + "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED": 7 } } } @@ -2785,6 +2834,67 @@ } } } + }, + "GetAutoMigrationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "config.googleapis.com/AutoMigrationConfig" + } + } + } + }, + "AutoMigrationConfig": { + "options": { + "(google.api.resource).type": "config.googleapis.com/AutoMigrationConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/autoMigrationConfig", + "(google.api.resource).plural": "autoMigrationConfigs", + "(google.api.resource).singular": "autoMigrationConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "autoMigrationEnabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAutoMigrationConfigRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoMigrationConfig": { + "type": "AutoMigrationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } } } } diff --git a/packages/google-cloud-config/samples/generated/v1/config.create_deployment.js b/packages/google-cloud-config/samples/generated/v1/config.create_deployment.js index a6db3fec1f8..dd27af30fc1 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.create_deployment.js +++ b/packages/google-cloud-config/samples/generated/v1/config.create_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.create_preview.js b/packages/google-cloud-config/samples/generated/v1/config.create_preview.js index 021d8397bde..d5794baa2e6 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.create_preview.js +++ b/packages/google-cloud-config/samples/generated/v1/config.create_preview.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.delete_deployment.js b/packages/google-cloud-config/samples/generated/v1/config.delete_deployment.js index 5b8f52b7f83..84a517e7bde 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.delete_deployment.js +++ b/packages/google-cloud-config/samples/generated/v1/config.delete_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.delete_preview.js b/packages/google-cloud-config/samples/generated/v1/config.delete_preview.js index 3cf6a20defc..4e62f8376be 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.delete_preview.js +++ b/packages/google-cloud-config/samples/generated/v1/config.delete_preview.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.delete_statefile.js b/packages/google-cloud-config/samples/generated/v1/config.delete_statefile.js index 89365b8d9bb..801f4b27f4b 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.delete_statefile.js +++ b/packages/google-cloud-config/samples/generated/v1/config.delete_statefile.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.export_deployment_statefile.js b/packages/google-cloud-config/samples/generated/v1/config.export_deployment_statefile.js index 05f6a041264..c010a9b1c04 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.export_deployment_statefile.js +++ b/packages/google-cloud-config/samples/generated/v1/config.export_deployment_statefile.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.export_lock_info.js b/packages/google-cloud-config/samples/generated/v1/config.export_lock_info.js index 54328dbaf1e..177d9e4cce6 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.export_lock_info.js +++ b/packages/google-cloud-config/samples/generated/v1/config.export_lock_info.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.export_preview_result.js b/packages/google-cloud-config/samples/generated/v1/config.export_preview_result.js index 2044f031341..1b57cac143a 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.export_preview_result.js +++ b/packages/google-cloud-config/samples/generated/v1/config.export_preview_result.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.export_revision_statefile.js b/packages/google-cloud-config/samples/generated/v1/config.export_revision_statefile.js index ce02dff0d31..d84fafc8b72 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.export_revision_statefile.js +++ b/packages/google-cloud-config/samples/generated/v1/config.export_revision_statefile.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_auto_migration_config.js b/packages/google-cloud-config/samples/generated/v1/config.get_auto_migration_config.js new file mode 100644 index 00000000000..40ccce1fc2d --- /dev/null +++ b/packages/google-cloud-config/samples/generated/v1/config.get_auto_migration_config.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START config_v1_generated_Config_GetAutoMigrationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the AutoMigrationConfig. + * Format: + * 'projects/{project_id}/locations/{location}/AutoMigrationConfig'. + */ + // const name = 'abc123' + + // Imports the Config library + const {ConfigClient} = require('@google-cloud/config').v1; + + // Instantiates a client + const configClient = new ConfigClient(); + + async function callGetAutoMigrationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await configClient.getAutoMigrationConfig(request); + console.log(response); + } + + callGetAutoMigrationConfig(); + // [END config_v1_generated_Config_GetAutoMigrationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_deployment.js b/packages/google-cloud-config/samples/generated/v1/config.get_deployment.js index 2ccdb82b20a..ee6136e7cfc 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_deployment.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_preview.js b/packages/google-cloud-config/samples/generated/v1/config.get_preview.js index 9f1a63dc35c..b09e7592be3 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_preview.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_preview.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_resource.js b/packages/google-cloud-config/samples/generated/v1/config.get_resource.js index b9529c522ec..9bd42763798 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_resource.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_resource.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_resource_change.js b/packages/google-cloud-config/samples/generated/v1/config.get_resource_change.js index 987dd8ff8c8..6e0f19df635 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_resource_change.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_resource_change.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_resource_drift.js b/packages/google-cloud-config/samples/generated/v1/config.get_resource_drift.js index 882c274c894..8c9ef3b5a9e 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_resource_drift.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_resource_drift.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_revision.js b/packages/google-cloud-config/samples/generated/v1/config.get_revision.js index 4dd6fe90504..0e90690afe6 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_revision.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_revision.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.get_terraform_version.js b/packages/google-cloud-config/samples/generated/v1/config.get_terraform_version.js index d0c80efd295..b8afed8589b 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.get_terraform_version.js +++ b/packages/google-cloud-config/samples/generated/v1/config.get_terraform_version.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.import_statefile.js b/packages/google-cloud-config/samples/generated/v1/config.import_statefile.js index bb65383ad1e..cc21a501e90 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.import_statefile.js +++ b/packages/google-cloud-config/samples/generated/v1/config.import_statefile.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_deployments.js b/packages/google-cloud-config/samples/generated/v1/config.list_deployments.js index 37b32053fb2..110414edd52 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_deployments.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_deployments.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_previews.js b/packages/google-cloud-config/samples/generated/v1/config.list_previews.js index 934928250f8..5003a95b2e6 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_previews.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_previews.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_resource_changes.js b/packages/google-cloud-config/samples/generated/v1/config.list_resource_changes.js index d21ea45a19c..7cbbfca0c85 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_resource_changes.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_resource_changes.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_resource_drifts.js b/packages/google-cloud-config/samples/generated/v1/config.list_resource_drifts.js index 81ed178228d..7ace24aad25 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_resource_drifts.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_resource_drifts.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_resources.js b/packages/google-cloud-config/samples/generated/v1/config.list_resources.js index cf73f5c4386..c66734c42d2 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_resources.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_resources.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_revisions.js b/packages/google-cloud-config/samples/generated/v1/config.list_revisions.js index edbd2c3cc99..34e18f6d4c6 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_revisions.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_revisions.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js b/packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js index 837f1f9f588..1f0d2b40a0f 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js +++ b/packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js b/packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js index 57b27dae450..1f8dabc4255 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js +++ b/packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js b/packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js index 5f1ec2e1d99..0a70fa290e1 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js +++ b/packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/config.update_auto_migration_config.js b/packages/google-cloud-config/samples/generated/v1/config.update_auto_migration_config.js new file mode 100644 index 00000000000..469f0f8519d --- /dev/null +++ b/packages/google-cloud-config/samples/generated/v1/config.update_auto_migration_config.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(autoMigrationConfig) { + // [START config_v1_generated_Config_UpdateAutoMigrationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The update mask applies to the resource. See + * google.protobuf.FieldMask google.protobuf.FieldMask. + */ + // const updateMask = {} + /** + * Required. The AutoMigrationConfig to update. + */ + // const autoMigrationConfig = {} + + // Imports the Config library + const {ConfigClient} = require('@google-cloud/config').v1; + + // Instantiates a client + const configClient = new ConfigClient(); + + async function callUpdateAutoMigrationConfig() { + // Construct request + const request = { + autoMigrationConfig, + }; + + // Run request + const [operation] = await configClient.updateAutoMigrationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAutoMigrationConfig(); + // [END config_v1_generated_Config_UpdateAutoMigrationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-config/samples/generated/v1/config.update_deployment.js b/packages/google-cloud-config/samples/generated/v1/config.update_deployment.js index afde24383a5..dacf8c07d91 100644 --- a/packages/google-cloud-config/samples/generated/v1/config.update_deployment.js +++ b/packages/google-cloud-config/samples/generated/v1/config.update_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json b/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json index d02d3b55417..ab843bf1d64 100644 --- a/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json +++ b/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json @@ -1270,6 +1270,90 @@ } } } + }, + { + "regionTag": "config_v1_generated_Config_GetAutoMigrationConfig_async", + "title": "Config getAutoMigrationConfig Sample", + "origin": "API_DEFINITION", + "description": " Get the AutoMigrationConfig for a given project and location.", + "canonical": true, + "file": "config.get_auto_migration_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAutoMigrationConfig", + "fullName": "google.cloud.config.v1.Config.GetAutoMigrationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.config.v1.AutoMigrationConfig", + "client": { + "shortName": "ConfigClient", + "fullName": "google.cloud.config.v1.ConfigClient" + }, + "method": { + "shortName": "GetAutoMigrationConfig", + "fullName": "google.cloud.config.v1.Config.GetAutoMigrationConfig", + "service": { + "shortName": "Config", + "fullName": "google.cloud.config.v1.Config" + } + } + } + }, + { + "regionTag": "config_v1_generated_Config_UpdateAutoMigrationConfig_async", + "title": "Config updateAutoMigrationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the AutoMigrationConfig for a given project and location.", + "canonical": true, + "file": "config.update_auto_migration_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAutoMigrationConfig", + "fullName": "google.cloud.config.v1.Config.UpdateAutoMigrationConfig", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "auto_migration_config", + "type": ".google.cloud.config.v1.AutoMigrationConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConfigClient", + "fullName": "google.cloud.config.v1.ConfigClient" + }, + "method": { + "shortName": "UpdateAutoMigrationConfig", + "fullName": "google.cloud.config.v1.Config.UpdateAutoMigrationConfig", + "service": { + "shortName": "Config", + "fullName": "google.cloud.config.v1.Config" + } + } + } } ] } diff --git a/packages/google-cloud-config/src/v1/config_client.ts b/packages/google-cloud-config/src/v1/config_client.ts index e80841b7188..db62f4c8f86 100644 --- a/packages/google-cloud-config/src/v1/config_client.ts +++ b/packages/google-cloud-config/src/v1/config_client.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -188,6 +188,9 @@ export class ConfigClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + autoMigrationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoMigrationConfig' + ), deploymentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/deployments/{deployment}' ), @@ -281,6 +284,10 @@ export class ConfigClient { '.google.cloud.config.v1.Preview') as gax.protobuf.Type; const deletePreviewMetadata = protoFilesRoot.lookup( '.google.cloud.config.v1.OperationMetadata') as gax.protobuf.Type; + const updateAutoMigrationConfigResponse = protoFilesRoot.lookup( + '.google.cloud.config.v1.AutoMigrationConfig') as gax.protobuf.Type; + const updateAutoMigrationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.config.v1.OperationMetadata') as gax.protobuf.Type; this.descriptors.longrunning = { createDeployment: new this._gaxModule.LongrunningDescriptor( @@ -310,7 +317,11 @@ export class ConfigClient { deletePreview: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deletePreviewResponse.decode.bind(deletePreviewResponse), - deletePreviewMetadata.decode.bind(deletePreviewMetadata)) + deletePreviewMetadata.decode.bind(deletePreviewMetadata)), + updateAutoMigrationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAutoMigrationConfigResponse.decode.bind(updateAutoMigrationConfigResponse), + updateAutoMigrationConfigMetadata.decode.bind(updateAutoMigrationConfigMetadata)) }; // Put together the default options sent with requests. @@ -356,7 +367,7 @@ export class ConfigClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const configStubMethods = - ['listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listRevisions', 'getRevision', 'getResource', 'listResources', 'exportDeploymentStatefile', 'exportRevisionStatefile', 'importStatefile', 'deleteStatefile', 'lockDeployment', 'unlockDeployment', 'exportLockInfo', 'createPreview', 'getPreview', 'listPreviews', 'deletePreview', 'exportPreviewResult', 'listTerraformVersions', 'getTerraformVersion', 'listResourceChanges', 'getResourceChange', 'listResourceDrifts', 'getResourceDrift']; + ['listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listRevisions', 'getRevision', 'getResource', 'listResources', 'exportDeploymentStatefile', 'exportRevisionStatefile', 'importStatefile', 'deleteStatefile', 'lockDeployment', 'unlockDeployment', 'exportLockInfo', 'createPreview', 'getPreview', 'listPreviews', 'deletePreview', 'exportPreviewResult', 'listTerraformVersions', 'getTerraformVersion', 'listResourceChanges', 'getResourceChange', 'listResourceDrifts', 'getResourceDrift', 'getAutoMigrationConfig', 'updateAutoMigrationConfig']; for (const methodName of configStubMethods) { const callPromise = this.configStub.then( stub => (...args: Array<{}>) => { @@ -1716,6 +1727,102 @@ export class ConfigClient { throw error; }); } +/** + * Get the AutoMigrationConfig for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the AutoMigrationConfig. + * Format: + * 'projects/{project_id}/locations/{location}/AutoMigrationConfig'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.config.v1.AutoMigrationConfig|AutoMigrationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/config.get_auto_migration_config.js + * region_tag:config_v1_generated_Config_GetAutoMigrationConfig_async + */ + getAutoMigrationConfig( + request?: protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|undefined, {}|undefined + ]>; + getAutoMigrationConfig( + request: protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|null|undefined, + {}|null|undefined>): void; + getAutoMigrationConfig( + request: protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest, + callback: Callback< + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|null|undefined, + {}|null|undefined>): void; + getAutoMigrationConfig( + request?: protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getAutoMigrationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAutoMigrationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAutoMigrationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.config.v1.IAutoMigrationConfig, + protos.google.cloud.config.v1.IGetAutoMigrationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAutoMigrationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } /** * Creates a {@link protos.google.cloud.config.v1.Deployment|Deployment}. @@ -2572,6 +2679,116 @@ export class ConfigClient { const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePreview, this._gaxModule.createDefaultBackoffSettings()); return decodeOperation as LROperation; } +/** + * Updates the AutoMigrationConfig for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The update mask applies to the resource. See + * {@link protos.google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {google.cloud.config.v1.AutoMigrationConfig} request.autoMigrationConfig + * Required. The AutoMigrationConfig to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/config.update_auto_migration_config.js + * region_tag:config_v1_generated_Config_UpdateAutoMigrationConfig_async + */ + updateAutoMigrationConfig( + request?: protos.google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateAutoMigrationConfig( + request: protos.google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateAutoMigrationConfig( + request: protos.google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateAutoMigrationConfig( + request?: protos.google.cloud.config.v1.IUpdateAutoMigrationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'auto_migration_config.name': request.autoMigrationConfig!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAutoMigrationConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAutoMigrationConfig request %j', request); + return this.innerApiCalls.updateAutoMigrationConfig(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateAutoMigrationConfig response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateAutoMigrationConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/config.update_auto_migration_config.js + * region_tag:config_v1_generated_Config_UpdateAutoMigrationConfig_async + */ + async checkUpdateAutoMigrationConfigProgress(name: string): Promise>{ + this._log.info('updateAutoMigrationConfig long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateAutoMigrationConfig, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } /** * Lists {@link protos.google.cloud.config.v1.Deployment|Deployment}s in a given project * and location. @@ -4869,6 +5086,42 @@ export class ConfigClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified autoMigrationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + autoMigrationConfigPath(project:string,location:string) { + return this.pathTemplates.autoMigrationConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from AutoMigrationConfig resource. + * + * @param {string} autoMigrationConfigName + * A fully-qualified path representing AutoMigrationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAutoMigrationConfigName(autoMigrationConfigName: string) { + return this.pathTemplates.autoMigrationConfigPathTemplate.match(autoMigrationConfigName).project; + } + + /** + * Parse the location from AutoMigrationConfig resource. + * + * @param {string} autoMigrationConfigName + * A fully-qualified path representing AutoMigrationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAutoMigrationConfigName(autoMigrationConfigName: string) { + return this.pathTemplates.autoMigrationConfigPathTemplate.match(autoMigrationConfigName).location; + } + /** * Return a fully-qualified deployment resource name string. * diff --git a/packages/google-cloud-config/src/v1/config_client_config.json b/packages/google-cloud-config/src/v1/config_client_config.json index 727ab8bb564..5ea0334b5ba 100644 --- a/packages/google-cloud-config/src/v1/config_client_config.json +++ b/packages/google-cloud-config/src/v1/config_client_config.json @@ -166,6 +166,16 @@ "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetAutoMigrationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateAutoMigrationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-config/src/v1/gapic_metadata.json b/packages/google-cloud-config/src/v1/gapic_metadata.json index f08a6825daa..171a745b9e1 100644 --- a/packages/google-cloud-config/src/v1/gapic_metadata.json +++ b/packages/google-cloud-config/src/v1/gapic_metadata.json @@ -75,6 +75,11 @@ "getResourceDrift" ] }, + "GetAutoMigrationConfig": { + "methods": [ + "getAutoMigrationConfig" + ] + }, "CreateDeployment": { "methods": [ "createDeployment" @@ -110,6 +115,11 @@ "deletePreview" ] }, + "UpdateAutoMigrationConfig": { + "methods": [ + "updateAutoMigrationConfig" + ] + }, "ListDeployments": { "methods": [ "listDeployments", @@ -229,6 +239,11 @@ "getResourceDrift" ] }, + "GetAutoMigrationConfig": { + "methods": [ + "getAutoMigrationConfig" + ] + }, "CreateDeployment": { "methods": [ "createDeployment" @@ -264,6 +279,11 @@ "deletePreview" ] }, + "UpdateAutoMigrationConfig": { + "methods": [ + "updateAutoMigrationConfig" + ] + }, "ListDeployments": { "methods": [ "listDeployments", diff --git a/packages/google-cloud-config/src/v1/index.ts b/packages/google-cloud-config/src/v1/index.ts index 17dc3f59c4f..1e486407673 100644 --- a/packages/google-cloud-config/src/v1/index.ts +++ b/packages/google-cloud-config/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/system-test/fixtures/sample/src/index.js b/packages/google-cloud-config/system-test/fixtures/sample/src/index.js index bd44ff32a33..50af44d34cf 100644 --- a/packages/google-cloud-config/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-config/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-config/system-test/fixtures/sample/src/index.ts index 3e46c1416cc..273682dac59 100644 --- a/packages/google-cloud-config/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-config/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/system-test/install.ts b/packages/google-cloud-config/system-test/install.ts index 2a505d6df0c..394f3362d20 100644 --- a/packages/google-cloud-config/system-test/install.ts +++ b/packages/google-cloud-config/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-config/test/gapic_config_v1.ts b/packages/google-cloud-config/test/gapic_config_v1.ts index 73c8e89257a..893be72024a 100644 --- a/packages/google-cloud-config/test/gapic_config_v1.ts +++ b/packages/google-cloud-config/test/gapic_config_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1679,6 +1679,114 @@ describe('v1.ConfigClient', () => { }); }); + describe('getAutoMigrationConfig', () => { + it('invokes getAutoMigrationConfig without error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.GetAutoMigrationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.GetAutoMigrationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.config.v1.AutoMigrationConfig() + ); + client.innerApiCalls.getAutoMigrationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getAutoMigrationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutoMigrationConfig without error using callback', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.GetAutoMigrationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.GetAutoMigrationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.config.v1.AutoMigrationConfig() + ); + client.innerApiCalls.getAutoMigrationConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAutoMigrationConfig( + request, + (err?: Error|null, result?: protos.google.cloud.config.v1.IAutoMigrationConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutoMigrationConfig with error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.GetAutoMigrationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.GetAutoMigrationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAutoMigrationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAutoMigrationConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutoMigrationConfig with closed client', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.GetAutoMigrationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.GetAutoMigrationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAutoMigrationConfig(request), expectedError); + }); + }); + describe('createDeployment', () => { it('invokes createDeployment without error', async () => { const client = new configModule.v1.ConfigClient({ @@ -2761,6 +2869,164 @@ describe('v1.ConfigClient', () => { }); }); + describe('updateAutoMigrationConfig', () => { + it('invokes updateAutoMigrationConfig without error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.UpdateAutoMigrationConfigRequest() + ); + request.autoMigrationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.UpdateAutoMigrationConfigRequest', ['autoMigrationConfig', 'name']); + request.autoMigrationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `auto_migration_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAutoMigrationConfig = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAutoMigrationConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutoMigrationConfig without error using callback', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.UpdateAutoMigrationConfigRequest() + ); + request.autoMigrationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.UpdateAutoMigrationConfigRequest', ['autoMigrationConfig', 'name']); + request.autoMigrationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `auto_migration_config.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAutoMigrationConfig = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAutoMigrationConfig( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutoMigrationConfig with call error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.UpdateAutoMigrationConfigRequest() + ); + request.autoMigrationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.UpdateAutoMigrationConfigRequest', ['autoMigrationConfig', 'name']); + request.autoMigrationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `auto_migration_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAutoMigrationConfig = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateAutoMigrationConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutoMigrationConfig with LRO error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.config.v1.UpdateAutoMigrationConfigRequest() + ); + request.autoMigrationConfig ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.config.v1.UpdateAutoMigrationConfigRequest', ['autoMigrationConfig', 'name']); + request.autoMigrationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `auto_migration_config.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAutoMigrationConfig = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateAutoMigrationConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoMigrationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAutoMigrationConfigProgress without error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAutoMigrationConfigProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAutoMigrationConfigProgress with error', async () => { + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateAutoMigrationConfigProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('listDeployments', () => { it('invokes listDeployments without error', async () => { const client = new configModule.v1.ConfigClient({ @@ -5175,6 +5441,44 @@ describe('v1.ConfigClient', () => { describe('Path templates', () => { + describe('autoMigrationConfig', async () => { + const fakePath = "/rendered/path/autoMigrationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new configModule.v1.ConfigClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.autoMigrationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.autoMigrationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('autoMigrationConfigPath', () => { + const result = client.autoMigrationConfigPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.autoMigrationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAutoMigrationConfigName', () => { + const result = client.matchProjectFromAutoMigrationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.autoMigrationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAutoMigrationConfigName', () => { + const result = client.matchLocationFromAutoMigrationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.autoMigrationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('deployment', async () => { const fakePath = "/rendered/path/deployment"; const expectedParameters = {