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/media_file.proto"; 21import "google/api/annotations.proto"; 22import "google/api/client.proto"; 23import "google/api/field_behavior.proto"; 24import "google/api/resource.proto"; 25import "google/rpc/status.proto"; 26 27option csharp_namespace = "Google.Ads.GoogleAds.V14.Services"; 28option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v14/services;services"; 29option java_multiple_files = true; 30option java_outer_classname = "MediaFileServiceProto"; 31option java_package = "com.google.ads.googleads.v14.services"; 32option objc_class_prefix = "GAA"; 33option php_namespace = "Google\\Ads\\GoogleAds\\V14\\Services"; 34option ruby_package = "Google::Ads::GoogleAds::V14::Services"; 35 36// Proto file describing the Media File service. 37 38// Service to manage media files. 39service MediaFileService { 40 option (google.api.default_host) = "googleads.googleapis.com"; 41 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords"; 42 43 // Creates media files. Operation statuses are returned. 44 // 45 // List of thrown errors: 46 // [AuthenticationError]() 47 // [AuthorizationError]() 48 // [DatabaseError]() 49 // [DistinctError]() 50 // [FieldError]() 51 // [HeaderError]() 52 // [IdError]() 53 // [ImageError]() 54 // [InternalError]() 55 // [MediaBundleError]() 56 // [MediaFileError]() 57 // [NewResourceCreationError]() 58 // [NotEmptyError]() 59 // [NullError]() 60 // [OperatorError]() 61 // [QuotaError]() 62 // [RangeError]() 63 // [RequestError]() 64 // [SizeLimitError]() 65 // [StringFormatError]() 66 // [StringLengthError]() 67 rpc MutateMediaFiles(MutateMediaFilesRequest) 68 returns (MutateMediaFilesResponse) { 69 option (google.api.http) = { 70 post: "/v14/customers/{customer_id=*}/mediaFiles:mutate" 71 body: "*" 72 }; 73 option (google.api.method_signature) = "customer_id,operations"; 74 } 75} 76 77// Request message for 78// [MediaFileService.MutateMediaFiles][google.ads.googleads.v14.services.MediaFileService.MutateMediaFiles] 79message MutateMediaFilesRequest { 80 // Required. The ID of the customer whose media files are being modified. 81 string customer_id = 1 [(google.api.field_behavior) = REQUIRED]; 82 83 // Required. The list of operations to perform on individual media file. 84 repeated MediaFileOperation operations = 2 85 [(google.api.field_behavior) = REQUIRED]; 86 87 // If true, successful operations will be carried out and invalid 88 // operations will return errors. If false, all operations will be carried 89 // out in one transaction if and only if they are all valid. 90 // Default is false. 91 bool partial_failure = 3; 92 93 // If true, the request is validated but not executed. Only errors are 94 // returned, not results. 95 bool validate_only = 4; 96 97 // The response content type setting. Determines whether the mutable resource 98 // or just the resource name should be returned post mutation. 99 google.ads.googleads.v14.enums.ResponseContentTypeEnum.ResponseContentType 100 response_content_type = 5; 101} 102 103// A single operation to create media file. 104message MediaFileOperation { 105 // The mutate operation. 106 oneof operation { 107 // Create operation: No resource name is expected for the new media file. 108 google.ads.googleads.v14.resources.MediaFile create = 1; 109 } 110} 111 112// Response message for a media file mutate. 113message MutateMediaFilesResponse { 114 // Errors that pertain to operation failures in the partial failure mode. 115 // Returned only when partial_failure = true and all errors occur inside the 116 // operations. If any errors occur outside the operations (for example, auth 117 // errors), we return an RPC level error. 118 google.rpc.Status partial_failure_error = 3; 119 120 // All results for the mutate. 121 repeated MutateMediaFileResult results = 2; 122} 123 124// The result for the media file mutate. 125message MutateMediaFileResult { 126 // The resource name returned for successful operations. 127 string resource_name = 1 [(google.api.resource_reference) = { 128 type: "googleads.googleapis.com/MediaFile" 129 }]; 130 131 // The mutated media file with only mutable fields after mutate. The field 132 // will only be returned when response_content_type is set to 133 // "MUTABLE_RESOURCE". 134 google.ads.googleads.v14.resources.MediaFile media_file = 2; 135} 136