customer_service.proto 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.ads.googleads.v8.services;
  16. import "google/ads/googleads/v8/enums/access_role.proto";
  17. import "google/ads/googleads/v8/enums/response_content_type.proto";
  18. import "google/ads/googleads/v8/resources/customer.proto";
  19. import "google/api/annotations.proto";
  20. import "google/api/client.proto";
  21. import "google/api/field_behavior.proto";
  22. import "google/api/resource.proto";
  23. import "google/protobuf/field_mask.proto";
  24. option csharp_namespace = "Google.Ads.GoogleAds.V8.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v8/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "CustomerServiceProto";
  28. option java_package = "com.google.ads.googleads.v8.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V8\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V8::Services";
  32. // Proto file describing the Customer service.
  33. // Service to manage customers.
  34. service CustomerService {
  35. option (google.api.default_host) = "googleads.googleapis.com";
  36. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  37. // Returns the requested customer in full detail.
  38. //
  39. // List of thrown errors:
  40. // [AuthenticationError]()
  41. // [AuthorizationError]()
  42. // [HeaderError]()
  43. // [InternalError]()
  44. // [QuotaError]()
  45. // [RequestError]()
  46. rpc GetCustomer(GetCustomerRequest) returns (google.ads.googleads.v8.resources.Customer) {
  47. option (google.api.http) = {
  48. get: "/v8/{resource_name=customers/*}"
  49. };
  50. option (google.api.method_signature) = "resource_name";
  51. }
  52. // Updates a customer. Operation statuses are returned.
  53. //
  54. // List of thrown errors:
  55. // [AuthenticationError]()
  56. // [AuthorizationError]()
  57. // [DatabaseError]()
  58. // [FieldMaskError]()
  59. // [HeaderError]()
  60. // [InternalError]()
  61. // [QuotaError]()
  62. // [RequestError]()
  63. // [UrlFieldError]()
  64. rpc MutateCustomer(MutateCustomerRequest) returns (MutateCustomerResponse) {
  65. option (google.api.http) = {
  66. post: "/v8/customers/{customer_id=*}:mutate"
  67. body: "*"
  68. };
  69. option (google.api.method_signature) = "customer_id,operation";
  70. }
  71. // Returns resource names of customers directly accessible by the
  72. // user authenticating the call.
  73. //
  74. // List of thrown errors:
  75. // [AuthenticationError]()
  76. // [AuthorizationError]()
  77. // [HeaderError]()
  78. // [InternalError]()
  79. // [QuotaError]()
  80. // [RequestError]()
  81. rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) {
  82. option (google.api.http) = {
  83. get: "/v8/customers:listAccessibleCustomers"
  84. };
  85. }
  86. // Creates a new client under manager. The new client customer is returned.
  87. //
  88. // List of thrown errors:
  89. // [AccessInvitationError]()
  90. // [AuthenticationError]()
  91. // [AuthorizationError]()
  92. // [CurrencyCodeError]()
  93. // [HeaderError]()
  94. // [InternalError]()
  95. // [ManagerLinkError]()
  96. // [QuotaError]()
  97. // [RequestError]()
  98. // [StringLengthError]()
  99. // [TimeZoneError]()
  100. rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) {
  101. option (google.api.http) = {
  102. post: "/v8/customers/{customer_id=*}:createCustomerClient"
  103. body: "*"
  104. };
  105. option (google.api.method_signature) = "customer_id,customer_client";
  106. }
  107. }
  108. // Request message for [CustomerService.GetCustomer][google.ads.googleads.v8.services.CustomerService.GetCustomer].
  109. message GetCustomerRequest {
  110. // Required. The resource name of the customer to fetch.
  111. string resource_name = 1 [
  112. (google.api.field_behavior) = REQUIRED,
  113. (google.api.resource_reference) = {
  114. type: "googleads.googleapis.com/Customer"
  115. }
  116. ];
  117. }
  118. // Request message for [CustomerService.MutateCustomer][google.ads.googleads.v8.services.CustomerService.MutateCustomer].
  119. message MutateCustomerRequest {
  120. // Required. The ID of the customer being modified.
  121. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  122. // Required. The operation to perform on the customer
  123. CustomerOperation operation = 4 [(google.api.field_behavior) = REQUIRED];
  124. // If true, the request is validated but not executed. Only errors are
  125. // returned, not results.
  126. bool validate_only = 5;
  127. // The response content type setting. Determines whether the mutable resource
  128. // or just the resource name should be returned post mutation.
  129. google.ads.googleads.v8.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 6;
  130. }
  131. // Request message for [CustomerService.CreateCustomerClient][google.ads.googleads.v8.services.CustomerService.CreateCustomerClient].
  132. message CreateCustomerClientRequest {
  133. // Required. The ID of the Manager under whom client customer is being created.
  134. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  135. // Required. The new client customer to create. The resource name on this customer
  136. // will be ignored.
  137. google.ads.googleads.v8.resources.Customer customer_client = 2 [(google.api.field_behavior) = REQUIRED];
  138. // Email address of the user who should be invited on the created client
  139. // customer. Accessible only to customers on the allow-list.
  140. optional string email_address = 5;
  141. // The proposed role of user on the created client customer.
  142. // Accessible only to customers on the allow-list.
  143. google.ads.googleads.v8.enums.AccessRoleEnum.AccessRole access_role = 4;
  144. // If true, the request is validated but not executed. Only errors are
  145. // returned, not results.
  146. bool validate_only = 6;
  147. }
  148. // A single update on a customer.
  149. message CustomerOperation {
  150. // Mutate operation. Only updates are supported for customer.
  151. google.ads.googleads.v8.resources.Customer update = 1;
  152. // FieldMask that determines which resource fields are modified in an update.
  153. google.protobuf.FieldMask update_mask = 2;
  154. }
  155. // Response message for CreateCustomerClient mutate.
  156. message CreateCustomerClientResponse {
  157. // The resource name of the newly created customer client.
  158. string resource_name = 2;
  159. // Link for inviting user to access the created customer. Accessible to
  160. // allowlisted customers only.
  161. string invitation_link = 3;
  162. }
  163. // Response message for customer mutate.
  164. message MutateCustomerResponse {
  165. // Result for the mutate.
  166. MutateCustomerResult result = 2;
  167. }
  168. // The result for the customer mutate.
  169. message MutateCustomerResult {
  170. // Returned for successful operations.
  171. string resource_name = 1;
  172. // The mutated customer with only mutable fields after mutate. The fields will
  173. // only be returned when response_content_type is set to "MUTABLE_RESOURCE".
  174. google.ads.googleads.v8.resources.Customer customer = 2;
  175. }
  176. // Request message for [CustomerService.ListAccessibleCustomers][google.ads.googleads.v8.services.CustomerService.ListAccessibleCustomers].
  177. message ListAccessibleCustomersRequest {
  178. }
  179. // Response message for [CustomerService.ListAccessibleCustomers][google.ads.googleads.v8.services.CustomerService.ListAccessibleCustomers].
  180. message ListAccessibleCustomersResponse {
  181. // Resource name of customers directly accessible by the
  182. // user authenticating the call.
  183. repeated string resource_names = 1;
  184. }