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