/vendor/google/apiclient-services/src/AnalyticsData/Resource/Properties.php

https://gitlab.com/Japang-Jawara/jawara-penilaian · PHP · 214 lines · 61 code · 4 blank · 149 comment · 0 complexity · c9025a4ae33a7895e8764deb274f5432 MD5 · raw file

  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\AnalyticsData\Resource;
  18. use Google\Service\AnalyticsData\BatchRunPivotReportsRequest;
  19. use Google\Service\AnalyticsData\BatchRunPivotReportsResponse;
  20. use Google\Service\AnalyticsData\BatchRunReportsRequest;
  21. use Google\Service\AnalyticsData\BatchRunReportsResponse;
  22. use Google\Service\AnalyticsData\CheckCompatibilityRequest;
  23. use Google\Service\AnalyticsData\CheckCompatibilityResponse;
  24. use Google\Service\AnalyticsData\Metadata;
  25. use Google\Service\AnalyticsData\RunPivotReportRequest;
  26. use Google\Service\AnalyticsData\RunPivotReportResponse;
  27. use Google\Service\AnalyticsData\RunRealtimeReportRequest;
  28. use Google\Service\AnalyticsData\RunRealtimeReportResponse;
  29. use Google\Service\AnalyticsData\RunReportRequest;
  30. use Google\Service\AnalyticsData\RunReportResponse;
  31. /**
  32. * The "properties" collection of methods.
  33. * Typical usage is:
  34. * <code>
  35. * $analyticsdataService = new Google\Service\AnalyticsData(...);
  36. * $properties = $analyticsdataService->properties;
  37. * </code>
  38. */
  39. class Properties extends \Google\Service\Resource
  40. {
  41. /**
  42. * Returns multiple pivot reports in a batch. All reports must be for the same
  43. * GA4 Property. (properties.batchRunPivotReports)
  44. *
  45. * @param string $property A Google Analytics GA4 property identifier whose
  46. * events are tracked. Specified in the URL path and not the body. To learn
  47. * more, see [where to find your Property
  48. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  49. * /property-id). This property must be specified for the batch. The property
  50. * within RunPivotReportRequest may either be unspecified or consistent with
  51. * this property. Example: properties/1234
  52. * @param BatchRunPivotReportsRequest $postBody
  53. * @param array $optParams Optional parameters.
  54. * @return BatchRunPivotReportsResponse
  55. */
  56. public function batchRunPivotReports($property, BatchRunPivotReportsRequest $postBody, $optParams = [])
  57. {
  58. $params = ['property' => $property, 'postBody' => $postBody];
  59. $params = array_merge($params, $optParams);
  60. return $this->call('batchRunPivotReports', [$params], BatchRunPivotReportsResponse::class);
  61. }
  62. /**
  63. * Returns multiple reports in a batch. All reports must be for the same GA4
  64. * Property. (properties.batchRunReports)
  65. *
  66. * @param string $property A Google Analytics GA4 property identifier whose
  67. * events are tracked. Specified in the URL path and not the body. To learn
  68. * more, see [where to find your Property
  69. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  70. * /property-id). This property must be specified for the batch. The property
  71. * within RunReportRequest may either be unspecified or consistent with this
  72. * property. Example: properties/1234
  73. * @param BatchRunReportsRequest $postBody
  74. * @param array $optParams Optional parameters.
  75. * @return BatchRunReportsResponse
  76. */
  77. public function batchRunReports($property, BatchRunReportsRequest $postBody, $optParams = [])
  78. {
  79. $params = ['property' => $property, 'postBody' => $postBody];
  80. $params = array_merge($params, $optParams);
  81. return $this->call('batchRunReports', [$params], BatchRunReportsResponse::class);
  82. }
  83. /**
  84. * This compatibility method lists dimensions and metrics that can be added to a
  85. * report request and maintain compatibility. This method fails if the request's
  86. * dimensions and metrics are incompatible. In Google Analytics, reports fail if
  87. * they request incompatible dimensions and/or metrics; in that case, you will
  88. * need to remove dimensions and/or metrics from the incompatible report until
  89. * the report is compatible. The Realtime and Core reports have different
  90. * compatibility rules. This method checks compatibility for Core reports.
  91. * (properties.checkCompatibility)
  92. *
  93. * @param string $property A Google Analytics GA4 property identifier whose
  94. * events are tracked. To learn more, see [where to find your Property
  95. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  96. * /property-id). `property` should be the same value as in your `runReport`
  97. * request. Example: properties/1234 Set the Property ID to 0 for compatibility
  98. * checking on dimensions and metrics common to all properties. In this special
  99. * mode, this method will not return custom dimensions and metrics.
  100. * @param CheckCompatibilityRequest $postBody
  101. * @param array $optParams Optional parameters.
  102. * @return CheckCompatibilityResponse
  103. */
  104. public function checkCompatibility($property, CheckCompatibilityRequest $postBody, $optParams = [])
  105. {
  106. $params = ['property' => $property, 'postBody' => $postBody];
  107. $params = array_merge($params, $optParams);
  108. return $this->call('checkCompatibility', [$params], CheckCompatibilityResponse::class);
  109. }
  110. /**
  111. * Returns metadata for dimensions and metrics available in reporting methods.
  112. * Used to explore the dimensions and metrics. In this method, a Google
  113. * Analytics GA4 Property Identifier is specified in the request, and the
  114. * metadata response includes Custom dimensions and metrics as well as Universal
  115. * metadata. For example if a custom metric with parameter name
  116. * `levels_unlocked` is registered to a property, the Metadata response will
  117. * contain `customEvent:levels_unlocked`. Universal metadata are dimensions and
  118. * metrics applicable to any property such as `country` and `totalUsers`.
  119. * (properties.getMetadata)
  120. *
  121. * @param string $name Required. The resource name of the metadata to retrieve.
  122. * This name field is specified in the URL path and not URL parameters. Property
  123. * is a numeric Google Analytics GA4 Property identifier. To learn more, see
  124. * [where to find your Property
  125. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  126. * /property-id). Example: properties/1234/metadata Set the Property ID to 0 for
  127. * dimensions and metrics common to all properties. In this special mode, this
  128. * method will not return custom dimensions and metrics.
  129. * @param array $optParams Optional parameters.
  130. * @return Metadata
  131. */
  132. public function getMetadata($name, $optParams = [])
  133. {
  134. $params = ['name' => $name];
  135. $params = array_merge($params, $optParams);
  136. return $this->call('getMetadata', [$params], Metadata::class);
  137. }
  138. /**
  139. * Returns a customized pivot report of your Google Analytics event data. Pivot
  140. * reports are more advanced and expressive formats than regular reports. In a
  141. * pivot report, dimensions are only visible if they are included in a pivot.
  142. * Multiple pivots can be specified to further dissect your data.
  143. * (properties.runPivotReport)
  144. *
  145. * @param string $property A Google Analytics GA4 property identifier whose
  146. * events are tracked. Specified in the URL path and not the body. To learn
  147. * more, see [where to find your Property
  148. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  149. * /property-id). Within a batch request, this property should either be
  150. * unspecified or consistent with the batch-level property. Example:
  151. * properties/1234
  152. * @param RunPivotReportRequest $postBody
  153. * @param array $optParams Optional parameters.
  154. * @return RunPivotReportResponse
  155. */
  156. public function runPivotReport($property, RunPivotReportRequest $postBody, $optParams = [])
  157. {
  158. $params = ['property' => $property, 'postBody' => $postBody];
  159. $params = array_merge($params, $optParams);
  160. return $this->call('runPivotReport', [$params], RunPivotReportResponse::class);
  161. }
  162. /**
  163. * The Google Analytics Realtime API returns a customized report of realtime
  164. * event data for your property. These reports show events and usage from the
  165. * last 30 minutes. (properties.runRealtimeReport)
  166. *
  167. * @param string $property A Google Analytics GA4 property identifier whose
  168. * events are tracked. Specified in the URL path and not the body. To learn
  169. * more, see [where to find your Property
  170. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  171. * /property-id). Example: properties/1234
  172. * @param RunRealtimeReportRequest $postBody
  173. * @param array $optParams Optional parameters.
  174. * @return RunRealtimeReportResponse
  175. */
  176. public function runRealtimeReport($property, RunRealtimeReportRequest $postBody, $optParams = [])
  177. {
  178. $params = ['property' => $property, 'postBody' => $postBody];
  179. $params = array_merge($params, $optParams);
  180. return $this->call('runRealtimeReport', [$params], RunRealtimeReportResponse::class);
  181. }
  182. /**
  183. * Returns a customized report of your Google Analytics event data. Reports
  184. * contain statistics derived from data collected by the Google Analytics
  185. * tracking code. The data returned from the API is as a table with columns for
  186. * the requested dimensions and metrics. Metrics are individual measurements of
  187. * user activity on your property, such as active users or event count.
  188. * Dimensions break down metrics across some common criteria, such as country or
  189. * event name. (properties.runReport)
  190. *
  191. * @param string $property A Google Analytics GA4 property identifier whose
  192. * events are tracked. Specified in the URL path and not the body. To learn
  193. * more, see [where to find your Property
  194. * ID](https://developers.google.com/analytics/devguides/reporting/data/v1
  195. * /property-id). Within a batch request, this property should either be
  196. * unspecified or consistent with the batch-level property. Example:
  197. * properties/1234
  198. * @param RunReportRequest $postBody
  199. * @param array $optParams Optional parameters.
  200. * @return RunReportResponse
  201. */
  202. public function runReport($property, RunReportRequest $postBody, $optParams = [])
  203. {
  204. $params = ['property' => $property, 'postBody' => $postBody];
  205. $params = array_merge($params, $optParams);
  206. return $this->call('runReport', [$params], RunReportResponse::class);
  207. }
  208. }
  209. // Adding a class alias for backwards compatibility with the previous class name.
  210. class_alias(Properties::class, 'Google_Service_AnalyticsData_Resource_Properties');