• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/ad_parameter.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 = "AdParameterServiceProto";
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 Ad Parameter service.
38
39// Service to manage ad parameters.
40service AdParameterService {
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 ad parameters. Operation statuses are
45  // returned.
46  //
47  // List of thrown errors:
48  //   [AdParameterError]()
49  //   [AuthenticationError]()
50  //   [AuthorizationError]()
51  //   [ContextError]()
52  //   [DatabaseError]()
53  //   [FieldError]()
54  //   [FieldMaskError]()
55  //   [HeaderError]()
56  //   [InternalError]()
57  //   [MutateError]()
58  //   [QuotaError]()
59  //   [RequestError]()
60  rpc MutateAdParameters(MutateAdParametersRequest)
61      returns (MutateAdParametersResponse) {
62    option (google.api.http) = {
63      post: "/v16/customers/{customer_id=*}/adParameters:mutate"
64      body: "*"
65    };
66    option (google.api.method_signature) = "customer_id,operations";
67  }
68}
69
70// Request message for
71// [AdParameterService.MutateAdParameters][google.ads.googleads.v16.services.AdParameterService.MutateAdParameters]
72message MutateAdParametersRequest {
73  // Required. The ID of the customer whose ad parameters are being modified.
74  string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
75
76  // Required. The list of operations to perform on individual ad parameters.
77  repeated AdParameterOperation operations = 2
78      [(google.api.field_behavior) = REQUIRED];
79
80  // If true, successful operations will be carried out and invalid
81  // operations will return errors. If false, all operations will be carried
82  // out in one transaction if and only if they are all valid.
83  // Default is false.
84  bool partial_failure = 3;
85
86  // If true, the request is validated but not executed. Only errors are
87  // returned, not results.
88  bool validate_only = 4;
89
90  // The response content type setting. Determines whether the mutable resource
91  // or just the resource name should be returned post mutation.
92  google.ads.googleads.v16.enums.ResponseContentTypeEnum.ResponseContentType
93      response_content_type = 5;
94}
95
96// A single operation (create, update, remove) on ad parameter.
97message AdParameterOperation {
98  // FieldMask that determines which resource fields are modified in an update.
99  google.protobuf.FieldMask update_mask = 4;
100
101  // The mutate operation.
102  oneof operation {
103    // Create operation: No resource name is expected for the new ad parameter.
104    google.ads.googleads.v16.resources.AdParameter create = 1;
105
106    // Update operation: The ad parameter is expected to have a valid resource
107    // name.
108    google.ads.googleads.v16.resources.AdParameter update = 2;
109
110    // Remove operation: A resource name for the ad parameter to remove is
111    // expected in this format:
112    //
113    // `customers/{customer_id}/adParameters/{ad_group_id}~{criterion_id}~{parameter_index}`
114    string remove = 3 [(google.api.resource_reference) = {
115      type: "googleads.googleapis.com/AdParameter"
116    }];
117  }
118}
119
120// Response message for an ad parameter mutate.
121message MutateAdParametersResponse {
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 MutateAdParameterResult results = 2;
130}
131
132// The result for the ad parameter mutate.
133message MutateAdParameterResult {
134  // The resource name returned for successful operations.
135  string resource_name = 1 [(google.api.resource_reference) = {
136    type: "googleads.googleapis.com/AdParameter"
137  }];
138
139  // The mutated AdParameter with only mutable fields after mutate. The field
140  // will only be returned when response_content_type is set to
141  // "MUTABLE_RESOURCE".
142  google.ads.googleads.v16.resources.AdParameter ad_parameter = 2;
143}
144