admob_api.proto 7.1 KB

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