customer_manager_link_service.proto 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.v11.services;
  16. import "google/ads/googleads/v11/resources/customer_manager_link.proto";
  17. import "google/api/annotations.proto";
  18. import "google/api/client.proto";
  19. import "google/api/field_behavior.proto";
  20. import "google/api/resource.proto";
  21. import "google/protobuf/field_mask.proto";
  22. option csharp_namespace = "Google.Ads.GoogleAds.V11.Services";
  23. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v11/services;services";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "CustomerManagerLinkServiceProto";
  26. option java_package = "com.google.ads.googleads.v11.services";
  27. option objc_class_prefix = "GAA";
  28. option php_namespace = "Google\\Ads\\GoogleAds\\V11\\Services";
  29. option ruby_package = "Google::Ads::GoogleAds::V11::Services";
  30. // Service to manage customer-manager links.
  31. service CustomerManagerLinkService {
  32. option (google.api.default_host) = "googleads.googleapis.com";
  33. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  34. // Updates customer manager links. Operation statuses are returned.
  35. //
  36. // List of thrown errors:
  37. // [AuthenticationError]()
  38. // [AuthorizationError]()
  39. // [DatabaseError]()
  40. // [FieldError]()
  41. // [FieldMaskError]()
  42. // [HeaderError]()
  43. // [InternalError]()
  44. // [ManagerLinkError]()
  45. // [MutateError]()
  46. // [QuotaError]()
  47. // [RequestError]()
  48. rpc MutateCustomerManagerLink(MutateCustomerManagerLinkRequest) returns (MutateCustomerManagerLinkResponse) {
  49. option (google.api.http) = {
  50. post: "/v11/customers/{customer_id=*}/customerManagerLinks:mutate"
  51. body: "*"
  52. };
  53. option (google.api.method_signature) = "customer_id,operations";
  54. }
  55. // Moves a client customer to a new manager customer.
  56. // This simplifies the complex request that requires two operations to move
  57. // a client customer to a new manager, for example:
  58. // 1. Update operation with Status INACTIVE (previous manager) and,
  59. // 2. Update operation with Status ACTIVE (new manager).
  60. //
  61. // List of thrown errors:
  62. // [AuthenticationError]()
  63. // [AuthorizationError]()
  64. // [DatabaseError]()
  65. // [FieldError]()
  66. // [HeaderError]()
  67. // [InternalError]()
  68. // [MutateError]()
  69. // [QuotaError]()
  70. // [RequestError]()
  71. rpc MoveManagerLink(MoveManagerLinkRequest) returns (MoveManagerLinkResponse) {
  72. option (google.api.http) = {
  73. post: "/v11/customers/{customer_id=*}/customerManagerLinks:moveManagerLink"
  74. body: "*"
  75. };
  76. option (google.api.method_signature) = "customer_id,previous_customer_manager_link,new_manager";
  77. }
  78. }
  79. // Request message for [CustomerManagerLinkService.MutateCustomerManagerLink][google.ads.googleads.v11.services.CustomerManagerLinkService.MutateCustomerManagerLink].
  80. message MutateCustomerManagerLinkRequest {
  81. // Required. The ID of the customer whose customer manager links are being modified.
  82. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  83. // Required. The list of operations to perform on individual customer manager links.
  84. repeated CustomerManagerLinkOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  85. // If true, the request is validated but not executed. Only errors are
  86. // returned, not results.
  87. bool validate_only = 3;
  88. }
  89. // Request message for [CustomerManagerLinkService.MoveManagerLink][google.ads.googleads.v11.services.CustomerManagerLinkService.MoveManagerLink].
  90. message MoveManagerLinkRequest {
  91. // Required. The ID of the client customer that is being moved.
  92. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  93. // Required. The resource name of the previous CustomerManagerLink.
  94. // The resource name has the form:
  95. // `customers/{customer_id}/customerManagerLinks/{manager_customer_id}~{manager_link_id}`
  96. string previous_customer_manager_link = 2 [(google.api.field_behavior) = REQUIRED];
  97. // Required. The resource name of the new manager customer that the client wants to move
  98. // to. Customer resource names have the format: "customers/{customer_id}"
  99. string new_manager = 3 [(google.api.field_behavior) = REQUIRED];
  100. // If true, the request is validated but not executed. Only errors are
  101. // returned, not results.
  102. bool validate_only = 4;
  103. }
  104. // Updates the status of a CustomerManagerLink.
  105. // The following actions are possible:
  106. // 1. Update operation with status ACTIVE accepts a pending invitation.
  107. // 2. Update operation with status REFUSED declines a pending invitation.
  108. // 3. Update operation with status INACTIVE terminates link to manager.
  109. message CustomerManagerLinkOperation {
  110. // FieldMask that determines which resource fields are modified in an update.
  111. google.protobuf.FieldMask update_mask = 4;
  112. // The mutate operation.
  113. oneof operation {
  114. // Update operation: The link is expected to have a valid resource name.
  115. google.ads.googleads.v11.resources.CustomerManagerLink update = 2;
  116. }
  117. }
  118. // Response message for a CustomerManagerLink mutate.
  119. message MutateCustomerManagerLinkResponse {
  120. // A result that identifies the resource affected by the mutate request.
  121. repeated MutateCustomerManagerLinkResult results = 1;
  122. }
  123. // Response message for a CustomerManagerLink moveManagerLink.
  124. message MoveManagerLinkResponse {
  125. // Returned for successful operations. Represents a CustomerManagerLink
  126. // resource of the newly created link between client customer and new manager
  127. // customer.
  128. string resource_name = 1 [(google.api.resource_reference) = {
  129. type: "googleads.googleapis.com/CustomerManagerLink"
  130. }];
  131. }
  132. // The result for the customer manager link mutate.
  133. message MutateCustomerManagerLinkResult {
  134. // Returned for successful operations.
  135. string resource_name = 1 [(google.api.resource_reference) = {
  136. type: "googleads.googleapis.com/CustomerManagerLink"
  137. }];
  138. }