asset_service.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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/response_content_type.proto";
  17. import "google/ads/googleads/v6/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. option csharp_namespace = "Google.Ads.GoogleAds.V6.Services";
  24. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v6/services;services";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "AssetServiceProto";
  27. option java_package = "com.google.ads.googleads.v6.services";
  28. option objc_class_prefix = "GAA";
  29. option php_namespace = "Google\\Ads\\GoogleAds\\V6\\Services";
  30. option ruby_package = "Google::Ads::GoogleAds::V6::Services";
  31. // Proto file describing the Asset service.
  32. // Service to manage assets. Asset types can be created with AssetService are
  33. // YoutubeVideoAsset, MediaBundleAsset and ImageAsset. TextAsset should be
  34. // created with Ad inline.
  35. service AssetService {
  36. option (google.api.default_host) = "googleads.googleapis.com";
  37. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
  38. // Returns the requested asset in full detail.
  39. rpc GetAsset(GetAssetRequest) returns (google.ads.googleads.v6.resources.Asset) {
  40. option (google.api.http) = {
  41. get: "/v6/{resource_name=customers/*/assets/*}"
  42. };
  43. option (google.api.method_signature) = "resource_name";
  44. }
  45. // Creates assets. Operation statuses are returned.
  46. rpc MutateAssets(MutateAssetsRequest) returns (MutateAssetsResponse) {
  47. option (google.api.http) = {
  48. post: "/v6/customers/{customer_id=*}/assets:mutate"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "customer_id,operations";
  52. }
  53. }
  54. // Request message for [AssetService.GetAsset][google.ads.googleads.v6.services.AssetService.GetAsset]
  55. message GetAssetRequest {
  56. // Required. The resource name of the asset to fetch.
  57. string resource_name = 1 [
  58. (google.api.field_behavior) = REQUIRED,
  59. (google.api.resource_reference) = {
  60. type: "googleads.googleapis.com/Asset"
  61. }
  62. ];
  63. }
  64. // Request message for [AssetService.MutateAssets][google.ads.googleads.v6.services.AssetService.MutateAssets]
  65. message MutateAssetsRequest {
  66. // Required. The ID of the customer whose assets are being modified.
  67. string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
  68. // Required. The list of operations to perform on individual assets.
  69. repeated AssetOperation operations = 2 [(google.api.field_behavior) = REQUIRED];
  70. // The response content type setting. Determines whether the mutable resource
  71. // or just the resource name should be returned post mutation.
  72. google.ads.googleads.v6.enums.ResponseContentTypeEnum.ResponseContentType response_content_type = 3;
  73. }
  74. // A single operation to create an asset. Supported asset types are
  75. // YoutubeVideoAsset, MediaBundleAsset, ImageAsset, and LeadFormAsset. TextAsset
  76. // should be created with Ad inline.
  77. message AssetOperation {
  78. // FieldMask that determines which resource fields are modified in an update.
  79. google.protobuf.FieldMask update_mask = 3;
  80. // The mutate operation.
  81. oneof operation {
  82. // Create operation: No resource name is expected for the new asset.
  83. google.ads.googleads.v6.resources.Asset create = 1;
  84. // Update operation: The asset is expected to have a valid resource name in
  85. // this format:
  86. //
  87. // `customers/{customer_id}/assets/{asset_id}`
  88. google.ads.googleads.v6.resources.Asset update = 2;
  89. }
  90. }
  91. // Response message for an asset mutate.
  92. message MutateAssetsResponse {
  93. // All results for the mutate.
  94. repeated MutateAssetResult results = 2;
  95. }
  96. // The result for the asset mutate.
  97. message MutateAssetResult {
  98. // The resource name returned for successful operations.
  99. string resource_name = 1;
  100. // The mutated asset with only mutable fields after mutate. The field will
  101. // only be returned when response_content_type is set to "MUTABLE_RESOURCE".
  102. google.ads.googleads.v6.resources.Asset asset = 2;
  103. }