diff --git a/protos/google/datastore/v1/entity.proto b/protos/google/datastore/v1/entity.proto index befbcd7b6..55d7b64fe 100644 --- a/protos/google/datastore/v1/entity.proto +++ b/protos/google/datastore/v1/entity.proto @@ -66,22 +66,33 @@ message Key { // If neither is set, the element is incomplete. message PathElement { // The kind of the entity. + // // A kind matching regex `__.*__` is reserved/read-only. // A kind must not contain more than 1500 bytes when UTF-8 encoded. // Cannot be `""`. + // + // Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + // encoded as `__bytes__` where `` is the base-64 encoding of the + // bytes. string kind = 1; // The type of ID. oneof id_type { // The auto-allocated ID of the entity. + // // Never equal to zero. Values less than zero are discouraged and may not // be supported in the future. int64 id = 2; // The name of the entity. + // // A name matching regex `__.*__` is reserved/read-only. // A name must not be more than 1500 bytes when UTF-8 encoded. // Cannot be `""`. + // + // Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + // encoded as `__bytes__` where `` is the base-64 encoding of the + // bytes. string name = 3; } } diff --git a/src/v1/datastore_admin_client.ts b/src/v1/datastore_admin_client.ts index 3b2d07357..a636e5f57 100644 --- a/src/v1/datastore_admin_client.ts +++ b/src/v1/datastore_admin_client.ts @@ -517,6 +517,7 @@ export class DatastoreAdminClient { options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + index_id: request.indexId || '', }); this.initialize(); return this.innerApiCalls.getIndex(request, options, callback); @@ -1114,6 +1115,7 @@ export class DatastoreAdminClient { options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ project_id: request.projectId || '', + index_id: request.indexId || '', }); this.initialize(); return this.innerApiCalls.deleteIndex(request, options, callback); diff --git a/test/gapic_datastore_admin_v1.ts b/test/gapic_datastore_admin_v1.ts index ae17a3512..122789d41 100644 --- a/test/gapic_datastore_admin_v1.ts +++ b/test/gapic_datastore_admin_v1.ts @@ -253,7 +253,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.GetIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: { @@ -284,7 +285,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.GetIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: { @@ -331,7 +333,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.GetIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: { @@ -359,6 +362,7 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.GetIndexRequest() ); request.projectId = ''; + request.indexId = ''; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIndex(request), expectedError); @@ -954,7 +958,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.DeleteIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: { @@ -986,7 +991,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.DeleteIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: { @@ -1040,7 +1046,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.DeleteIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: { @@ -1071,7 +1078,8 @@ describe('v1.DatastoreAdminClient', () => { new protos.google.datastore.admin.v1.DeleteIndexRequest() ); request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; + request.indexId = ''; + const expectedHeaderRequestParams = 'project_id=&index_id='; const expectedOptions = { otherArgs: { headers: {