label_service.proto 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.v7.services;
  16. import "google/ads/googleads/v7/enums/response_content_type.proto";
  17. import "google/ads/googleads/v7/resources/label.proto";
  18. import "google/api/annotations.proto";
  19. import "google/api/client.proto";
  20. import "google/api/field_behavior.proto";
  21. import "google/api/resource.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/rpc/status.proto";
  24. option csharp_namespace = "Google.Ads.GoogleAds.V7.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v7/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "LabelServiceProto";
  28. option java_package = "com.google.ads.googleads.v7.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V7\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V7::Services";
  32. // Service to manage labels.
  33. service LabelService {
  34. option (google.api.default_host) = "googleads.googleapis.com";
  35. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  36. // Returns the requested label in full detail.
  37. //
  38. // List of thrown errors:
  39. // [AuthenticationError]()
  40. // [AuthorizationError]()
  41. // [HeaderError]()
  42. // [InternalError]()
  43. // [QuotaError]()
  44. // [RequestError]()
  45. rpc GetLabel(GetLabelRequest) returns (google.ads.googleads.v7.resources.Label) {
  46. option (google.api.http) = {
  47. get: "/v7/{resource_name=customers/*/labels/*}"
  48. };
  49. option (google.api.method_signature) = "resource_name";
  50. }
  51. // Creates, updates, or removes labels. Operation statuses are returned.
  52. //
  53. // List of thrown errors:
  54. // [AuthenticationError]()
  55. // [AuthorizationError]()
  56. // [DatabaseError]()
  57. // [DateError]()
  58. // [DistinctError]()
  59. // [FieldError]()
  60. // [FieldMaskError]()
  61. // [HeaderError]()
  62. // [IdError]()
  63. // [InternalError]()
  64. // [LabelError]()
  65. // [MutateError]()
  66. // [NewResourceCreationError]()
  67. // [NotEmptyError]()
  68. // [NullError]()
  69. // [OperatorError]()
  70. // [QuotaError]()
  71. // [RangeError]()
  72. // [RequestError]()
  73. // [ResourceCountLimitExceededError]()
  74. // [SizeLimitError]()
  75. // [StringFormatError]()
  76. // [StringLengthError]()
  77. rpc MutateLabels(MutateLabelsRequest) returns (MutateLabelsResponse) {
  78. option (google.api.http) = {
  79. post: "/v7/customers/{customer_id=*}/labels:mutate"
  80. body: "*"
  81. };
  82. option (google.api.method_signature) = "customer_id,operations";
  83. }
  84. }
  85. // Request message for [LabelService.GetLabel][google.ads.googleads.v7.services.LabelService.GetLabel].
  86. message GetLabelRequest {
  87. // Required. The resource name of the label to fetch.
  88. string resource_name = 1 [
  89. (google.api.field_behavior) = REQUIRED,
  90. (google.api.resource_reference) = {
  91. type: "googleads.googleapis.com/Label"
  92. }
  93. ];
  94. }
  95. // Request message for [LabelService.MutateLabels][google.ads.googleads.v7.services.LabelService.MutateLabels].
  96. message MutateLabelsRequest {
  97. // Required. ID of the customer whose labels are being modified.
  98. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  99. // Required. The list of operations to perform on labels.
  100. repeated LabelOperation operations = 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. // The response content type setting. Determines whether the mutable resource
  110. // or just the resource name should be returned post mutation.
  111. google.ads.googleads.v7.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 5;
  112. }
  113. // A single operation (create, remove, update) on a label.
  114. message LabelOperation {
  115. // FieldMask that determines which resource fields are modified in an update.
  116. google.protobuf.FieldMask update_mask = 4;
  117. // The mutate operation.
  118. oneof operation {
  119. // Create operation: No resource name is expected for the new label.
  120. google.ads.googleads.v7.resources.Label create = 1;
  121. // Update operation: The label is expected to have a valid resource name.
  122. google.ads.googleads.v7.resources.Label update = 2;
  123. // Remove operation: A resource name for the label being removed, in
  124. // this format:
  125. //
  126. // `customers/{customer_id}/labels/{label_id}`
  127. string remove = 3;
  128. }
  129. }
  130. // Response message for a labels mutate.
  131. message MutateLabelsResponse {
  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 (e.g. auth errors),
  135. // we return an RPC level error.
  136. google.rpc.Status partial_failure_error = 3;
  137. // All results for the mutate.
  138. repeated MutateLabelResult results = 2;
  139. }
  140. // The result for a label mutate.
  141. message MutateLabelResult {
  142. // Returned for successful operations.
  143. string resource_name = 1;
  144. // The mutated label with only mutable fields after mutate. The field will
  145. // only be returned when response_content_type is set to "MUTABLE_RESOURCE".
  146. google.ads.googleads.v7.resources.Label label = 2;
  147. }