1// Copyright 2020 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.admob.v1; 18 19import "google/ads/admob/v1/admob_resources.proto"; 20import "google/api/annotations.proto"; 21import "google/api/client.proto"; 22import "google/api/field_behavior.proto"; 23import "google/api/resource.proto"; 24 25option go_package = "google.golang.org/genproto/googleapis/ads/admob/v1;admob"; 26option java_outer_classname = "AdMobApiProto"; 27option java_package = "com.google.ads.admob.v1"; 28 29// The AdMob API allows AdMob publishers programmatically get information about 30// their AdMob account. 31service AdMobApi { 32 option (google.api.default_host) = "admob.googleapis.com"; 33 option (google.api.oauth_scopes) = 34 "https://www.googleapis.com/auth/admob.report"; 35 36 // Gets information about the specified AdMob publisher account. 37 rpc GetPublisherAccount(GetPublisherAccountRequest) 38 returns (PublisherAccount) { 39 option (google.api.http) = { 40 get: "/v1/{name=accounts/*}" 41 }; 42 option (google.api.method_signature) = "name"; 43 } 44 45 // Lists the AdMob publisher account accessible with the client credential. 46 // Currently, all credentials have access to at most one AdMob account. 47 rpc ListPublisherAccounts(ListPublisherAccountsRequest) 48 returns (ListPublisherAccountsResponse) { 49 option (google.api.http) = { 50 get: "/v1/accounts" 51 }; 52 } 53 54 // Generates an AdMob Network report based on the provided report 55 // specification. 56 rpc GenerateNetworkReport(GenerateNetworkReportRequest) 57 returns (stream GenerateNetworkReportResponse) { 58 option (google.api.http) = { 59 post: "/v1/{parent=accounts/*}/networkReport:generate" 60 body: "*" 61 }; 62 } 63 64 // Generates an AdMob Mediation report based on the provided report 65 // specification. 66 rpc GenerateMediationReport(GenerateMediationReportRequest) 67 returns (stream GenerateMediationReportResponse) { 68 option (google.api.http) = { 69 post: "/v1/{parent=accounts/*}/mediationReport:generate" 70 body: "*" 71 }; 72 } 73} 74 75// Request to retrieve the specified publisher account. 76message GetPublisherAccountRequest { 77 // Resource name of the publisher account to retrieve. 78 // Example: accounts/pub-9876543210987654 79 string name = 1; 80} 81 82// Request to retrieve the AdMob publisher account accessible with the client 83// credential. Currently all credentials have access to at most 1 account. 84message ListPublisherAccountsRequest { 85 // Maximum number of accounts to return. 86 int32 page_size = 1; 87 88 // The value returned by the last `ListPublisherAccountsResponse`; indicates 89 // that this is a continuation of a prior `ListPublisherAccounts` call, and 90 // that the system should return the next page of data. 91 string page_token = 2; 92} 93 94// Response for the publisher account list request. 95message ListPublisherAccountsResponse { 96 // Publisher that the client credentials can access. 97 repeated PublisherAccount account = 1; 98 99 // If not empty, indicates that there might be more accounts for the request; 100 // you must pass this value in a new `ListPublisherAccountsRequest`. 101 string next_page_token = 2; 102} 103 104// Request to generate an AdMob Mediation report. 105message GenerateMediationReportRequest { 106 // Resource name of the account to generate the report for. 107 // Example: accounts/pub-9876543210987654 108 string parent = 1; 109 110 // Network report specification. 111 MediationReportSpec report_spec = 2; 112} 113 114// The streaming response for the AdMob Mediation report where the first 115// response contains the report header, then a stream of row responses, and 116// finally a footer as the last response message. 117// 118// For example: 119// 120// [{ 121// "header": { 122// "date_range": { 123// "start_date": {"year": 2018, "month": 9, "day": 1}, 124// "end_date": {"year": 2018, "month": 9, "day": 1} 125// }, 126// "localization_settings": { 127// "currency_code": "USD", 128// "language_code": "en-US" 129// } 130// } 131// }, 132// { 133// "row": { 134// "dimension_values": { 135// "DATE": {"value": "20180918"}, 136// "APP": { 137// "value": "ca-app-pub-8123415297019784~1001342552", 138// "display_label": "My app name!" 139// } 140// }, 141// "metric_values": { 142// "ESTIMATED_EARNINGS": {"decimal_value": "1324746"} 143// } 144// } 145// }, 146// { 147// "footer": {"matching_row_count": 1} 148// }] 149message GenerateMediationReportResponse { 150 // Each stream response message contains one type of payload. 151 oneof payload { 152 // Report generation settings that describes the report contents, such as 153 // the report date range and localization settings. 154 ReportHeader header = 1; 155 156 // Actual report data. 157 ReportRow row = 2; 158 159 // Additional information about the generated report, such as warnings about 160 // the data. 161 ReportFooter footer = 3; 162 } 163} 164 165// Request to generate an AdMob Network report. 166message GenerateNetworkReportRequest { 167 // Resource name of the account to generate the report for. 168 // Example: accounts/pub-9876543210987654 169 string parent = 1; 170 171 // Network report specification. 172 NetworkReportSpec report_spec = 2; 173} 174 175// The streaming response for the AdMob Network report where the first response 176// contains the report header, then a stream of row responses, and finally a 177// footer as the last response message. 178// 179// For example: 180// 181// [{ 182// "header": { 183// "dateRange": { 184// "startDate": {"year": 2018, "month": 9, "day": 1}, 185// "endDate": {"year": 2018, "month": 9, "day": 1} 186// }, 187// "localizationSettings": { 188// "currencyCode": "USD", 189// "languageCode": "en-US" 190// } 191// } 192// }, 193// { 194// "row": { 195// "dimensionValues": { 196// "DATE": {"value": "20180918"}, 197// "APP": { 198// "value": "ca-app-pub-8123415297019784~1001342552", 199// displayLabel: "My app name!" 200// } 201// }, 202// "metricValues": { 203// "ESTIMATED_EARNINGS": {"microsValue": 6500000} 204// } 205// } 206// }, 207// { 208// "footer": {"matchingRowCount": 1} 209// }] 210message GenerateNetworkReportResponse { 211 // Each stream response message contains one type of payload. 212 oneof payload { 213 // Report generation settings that describes the report contents, such as 214 // the report date range and localization settings. 215 ReportHeader header = 1; 216 217 // Actual report data. 218 ReportRow row = 2; 219 220 // Additional information about the generated report, such as warnings about 221 // the data. 222 ReportFooter footer = 3; 223 } 224} 225