Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [retail] fix the HTTP format for merchant center link service #4183

Merged
merged 3 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,12 @@ service MerchantCenterAccountLinkService {
option (google.api.method_signature) = "parent";
}

// Creates a MerchantCenterAccountLink.
//
// [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
// cannot be set to a different oneof field, if so an INVALID_ARGUMENT is
// returned.
// Creates a
// [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
rpc CreateMerchantCenterAccountLink(CreateMerchantCenterAccountLinkRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2alpha/{merchant_center_account_link.name=projects/*/locations/*/catalogs/*/merchantCenterAccountLinks/*}"
post: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/merchantCenterAccountLinks"
body: "merchant_center_account_link"
};
option (google.api.method_signature) =
Expand All @@ -69,7 +66,8 @@ service MerchantCenterAccountLinkService {
};
}

// Deletes a MerchantCenterAccountLink.
// Deletes a
// [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
// If the
// [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
// to delete does not exist, a NOT_FOUND error is returned.
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-retail/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-retail",
"version": "2.3.1",
"version": "2.4.0",
"language": "TYPESCRIPT",
"apis": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-retail",
"version": "2.3.1",
"version": "2.4.0",
"language": "TYPESCRIPT",
"apis": [
{
Expand Down Expand Up @@ -931,7 +931,7 @@
"regionTag": "retail_v2alpha_generated_MerchantCenterAccountLinkService_CreateMerchantCenterAccountLink_async",
"title": "CatalogService createMerchantCenterAccountLink Sample",
"origin": "API_DEFINITION",
"description": " Creates a MerchantCenterAccountLink. [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned.",
"description": " Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].",
"canonical": true,
"file": "merchant_center_account_link_service.create_merchant_center_account_link.js",
"language": "JAVASCRIPT",
Expand Down Expand Up @@ -975,7 +975,7 @@
"regionTag": "retail_v2alpha_generated_MerchantCenterAccountLinkService_DeleteMerchantCenterAccountLink_async",
"title": "CatalogService deleteMerchantCenterAccountLink Sample",
"origin": "API_DEFINITION",
"description": " Deletes a MerchantCenterAccountLink. If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete does not exist, a NOT_FOUND error is returned.",
"description": " Deletes a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]. If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete does not exist, a NOT_FOUND error is returned.",
"canonical": true,
"file": "merchant_center_account_link_service.delete_merchant_center_account_link.js",
"language": "JAVASCRIPT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-retail",
"version": "2.3.1",
"version": "2.4.0",
"language": "TYPESCRIPT",
"apis": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ export class MerchantCenterAccountLinkServiceClient {
);
}
/**
* Deletes a MerchantCenterAccountLink.
* Deletes a
* {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink|MerchantCenterAccountLink}.
* If the
* {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink|MerchantCenterAccountLink}
* to delete does not exist, a NOT_FOUND error is returned.
Expand Down Expand Up @@ -620,11 +621,8 @@ export class MerchantCenterAccountLinkServiceClient {
}

/**
* Creates a MerchantCenterAccountLink.
*
* {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink|MerchantCenterAccountLink}
* cannot be set to a different oneof field, if so an INVALID_ARGUMENT is
* returned.
* Creates a
* {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink|MerchantCenterAccountLink}.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -732,8 +730,7 @@ export class MerchantCenterAccountLinkServiceClient {
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] =
this._gaxModule.routingHeader.fromParams({
'merchant_center_account_link.name':
request.merchantCenterAccountLink!.name ?? '',
parent: request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.createMerchantCenterAccountLink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,12 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => {
const request = generateSampleMessage(
new protos.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest()
);
request.merchantCenterAccountLink ??= {};
const defaultValue1 = getTypeDefaultValue(
'.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest',
['merchantCenterAccountLink', 'name']
['parent']
);
request.merchantCenterAccountLink.name = defaultValue1;
const expectedHeaderRequestParams = `merchant_center_account_link.name=${defaultValue1}`;
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedResponse = generateSampleMessage(
new protos.google.longrunning.Operation()
);
Expand Down Expand Up @@ -601,13 +600,12 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => {
const request = generateSampleMessage(
new protos.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest()
);
request.merchantCenterAccountLink ??= {};
const defaultValue1 = getTypeDefaultValue(
'.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest',
['merchantCenterAccountLink', 'name']
['parent']
);
request.merchantCenterAccountLink.name = defaultValue1;
const expectedHeaderRequestParams = `merchant_center_account_link.name=${defaultValue1}`;
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedResponse = generateSampleMessage(
new protos.google.longrunning.Operation()
);
Expand Down Expand Up @@ -659,13 +657,12 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => {
const request = generateSampleMessage(
new protos.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest()
);
request.merchantCenterAccountLink ??= {};
const defaultValue1 = getTypeDefaultValue(
'.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest',
['merchantCenterAccountLink', 'name']
['parent']
);
request.merchantCenterAccountLink.name = defaultValue1;
const expectedHeaderRequestParams = `merchant_center_account_link.name=${defaultValue1}`;
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedError = new Error('expected');
client.innerApiCalls.createMerchantCenterAccountLink =
stubLongRunningCall(undefined, expectedError);
Expand Down Expand Up @@ -695,13 +692,12 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => {
const request = generateSampleMessage(
new protos.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest()
);
request.merchantCenterAccountLink ??= {};
const defaultValue1 = getTypeDefaultValue(
'.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest',
['merchantCenterAccountLink', 'name']
['parent']
);
request.merchantCenterAccountLink.name = defaultValue1;
const expectedHeaderRequestParams = `merchant_center_account_link.name=${defaultValue1}`;
request.parent = defaultValue1;
const expectedHeaderRequestParams = `parent=${defaultValue1}`;
const expectedError = new Error('expected');
client.innerApiCalls.createMerchantCenterAccountLink =
stubLongRunningCall(undefined, undefined, expectedError);
Expand Down