customer_service.proto 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // Copyright 2022 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.v12.services;
  16. import "google/ads/googleads/v12/enums/access_role.proto";
  17. import "google/ads/googleads/v12/enums/response_content_type.proto";
  18. import "google/ads/googleads/v12/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.V12.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v12/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "CustomerServiceProto";
  28. option java_package = "com.google.ads.googleads.v12.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V12\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V12::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. // Updates a customer. Operation statuses are returned.
  38. //
  39. // List of thrown errors:
  40. // [AuthenticationError]()
  41. // [AuthorizationError]()
  42. // [DatabaseError]()
  43. // [FieldMaskError]()
  44. // [HeaderError]()
  45. // [InternalError]()
  46. // [QuotaError]()
  47. // [RequestError]()
  48. // [UrlFieldError]()
  49. rpc MutateCustomer(MutateCustomerRequest) returns (MutateCustomerResponse) {
  50. option (google.api.http) = {
  51. post: "/v12/customers/{customer_id=*}:mutate"
  52. body: "*"
  53. };
  54. option (google.api.method_signature) = "customer_id,operation";
  55. }
  56. // Returns resource names of customers directly accessible by the
  57. // user authenticating the call.
  58. //
  59. // List of thrown errors:
  60. // [AuthenticationError]()
  61. // [AuthorizationError]()
  62. // [HeaderError]()
  63. // [InternalError]()
  64. // [QuotaError]()
  65. // [RequestError]()
  66. rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) {
  67. option (google.api.http) = {
  68. get: "/v12/customers:listAccessibleCustomers"
  69. };
  70. }
  71. // Creates a new client under manager. The new client customer is returned.
  72. //
  73. // List of thrown errors:
  74. // [AccessInvitationError]()
  75. // [AuthenticationError]()
  76. // [AuthorizationError]()
  77. // [CurrencyCodeError]()
  78. // [HeaderError]()
  79. // [InternalError]()
  80. // [ManagerLinkError]()
  81. // [QuotaError]()
  82. // [RequestError]()
  83. // [StringLengthError]()
  84. // [TimeZoneError]()
  85. rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) {
  86. option (google.api.http) = {
  87. post: "/v12/customers/{customer_id=*}:createCustomerClient"
  88. body: "*"
  89. };
  90. option (google.api.method_signature) = "customer_id,customer_client";
  91. }
  92. }
  93. // Request message for [CustomerService.MutateCustomer][google.ads.googleads.v12.services.CustomerService.MutateCustomer].
  94. message MutateCustomerRequest {
  95. // Required. The ID of the customer being modified.
  96. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  97. // Required. The operation to perform on the customer
  98. CustomerOperation operation = 4 [(google.api.field_behavior) = REQUIRED];
  99. // If true, the request is validated but not executed. Only errors are
  100. // returned, not results.
  101. bool validate_only = 5;
  102. // The response content type setting. Determines whether the mutable resource
  103. // or just the resource name should be returned post mutation.
  104. google.ads.googleads.v12.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 6;
  105. }
  106. // Request message for [CustomerService.CreateCustomerClient][google.ads.googleads.v12.services.CustomerService.CreateCustomerClient].
  107. message CreateCustomerClientRequest {
  108. // Required. The ID of the Manager under whom client customer is being created.
  109. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  110. // Required. The new client customer to create. The resource name on this customer
  111. // will be ignored.
  112. google.ads.googleads.v12.resources.Customer customer_client = 2 [(google.api.field_behavior) = REQUIRED];
  113. // Email address of the user who should be invited on the created client
  114. // customer. Accessible only to customers on the allow-list.
  115. optional string email_address = 5;
  116. // The proposed role of user on the created client customer.
  117. // Accessible only to customers on the allow-list.
  118. google.ads.googleads.v12.enums.AccessRoleEnum.AccessRole access_role = 4;
  119. // If true, the request is validated but not executed. Only errors are
  120. // returned, not results.
  121. bool validate_only = 6;
  122. }
  123. // A single update on a customer.
  124. message CustomerOperation {
  125. // Mutate operation. Only updates are supported for customer.
  126. google.ads.googleads.v12.resources.Customer update = 1;
  127. // FieldMask that determines which resource fields are modified in an update.
  128. google.protobuf.FieldMask update_mask = 2;
  129. }
  130. // Response message for CreateCustomerClient mutate.
  131. message CreateCustomerClientResponse {
  132. // The resource name of the newly created customer. Customer resource names
  133. // have the form: `customers/{customer_id}`.
  134. string resource_name = 2 [(google.api.resource_reference) = {
  135. type: "googleads.googleapis.com/Customer"
  136. }];
  137. // Link for inviting user to access the created customer. Accessible to
  138. // allowlisted customers only.
  139. string invitation_link = 3;
  140. }
  141. // Response message for customer mutate.
  142. message MutateCustomerResponse {
  143. // Result for the mutate.
  144. MutateCustomerResult result = 2;
  145. }
  146. // The result for the customer mutate.
  147. message MutateCustomerResult {
  148. // Returned for successful operations.
  149. string resource_name = 1 [(google.api.resource_reference) = {
  150. type: "googleads.googleapis.com/Customer"
  151. }];
  152. // The mutated customer with only mutable fields after mutate. The fields will
  153. // only be returned when response_content_type is set to "MUTABLE_RESOURCE".
  154. google.ads.googleads.v12.resources.Customer customer = 2;
  155. }
  156. // Request message for [CustomerService.ListAccessibleCustomers][google.ads.googleads.v12.services.CustomerService.ListAccessibleCustomers].
  157. message ListAccessibleCustomersRequest {
  158. }
  159. // Response message for [CustomerService.ListAccessibleCustomers][google.ads.googleads.v12.services.CustomerService.ListAccessibleCustomers].
  160. message ListAccessibleCustomersResponse {
  161. // Resource name of customers directly accessible by the
  162. // user authenticating the call.
  163. repeated string resource_names = 1;
  164. }