account_link_service.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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/account_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. import "google/rpc/status.proto";
  23. option csharp_namespace = "Google.Ads.GoogleAds.V11.Services";
  24. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v11/services;services";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "AccountLinkServiceProto";
  27. option java_package = "com.google.ads.googleads.v11.services";
  28. option objc_class_prefix = "GAA";
  29. option php_namespace = "Google\\Ads\\GoogleAds\\V11\\Services";
  30. option ruby_package = "Google::Ads::GoogleAds::V11::Services";
  31. // This service allows management of links between Google Ads accounts and other
  32. // accounts.
  33. service AccountLinkService {
  34. option (google.api.default_host) = "googleads.googleapis.com";
  35. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  36. // Creates an account link.
  37. //
  38. // List of thrown errors:
  39. // [AuthenticationError]()
  40. // [AuthorizationError]()
  41. // [DatabaseError]()
  42. // [FieldError]()
  43. // [HeaderError]()
  44. // [InternalError]()
  45. // [MutateError]()
  46. // [QuotaError]()
  47. // [RequestError]()
  48. // [ThirdPartyAppAnalyticsLinkError]()
  49. rpc CreateAccountLink(CreateAccountLinkRequest) returns (CreateAccountLinkResponse) {
  50. option (google.api.http) = {
  51. post: "/v11/customers/{customer_id=*}/accountLinks:create"
  52. body: "*"
  53. };
  54. option (google.api.method_signature) = "customer_id,account_link";
  55. }
  56. // Creates or removes an account link.
  57. // From V5, create is not supported through
  58. // AccountLinkService.MutateAccountLink. Use
  59. // AccountLinkService.CreateAccountLink instead.
  60. //
  61. // List of thrown errors:
  62. // [AccountLinkError]()
  63. // [AuthenticationError]()
  64. // [AuthorizationError]()
  65. // [FieldMaskError]()
  66. // [HeaderError]()
  67. // [InternalError]()
  68. // [MutateError]()
  69. // [QuotaError]()
  70. // [RequestError]()
  71. rpc MutateAccountLink(MutateAccountLinkRequest) returns (MutateAccountLinkResponse) {
  72. option (google.api.http) = {
  73. post: "/v11/customers/{customer_id=*}/accountLinks:mutate"
  74. body: "*"
  75. };
  76. option (google.api.method_signature) = "customer_id,operation";
  77. }
  78. }
  79. // Request message for
  80. // [AccountLinkService.CreateAccountLink][google.ads.googleads.v11.services.AccountLinkService.CreateAccountLink].
  81. message CreateAccountLinkRequest {
  82. // Required. The ID of the customer for which the account link is created.
  83. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  84. // Required. The account link to be created.
  85. google.ads.googleads.v11.resources.AccountLink account_link = 2 [(google.api.field_behavior) = REQUIRED];
  86. }
  87. // Response message for
  88. // [AccountLinkService.CreateAccountLink][google.ads.googleads.v11.services.AccountLinkService.CreateAccountLink].
  89. message CreateAccountLinkResponse {
  90. // Returned for successful operations. Resource name of the account link.
  91. string resource_name = 1 [(google.api.resource_reference) = {
  92. type: "googleads.googleapis.com/AccountLink"
  93. }];
  94. }
  95. // Request message for [AccountLinkService.MutateAccountLink][google.ads.googleads.v11.services.AccountLinkService.MutateAccountLink].
  96. message MutateAccountLinkRequest {
  97. // Required. The ID of the customer being modified.
  98. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  99. // Required. The operation to perform on the link.
  100. AccountLinkOperation operation = 2 [(google.api.field_behavior) = REQUIRED];
  101. // If true, successful operations will be carried out and invalid
  102. // operations will return errors. If false, all operations will be carried
  103. // out in one transaction if and only if they are all valid.
  104. // Default is false.
  105. bool partial_failure = 3;
  106. // If true, the request is validated but not executed. Only errors are
  107. // returned, not results.
  108. bool validate_only = 4;
  109. }
  110. // A single update on an account link.
  111. message AccountLinkOperation {
  112. // FieldMask that determines which resource fields are modified in an update.
  113. google.protobuf.FieldMask update_mask = 4;
  114. // The operation to perform.
  115. oneof operation {
  116. // Update operation: The account link is expected to have
  117. // a valid resource name.
  118. google.ads.googleads.v11.resources.AccountLink update = 2;
  119. // Remove operation: A resource name for the account link to remove is
  120. // expected, in this format:
  121. //
  122. // `customers/{customer_id}/accountLinks/{account_link_id}`
  123. string remove = 3 [(google.api.resource_reference) = {
  124. type: "googleads.googleapis.com/AccountLink"
  125. }];
  126. }
  127. }
  128. // Response message for account link mutate.
  129. message MutateAccountLinkResponse {
  130. // Result for the mutate.
  131. MutateAccountLinkResult result = 1;
  132. // Errors that pertain to operation failures in the partial failure mode.
  133. // Returned only when partial_failure = true and all errors occur inside the
  134. // operations. If any errors occur outside the operations (for example, auth
  135. // errors), we return an RPC level error.
  136. google.rpc.Status partial_failure_error = 2;
  137. }
  138. // The result for the account link mutate.
  139. message MutateAccountLinkResult {
  140. // Returned for successful operations.
  141. string resource_name = 1 [(google.api.resource_reference) = {
  142. type: "googleads.googleapis.com/AccountLink"
  143. }];
  144. }