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.v16.services; 18 19import "google/ads/googleads/v16/enums/response_content_type.proto"; 20import "google/ads/googleads/v16/resources/feed.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.V16.Services"; 29option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v16/services;services"; 30option java_multiple_files = true; 31option java_outer_classname = "FeedServiceProto"; 32option java_package = "com.google.ads.googleads.v16.services"; 33option objc_class_prefix = "GAA"; 34option php_namespace = "Google\\Ads\\GoogleAds\\V16\\Services"; 35option ruby_package = "Google::Ads::GoogleAds::V16::Services"; 36 37// Proto file describing the Feed service. 38 39// Service to manage feeds. 40service FeedService { 41 option (google.api.default_host) = "googleads.googleapis.com"; 42 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords"; 43 44 // Creates, updates, or removes feeds. Operation statuses are 45 // returned. 46 // 47 // List of thrown errors: 48 // [AuthenticationError]() 49 // [AuthorizationError]() 50 // [CollectionSizeError]() 51 // [DatabaseError]() 52 // [DistinctError]() 53 // [FeedError]() 54 // [FieldError]() 55 // [FieldMaskError]() 56 // [HeaderError]() 57 // [IdError]() 58 // [InternalError]() 59 // [ListOperationError]() 60 // [MutateError]() 61 // [NewResourceCreationError]() 62 // [NotEmptyError]() 63 // [NullError]() 64 // [OperatorError]() 65 // [QuotaError]() 66 // [RangeError]() 67 // [RequestError]() 68 // [ResourceCountLimitExceededError]() 69 // [SizeLimitError]() 70 // [StringFormatError]() 71 // [StringLengthError]() 72 rpc MutateFeeds(MutateFeedsRequest) returns (MutateFeedsResponse) { 73 option (google.api.http) = { 74 post: "/v16/customers/{customer_id=*}/feeds:mutate" 75 body: "*" 76 }; 77 option (google.api.method_signature) = "customer_id,operations"; 78 } 79} 80 81// Request message for 82// [FeedService.MutateFeeds][google.ads.googleads.v16.services.FeedService.MutateFeeds]. 83message MutateFeedsRequest { 84 // Required. The ID of the customer whose feeds are being modified. 85 string customer_id = 1 [(google.api.field_behavior) = REQUIRED]; 86 87 // Required. The list of operations to perform on individual feeds. 88 repeated FeedOperation operations = 2 89 [(google.api.field_behavior) = REQUIRED]; 90 91 // If true, successful operations will be carried out and invalid 92 // operations will return errors. If false, all operations will be carried 93 // out in one transaction if and only if they are all valid. 94 // Default is false. 95 bool partial_failure = 3; 96 97 // If true, the request is validated but not executed. Only errors are 98 // returned, not results. 99 bool validate_only = 4; 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.v16.enums.ResponseContentTypeEnum.ResponseContentType 104 response_content_type = 5; 105} 106 107// A single operation (create, update, remove) on an feed. 108message FeedOperation { 109 // FieldMask that determines which resource fields are modified in an update. 110 google.protobuf.FieldMask update_mask = 4; 111 112 // The mutate operation. 113 oneof operation { 114 // Create operation: No resource name is expected for the new feed. 115 google.ads.googleads.v16.resources.Feed create = 1; 116 117 // Update operation: The feed is expected to have a valid resource 118 // name. 119 google.ads.googleads.v16.resources.Feed update = 2; 120 121 // Remove operation: A resource name for the removed feed is 122 // expected, in this format: 123 // 124 // `customers/{customer_id}/feeds/{feed_id}` 125 string remove = 3 [(google.api.resource_reference) = { 126 type: "googleads.googleapis.com/Feed" 127 }]; 128 } 129} 130 131// Response message for an feed mutate. 132message MutateFeedsResponse { 133 // Errors that pertain to operation failures in the partial failure mode. 134 // Returned only when partial_failure = true and all errors occur inside the 135 // operations. If any errors occur outside the operations (for example, auth 136 // errors), we return an RPC level error. 137 google.rpc.Status partial_failure_error = 3; 138 139 // All results for the mutate. 140 repeated MutateFeedResult results = 2; 141} 142 143// The result for the feed mutate. 144message MutateFeedResult { 145 // Returned for successful operations. 146 string resource_name = 1 [ 147 (google.api.resource_reference) = { type: "googleads.googleapis.com/Feed" } 148 ]; 149 150 // The mutated feed with only mutable fields after mutate. The field will only 151 // be returned when response_content_type is set to "MUTABLE_RESOURCE". 152 google.ads.googleads.v16.resources.Feed feed = 2; 153} 154