1919from typing import Dict , Sequence , Tuple , Type , Union
2020import pkg_resources
2121
22- import google .api_core .client_options as ClientOptions # type: ignore
22+ from google .api_core .client_options import ClientOptions # type: ignore
2323from google .api_core import exceptions as core_exceptions # type: ignore
2424from google .api_core import gapic_v1 # type: ignore
2525from google .api_core import retry as retries # type: ignore
2626from google .auth import credentials as ga_credentials # type: ignore
2727from google .oauth2 import service_account # type: ignore
2828
29+ OptionalRetry = Union [retries .Retry , object ]
30+
2931from google .analytics .data_v1beta .types import analytics_data_api
3032from google .analytics .data_v1beta .types import data
3133from .transports .base import BetaAnalyticsDataTransport , DEFAULT_CLIENT_INFO
@@ -163,9 +165,9 @@ def __init__(
163165
164166 async def run_report (
165167 self ,
166- request : analytics_data_api .RunReportRequest = None ,
168+ request : Union [ analytics_data_api .RunReportRequest , dict ] = None ,
167169 * ,
168- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
170+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
169171 timeout : float = None ,
170172 metadata : Sequence [Tuple [str , str ]] = (),
171173 ) -> analytics_data_api .RunReportResponse :
@@ -180,7 +182,7 @@ async def run_report(
180182 criteria, such as country or event name.
181183
182184 Args:
183- request (:class:` google.analytics.data_v1beta.types.RunReportRequest` ):
185+ request (Union[ google.analytics.data_v1beta.types.RunReportRequest, dict] ):
184186 The request object. The request to generate a report.
185187 retry (google.api_core.retry.Retry): Designation of what errors, if any,
186188 should be retried.
@@ -219,9 +221,9 @@ async def run_report(
219221
220222 async def run_pivot_report (
221223 self ,
222- request : analytics_data_api .RunPivotReportRequest = None ,
224+ request : Union [ analytics_data_api .RunPivotReportRequest , dict ] = None ,
223225 * ,
224- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
226+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
225227 timeout : float = None ,
226228 metadata : Sequence [Tuple [str , str ]] = (),
227229 ) -> analytics_data_api .RunPivotReportResponse :
@@ -233,7 +235,7 @@ async def run_pivot_report(
233235 dissect your data.
234236
235237 Args:
236- request (:class:` google.analytics.data_v1beta.types.RunPivotReportRequest` ):
238+ request (Union[ google.analytics.data_v1beta.types.RunPivotReportRequest, dict] ):
237239 The request object. The request to generate a pivot
238240 report.
239241 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -273,17 +275,17 @@ async def run_pivot_report(
273275
274276 async def batch_run_reports (
275277 self ,
276- request : analytics_data_api .BatchRunReportsRequest = None ,
278+ request : Union [ analytics_data_api .BatchRunReportsRequest , dict ] = None ,
277279 * ,
278- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
280+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
279281 timeout : float = None ,
280282 metadata : Sequence [Tuple [str , str ]] = (),
281283 ) -> analytics_data_api .BatchRunReportsResponse :
282284 r"""Returns multiple reports in a batch. All reports must
283285 be for the same GA4 Property.
284286
285287 Args:
286- request (:class:` google.analytics.data_v1beta.types.BatchRunReportsRequest` ):
288+ request (Union[ google.analytics.data_v1beta.types.BatchRunReportsRequest, dict] ):
287289 The request object. The batch request containing
288290 multiple report requests.
289291 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -323,17 +325,17 @@ async def batch_run_reports(
323325
324326 async def batch_run_pivot_reports (
325327 self ,
326- request : analytics_data_api .BatchRunPivotReportsRequest = None ,
328+ request : Union [ analytics_data_api .BatchRunPivotReportsRequest , dict ] = None ,
327329 * ,
328- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
330+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
329331 timeout : float = None ,
330332 metadata : Sequence [Tuple [str , str ]] = (),
331333 ) -> analytics_data_api .BatchRunPivotReportsResponse :
332334 r"""Returns multiple pivot reports in a batch. All
333335 reports must be for the same GA4 Property.
334336
335337 Args:
336- request (:class:` google.analytics.data_v1beta.types.BatchRunPivotReportsRequest` ):
338+ request (Union[ google.analytics.data_v1beta.types.BatchRunPivotReportsRequest, dict] ):
337339 The request object. The batch request containing
338340 multiple pivot report requests.
339341 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -373,10 +375,10 @@ async def batch_run_pivot_reports(
373375
374376 async def get_metadata (
375377 self ,
376- request : analytics_data_api .GetMetadataRequest = None ,
378+ request : Union [ analytics_data_api .GetMetadataRequest , dict ] = None ,
377379 * ,
378380 name : str = None ,
379- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
381+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
380382 timeout : float = None ,
381383 metadata : Sequence [Tuple [str , str ]] = (),
382384 ) -> analytics_data_api .Metadata :
@@ -393,7 +395,7 @@ async def get_metadata(
393395 such as ``country`` and ``totalUsers``.
394396
395397 Args:
396- request (:class:` google.analytics.data_v1beta.types.GetMetadataRequest` ):
398+ request (Union[ google.analytics.data_v1beta.types.GetMetadataRequest, dict] ):
397399 The request object. Request for a property's dimension
398400 and metric metadata.
399401 name (:class:`str`):
@@ -464,9 +466,9 @@ async def get_metadata(
464466
465467 async def run_realtime_report (
466468 self ,
467- request : analytics_data_api .RunRealtimeReportRequest = None ,
469+ request : Union [ analytics_data_api .RunRealtimeReportRequest , dict ] = None ,
468470 * ,
469- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
471+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
470472 timeout : float = None ,
471473 metadata : Sequence [Tuple [str , str ]] = (),
472474 ) -> analytics_data_api .RunRealtimeReportResponse :
@@ -476,7 +478,7 @@ async def run_realtime_report(
476478 last 30 minutes.
477479
478480 Args:
479- request (:class:` google.analytics.data_v1beta.types.RunRealtimeReportRequest` ):
481+ request (Union[ google.analytics.data_v1beta.types.RunRealtimeReportRequest, dict] ):
480482 The request object. The request to generate a realtime
481483 report.
482484 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -516,9 +518,9 @@ async def run_realtime_report(
516518
517519 async def check_compatibility (
518520 self ,
519- request : analytics_data_api .CheckCompatibilityRequest = None ,
521+ request : Union [ analytics_data_api .CheckCompatibilityRequest , dict ] = None ,
520522 * ,
521- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
523+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
522524 timeout : float = None ,
523525 metadata : Sequence [Tuple [str , str ]] = (),
524526 ) -> analytics_data_api .CheckCompatibilityResponse :
@@ -535,7 +537,7 @@ async def check_compatibility(
535537 for Core reports.
536538
537539 Args:
538- request (:class:` google.analytics.data_v1beta.types.CheckCompatibilityRequest` ):
540+ request (Union[ google.analytics.data_v1beta.types.CheckCompatibilityRequest, dict] ):
539541 The request object. The request for compatibility
540542 information for a report's dimensions and metrics. Check
541543 compatibility provides a preview of the compatibility of
0 commit comments