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/resources/custom_audience.proto"; 20import "google/api/annotations.proto"; 21import "google/api/client.proto"; 22import "google/api/field_behavior.proto"; 23import "google/api/resource.proto"; 24import "google/protobuf/field_mask.proto"; 25 26option csharp_namespace = "Google.Ads.GoogleAds.V14.Services"; 27option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v14/services;services"; 28option java_multiple_files = true; 29option java_outer_classname = "CustomAudienceServiceProto"; 30option java_package = "com.google.ads.googleads.v14.services"; 31option objc_class_prefix = "GAA"; 32option php_namespace = "Google\\Ads\\GoogleAds\\V14\\Services"; 33option ruby_package = "Google::Ads::GoogleAds::V14::Services"; 34 35// Proto file describing the Custom Audience service. 36 37// Service to manage custom audiences. 38service CustomAudienceService { 39 option (google.api.default_host) = "googleads.googleapis.com"; 40 option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords"; 41 42 // Creates or updates custom audiences. Operation statuses are returned. 43 // 44 // List of thrown errors: 45 // [AuthenticationError]() 46 // [AuthorizationError]() 47 // [CustomAudienceError]() 48 // [CustomInterestError]() 49 // [FieldError]() 50 // [FieldMaskError]() 51 // [HeaderError]() 52 // [InternalError]() 53 // [MutateError]() 54 // [OperationAccessDeniedError]() 55 // [PolicyViolationError]() 56 // [QuotaError]() 57 // [RequestError]() 58 rpc MutateCustomAudiences(MutateCustomAudiencesRequest) 59 returns (MutateCustomAudiencesResponse) { 60 option (google.api.http) = { 61 post: "/v14/customers/{customer_id=*}/customAudiences:mutate" 62 body: "*" 63 }; 64 option (google.api.method_signature) = "customer_id,operations"; 65 } 66} 67 68// Request message for 69// [CustomAudienceService.MutateCustomAudiences][google.ads.googleads.v14.services.CustomAudienceService.MutateCustomAudiences]. 70message MutateCustomAudiencesRequest { 71 // Required. The ID of the customer whose custom audiences are being modified. 72 string customer_id = 1 [(google.api.field_behavior) = REQUIRED]; 73 74 // Required. The list of operations to perform on individual custom audiences. 75 repeated CustomAudienceOperation operations = 2 76 [(google.api.field_behavior) = REQUIRED]; 77 78 // If true, the request is validated but not executed. Only errors are 79 // returned, not results. 80 bool validate_only = 3; 81} 82 83// A single operation (create, update) on a custom audience. 84message CustomAudienceOperation { 85 // FieldMask that determines which resource fields are modified in an update. 86 google.protobuf.FieldMask update_mask = 4; 87 88 // The mutate operation. 89 oneof operation { 90 // Create operation: No resource name is expected for the new custom 91 // audience. 92 google.ads.googleads.v14.resources.CustomAudience create = 1; 93 94 // Update operation: The custom audience is expected to have a valid 95 // resource name. 96 google.ads.googleads.v14.resources.CustomAudience update = 2; 97 98 // Remove operation: A resource name for the removed custom audience is 99 // expected, in this format: 100 // 101 // `customers/{customer_id}/customAudiences/{custom_audience_id}` 102 string remove = 3 [(google.api.resource_reference) = { 103 type: "googleads.googleapis.com/CustomAudience" 104 }]; 105 } 106} 107 108// Response message for custom audience mutate. 109message MutateCustomAudiencesResponse { 110 // All results for the mutate. 111 repeated MutateCustomAudienceResult results = 1; 112} 113 114// The result for the custom audience mutate. 115message MutateCustomAudienceResult { 116 // Returned for successful operations. 117 string resource_name = 1 [(google.api.resource_reference) = { 118 type: "googleads.googleapis.com/CustomAudience" 119 }]; 120} 121