Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / ads / googleads / v0 / services / campaign_service.proto
1 // Copyright 2018 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 //
15
16 syntax = "proto3";
17
18 package google.ads.googleads.v0.services;
19
20 import "google/ads/googleads/v0/resources/campaign.proto";
21 import "google/api/annotations.proto";
22 import "google/protobuf/field_mask.proto";
23 import "google/protobuf/wrappers.proto";
24 import "google/rpc/status.proto";
25
26 option csharp_namespace = "Google.Ads.GoogleAds.V0.Services";
27 option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v0/services;services";
28 option java_multiple_files = true;
29 option java_outer_classname = "CampaignServiceProto";
30 option java_package = "com.google.ads.googleads.v0.services";
31 option objc_class_prefix = "GAA";
32 option php_namespace = "Google\\Ads\\GoogleAds\\V0\\Services";
33 option ruby_package = "Google::Ads::GoogleAds::V0::Services";
34
35 // Proto file describing the Campaign service.
36
37 // Service to manage campaigns.
38 service CampaignService {
39   // Returns the requested campaign in full detail.
40   rpc GetCampaign(GetCampaignRequest)
41       returns (google.ads.googleads.v0.resources.Campaign) {
42     option (google.api.http) = {
43       get: "/v0/{resource_name=customers/*/campaigns/*}"
44     };
45   }
46
47   // Creates, updates, or removes campaigns. Operation statuses are returned.
48   rpc MutateCampaigns(MutateCampaignsRequest)
49       returns (MutateCampaignsResponse) {
50     option (google.api.http) = {
51       post: "/v0/customers/{customer_id=*}/campaigns:mutate"
52       body: "*"
53     };
54   }
55 }
56
57 // Request message for
58 // [CampaignService.GetCampaign][google.ads.googleads.v0.services.CampaignService.GetCampaign].
59 message GetCampaignRequest {
60   // The resource name of the campaign to fetch.
61   string resource_name = 1;
62 }
63
64 // Request message for
65 // [CampaignService.MutateCampaigns][google.ads.googleads.v0.services.CampaignService.MutateCampaigns].
66 message MutateCampaignsRequest {
67   // The ID of the customer whose campaigns are being modified.
68   string customer_id = 1;
69
70   // The list of operations to perform on individual campaigns.
71   repeated CampaignOperation operations = 2;
72
73   // If true, successful operations will be carried out and invalid
74   // operations will return errors. If false, all operations will be carried
75   // out in one transaction if and only if they are all valid.
76   // Default is false.
77   bool partial_failure = 3;
78
79   // If true, the request is validated but not executed. Only errors are
80   // returned, not results.
81   bool validate_only = 4;
82 }
83
84 // A single operation (create, update, remove) on a campaign.
85 message CampaignOperation {
86   // FieldMask that determines which resource fields are modified in an update.
87   google.protobuf.FieldMask update_mask = 4;
88
89   // The mutate operation.
90   oneof operation {
91     // Create operation: No resource name is expected for the new campaign.
92     google.ads.googleads.v0.resources.Campaign create = 1;
93
94     // Update operation: The campaign is expected to have a valid
95     // resource name.
96     google.ads.googleads.v0.resources.Campaign update = 2;
97
98     // Remove operation: A resource name for the removed campaign is
99     // expected, in this format:
100     //
101     // `customers/{customer_id}/campaigns/{campaign_id}`
102     string remove = 3;
103   }
104 }
105
106 // Response message for campaign mutate.
107 message MutateCampaignsResponse {
108   // Errors that pertain to operation failures in the partial failure mode.
109   // Returned only when partial_failure = true and all errors occur inside the
110   // operations. If any errors occur outside the operations (e.g. auth errors),
111   // we return an RPC level error.
112   google.rpc.Status partial_failure_error = 3;
113
114   // All results for the mutate.
115   repeated MutateCampaignResult results = 2;
116 }
117
118 // The result for the campaign mutate.
119 message MutateCampaignResult {
120   // Returned for successful operations.
121   string resource_name = 1;
122 }