• 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.v14.services;
18
19import "google/ads/googleads/v14/enums/response_content_type.proto";
20import "google/ads/googleads/v14/enums/smart_campaign_not_eligible_reason.proto";
21import "google/ads/googleads/v14/enums/smart_campaign_status.proto";
22import "google/ads/googleads/v14/resources/smart_campaign_setting.proto";
23import "google/api/annotations.proto";
24import "google/api/client.proto";
25import "google/api/field_behavior.proto";
26import "google/api/resource.proto";
27import "google/protobuf/field_mask.proto";
28import "google/rpc/status.proto";
29
30option csharp_namespace = "Google.Ads.GoogleAds.V14.Services";
31option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v14/services;services";
32option java_multiple_files = true;
33option java_outer_classname = "SmartCampaignSettingServiceProto";
34option java_package = "com.google.ads.googleads.v14.services";
35option objc_class_prefix = "GAA";
36option php_namespace = "Google\\Ads\\GoogleAds\\V14\\Services";
37option ruby_package = "Google::Ads::GoogleAds::V14::Services";
38
39// Proto file describing the Smart campaign setting service.
40
41// Service to manage Smart campaign settings.
42service SmartCampaignSettingService {
43  option (google.api.default_host) = "googleads.googleapis.com";
44  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/adwords";
45
46  // Returns the status of the requested Smart campaign.
47  rpc GetSmartCampaignStatus(GetSmartCampaignStatusRequest)
48      returns (GetSmartCampaignStatusResponse) {
49    option (google.api.http) = {
50      get: "/v14/{resource_name=customers/*/smartCampaignSettings/*}:getSmartCampaignStatus"
51    };
52    option (google.api.method_signature) = "resource_name";
53  }
54
55  // Updates Smart campaign settings for campaigns.
56  rpc MutateSmartCampaignSettings(MutateSmartCampaignSettingsRequest)
57      returns (MutateSmartCampaignSettingsResponse) {
58    option (google.api.http) = {
59      post: "/v14/customers/{customer_id=*}/smartCampaignSettings:mutate"
60      body: "*"
61    };
62    option (google.api.method_signature) = "customer_id,operations";
63  }
64}
65
66// Request message for
67// [SmartCampaignSettingService.GetSmartCampaignStatus][google.ads.googleads.v14.services.SmartCampaignSettingService.GetSmartCampaignStatus].
68message GetSmartCampaignStatusRequest {
69  // Required. The resource name of the Smart campaign setting belonging to the
70  // Smart campaign to fetch the status of.
71  string resource_name = 1 [
72    (google.api.field_behavior) = REQUIRED,
73    (google.api.resource_reference) = {
74      type: "googleads.googleapis.com/SmartCampaignSetting"
75    }
76  ];
77}
78
79// Details related to Smart campaigns that are not eligible to serve.
80message SmartCampaignNotEligibleDetails {
81  // The reason why the Smart campaign is not eligible to serve.
82  optional google.ads.googleads.v14.enums.SmartCampaignNotEligibleReasonEnum
83      .SmartCampaignNotEligibleReason not_eligible_reason = 1;
84}
85
86// Details related to Smart campaigns that are eligible to serve.
87message SmartCampaignEligibleDetails {
88  // The timestamp of the last impression observed in the last 48 hours for this
89  // campaign.
90  // The timestamp is in the customer’s timezone and in
91  // “yyyy-MM-dd HH:mm:ss” format.
92  optional string last_impression_date_time = 1;
93
94  // The timestamp of when the campaign will end, if applicable.
95  // The timestamp is in the customer’s timezone and in
96  // “yyyy-MM-dd HH:mm:ss” format.
97  optional string end_date_time = 2;
98}
99
100// Details related to paused Smart campaigns.
101message SmartCampaignPausedDetails {
102  // The timestamp of when the campaign was last paused.
103  // The timestamp is in the customer’s timezone and in
104  // “yyyy-MM-dd HH:mm:ss” format.
105  optional string paused_date_time = 1;
106}
107
108// Details related to removed Smart campaigns.
109message SmartCampaignRemovedDetails {
110  // The timestamp of when the campaign was removed.
111  // The timestamp is in the customer’s timezone and in
112  // “yyyy-MM-dd HH:mm:ss” format.
113  optional string removed_date_time = 1;
114}
115
116// Details related to Smart campaigns that have ended.
117message SmartCampaignEndedDetails {
118  // The timestamp of when the campaign ended.
119  // The timestamp is in the customer’s timezone and in
120  // “yyyy-MM-dd HH:mm:ss” format.
121  optional string end_date_time = 1;
122}
123
124// Response message for
125// [SmartCampaignSettingService.GetSmartCampaignStatus][google.ads.googleads.v14.services.SmartCampaignSettingService.GetSmartCampaignStatus].
126message GetSmartCampaignStatusResponse {
127  // The status of this Smart campaign.
128  google.ads.googleads.v14.enums.SmartCampaignStatusEnum.SmartCampaignStatus
129      smart_campaign_status = 1;
130
131  // Additional details accompanying the status of a Smart campaign.
132  oneof smart_campaign_status_details {
133    // Details related to Smart campaigns that are ineligible to serve.
134    SmartCampaignNotEligibleDetails not_eligible_details = 2;
135
136    // Details related to Smart campaigns that are eligible to serve.
137    SmartCampaignEligibleDetails eligible_details = 3;
138
139    // Details related to paused Smart campaigns.
140    SmartCampaignPausedDetails paused_details = 4;
141
142    // Details related to removed Smart campaigns.
143    SmartCampaignRemovedDetails removed_details = 5;
144
145    // Details related to Smart campaigns that have ended.
146    SmartCampaignEndedDetails ended_details = 6;
147  }
148}
149
150// Request message for
151// [SmartCampaignSettingService.MutateSmartCampaignSettings][google.ads.googleads.v14.services.SmartCampaignSettingService.MutateSmartCampaignSettings].
152message MutateSmartCampaignSettingsRequest {
153  // Required. The ID of the customer whose Smart campaign settings are being
154  // modified.
155  string customer_id = 1 [(google.api.field_behavior) = REQUIRED];
156
157  // Required. The list of operations to perform on individual Smart campaign
158  // settings.
159  repeated SmartCampaignSettingOperation operations = 2
160      [(google.api.field_behavior) = REQUIRED];
161
162  // If true, successful operations will be carried out and invalid
163  // operations will return errors. If false, all operations will be carried
164  // out in one transaction if and only if they are all valid.
165  // Default is false.
166  bool partial_failure = 3;
167
168  // If true, the request is validated but not executed. Only errors are
169  // returned, not results.
170  bool validate_only = 4;
171
172  // The response content type setting. Determines whether the mutable resource
173  // or just the resource name should be returned post mutation.
174  google.ads.googleads.v14.enums.ResponseContentTypeEnum.ResponseContentType
175      response_content_type = 5;
176}
177
178// A single operation to update Smart campaign settings for a campaign.
179message SmartCampaignSettingOperation {
180  // Update operation: The Smart campaign setting must specify a valid
181  // resource name.
182  google.ads.googleads.v14.resources.SmartCampaignSetting update = 1;
183
184  // FieldMask that determines which resource fields are modified in an update.
185  google.protobuf.FieldMask update_mask = 2;
186}
187
188// Response message for campaign mutate.
189message MutateSmartCampaignSettingsResponse {
190  // Errors that pertain to operation failures in the partial failure mode.
191  // Returned only when partial_failure = true and all errors occur inside the
192  // operations. If any errors occur outside the operations (for example, auth
193  // errors), we return an RPC level error.
194  google.rpc.Status partial_failure_error = 1;
195
196  // All results for the mutate.
197  repeated MutateSmartCampaignSettingResult results = 2;
198}
199
200// The result for the Smart campaign setting mutate.
201message MutateSmartCampaignSettingResult {
202  // Returned for successful operations.
203  string resource_name = 1 [(google.api.resource_reference) = {
204    type: "googleads.googleapis.com/SmartCampaignSetting"
205  }];
206
207  // The mutated Smart campaign setting with only mutable fields after mutate.
208  // The field will only be returned when response_content_type is set to
209  // "MUTABLE_RESOURCE".
210  google.ads.googleads.v14.resources.SmartCampaignSetting
211      smart_campaign_setting = 2;
212}
213