Skip to content

Commit

Permalink
feat: [Many APIs] add several fields to manage state of database encr…
Browse files Browse the repository at this point in the history
…yption update (#5189)

* feat: add several fields to manage state of database encryption update

PiperOrigin-RevId: 619289281

Source-Link: googleapis/googleapis@3a7c334

Source-Link: googleapis/googleapis-gen@6a8c733
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZW11bHRpY2xvdWQvLk93bEJvdC55YW1sIiwiaCI6IjZhOGM3MzMwNjJkODMzZDExYzUyNDVlZGE1MGY1MTA4ZTBlNTUzMjQifQ==
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdzdWl0ZWFkZG9ucy8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhcC8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlkcy8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlvdC8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy1pbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6IjZhOGM3MzMwNjJkODMzZDExYzUyNDVlZGE1MGY1MTA4ZTBlNTUzMjQifQ==
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy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CJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldGFwcC8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmtjb25uZWN0aXZpdHkvLk93bEJvdC55YW1sIiwiaCI6IjZhOGM3MzMwNjJkODMzZDExYzUyNDVlZGE1MGY1MTA4ZTBlNTUzMjQifQ==
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmttYW5hZ2VtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI2YThjNzMzMDYyZDgzM2QxMWM1MjQ1ZWRhNTBmNTEwOGUwZTU1MzI0In0=
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmtzZWN1cml0eS8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmtzZXJ2aWNlcy8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5vdGVib29rcy8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Mar 29, 2024
1 parent 1952fbe commit 64b5a75
Show file tree
Hide file tree
Showing 141 changed files with 70,751 additions and 4,623 deletions.
786 changes: 770 additions & 16 deletions packages/google-cloud-gkemulticloud/protos/protos.d.ts

Large diffs are not rendered by default.

3,012 changes: 2,853 additions & 159 deletions packages/google-cloud-gkemulticloud/protos/protos.js

Large diffs are not rendered by default.

366 changes: 349 additions & 17 deletions packages/google-cloud-gkemulticloud/protos/protos.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,15 @@ export class AttachedClustersClient {
'Please set either universe_domain or universeDomain, but not both.'
);
}
const universeDomainEnvVar =
typeof process === 'object' && typeof process.env === 'object'
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
: undefined;
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'gkemulticloud.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
Expand Down Expand Up @@ -174,7 +181,7 @@ export class AttachedClustersClient {

// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process !== 'undefined' && 'versions' in process) {
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
Expand Down Expand Up @@ -428,7 +435,7 @@ export class AttachedClustersClient {
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand All @@ -446,7 +453,7 @@ export class AttachedClustersClient {
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand Down
15 changes: 11 additions & 4 deletions packages/google-cloud-gkemulticloud/src/v1/aws_clusters_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ export class AwsClustersClient {
'Please set either universe_domain or universeDomain, but not both.'
);
}
const universeDomainEnvVar =
typeof process === 'object' && typeof process.env === 'object'
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
: undefined;
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'gkemulticloud.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
Expand Down Expand Up @@ -173,7 +180,7 @@ export class AwsClustersClient {

// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process !== 'undefined' && 'versions' in process) {
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
Expand Down Expand Up @@ -468,7 +475,7 @@ export class AwsClustersClient {
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand All @@ -486,7 +493,7 @@ export class AwsClustersClient {
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ export class AzureClustersClient {
'Please set either universe_domain or universeDomain, but not both.'
);
}
const universeDomainEnvVar =
typeof process === 'object' && typeof process.env === 'object'
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
: undefined;
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'gkemulticloud.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
Expand Down Expand Up @@ -173,7 +180,7 @@ export class AzureClustersClient {

// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process !== 'undefined' && 'versions' in process) {
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
Expand Down Expand Up @@ -483,7 +490,7 @@ export class AzureClustersClient {
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand All @@ -501,7 +508,7 @@ export class AzureClustersClient {
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('v1.AttachedClustersClient', () => {
});

if (
typeof process !== 'undefined' &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
it('throws DeprecationWarning if static servicePath is used', () => {
Expand Down Expand Up @@ -210,6 +210,41 @@ describe('v1.AttachedClustersClient', () => {
const servicePath = client.apiEndpoint;
assert.strictEqual(servicePath, 'gkemulticloud.example.com');
});

if (typeof process === 'object' && 'env' in process) {
describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => {
it('sets apiEndpoint from environment variable', () => {
const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com';
const client = new attachedclustersModule.v1.AttachedClustersClient();
const servicePath = client.apiEndpoint;
assert.strictEqual(servicePath, 'gkemulticloud.example.com');
if (saved) {
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved;
} else {
delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
}
});

it('value configured in code has priority over environment variable', () => {
const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com';
const client = new attachedclustersModule.v1.AttachedClustersClient({
universeDomain: 'configured.example.com',
});
const servicePath = client.apiEndpoint;
assert.strictEqual(
servicePath,
'gkemulticloud.configured.example.com'
);
if (saved) {
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved;
} else {
delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
}
});
});
}
it('does not allow setting both universeDomain and universe_domain', () => {
assert.throws(() => {
new attachedclustersModule.v1.AttachedClustersClient({
Expand Down Expand Up @@ -1823,9 +1858,9 @@ describe('v1.AttachedClustersClient', () => {
assert(
(client.descriptors.page.listAttachedClusters.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1873,9 +1908,9 @@ describe('v1.AttachedClustersClient', () => {
assert(
(client.descriptors.page.listAttachedClusters.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1923,9 +1958,9 @@ describe('v1.AttachedClustersClient', () => {
assert(
(client.descriptors.page.listAttachedClusters.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -1964,9 +1999,9 @@ describe('v1.AttachedClustersClient', () => {
assert(
(client.descriptors.page.listAttachedClusters.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down
85 changes: 60 additions & 25 deletions packages/google-cloud-gkemulticloud/test/gapic_aws_clusters_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('v1.AwsClustersClient', () => {
});

if (
typeof process !== 'undefined' &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
it('throws DeprecationWarning if static servicePath is used', () => {
Expand Down Expand Up @@ -208,6 +208,41 @@ describe('v1.AwsClustersClient', () => {
const servicePath = client.apiEndpoint;
assert.strictEqual(servicePath, 'gkemulticloud.example.com');
});

if (typeof process === 'object' && 'env' in process) {
describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => {
it('sets apiEndpoint from environment variable', () => {
const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com';
const client = new awsclustersModule.v1.AwsClustersClient();
const servicePath = client.apiEndpoint;
assert.strictEqual(servicePath, 'gkemulticloud.example.com');
if (saved) {
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved;
} else {
delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
}
});

it('value configured in code has priority over environment variable', () => {
const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com';
const client = new awsclustersModule.v1.AwsClustersClient({
universeDomain: 'configured.example.com',
});
const servicePath = client.apiEndpoint;
assert.strictEqual(
servicePath,
'gkemulticloud.configured.example.com'
);
if (saved) {
process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved;
} else {
delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'];
}
});
});
}
it('does not allow setting both universeDomain and universe_domain', () => {
assert.throws(() => {
new awsclustersModule.v1.AwsClustersClient({
Expand Down Expand Up @@ -2779,9 +2814,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsClusters.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -2828,9 +2863,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsClusters.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -2877,9 +2912,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsClusters.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -2918,9 +2953,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsClusters.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down Expand Up @@ -3106,9 +3141,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsNodePools.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -3156,9 +3191,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsNodePools.createStream as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -3205,9 +3240,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsNodePools.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});

Expand Down Expand Up @@ -3246,9 +3281,9 @@ describe('v1.AwsClustersClient', () => {
assert(
(client.descriptors.page.listAwsNodePools.asyncIterate as SinonStub)
.getCall(0)
.args[2].otherArgs.headers['x-goog-request-params'].includes(
expectedHeaderRequestParams
)
.args[2].otherArgs.headers[
'x-goog-request-params'
].includes(expectedHeaderRequestParams)
);
});
});
Expand Down
Loading

0 comments on commit 64b5a75

Please sign in to comment.