asset_service.proto 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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.v8.services;
  16. import "google/ads/googleads/v8/enums/response_content_type.proto";
  17. import "google/ads/googleads/v8/resources/asset.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.V8.Services";
  25. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v8/services;services";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "AssetServiceProto";
  28. option java_package = "com.google.ads.googleads.v8.services";
  29. option objc_class_prefix = "GAA";
  30. option php_namespace = "Google\\Ads\\GoogleAds\\V8\\Services";
  31. option ruby_package = "Google::Ads::GoogleAds::V8::Services";
  32. // Proto file describing the Asset service.
  33. // Service to manage assets. Asset types can be created with AssetService are
  34. // YoutubeVideoAsset, MediaBundleAsset and ImageAsset. TextAsset should be
  35. // created with Ad inline.
  36. service AssetService {
  37. option (google.api.default_host) = "googleads.googleapis.com";
  38. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  39. // Returns the requested asset in full detail.
  40. //
  41. // List of thrown errors:
  42. // [AuthenticationError]()
  43. // [AuthorizationError]()
  44. // [HeaderError]()
  45. // [InternalError]()
  46. // [QuotaError]()
  47. // [RequestError]()
  48. rpc GetAsset(GetAssetRequest) returns (google.ads.googleads.v8.resources.Asset) {
  49. option (google.api.http) = {
  50. get: "/v8/{resource_name=customers/*/assets/*}"
  51. };
  52. option (google.api.method_signature) = "resource_name";
  53. }
  54. // Creates assets. Operation statuses are returned.
  55. //
  56. // List of thrown errors:
  57. // [AssetError]()
  58. // [AuthenticationError]()
  59. // [AuthorizationError]()
  60. // [CollectionSizeError]()
  61. // [CurrencyCodeError]()
  62. // [DatabaseError]()
  63. // [DateError]()
  64. // [DistinctError]()
  65. // [FieldError]()
  66. // [FieldMaskError]()
  67. // [HeaderError]()
  68. // [IdError]()
  69. // [InternalError]()
  70. // [ListOperationError]()
  71. // [MediaUploadError]()
  72. // [MutateError]()
  73. // [NotAllowlistedError]()
  74. // [NotEmptyError]()
  75. // [OperatorError]()
  76. // [QuotaError]()
  77. // [RangeError]()
  78. // [RequestError]()
  79. // [SizeLimitError]()
  80. // [StringFormatError]()
  81. // [StringLengthError]()
  82. // [UrlFieldError]()
  83. // [YoutubeVideoRegistrationError]()
  84. rpc MutateAssets(MutateAssetsRequest) returns (MutateAssetsResponse) {
  85. option (google.api.http) = {
  86. post: "/v8/customers/{customer_id=*}/assets:mutate"
  87. body: "*"
  88. };
  89. option (google.api.method_signature) = "customer_id,operations";
  90. }
  91. }
  92. // Request message for [AssetService.GetAsset][google.ads.googleads.v8.services.AssetService.GetAsset]
  93. message GetAssetRequest {
  94. // Required. The resource name of the asset to fetch.
  95. string resource_name = 1 [
  96. (google.api.field_behavior) = REQUIRED,
  97. (google.api.resource_reference) = {
  98. type: "googleads.googleapis.com/Asset"
  99. }
  100. ];
  101. }
  102. // Request message for [AssetService.MutateAssets][google.ads.googleads.v8.services.AssetService.MutateAssets]
  103. message MutateAssetsRequest {
  104. // Required. The ID of the customer whose assets are being modified.
  105. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  106. // Required. The list of operations to perform on individual assets.
  107. repeated AssetOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  108. // If true, successful operations will be carried out and invalid
  109. // operations will return errors. If false, all operations will be carried
  110. // out in one transaction if and only if they are all valid.
  111. // Default is false.
  112. bool partial_failure = 5;
  113. // The response content type setting. Determines whether the mutable resource
  114. // or just the resource name should be returned post mutation.
  115. google.ads.googleads.v8.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 3;
  116. // If true, the request is validated but not executed. Only errors are
  117. // returned, not results.
  118. bool validate_only = 4;
  119. }
  120. // A single operation to create an asset. Supported asset types are
  121. // YoutubeVideoAsset, MediaBundleAsset, ImageAsset, and LeadFormAsset. TextAsset
  122. // should be created with Ad inline.
  123. message AssetOperation {
  124. // FieldMask that determines which resource fields are modified in an update.
  125. google.protobuf.FieldMask update_mask = 3;
  126. // The mutate operation.
  127. oneof operation {
  128. // Create operation: No resource name is expected for the new asset.
  129. google.ads.googleads.v8.resources.Asset create = 1;
  130. // Update operation: The asset is expected to have a valid resource name in
  131. // this format:
  132. //
  133. // `customers/{customer_id}/assets/{asset_id}`
  134. google.ads.googleads.v8.resources.Asset update = 2;
  135. }
  136. }
  137. // Response message for an asset mutate.
  138. message MutateAssetsResponse {
  139. // Errors that pertain to operation failures in the partial failure mode.
  140. // Returned only when partial_failure = true and all errors occur inside the
  141. // operations. If any errors occur outside the operations (e.g. auth errors),
  142. // we return an RPC level error.
  143. google.rpc.Status partial_failure_error = 3;
  144. // All results for the mutate.
  145. repeated MutateAssetResult results = 2;
  146. }
  147. // The result for the asset mutate.
  148. message MutateAssetResult {
  149. // The resource name returned for successful operations.
  150. string resource_name = 1;
  151. // The mutated asset with only mutable fields after mutate. The field will
  152. // only be returned when response_content_type is set to "MUTABLE_RESOURCE".
  153. google.ads.googleads.v8.resources.Asset asset = 2;
  154. }