Skip to content

Commit 33a255c

Browse files
Google APIscopybara-github
authored andcommitted
feat: updated comments for returns sub-API publication
docs: A comment for service `OnlineReturnPolicyService` is changed docs: A comment for method `GetOnlineReturnPolicy` in service `OnlineReturnPolicyService` is changed docs: A comment for method `ListOnlineReturnPolicies` in service `OnlineReturnPolicyService` is changed docs: A comment for field `parent` in message `.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest` is changed docs: A comment for field `policy` in message `.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy` is changed docs: A comment for field `restocking_fee` in message `.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy` is changed docs: A comment for field `return_methods` in message `.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy` is changed docs: A comment for field `item_conditions` in message `.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy` is changed docs: A comment for field `return_shipping_fee` in message `.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy` is changed PiperOrigin-RevId: 758512860
1 parent 8a3ddf0 commit 33a255c

1 file changed

Lines changed: 109 additions & 18 deletions

File tree

google/shopping/merchant/accounts/v1beta/online_return_policy.proto

Lines changed: 109 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/protobuf/empty.proto";
24+
import "google/protobuf/field_mask.proto";
2325
import "google/shopping/type/types.proto";
2426
import "google/type/date.proto";
2527

@@ -32,12 +34,12 @@ option java_package = "com.google.shopping.merchant.accounts.v1beta";
3234
// configuration, encompassing return policies for both ads and free listings
3335
// ## programs. This API defines the following resource model:
3436
//
35-
// [OnlineReturnPolicy][google.shopping.merchant.accounts.v1.OnlineReturnPolicy]
37+
// [OnlineReturnPolicy](/merchant/api/reference/rpc/google.shopping.merchant.accounts.v1beta#google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy)
3638
service OnlineReturnPolicyService {
3739
option (google.api.default_host) = "merchantapi.googleapis.com";
3840
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content";
3941

40-
// Gets an existing return policy for a given business.
42+
// Gets an existing return policy for a given merchant.
4143
rpc GetOnlineReturnPolicy(GetOnlineReturnPolicyRequest)
4244
returns (OnlineReturnPolicy) {
4345
option (google.api.http) = {
@@ -46,14 +48,43 @@ service OnlineReturnPolicyService {
4648
option (google.api.method_signature) = "name";
4749
}
4850

49-
// Lists all existing return policies for a given business.
51+
// Lists all existing return policies for a given merchant.
5052
rpc ListOnlineReturnPolicies(ListOnlineReturnPoliciesRequest)
5153
returns (ListOnlineReturnPoliciesResponse) {
5254
option (google.api.http) = {
5355
get: "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies"
5456
};
5557
option (google.api.method_signature) = "parent";
5658
}
59+
60+
// Creates a new return policy for a given merchant.
61+
rpc CreateOnlineReturnPolicy(CreateOnlineReturnPolicyRequest)
62+
returns (OnlineReturnPolicy) {
63+
option (google.api.http) = {
64+
post: "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies"
65+
body: "online_return_policy"
66+
};
67+
option (google.api.method_signature) = "parent";
68+
}
69+
70+
// Updates an existing return policy for a given merchant.
71+
rpc UpdateOnlineReturnPolicy(UpdateOnlineReturnPolicyRequest)
72+
returns (OnlineReturnPolicy) {
73+
option (google.api.http) = {
74+
patch: "/accounts/v1beta/{online_return_policy.name=accounts/*/onlineReturnPolicies/*}"
75+
body: "online_return_policy"
76+
};
77+
option (google.api.method_signature) = "online_return_policy,update_mask";
78+
}
79+
80+
// Deletes an existing return policy for a given merchant.
81+
rpc DeleteOnlineReturnPolicy(DeleteOnlineReturnPolicyRequest)
82+
returns (google.protobuf.Empty) {
83+
option (google.api.http) = {
84+
delete: "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}"
85+
};
86+
option (google.api.method_signature) = "name";
87+
}
5788
}
5889

5990
// Request message for the `GetOnlineReturnPolicy` method.
@@ -70,7 +101,7 @@ message GetOnlineReturnPolicyRequest {
70101

71102
// Request message for the `ListOnlineReturnPolicies` method.
72103
message ListOnlineReturnPoliciesRequest {
73-
// Required. The business account for which to list return policies.
104+
// Required. The merchant account for which to list return policies.
74105
// Format: `accounts/{account}`
75106
string parent = 1 [
76107
(google.api.field_behavior) = REQUIRED,
@@ -97,6 +128,43 @@ message ListOnlineReturnPoliciesRequest {
97128
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
98129
}
99130

131+
// Request message for the `CreateOnlineReturnPolicy` method.
132+
message CreateOnlineReturnPolicyRequest {
133+
// Required. The merchant account for which to create a return policy.
134+
// Format: `accounts/{account}`
135+
string parent = 1 [
136+
(google.api.field_behavior) = REQUIRED,
137+
(google.api.resource_reference) = {
138+
child_type: "merchantapi.googleapis.com/OnlineReturnPolicy"
139+
}
140+
];
141+
142+
// Required. The return policy to create.
143+
OnlineReturnPolicy online_return_policy = 2
144+
[(google.api.field_behavior) = REQUIRED];
145+
}
146+
147+
// Request message for the `UpdateOnlineReturnPolicy` method.
148+
message UpdateOnlineReturnPolicyRequest {
149+
// Required. The return policy to update.
150+
OnlineReturnPolicy online_return_policy = 1
151+
[(google.api.field_behavior) = REQUIRED];
152+
153+
google.protobuf.FieldMask update_mask = 2;
154+
}
155+
156+
// Request message for the `DeleteOnlineReturnPolicy` method.
157+
message DeleteOnlineReturnPolicyRequest {
158+
// Required. The name of the return policy to delete.
159+
// Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`
160+
string name = 1 [
161+
(google.api.field_behavior) = REQUIRED,
162+
(google.api.resource_reference) = {
163+
type: "merchantapi.googleapis.com/OnlineReturnPolicy"
164+
}
165+
];
166+
}
167+
100168
// Response message for the `ListOnlineReturnPolicies` method.
101169
message ListOnlineReturnPoliciesResponse {
102170
// The retrieved return policies.
@@ -232,6 +300,21 @@ message OnlineReturnPolicy {
232300
USED = 2;
233301
}
234302

303+
// The available return label sources.
304+
enum ReturnLabelSource {
305+
// Default value. This value is unused.
306+
RETURN_LABEL_SOURCE_UNSPECIFIED = 0;
307+
308+
// Download and print.
309+
DOWNLOAD_AND_PRINT = 1;
310+
311+
// Label include in the package.
312+
IN_THE_PACKAGE = 2;
313+
314+
// Customer to provide.
315+
CUSTOMER_RESPONSIBILITY = 3;
316+
}
317+
235318
// Identifier. The name of the `OnlineReturnPolicy` resource.
236319
// Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`
237320
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
@@ -259,29 +342,33 @@ message OnlineReturnPolicy {
259342
(google.api.field_behavior) = IMMUTABLE
260343
];
261344

262-
// The return policy.
263-
Policy policy = 5;
345+
// Optional. The return policy.
346+
Policy policy = 5 [(google.api.field_behavior) = OPTIONAL];
264347

265348
// Optional. Overrides to the general policy for orders placed during a
266349
// specific set of time intervals.
267350
repeated SeasonalOverride seasonal_overrides = 14
268351
[(google.api.field_behavior) = OPTIONAL];
269352

270-
// The restocking fee that applies to all return reason categories. This would
271-
// be treated as a free restocking fee if the value is not set.
272-
RestockingFee restocking_fee = 6;
353+
// Optional. The restocking fee that applies to all return reason categories.
354+
// This would be treated as a free restocking fee if the value is not set.
355+
RestockingFee restocking_fee = 6 [(google.api.field_behavior) = OPTIONAL];
273356

274-
// The return methods of how customers can return an item. This value is
275-
// required to not be empty unless the type of return policy is noReturns.
276-
repeated ReturnMethod return_methods = 7;
357+
// Optional. The return methods of how customers can return an item. This
358+
// value is required to not be empty unless the type of return policy is
359+
// noReturns.
360+
repeated ReturnMethod return_methods = 7
361+
[(google.api.field_behavior) = OPTIONAL];
277362

278-
// The item conditions accepted for returns must not be empty unless the type
279-
// of return policy is 'noReturns'.
280-
repeated ItemCondition item_conditions = 8;
363+
// Optional. The item conditions accepted for returns must not be empty unless
364+
// the type of return policy is 'noReturns'.
365+
repeated ItemCondition item_conditions = 8
366+
[(google.api.field_behavior) = OPTIONAL];
281367

282-
// The return shipping fee. Should be set only when customer need to download
283-
// and print the return label.
284-
ReturnShippingFee return_shipping_fee = 9;
368+
// Optional. The return shipping fee. Should be set only when customer need to
369+
// download and print the return label.
370+
ReturnShippingFee return_shipping_fee = 9
371+
[(google.api.field_behavior) = OPTIONAL];
285372

286373
// Required. The return policy uri. This can used by Google to do a sanity
287374
// check for the policy. It must be a valid URL.
@@ -298,4 +385,8 @@ message OnlineReturnPolicy {
298385
// This field specifies if merchant allows customers to exchange products,
299386
// this field is required.
300387
optional bool accept_exchange = 13;
388+
389+
// The field specifies the return label source. This field is required when
390+
// return method is BY_MAIL.
391+
optional ReturnLabelSource return_label_source = 15;
301392
}

0 commit comments

Comments
 (0)