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/shared_criterion.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 = "SharedCriterionServiceProto"; 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 Shared Criterion service. 37 38// Service to manage shared criteria. 39service SharedCriterionService { 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 shared criteria. Operation statuses are returned. 44 // 45 // List of thrown errors: 46 // [AuthenticationError]() 47 // [AuthorizationError]() 48 // [CriterionError]() 49 // [DatabaseError]() 50 // [DistinctError]() 51 // [FieldError]() 52 // [HeaderError]() 53 // [IdError]() 54 // [InternalError]() 55 // [MutateError]() 56 // [NotEmptyError]() 57 // [NullError]() 58 // [OperatorError]() 59 // [QuotaError]() 60 // [RangeError]() 61 // [RequestError]() 62 // [ResourceCountLimitExceededError]() 63 // [SizeLimitError]() 64 // [StringFormatError]() 65 // [StringLengthError]() 66 rpc MutateSharedCriteria(MutateSharedCriteriaRequest) 67 returns (MutateSharedCriteriaResponse) { 68 option (google.api.http) = { 69 post: "/v14/customers/{customer_id=*}/sharedCriteria:mutate" 70 body: "*" 71 }; 72 option (google.api.method_signature) = "customer_id,operations"; 73 } 74} 75 76// Request message for 77// [SharedCriterionService.MutateSharedCriteria][google.ads.googleads.v14.services.SharedCriterionService.MutateSharedCriteria]. 78message MutateSharedCriteriaRequest { 79 // Required. The ID of the customer whose shared criteria are being modified. 80 string customer_id = 1 [(google.api.field_behavior) = REQUIRED]; 81 82 // Required. The list of operations to perform on individual shared criteria. 83 repeated SharedCriterionOperation 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.v14.enums.ResponseContentTypeEnum.ResponseContentType 99 response_content_type = 5; 100} 101 102// A single operation (create, remove) on an shared criterion. 103message SharedCriterionOperation { 104 // The mutate operation. 105 oneof operation { 106 // Create operation: No resource name is expected for the new shared 107 // criterion. 108 google.ads.googleads.v14.resources.SharedCriterion create = 1; 109 110 // Remove operation: A resource name for the removed shared criterion is 111 // expected, in this format: 112 // 113 // `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}` 114 string remove = 3 [(google.api.resource_reference) = { 115 type: "googleads.googleapis.com/SharedCriterion" 116 }]; 117 } 118} 119 120// Response message for a shared criterion mutate. 121message MutateSharedCriteriaResponse { 122 // Errors that pertain to operation failures in the partial failure mode. 123 // Returned only when partial_failure = true and all errors occur inside the 124 // operations. If any errors occur outside the operations (for example, auth 125 // errors), we return an RPC level error. 126 google.rpc.Status partial_failure_error = 3; 127 128 // All results for the mutate. 129 repeated MutateSharedCriterionResult results = 2; 130} 131 132// The result for the shared criterion mutate. 133message MutateSharedCriterionResult { 134 // Returned for successful operations. 135 string resource_name = 1 [(google.api.resource_reference) = { 136 type: "googleads.googleapis.com/SharedCriterion" 137 }]; 138 139 // The mutated shared criterion with only mutable fields after mutate. The 140 // field will only be returned when response_content_type is set to 141 // "MUTABLE_RESOURCE". 142 google.ads.googleads.v14.resources.SharedCriterion shared_criterion = 2; 143} 144