xref: /aosp_15_r20/external/googleapis/google/ads/admanager/v1/report_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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.admanager.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/longrunning/operations.proto";
24
25option csharp_namespace = "Google.Ads.AdManager.V1";
26option go_package = "google.golang.org/genproto/googleapis/ads/admanager/v1;admanager";
27option java_multiple_files = true;
28option java_outer_classname = "ReportServiceProto";
29option java_package = "com.google.ads.admanager.v1";
30option php_namespace = "Google\\Ads\\AdManager\\V1";
31
32// Provides methods for interacting with Reports.
33service ReportService {
34  option (google.api.default_host) = "admanager.googleapis.com";
35
36  // Initiates the execution and export of a report asynchronously. Users can
37  // get the report by polling this operation via
38  // OperationsService.GetOperation.
39  // Intervals of at least 2 seconds are recommended, with an exponential
40  // backoff. Once a report is complete, the operation will contain a
41  // ExportSavedReportResponse in its response field.
42  rpc ExportSavedReport(ExportSavedReportRequest)
43      returns (google.longrunning.Operation) {
44    option (google.api.http) = {
45      post: "/v1/{report=networks/*/reports/*}:exportSavedReport"
46      body: "*"
47    };
48    option (google.api.method_signature) = "report";
49    option (google.longrunning.operation_info) = {
50      response_type: "ExportSavedReportResponse"
51      metadata_type: "ExportSavedReportMetadata"
52    };
53  }
54}
55
56// The Report resource.
57message Report {
58  option (google.api.resource) = {
59    type: "admanager.googleapis.com/Report"
60    pattern: "networks/{network_code}/reports/{report}"
61    plural: "reports"
62    singular: "report"
63  };
64
65  // Identifier. The resource name of the Report.
66  // Report resource name have the form:
67  // `networks/{network_code}/reports/{report_id}`
68  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
69}
70
71// Request proto for the configuration of a report run.
72message ExportSavedReportRequest {
73  // Supported file formats.
74  enum Format {
75    // Default value. This value is unused.
76    FORMAT_UNSPECIFIED = 0;
77
78    // Comma separated values meant to be used by automated machine
79    // processing.
80    //
81    // Unlike other formats, the output is not localized and there is no
82    // totals row by default.
83    CSV_DUMP = 2;
84
85    // The report file is generated as an Office Open XML spreadsheet designed
86    // for Excel 2007+.
87    XLSX = 5;
88
89    // The report is generated as XML.
90    XML = 6;
91  }
92
93  // The name of a particular saved report resource.
94  //
95  // A report will be run based on the specification of this saved report.
96  // It must have the format of
97  // "networks/{network_code}/reports/{report_id}"
98  string report = 1 [(google.api.resource_reference) = {
99    type: "admanager.googleapis.com/Report"
100  }];
101
102  // Required. The export format requested.
103  Format format = 2 [(google.api.field_behavior) = REQUIRED];
104
105  // Whether or not to include the report properties (e.g. network, user, date
106  // generated...) in the generated report.
107  bool include_report_properties = 3;
108
109  // Whether or not to include the IDs if there are any (e.g. advertiser ID,
110  //  order ID...) present in the report.
111  bool include_ids = 4;
112
113  // Whether or not to include a row containing metric totals.
114  bool include_totals_row = 5;
115
116  // The file name of report download. The file extension is determined by
117  // export_format and gzip_compressed.
118  //
119  // Defaults to "DFP Report" if not specified.
120  string file_name = 6;
121}
122
123// The message stored in the google.longrunning.Operation.metadata field.
124// Contains metadata regarding this execution.
125message ExportSavedReportMetadata {
126  // The result generated in this report run.
127  int64 result_id = 1;
128}
129
130// Message included in the longrunning Operation result.response field when
131// the report completes successfully.
132message ExportSavedReportResponse {
133  // The link to the exported file.
134  string download_url = 1;
135}
136