customer_service.proto 6.6 KB

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