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