google-analytics-admin 0.23.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. google/analytics/admin/__init__.py +615 -0
  2. google/analytics/admin/gapic_version.py +16 -0
  3. google/analytics/admin/py.typed +2 -0
  4. google/analytics/admin_v1alpha/__init__.py +613 -0
  5. google/analytics/admin_v1alpha/gapic_metadata.json +2278 -0
  6. google/analytics/admin_v1alpha/gapic_version.py +16 -0
  7. google/analytics/admin_v1alpha/py.typed +2 -0
  8. google/analytics/admin_v1alpha/services/__init__.py +15 -0
  9. google/analytics/admin_v1alpha/services/analytics_admin_service/__init__.py +22 -0
  10. google/analytics/admin_v1alpha/services/analytics_admin_service/async_client.py +14122 -0
  11. google/analytics/admin_v1alpha/services/analytics_admin_service/client.py +14680 -0
  12. google/analytics/admin_v1alpha/services/analytics_admin_service/pagers.py +4337 -0
  13. google/analytics/admin_v1alpha/services/analytics_admin_service/transports/__init__.py +41 -0
  14. google/analytics/admin_v1alpha/services/analytics_admin_service/transports/base.py +2494 -0
  15. google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc.py +4797 -0
  16. google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc_asyncio.py +5671 -0
  17. google/analytics/admin_v1alpha/services/analytics_admin_service/transports/rest.py +31875 -0
  18. google/analytics/admin_v1alpha/services/analytics_admin_service/transports/rest_base.py +7944 -0
  19. google/analytics/admin_v1alpha/types/__init__.py +602 -0
  20. google/analytics/admin_v1alpha/types/access_report.py +705 -0
  21. google/analytics/admin_v1alpha/types/analytics_admin.py +4997 -0
  22. google/analytics/admin_v1alpha/types/audience.py +781 -0
  23. google/analytics/admin_v1alpha/types/channel_group.py +309 -0
  24. google/analytics/admin_v1alpha/types/event_create_and_edit.py +298 -0
  25. google/analytics/admin_v1alpha/types/expanded_data_set.py +282 -0
  26. google/analytics/admin_v1alpha/types/resources.py +3289 -0
  27. google/analytics/admin_v1alpha/types/subproperty_event_filter.py +292 -0
  28. google/analytics/admin_v1beta/__init__.py +255 -0
  29. google/analytics/admin_v1beta/gapic_metadata.json +838 -0
  30. google/analytics/admin_v1beta/gapic_version.py +16 -0
  31. google/analytics/admin_v1beta/py.typed +2 -0
  32. google/analytics/admin_v1beta/services/__init__.py +15 -0
  33. google/analytics/admin_v1beta/services/analytics_admin_service/__init__.py +22 -0
  34. google/analytics/admin_v1beta/services/analytics_admin_service/async_client.py +6707 -0
  35. google/analytics/admin_v1beta/services/analytics_admin_service/client.py +7164 -0
  36. google/analytics/admin_v1beta/services/analytics_admin_service/pagers.py +1927 -0
  37. google/analytics/admin_v1beta/services/analytics_admin_service/transports/__init__.py +41 -0
  38. google/analytics/admin_v1beta/services/analytics_admin_service/transports/base.py +965 -0
  39. google/analytics/admin_v1beta/services/analytics_admin_service/transports/grpc.py +1917 -0
  40. google/analytics/admin_v1beta/services/analytics_admin_service/transports/grpc_asyncio.py +2251 -0
  41. google/analytics/admin_v1beta/services/analytics_admin_service/transports/rest.py +11423 -0
  42. google/analytics/admin_v1beta/services/analytics_admin_service/transports/rest_base.py +2857 -0
  43. google/analytics/admin_v1beta/types/__init__.py +244 -0
  44. google/analytics/admin_v1beta/types/access_report.py +705 -0
  45. google/analytics/admin_v1beta/types/analytics_admin.py +2006 -0
  46. google/analytics/admin_v1beta/types/resources.py +1677 -0
  47. google_analytics_admin-0.23.6.dist-info/LICENSE +202 -0
  48. google_analytics_admin-0.23.6.dist-info/METADATA +228 -0
  49. google_analytics_admin-0.23.6.dist-info/RECORD +51 -0
  50. google_analytics_admin-0.23.6.dist-info/WHEEL +5 -0
  51. google_analytics_admin-0.23.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1917 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ import json
17
+ import logging as std_logging
18
+ import pickle
19
+ from typing import Callable, Dict, Optional, Sequence, Tuple, Union
20
+ import warnings
21
+
22
+ from google.api_core import gapic_v1, grpc_helpers
23
+ import google.auth # type: ignore
24
+ from google.auth import credentials as ga_credentials # type: ignore
25
+ from google.auth.transport.grpc import SslCredentials # type: ignore
26
+ from google.protobuf import empty_pb2 # type: ignore
27
+ from google.protobuf.json_format import MessageToJson
28
+ import google.protobuf.message
29
+ import grpc # type: ignore
30
+ import proto # type: ignore
31
+
32
+ from google.analytics.admin_v1beta.types import analytics_admin, resources
33
+
34
+ from .base import DEFAULT_CLIENT_INFO, AnalyticsAdminServiceTransport
35
+
36
+ try:
37
+ from google.api_core import client_logging # type: ignore
38
+
39
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
40
+ except ImportError: # pragma: NO COVER
41
+ CLIENT_LOGGING_SUPPORTED = False
42
+
43
+ _LOGGER = std_logging.getLogger(__name__)
44
+
45
+
46
+ class _LoggingClientInterceptor(grpc.UnaryUnaryClientInterceptor): # pragma: NO COVER
47
+ def intercept_unary_unary(self, continuation, client_call_details, request):
48
+ logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
49
+ std_logging.DEBUG
50
+ )
51
+ if logging_enabled: # pragma: NO COVER
52
+ request_metadata = client_call_details.metadata
53
+ if isinstance(request, proto.Message):
54
+ request_payload = type(request).to_json(request)
55
+ elif isinstance(request, google.protobuf.message.Message):
56
+ request_payload = MessageToJson(request)
57
+ else:
58
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
59
+
60
+ request_metadata = {
61
+ key: value.decode("utf-8") if isinstance(value, bytes) else value
62
+ for key, value in request_metadata
63
+ }
64
+ grpc_request = {
65
+ "payload": request_payload,
66
+ "requestMethod": "grpc",
67
+ "metadata": dict(request_metadata),
68
+ }
69
+ _LOGGER.debug(
70
+ f"Sending request for {client_call_details.method}",
71
+ extra={
72
+ "serviceName": "google.analytics.admin.v1beta.AnalyticsAdminService",
73
+ "rpcName": client_call_details.method,
74
+ "request": grpc_request,
75
+ "metadata": grpc_request["metadata"],
76
+ },
77
+ )
78
+
79
+ response = continuation(client_call_details, request)
80
+ if logging_enabled: # pragma: NO COVER
81
+ response_metadata = response.trailing_metadata()
82
+ # Convert gRPC metadata `<class 'grpc.aio._metadata.Metadata'>` to list of tuples
83
+ metadata = (
84
+ dict([(k, str(v)) for k, v in response_metadata])
85
+ if response_metadata
86
+ else None
87
+ )
88
+ result = response.result()
89
+ if isinstance(result, proto.Message):
90
+ response_payload = type(result).to_json(result)
91
+ elif isinstance(result, google.protobuf.message.Message):
92
+ response_payload = MessageToJson(result)
93
+ else:
94
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
95
+ grpc_response = {
96
+ "payload": response_payload,
97
+ "metadata": metadata,
98
+ "status": "OK",
99
+ }
100
+ _LOGGER.debug(
101
+ f"Received response for {client_call_details.method}.",
102
+ extra={
103
+ "serviceName": "google.analytics.admin.v1beta.AnalyticsAdminService",
104
+ "rpcName": client_call_details.method,
105
+ "response": grpc_response,
106
+ "metadata": grpc_response["metadata"],
107
+ },
108
+ )
109
+ return response
110
+
111
+
112
+ class AnalyticsAdminServiceGrpcTransport(AnalyticsAdminServiceTransport):
113
+ """gRPC backend transport for AnalyticsAdminService.
114
+
115
+ Service Interface for the Google Analytics Admin API.
116
+
117
+ This class defines the same methods as the primary client, so the
118
+ primary client can load the underlying transport implementation
119
+ and call it.
120
+
121
+ It sends protocol buffers over the wire using gRPC (which is built on
122
+ top of HTTP/2); the ``grpcio`` package must be installed.
123
+ """
124
+
125
+ _stubs: Dict[str, Callable]
126
+
127
+ def __init__(
128
+ self,
129
+ *,
130
+ host: str = "analyticsadmin.googleapis.com",
131
+ credentials: Optional[ga_credentials.Credentials] = None,
132
+ credentials_file: Optional[str] = None,
133
+ scopes: Optional[Sequence[str]] = None,
134
+ channel: Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]] = None,
135
+ api_mtls_endpoint: Optional[str] = None,
136
+ client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
137
+ ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
138
+ client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
139
+ quota_project_id: Optional[str] = None,
140
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
141
+ always_use_jwt_access: Optional[bool] = False,
142
+ api_audience: Optional[str] = None,
143
+ ) -> None:
144
+ """Instantiate the transport.
145
+
146
+ Args:
147
+ host (Optional[str]):
148
+ The hostname to connect to (default: 'analyticsadmin.googleapis.com').
149
+ credentials (Optional[google.auth.credentials.Credentials]): The
150
+ authorization credentials to attach to requests. These
151
+ credentials identify the application to the service; if none
152
+ are specified, the client will attempt to ascertain the
153
+ credentials from the environment.
154
+ This argument is ignored if a ``channel`` instance is provided.
155
+ credentials_file (Optional[str]): A file with credentials that can
156
+ be loaded with :func:`google.auth.load_credentials_from_file`.
157
+ This argument is ignored if a ``channel`` instance is provided.
158
+ scopes (Optional(Sequence[str])): A list of scopes. This argument is
159
+ ignored if a ``channel`` instance is provided.
160
+ channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
161
+ A ``Channel`` instance through which to make calls, or a Callable
162
+ that constructs and returns one. If set to None, ``self.create_channel``
163
+ is used to create the channel. If a Callable is given, it will be called
164
+ with the same arguments as used in ``self.create_channel``.
165
+ api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
166
+ If provided, it overrides the ``host`` argument and tries to create
167
+ a mutual TLS channel with client SSL credentials from
168
+ ``client_cert_source`` or application default SSL credentials.
169
+ client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
170
+ Deprecated. A callback to provide client SSL certificate bytes and
171
+ private key bytes, both in PEM format. It is ignored if
172
+ ``api_mtls_endpoint`` is None.
173
+ ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
174
+ for the grpc channel. It is ignored if a ``channel`` instance is provided.
175
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
176
+ A callback to provide client certificate bytes and private key bytes,
177
+ both in PEM format. It is used to configure a mutual TLS channel. It is
178
+ ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
179
+ quota_project_id (Optional[str]): An optional project to use for billing
180
+ and quota.
181
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
182
+ The client info used to send a user-agent string along with
183
+ API requests. If ``None``, then default info will be used.
184
+ Generally, you only need to set this if you're developing
185
+ your own client library.
186
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
187
+ be used for service account credentials.
188
+
189
+ Raises:
190
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
191
+ creation failed for any reason.
192
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
193
+ and ``credentials_file`` are passed.
194
+ """
195
+ self._grpc_channel = None
196
+ self._ssl_channel_credentials = ssl_channel_credentials
197
+ self._stubs: Dict[str, Callable] = {}
198
+
199
+ if api_mtls_endpoint:
200
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
201
+ if client_cert_source:
202
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
203
+
204
+ if isinstance(channel, grpc.Channel):
205
+ # Ignore credentials if a channel was passed.
206
+ credentials = None
207
+ self._ignore_credentials = True
208
+ # If a channel was explicitly provided, set it.
209
+ self._grpc_channel = channel
210
+ self._ssl_channel_credentials = None
211
+
212
+ else:
213
+ if api_mtls_endpoint:
214
+ host = api_mtls_endpoint
215
+
216
+ # Create SSL credentials with client_cert_source or application
217
+ # default SSL credentials.
218
+ if client_cert_source:
219
+ cert, key = client_cert_source()
220
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
221
+ certificate_chain=cert, private_key=key
222
+ )
223
+ else:
224
+ self._ssl_channel_credentials = SslCredentials().ssl_credentials
225
+
226
+ else:
227
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
228
+ cert, key = client_cert_source_for_mtls()
229
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
230
+ certificate_chain=cert, private_key=key
231
+ )
232
+
233
+ # The base transport sets the host, credentials and scopes
234
+ super().__init__(
235
+ host=host,
236
+ credentials=credentials,
237
+ credentials_file=credentials_file,
238
+ scopes=scopes,
239
+ quota_project_id=quota_project_id,
240
+ client_info=client_info,
241
+ always_use_jwt_access=always_use_jwt_access,
242
+ api_audience=api_audience,
243
+ )
244
+
245
+ if not self._grpc_channel:
246
+ # initialize with the provided callable or the default channel
247
+ channel_init = channel or type(self).create_channel
248
+ self._grpc_channel = channel_init(
249
+ self._host,
250
+ # use the credentials which are saved
251
+ credentials=self._credentials,
252
+ # Set ``credentials_file`` to ``None`` here as
253
+ # the credentials that we saved earlier should be used.
254
+ credentials_file=None,
255
+ scopes=self._scopes,
256
+ ssl_credentials=self._ssl_channel_credentials,
257
+ quota_project_id=quota_project_id,
258
+ options=[
259
+ ("grpc.max_send_message_length", -1),
260
+ ("grpc.max_receive_message_length", -1),
261
+ ],
262
+ )
263
+
264
+ self._interceptor = _LoggingClientInterceptor()
265
+ self._logged_channel = grpc.intercept_channel(
266
+ self._grpc_channel, self._interceptor
267
+ )
268
+
269
+ # Wrap messages. This must be done after self._logged_channel exists
270
+ self._prep_wrapped_messages(client_info)
271
+
272
+ @classmethod
273
+ def create_channel(
274
+ cls,
275
+ host: str = "analyticsadmin.googleapis.com",
276
+ credentials: Optional[ga_credentials.Credentials] = None,
277
+ credentials_file: Optional[str] = None,
278
+ scopes: Optional[Sequence[str]] = None,
279
+ quota_project_id: Optional[str] = None,
280
+ **kwargs,
281
+ ) -> grpc.Channel:
282
+ """Create and return a gRPC channel object.
283
+ Args:
284
+ host (Optional[str]): The host for the channel to use.
285
+ credentials (Optional[~.Credentials]): The
286
+ authorization credentials to attach to requests. These
287
+ credentials identify this application to the service. If
288
+ none are specified, the client will attempt to ascertain
289
+ the credentials from the environment.
290
+ credentials_file (Optional[str]): A file with credentials that can
291
+ be loaded with :func:`google.auth.load_credentials_from_file`.
292
+ This argument is mutually exclusive with credentials.
293
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
294
+ service. These are only used when credentials are not specified and
295
+ are passed to :func:`google.auth.default`.
296
+ quota_project_id (Optional[str]): An optional project to use for billing
297
+ and quota.
298
+ kwargs (Optional[dict]): Keyword arguments, which are passed to the
299
+ channel creation.
300
+ Returns:
301
+ grpc.Channel: A gRPC channel object.
302
+
303
+ Raises:
304
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
305
+ and ``credentials_file`` are passed.
306
+ """
307
+
308
+ return grpc_helpers.create_channel(
309
+ host,
310
+ credentials=credentials,
311
+ credentials_file=credentials_file,
312
+ quota_project_id=quota_project_id,
313
+ default_scopes=cls.AUTH_SCOPES,
314
+ scopes=scopes,
315
+ default_host=cls.DEFAULT_HOST,
316
+ **kwargs,
317
+ )
318
+
319
+ @property
320
+ def grpc_channel(self) -> grpc.Channel:
321
+ """Return the channel designed to connect to this service."""
322
+ return self._grpc_channel
323
+
324
+ @property
325
+ def get_account(
326
+ self,
327
+ ) -> Callable[[analytics_admin.GetAccountRequest], resources.Account]:
328
+ r"""Return a callable for the get account method over gRPC.
329
+
330
+ Lookup for a single Account.
331
+
332
+ Returns:
333
+ Callable[[~.GetAccountRequest],
334
+ ~.Account]:
335
+ A function that, when called, will call the underlying RPC
336
+ on the server.
337
+ """
338
+ # Generate a "stub function" on-the-fly which will actually make
339
+ # the request.
340
+ # gRPC handles serialization and deserialization, so we just need
341
+ # to pass in the functions for each.
342
+ if "get_account" not in self._stubs:
343
+ self._stubs["get_account"] = self._logged_channel.unary_unary(
344
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetAccount",
345
+ request_serializer=analytics_admin.GetAccountRequest.serialize,
346
+ response_deserializer=resources.Account.deserialize,
347
+ )
348
+ return self._stubs["get_account"]
349
+
350
+ @property
351
+ def list_accounts(
352
+ self,
353
+ ) -> Callable[
354
+ [analytics_admin.ListAccountsRequest], analytics_admin.ListAccountsResponse
355
+ ]:
356
+ r"""Return a callable for the list accounts method over gRPC.
357
+
358
+ Returns all accounts accessible by the caller.
359
+
360
+ Note that these accounts might not currently have GA
361
+ properties. Soft-deleted (ie: "trashed") accounts are
362
+ excluded by default. Returns an empty list if no
363
+ relevant accounts are found.
364
+
365
+ Returns:
366
+ Callable[[~.ListAccountsRequest],
367
+ ~.ListAccountsResponse]:
368
+ A function that, when called, will call the underlying RPC
369
+ on the server.
370
+ """
371
+ # Generate a "stub function" on-the-fly which will actually make
372
+ # the request.
373
+ # gRPC handles serialization and deserialization, so we just need
374
+ # to pass in the functions for each.
375
+ if "list_accounts" not in self._stubs:
376
+ self._stubs["list_accounts"] = self._logged_channel.unary_unary(
377
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListAccounts",
378
+ request_serializer=analytics_admin.ListAccountsRequest.serialize,
379
+ response_deserializer=analytics_admin.ListAccountsResponse.deserialize,
380
+ )
381
+ return self._stubs["list_accounts"]
382
+
383
+ @property
384
+ def delete_account(
385
+ self,
386
+ ) -> Callable[[analytics_admin.DeleteAccountRequest], empty_pb2.Empty]:
387
+ r"""Return a callable for the delete account method over gRPC.
388
+
389
+ Marks target Account as soft-deleted (ie: "trashed")
390
+ and returns it.
391
+ This API does not have a method to restore soft-deleted
392
+ accounts. However, they can be restored using the Trash
393
+ Can UI.
394
+
395
+ If the accounts are not restored before the expiration
396
+ time, the account and all child resources (eg:
397
+ Properties, GoogleAdsLinks, Streams, AccessBindings)
398
+ will be permanently purged.
399
+ https://support.google.com/analytics/answer/6154772
400
+
401
+ Returns an error if the target is not found.
402
+
403
+ Returns:
404
+ Callable[[~.DeleteAccountRequest],
405
+ ~.Empty]:
406
+ A function that, when called, will call the underlying RPC
407
+ on the server.
408
+ """
409
+ # Generate a "stub function" on-the-fly which will actually make
410
+ # the request.
411
+ # gRPC handles serialization and deserialization, so we just need
412
+ # to pass in the functions for each.
413
+ if "delete_account" not in self._stubs:
414
+ self._stubs["delete_account"] = self._logged_channel.unary_unary(
415
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteAccount",
416
+ request_serializer=analytics_admin.DeleteAccountRequest.serialize,
417
+ response_deserializer=empty_pb2.Empty.FromString,
418
+ )
419
+ return self._stubs["delete_account"]
420
+
421
+ @property
422
+ def update_account(
423
+ self,
424
+ ) -> Callable[[analytics_admin.UpdateAccountRequest], resources.Account]:
425
+ r"""Return a callable for the update account method over gRPC.
426
+
427
+ Updates an account.
428
+
429
+ Returns:
430
+ Callable[[~.UpdateAccountRequest],
431
+ ~.Account]:
432
+ A function that, when called, will call the underlying RPC
433
+ on the server.
434
+ """
435
+ # Generate a "stub function" on-the-fly which will actually make
436
+ # the request.
437
+ # gRPC handles serialization and deserialization, so we just need
438
+ # to pass in the functions for each.
439
+ if "update_account" not in self._stubs:
440
+ self._stubs["update_account"] = self._logged_channel.unary_unary(
441
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateAccount",
442
+ request_serializer=analytics_admin.UpdateAccountRequest.serialize,
443
+ response_deserializer=resources.Account.deserialize,
444
+ )
445
+ return self._stubs["update_account"]
446
+
447
+ @property
448
+ def provision_account_ticket(
449
+ self,
450
+ ) -> Callable[
451
+ [analytics_admin.ProvisionAccountTicketRequest],
452
+ analytics_admin.ProvisionAccountTicketResponse,
453
+ ]:
454
+ r"""Return a callable for the provision account ticket method over gRPC.
455
+
456
+ Requests a ticket for creating an account.
457
+
458
+ Returns:
459
+ Callable[[~.ProvisionAccountTicketRequest],
460
+ ~.ProvisionAccountTicketResponse]:
461
+ A function that, when called, will call the underlying RPC
462
+ on the server.
463
+ """
464
+ # Generate a "stub function" on-the-fly which will actually make
465
+ # the request.
466
+ # gRPC handles serialization and deserialization, so we just need
467
+ # to pass in the functions for each.
468
+ if "provision_account_ticket" not in self._stubs:
469
+ self._stubs["provision_account_ticket"] = self._logged_channel.unary_unary(
470
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ProvisionAccountTicket",
471
+ request_serializer=analytics_admin.ProvisionAccountTicketRequest.serialize,
472
+ response_deserializer=analytics_admin.ProvisionAccountTicketResponse.deserialize,
473
+ )
474
+ return self._stubs["provision_account_ticket"]
475
+
476
+ @property
477
+ def list_account_summaries(
478
+ self,
479
+ ) -> Callable[
480
+ [analytics_admin.ListAccountSummariesRequest],
481
+ analytics_admin.ListAccountSummariesResponse,
482
+ ]:
483
+ r"""Return a callable for the list account summaries method over gRPC.
484
+
485
+ Returns summaries of all accounts accessible by the
486
+ caller.
487
+
488
+ Returns:
489
+ Callable[[~.ListAccountSummariesRequest],
490
+ ~.ListAccountSummariesResponse]:
491
+ A function that, when called, will call the underlying RPC
492
+ on the server.
493
+ """
494
+ # Generate a "stub function" on-the-fly which will actually make
495
+ # the request.
496
+ # gRPC handles serialization and deserialization, so we just need
497
+ # to pass in the functions for each.
498
+ if "list_account_summaries" not in self._stubs:
499
+ self._stubs["list_account_summaries"] = self._logged_channel.unary_unary(
500
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListAccountSummaries",
501
+ request_serializer=analytics_admin.ListAccountSummariesRequest.serialize,
502
+ response_deserializer=analytics_admin.ListAccountSummariesResponse.deserialize,
503
+ )
504
+ return self._stubs["list_account_summaries"]
505
+
506
+ @property
507
+ def get_property(
508
+ self,
509
+ ) -> Callable[[analytics_admin.GetPropertyRequest], resources.Property]:
510
+ r"""Return a callable for the get property method over gRPC.
511
+
512
+ Lookup for a single GA Property.
513
+
514
+ Returns:
515
+ Callable[[~.GetPropertyRequest],
516
+ ~.Property]:
517
+ A function that, when called, will call the underlying RPC
518
+ on the server.
519
+ """
520
+ # Generate a "stub function" on-the-fly which will actually make
521
+ # the request.
522
+ # gRPC handles serialization and deserialization, so we just need
523
+ # to pass in the functions for each.
524
+ if "get_property" not in self._stubs:
525
+ self._stubs["get_property"] = self._logged_channel.unary_unary(
526
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetProperty",
527
+ request_serializer=analytics_admin.GetPropertyRequest.serialize,
528
+ response_deserializer=resources.Property.deserialize,
529
+ )
530
+ return self._stubs["get_property"]
531
+
532
+ @property
533
+ def list_properties(
534
+ self,
535
+ ) -> Callable[
536
+ [analytics_admin.ListPropertiesRequest], analytics_admin.ListPropertiesResponse
537
+ ]:
538
+ r"""Return a callable for the list properties method over gRPC.
539
+
540
+ Returns child Properties under the specified parent
541
+ Account.
542
+ Properties will be excluded if the caller does not have
543
+ access. Soft-deleted (ie: "trashed") properties are
544
+ excluded by default. Returns an empty list if no
545
+ relevant properties are found.
546
+
547
+ Returns:
548
+ Callable[[~.ListPropertiesRequest],
549
+ ~.ListPropertiesResponse]:
550
+ A function that, when called, will call the underlying RPC
551
+ on the server.
552
+ """
553
+ # Generate a "stub function" on-the-fly which will actually make
554
+ # the request.
555
+ # gRPC handles serialization and deserialization, so we just need
556
+ # to pass in the functions for each.
557
+ if "list_properties" not in self._stubs:
558
+ self._stubs["list_properties"] = self._logged_channel.unary_unary(
559
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListProperties",
560
+ request_serializer=analytics_admin.ListPropertiesRequest.serialize,
561
+ response_deserializer=analytics_admin.ListPropertiesResponse.deserialize,
562
+ )
563
+ return self._stubs["list_properties"]
564
+
565
+ @property
566
+ def create_property(
567
+ self,
568
+ ) -> Callable[[analytics_admin.CreatePropertyRequest], resources.Property]:
569
+ r"""Return a callable for the create property method over gRPC.
570
+
571
+ Creates a Google Analytics property with the
572
+ specified location and attributes.
573
+
574
+ Returns:
575
+ Callable[[~.CreatePropertyRequest],
576
+ ~.Property]:
577
+ A function that, when called, will call the underlying RPC
578
+ on the server.
579
+ """
580
+ # Generate a "stub function" on-the-fly which will actually make
581
+ # the request.
582
+ # gRPC handles serialization and deserialization, so we just need
583
+ # to pass in the functions for each.
584
+ if "create_property" not in self._stubs:
585
+ self._stubs["create_property"] = self._logged_channel.unary_unary(
586
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateProperty",
587
+ request_serializer=analytics_admin.CreatePropertyRequest.serialize,
588
+ response_deserializer=resources.Property.deserialize,
589
+ )
590
+ return self._stubs["create_property"]
591
+
592
+ @property
593
+ def delete_property(
594
+ self,
595
+ ) -> Callable[[analytics_admin.DeletePropertyRequest], resources.Property]:
596
+ r"""Return a callable for the delete property method over gRPC.
597
+
598
+ Marks target Property as soft-deleted (ie: "trashed")
599
+ and returns it.
600
+ This API does not have a method to restore soft-deleted
601
+ properties. However, they can be restored using the
602
+ Trash Can UI.
603
+
604
+ If the properties are not restored before the expiration
605
+ time, the Property and all child resources (eg:
606
+ GoogleAdsLinks, Streams, AccessBindings) will be
607
+ permanently purged.
608
+ https://support.google.com/analytics/answer/6154772
609
+
610
+ Returns an error if the target is not found.
611
+
612
+ Returns:
613
+ Callable[[~.DeletePropertyRequest],
614
+ ~.Property]:
615
+ A function that, when called, will call the underlying RPC
616
+ on the server.
617
+ """
618
+ # Generate a "stub function" on-the-fly which will actually make
619
+ # the request.
620
+ # gRPC handles serialization and deserialization, so we just need
621
+ # to pass in the functions for each.
622
+ if "delete_property" not in self._stubs:
623
+ self._stubs["delete_property"] = self._logged_channel.unary_unary(
624
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteProperty",
625
+ request_serializer=analytics_admin.DeletePropertyRequest.serialize,
626
+ response_deserializer=resources.Property.deserialize,
627
+ )
628
+ return self._stubs["delete_property"]
629
+
630
+ @property
631
+ def update_property(
632
+ self,
633
+ ) -> Callable[[analytics_admin.UpdatePropertyRequest], resources.Property]:
634
+ r"""Return a callable for the update property method over gRPC.
635
+
636
+ Updates a property.
637
+
638
+ Returns:
639
+ Callable[[~.UpdatePropertyRequest],
640
+ ~.Property]:
641
+ A function that, when called, will call the underlying RPC
642
+ on the server.
643
+ """
644
+ # Generate a "stub function" on-the-fly which will actually make
645
+ # the request.
646
+ # gRPC handles serialization and deserialization, so we just need
647
+ # to pass in the functions for each.
648
+ if "update_property" not in self._stubs:
649
+ self._stubs["update_property"] = self._logged_channel.unary_unary(
650
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateProperty",
651
+ request_serializer=analytics_admin.UpdatePropertyRequest.serialize,
652
+ response_deserializer=resources.Property.deserialize,
653
+ )
654
+ return self._stubs["update_property"]
655
+
656
+ @property
657
+ def create_firebase_link(
658
+ self,
659
+ ) -> Callable[[analytics_admin.CreateFirebaseLinkRequest], resources.FirebaseLink]:
660
+ r"""Return a callable for the create firebase link method over gRPC.
661
+
662
+ Creates a FirebaseLink.
663
+
664
+ Properties can have at most one FirebaseLink.
665
+
666
+ Returns:
667
+ Callable[[~.CreateFirebaseLinkRequest],
668
+ ~.FirebaseLink]:
669
+ A function that, when called, will call the underlying RPC
670
+ on the server.
671
+ """
672
+ # Generate a "stub function" on-the-fly which will actually make
673
+ # the request.
674
+ # gRPC handles serialization and deserialization, so we just need
675
+ # to pass in the functions for each.
676
+ if "create_firebase_link" not in self._stubs:
677
+ self._stubs["create_firebase_link"] = self._logged_channel.unary_unary(
678
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateFirebaseLink",
679
+ request_serializer=analytics_admin.CreateFirebaseLinkRequest.serialize,
680
+ response_deserializer=resources.FirebaseLink.deserialize,
681
+ )
682
+ return self._stubs["create_firebase_link"]
683
+
684
+ @property
685
+ def delete_firebase_link(
686
+ self,
687
+ ) -> Callable[[analytics_admin.DeleteFirebaseLinkRequest], empty_pb2.Empty]:
688
+ r"""Return a callable for the delete firebase link method over gRPC.
689
+
690
+ Deletes a FirebaseLink on a property
691
+
692
+ Returns:
693
+ Callable[[~.DeleteFirebaseLinkRequest],
694
+ ~.Empty]:
695
+ A function that, when called, will call the underlying RPC
696
+ on the server.
697
+ """
698
+ # Generate a "stub function" on-the-fly which will actually make
699
+ # the request.
700
+ # gRPC handles serialization and deserialization, so we just need
701
+ # to pass in the functions for each.
702
+ if "delete_firebase_link" not in self._stubs:
703
+ self._stubs["delete_firebase_link"] = self._logged_channel.unary_unary(
704
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteFirebaseLink",
705
+ request_serializer=analytics_admin.DeleteFirebaseLinkRequest.serialize,
706
+ response_deserializer=empty_pb2.Empty.FromString,
707
+ )
708
+ return self._stubs["delete_firebase_link"]
709
+
710
+ @property
711
+ def list_firebase_links(
712
+ self,
713
+ ) -> Callable[
714
+ [analytics_admin.ListFirebaseLinksRequest],
715
+ analytics_admin.ListFirebaseLinksResponse,
716
+ ]:
717
+ r"""Return a callable for the list firebase links method over gRPC.
718
+
719
+ Lists FirebaseLinks on a property.
720
+ Properties can have at most one FirebaseLink.
721
+
722
+ Returns:
723
+ Callable[[~.ListFirebaseLinksRequest],
724
+ ~.ListFirebaseLinksResponse]:
725
+ A function that, when called, will call the underlying RPC
726
+ on the server.
727
+ """
728
+ # Generate a "stub function" on-the-fly which will actually make
729
+ # the request.
730
+ # gRPC handles serialization and deserialization, so we just need
731
+ # to pass in the functions for each.
732
+ if "list_firebase_links" not in self._stubs:
733
+ self._stubs["list_firebase_links"] = self._logged_channel.unary_unary(
734
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListFirebaseLinks",
735
+ request_serializer=analytics_admin.ListFirebaseLinksRequest.serialize,
736
+ response_deserializer=analytics_admin.ListFirebaseLinksResponse.deserialize,
737
+ )
738
+ return self._stubs["list_firebase_links"]
739
+
740
+ @property
741
+ def create_google_ads_link(
742
+ self,
743
+ ) -> Callable[
744
+ [analytics_admin.CreateGoogleAdsLinkRequest], resources.GoogleAdsLink
745
+ ]:
746
+ r"""Return a callable for the create google ads link method over gRPC.
747
+
748
+ Creates a GoogleAdsLink.
749
+
750
+ Returns:
751
+ Callable[[~.CreateGoogleAdsLinkRequest],
752
+ ~.GoogleAdsLink]:
753
+ A function that, when called, will call the underlying RPC
754
+ on the server.
755
+ """
756
+ # Generate a "stub function" on-the-fly which will actually make
757
+ # the request.
758
+ # gRPC handles serialization and deserialization, so we just need
759
+ # to pass in the functions for each.
760
+ if "create_google_ads_link" not in self._stubs:
761
+ self._stubs["create_google_ads_link"] = self._logged_channel.unary_unary(
762
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateGoogleAdsLink",
763
+ request_serializer=analytics_admin.CreateGoogleAdsLinkRequest.serialize,
764
+ response_deserializer=resources.GoogleAdsLink.deserialize,
765
+ )
766
+ return self._stubs["create_google_ads_link"]
767
+
768
+ @property
769
+ def update_google_ads_link(
770
+ self,
771
+ ) -> Callable[
772
+ [analytics_admin.UpdateGoogleAdsLinkRequest], resources.GoogleAdsLink
773
+ ]:
774
+ r"""Return a callable for the update google ads link method over gRPC.
775
+
776
+ Updates a GoogleAdsLink on a property
777
+
778
+ Returns:
779
+ Callable[[~.UpdateGoogleAdsLinkRequest],
780
+ ~.GoogleAdsLink]:
781
+ A function that, when called, will call the underlying RPC
782
+ on the server.
783
+ """
784
+ # Generate a "stub function" on-the-fly which will actually make
785
+ # the request.
786
+ # gRPC handles serialization and deserialization, so we just need
787
+ # to pass in the functions for each.
788
+ if "update_google_ads_link" not in self._stubs:
789
+ self._stubs["update_google_ads_link"] = self._logged_channel.unary_unary(
790
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateGoogleAdsLink",
791
+ request_serializer=analytics_admin.UpdateGoogleAdsLinkRequest.serialize,
792
+ response_deserializer=resources.GoogleAdsLink.deserialize,
793
+ )
794
+ return self._stubs["update_google_ads_link"]
795
+
796
+ @property
797
+ def delete_google_ads_link(
798
+ self,
799
+ ) -> Callable[[analytics_admin.DeleteGoogleAdsLinkRequest], empty_pb2.Empty]:
800
+ r"""Return a callable for the delete google ads link method over gRPC.
801
+
802
+ Deletes a GoogleAdsLink on a property
803
+
804
+ Returns:
805
+ Callable[[~.DeleteGoogleAdsLinkRequest],
806
+ ~.Empty]:
807
+ A function that, when called, will call the underlying RPC
808
+ on the server.
809
+ """
810
+ # Generate a "stub function" on-the-fly which will actually make
811
+ # the request.
812
+ # gRPC handles serialization and deserialization, so we just need
813
+ # to pass in the functions for each.
814
+ if "delete_google_ads_link" not in self._stubs:
815
+ self._stubs["delete_google_ads_link"] = self._logged_channel.unary_unary(
816
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteGoogleAdsLink",
817
+ request_serializer=analytics_admin.DeleteGoogleAdsLinkRequest.serialize,
818
+ response_deserializer=empty_pb2.Empty.FromString,
819
+ )
820
+ return self._stubs["delete_google_ads_link"]
821
+
822
+ @property
823
+ def list_google_ads_links(
824
+ self,
825
+ ) -> Callable[
826
+ [analytics_admin.ListGoogleAdsLinksRequest],
827
+ analytics_admin.ListGoogleAdsLinksResponse,
828
+ ]:
829
+ r"""Return a callable for the list google ads links method over gRPC.
830
+
831
+ Lists GoogleAdsLinks on a property.
832
+
833
+ Returns:
834
+ Callable[[~.ListGoogleAdsLinksRequest],
835
+ ~.ListGoogleAdsLinksResponse]:
836
+ A function that, when called, will call the underlying RPC
837
+ on the server.
838
+ """
839
+ # Generate a "stub function" on-the-fly which will actually make
840
+ # the request.
841
+ # gRPC handles serialization and deserialization, so we just need
842
+ # to pass in the functions for each.
843
+ if "list_google_ads_links" not in self._stubs:
844
+ self._stubs["list_google_ads_links"] = self._logged_channel.unary_unary(
845
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListGoogleAdsLinks",
846
+ request_serializer=analytics_admin.ListGoogleAdsLinksRequest.serialize,
847
+ response_deserializer=analytics_admin.ListGoogleAdsLinksResponse.deserialize,
848
+ )
849
+ return self._stubs["list_google_ads_links"]
850
+
851
+ @property
852
+ def get_data_sharing_settings(
853
+ self,
854
+ ) -> Callable[
855
+ [analytics_admin.GetDataSharingSettingsRequest], resources.DataSharingSettings
856
+ ]:
857
+ r"""Return a callable for the get data sharing settings method over gRPC.
858
+
859
+ Get data sharing settings on an account.
860
+ Data sharing settings are singletons.
861
+
862
+ Returns:
863
+ Callable[[~.GetDataSharingSettingsRequest],
864
+ ~.DataSharingSettings]:
865
+ A function that, when called, will call the underlying RPC
866
+ on the server.
867
+ """
868
+ # Generate a "stub function" on-the-fly which will actually make
869
+ # the request.
870
+ # gRPC handles serialization and deserialization, so we just need
871
+ # to pass in the functions for each.
872
+ if "get_data_sharing_settings" not in self._stubs:
873
+ self._stubs["get_data_sharing_settings"] = self._logged_channel.unary_unary(
874
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetDataSharingSettings",
875
+ request_serializer=analytics_admin.GetDataSharingSettingsRequest.serialize,
876
+ response_deserializer=resources.DataSharingSettings.deserialize,
877
+ )
878
+ return self._stubs["get_data_sharing_settings"]
879
+
880
+ @property
881
+ def get_measurement_protocol_secret(
882
+ self,
883
+ ) -> Callable[
884
+ [analytics_admin.GetMeasurementProtocolSecretRequest],
885
+ resources.MeasurementProtocolSecret,
886
+ ]:
887
+ r"""Return a callable for the get measurement protocol
888
+ secret method over gRPC.
889
+
890
+ Lookup for a single MeasurementProtocolSecret.
891
+
892
+ Returns:
893
+ Callable[[~.GetMeasurementProtocolSecretRequest],
894
+ ~.MeasurementProtocolSecret]:
895
+ A function that, when called, will call the underlying RPC
896
+ on the server.
897
+ """
898
+ # Generate a "stub function" on-the-fly which will actually make
899
+ # the request.
900
+ # gRPC handles serialization and deserialization, so we just need
901
+ # to pass in the functions for each.
902
+ if "get_measurement_protocol_secret" not in self._stubs:
903
+ self._stubs[
904
+ "get_measurement_protocol_secret"
905
+ ] = self._logged_channel.unary_unary(
906
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetMeasurementProtocolSecret",
907
+ request_serializer=analytics_admin.GetMeasurementProtocolSecretRequest.serialize,
908
+ response_deserializer=resources.MeasurementProtocolSecret.deserialize,
909
+ )
910
+ return self._stubs["get_measurement_protocol_secret"]
911
+
912
+ @property
913
+ def list_measurement_protocol_secrets(
914
+ self,
915
+ ) -> Callable[
916
+ [analytics_admin.ListMeasurementProtocolSecretsRequest],
917
+ analytics_admin.ListMeasurementProtocolSecretsResponse,
918
+ ]:
919
+ r"""Return a callable for the list measurement protocol
920
+ secrets method over gRPC.
921
+
922
+ Returns child MeasurementProtocolSecrets under the
923
+ specified parent Property.
924
+
925
+ Returns:
926
+ Callable[[~.ListMeasurementProtocolSecretsRequest],
927
+ ~.ListMeasurementProtocolSecretsResponse]:
928
+ A function that, when called, will call the underlying RPC
929
+ on the server.
930
+ """
931
+ # Generate a "stub function" on-the-fly which will actually make
932
+ # the request.
933
+ # gRPC handles serialization and deserialization, so we just need
934
+ # to pass in the functions for each.
935
+ if "list_measurement_protocol_secrets" not in self._stubs:
936
+ self._stubs[
937
+ "list_measurement_protocol_secrets"
938
+ ] = self._logged_channel.unary_unary(
939
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListMeasurementProtocolSecrets",
940
+ request_serializer=analytics_admin.ListMeasurementProtocolSecretsRequest.serialize,
941
+ response_deserializer=analytics_admin.ListMeasurementProtocolSecretsResponse.deserialize,
942
+ )
943
+ return self._stubs["list_measurement_protocol_secrets"]
944
+
945
+ @property
946
+ def create_measurement_protocol_secret(
947
+ self,
948
+ ) -> Callable[
949
+ [analytics_admin.CreateMeasurementProtocolSecretRequest],
950
+ resources.MeasurementProtocolSecret,
951
+ ]:
952
+ r"""Return a callable for the create measurement protocol
953
+ secret method over gRPC.
954
+
955
+ Creates a measurement protocol secret.
956
+
957
+ Returns:
958
+ Callable[[~.CreateMeasurementProtocolSecretRequest],
959
+ ~.MeasurementProtocolSecret]:
960
+ A function that, when called, will call the underlying RPC
961
+ on the server.
962
+ """
963
+ # Generate a "stub function" on-the-fly which will actually make
964
+ # the request.
965
+ # gRPC handles serialization and deserialization, so we just need
966
+ # to pass in the functions for each.
967
+ if "create_measurement_protocol_secret" not in self._stubs:
968
+ self._stubs[
969
+ "create_measurement_protocol_secret"
970
+ ] = self._logged_channel.unary_unary(
971
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateMeasurementProtocolSecret",
972
+ request_serializer=analytics_admin.CreateMeasurementProtocolSecretRequest.serialize,
973
+ response_deserializer=resources.MeasurementProtocolSecret.deserialize,
974
+ )
975
+ return self._stubs["create_measurement_protocol_secret"]
976
+
977
+ @property
978
+ def delete_measurement_protocol_secret(
979
+ self,
980
+ ) -> Callable[
981
+ [analytics_admin.DeleteMeasurementProtocolSecretRequest], empty_pb2.Empty
982
+ ]:
983
+ r"""Return a callable for the delete measurement protocol
984
+ secret method over gRPC.
985
+
986
+ Deletes target MeasurementProtocolSecret.
987
+
988
+ Returns:
989
+ Callable[[~.DeleteMeasurementProtocolSecretRequest],
990
+ ~.Empty]:
991
+ A function that, when called, will call the underlying RPC
992
+ on the server.
993
+ """
994
+ # Generate a "stub function" on-the-fly which will actually make
995
+ # the request.
996
+ # gRPC handles serialization and deserialization, so we just need
997
+ # to pass in the functions for each.
998
+ if "delete_measurement_protocol_secret" not in self._stubs:
999
+ self._stubs[
1000
+ "delete_measurement_protocol_secret"
1001
+ ] = self._logged_channel.unary_unary(
1002
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteMeasurementProtocolSecret",
1003
+ request_serializer=analytics_admin.DeleteMeasurementProtocolSecretRequest.serialize,
1004
+ response_deserializer=empty_pb2.Empty.FromString,
1005
+ )
1006
+ return self._stubs["delete_measurement_protocol_secret"]
1007
+
1008
+ @property
1009
+ def update_measurement_protocol_secret(
1010
+ self,
1011
+ ) -> Callable[
1012
+ [analytics_admin.UpdateMeasurementProtocolSecretRequest],
1013
+ resources.MeasurementProtocolSecret,
1014
+ ]:
1015
+ r"""Return a callable for the update measurement protocol
1016
+ secret method over gRPC.
1017
+
1018
+ Updates a measurement protocol secret.
1019
+
1020
+ Returns:
1021
+ Callable[[~.UpdateMeasurementProtocolSecretRequest],
1022
+ ~.MeasurementProtocolSecret]:
1023
+ A function that, when called, will call the underlying RPC
1024
+ on the server.
1025
+ """
1026
+ # Generate a "stub function" on-the-fly which will actually make
1027
+ # the request.
1028
+ # gRPC handles serialization and deserialization, so we just need
1029
+ # to pass in the functions for each.
1030
+ if "update_measurement_protocol_secret" not in self._stubs:
1031
+ self._stubs[
1032
+ "update_measurement_protocol_secret"
1033
+ ] = self._logged_channel.unary_unary(
1034
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateMeasurementProtocolSecret",
1035
+ request_serializer=analytics_admin.UpdateMeasurementProtocolSecretRequest.serialize,
1036
+ response_deserializer=resources.MeasurementProtocolSecret.deserialize,
1037
+ )
1038
+ return self._stubs["update_measurement_protocol_secret"]
1039
+
1040
+ @property
1041
+ def acknowledge_user_data_collection(
1042
+ self,
1043
+ ) -> Callable[
1044
+ [analytics_admin.AcknowledgeUserDataCollectionRequest],
1045
+ analytics_admin.AcknowledgeUserDataCollectionResponse,
1046
+ ]:
1047
+ r"""Return a callable for the acknowledge user data
1048
+ collection method over gRPC.
1049
+
1050
+ Acknowledges the terms of user data collection for
1051
+ the specified property.
1052
+ This acknowledgement must be completed (either in the
1053
+ Google Analytics UI or through this API) before
1054
+ MeasurementProtocolSecret resources may be created.
1055
+
1056
+ Returns:
1057
+ Callable[[~.AcknowledgeUserDataCollectionRequest],
1058
+ ~.AcknowledgeUserDataCollectionResponse]:
1059
+ A function that, when called, will call the underlying RPC
1060
+ on the server.
1061
+ """
1062
+ # Generate a "stub function" on-the-fly which will actually make
1063
+ # the request.
1064
+ # gRPC handles serialization and deserialization, so we just need
1065
+ # to pass in the functions for each.
1066
+ if "acknowledge_user_data_collection" not in self._stubs:
1067
+ self._stubs[
1068
+ "acknowledge_user_data_collection"
1069
+ ] = self._logged_channel.unary_unary(
1070
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/AcknowledgeUserDataCollection",
1071
+ request_serializer=analytics_admin.AcknowledgeUserDataCollectionRequest.serialize,
1072
+ response_deserializer=analytics_admin.AcknowledgeUserDataCollectionResponse.deserialize,
1073
+ )
1074
+ return self._stubs["acknowledge_user_data_collection"]
1075
+
1076
+ @property
1077
+ def search_change_history_events(
1078
+ self,
1079
+ ) -> Callable[
1080
+ [analytics_admin.SearchChangeHistoryEventsRequest],
1081
+ analytics_admin.SearchChangeHistoryEventsResponse,
1082
+ ]:
1083
+ r"""Return a callable for the search change history events method over gRPC.
1084
+
1085
+ Searches through all changes to an account or its
1086
+ children given the specified set of filters.
1087
+
1088
+ Only returns the subset of changes supported by the API.
1089
+ The UI may return additional changes.
1090
+
1091
+ Returns:
1092
+ Callable[[~.SearchChangeHistoryEventsRequest],
1093
+ ~.SearchChangeHistoryEventsResponse]:
1094
+ A function that, when called, will call the underlying RPC
1095
+ on the server.
1096
+ """
1097
+ # Generate a "stub function" on-the-fly which will actually make
1098
+ # the request.
1099
+ # gRPC handles serialization and deserialization, so we just need
1100
+ # to pass in the functions for each.
1101
+ if "search_change_history_events" not in self._stubs:
1102
+ self._stubs[
1103
+ "search_change_history_events"
1104
+ ] = self._logged_channel.unary_unary(
1105
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/SearchChangeHistoryEvents",
1106
+ request_serializer=analytics_admin.SearchChangeHistoryEventsRequest.serialize,
1107
+ response_deserializer=analytics_admin.SearchChangeHistoryEventsResponse.deserialize,
1108
+ )
1109
+ return self._stubs["search_change_history_events"]
1110
+
1111
+ @property
1112
+ def create_conversion_event(
1113
+ self,
1114
+ ) -> Callable[
1115
+ [analytics_admin.CreateConversionEventRequest], resources.ConversionEvent
1116
+ ]:
1117
+ r"""Return a callable for the create conversion event method over gRPC.
1118
+
1119
+ Deprecated: Use ``CreateKeyEvent`` instead. Creates a conversion
1120
+ event with the specified attributes.
1121
+
1122
+ Returns:
1123
+ Callable[[~.CreateConversionEventRequest],
1124
+ ~.ConversionEvent]:
1125
+ A function that, when called, will call the underlying RPC
1126
+ on the server.
1127
+ """
1128
+ # Generate a "stub function" on-the-fly which will actually make
1129
+ # the request.
1130
+ # gRPC handles serialization and deserialization, so we just need
1131
+ # to pass in the functions for each.
1132
+ if "create_conversion_event" not in self._stubs:
1133
+ self._stubs["create_conversion_event"] = self._logged_channel.unary_unary(
1134
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateConversionEvent",
1135
+ request_serializer=analytics_admin.CreateConversionEventRequest.serialize,
1136
+ response_deserializer=resources.ConversionEvent.deserialize,
1137
+ )
1138
+ return self._stubs["create_conversion_event"]
1139
+
1140
+ @property
1141
+ def update_conversion_event(
1142
+ self,
1143
+ ) -> Callable[
1144
+ [analytics_admin.UpdateConversionEventRequest], resources.ConversionEvent
1145
+ ]:
1146
+ r"""Return a callable for the update conversion event method over gRPC.
1147
+
1148
+ Deprecated: Use ``UpdateKeyEvent`` instead. Updates a conversion
1149
+ event with the specified attributes.
1150
+
1151
+ Returns:
1152
+ Callable[[~.UpdateConversionEventRequest],
1153
+ ~.ConversionEvent]:
1154
+ A function that, when called, will call the underlying RPC
1155
+ on the server.
1156
+ """
1157
+ # Generate a "stub function" on-the-fly which will actually make
1158
+ # the request.
1159
+ # gRPC handles serialization and deserialization, so we just need
1160
+ # to pass in the functions for each.
1161
+ if "update_conversion_event" not in self._stubs:
1162
+ self._stubs["update_conversion_event"] = self._logged_channel.unary_unary(
1163
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateConversionEvent",
1164
+ request_serializer=analytics_admin.UpdateConversionEventRequest.serialize,
1165
+ response_deserializer=resources.ConversionEvent.deserialize,
1166
+ )
1167
+ return self._stubs["update_conversion_event"]
1168
+
1169
+ @property
1170
+ def get_conversion_event(
1171
+ self,
1172
+ ) -> Callable[
1173
+ [analytics_admin.GetConversionEventRequest], resources.ConversionEvent
1174
+ ]:
1175
+ r"""Return a callable for the get conversion event method over gRPC.
1176
+
1177
+ Deprecated: Use ``GetKeyEvent`` instead. Retrieve a single
1178
+ conversion event.
1179
+
1180
+ Returns:
1181
+ Callable[[~.GetConversionEventRequest],
1182
+ ~.ConversionEvent]:
1183
+ A function that, when called, will call the underlying RPC
1184
+ on the server.
1185
+ """
1186
+ # Generate a "stub function" on-the-fly which will actually make
1187
+ # the request.
1188
+ # gRPC handles serialization and deserialization, so we just need
1189
+ # to pass in the functions for each.
1190
+ if "get_conversion_event" not in self._stubs:
1191
+ self._stubs["get_conversion_event"] = self._logged_channel.unary_unary(
1192
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetConversionEvent",
1193
+ request_serializer=analytics_admin.GetConversionEventRequest.serialize,
1194
+ response_deserializer=resources.ConversionEvent.deserialize,
1195
+ )
1196
+ return self._stubs["get_conversion_event"]
1197
+
1198
+ @property
1199
+ def delete_conversion_event(
1200
+ self,
1201
+ ) -> Callable[[analytics_admin.DeleteConversionEventRequest], empty_pb2.Empty]:
1202
+ r"""Return a callable for the delete conversion event method over gRPC.
1203
+
1204
+ Deprecated: Use ``DeleteKeyEvent`` instead. Deletes a conversion
1205
+ event in a property.
1206
+
1207
+ Returns:
1208
+ Callable[[~.DeleteConversionEventRequest],
1209
+ ~.Empty]:
1210
+ A function that, when called, will call the underlying RPC
1211
+ on the server.
1212
+ """
1213
+ # Generate a "stub function" on-the-fly which will actually make
1214
+ # the request.
1215
+ # gRPC handles serialization and deserialization, so we just need
1216
+ # to pass in the functions for each.
1217
+ if "delete_conversion_event" not in self._stubs:
1218
+ self._stubs["delete_conversion_event"] = self._logged_channel.unary_unary(
1219
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteConversionEvent",
1220
+ request_serializer=analytics_admin.DeleteConversionEventRequest.serialize,
1221
+ response_deserializer=empty_pb2.Empty.FromString,
1222
+ )
1223
+ return self._stubs["delete_conversion_event"]
1224
+
1225
+ @property
1226
+ def list_conversion_events(
1227
+ self,
1228
+ ) -> Callable[
1229
+ [analytics_admin.ListConversionEventsRequest],
1230
+ analytics_admin.ListConversionEventsResponse,
1231
+ ]:
1232
+ r"""Return a callable for the list conversion events method over gRPC.
1233
+
1234
+ Deprecated: Use ``ListKeyEvents`` instead. Returns a list of
1235
+ conversion events in the specified parent property.
1236
+
1237
+ Returns an empty list if no conversion events are found.
1238
+
1239
+ Returns:
1240
+ Callable[[~.ListConversionEventsRequest],
1241
+ ~.ListConversionEventsResponse]:
1242
+ A function that, when called, will call the underlying RPC
1243
+ on the server.
1244
+ """
1245
+ # Generate a "stub function" on-the-fly which will actually make
1246
+ # the request.
1247
+ # gRPC handles serialization and deserialization, so we just need
1248
+ # to pass in the functions for each.
1249
+ if "list_conversion_events" not in self._stubs:
1250
+ self._stubs["list_conversion_events"] = self._logged_channel.unary_unary(
1251
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListConversionEvents",
1252
+ request_serializer=analytics_admin.ListConversionEventsRequest.serialize,
1253
+ response_deserializer=analytics_admin.ListConversionEventsResponse.deserialize,
1254
+ )
1255
+ return self._stubs["list_conversion_events"]
1256
+
1257
+ @property
1258
+ def create_key_event(
1259
+ self,
1260
+ ) -> Callable[[analytics_admin.CreateKeyEventRequest], resources.KeyEvent]:
1261
+ r"""Return a callable for the create key event method over gRPC.
1262
+
1263
+ Creates a Key Event.
1264
+
1265
+ Returns:
1266
+ Callable[[~.CreateKeyEventRequest],
1267
+ ~.KeyEvent]:
1268
+ A function that, when called, will call the underlying RPC
1269
+ on the server.
1270
+ """
1271
+ # Generate a "stub function" on-the-fly which will actually make
1272
+ # the request.
1273
+ # gRPC handles serialization and deserialization, so we just need
1274
+ # to pass in the functions for each.
1275
+ if "create_key_event" not in self._stubs:
1276
+ self._stubs["create_key_event"] = self._logged_channel.unary_unary(
1277
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateKeyEvent",
1278
+ request_serializer=analytics_admin.CreateKeyEventRequest.serialize,
1279
+ response_deserializer=resources.KeyEvent.deserialize,
1280
+ )
1281
+ return self._stubs["create_key_event"]
1282
+
1283
+ @property
1284
+ def update_key_event(
1285
+ self,
1286
+ ) -> Callable[[analytics_admin.UpdateKeyEventRequest], resources.KeyEvent]:
1287
+ r"""Return a callable for the update key event method over gRPC.
1288
+
1289
+ Updates a Key Event.
1290
+
1291
+ Returns:
1292
+ Callable[[~.UpdateKeyEventRequest],
1293
+ ~.KeyEvent]:
1294
+ A function that, when called, will call the underlying RPC
1295
+ on the server.
1296
+ """
1297
+ # Generate a "stub function" on-the-fly which will actually make
1298
+ # the request.
1299
+ # gRPC handles serialization and deserialization, so we just need
1300
+ # to pass in the functions for each.
1301
+ if "update_key_event" not in self._stubs:
1302
+ self._stubs["update_key_event"] = self._logged_channel.unary_unary(
1303
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateKeyEvent",
1304
+ request_serializer=analytics_admin.UpdateKeyEventRequest.serialize,
1305
+ response_deserializer=resources.KeyEvent.deserialize,
1306
+ )
1307
+ return self._stubs["update_key_event"]
1308
+
1309
+ @property
1310
+ def get_key_event(
1311
+ self,
1312
+ ) -> Callable[[analytics_admin.GetKeyEventRequest], resources.KeyEvent]:
1313
+ r"""Return a callable for the get key event method over gRPC.
1314
+
1315
+ Retrieve a single Key Event.
1316
+
1317
+ Returns:
1318
+ Callable[[~.GetKeyEventRequest],
1319
+ ~.KeyEvent]:
1320
+ A function that, when called, will call the underlying RPC
1321
+ on the server.
1322
+ """
1323
+ # Generate a "stub function" on-the-fly which will actually make
1324
+ # the request.
1325
+ # gRPC handles serialization and deserialization, so we just need
1326
+ # to pass in the functions for each.
1327
+ if "get_key_event" not in self._stubs:
1328
+ self._stubs["get_key_event"] = self._logged_channel.unary_unary(
1329
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetKeyEvent",
1330
+ request_serializer=analytics_admin.GetKeyEventRequest.serialize,
1331
+ response_deserializer=resources.KeyEvent.deserialize,
1332
+ )
1333
+ return self._stubs["get_key_event"]
1334
+
1335
+ @property
1336
+ def delete_key_event(
1337
+ self,
1338
+ ) -> Callable[[analytics_admin.DeleteKeyEventRequest], empty_pb2.Empty]:
1339
+ r"""Return a callable for the delete key event method over gRPC.
1340
+
1341
+ Deletes a Key Event.
1342
+
1343
+ Returns:
1344
+ Callable[[~.DeleteKeyEventRequest],
1345
+ ~.Empty]:
1346
+ A function that, when called, will call the underlying RPC
1347
+ on the server.
1348
+ """
1349
+ # Generate a "stub function" on-the-fly which will actually make
1350
+ # the request.
1351
+ # gRPC handles serialization and deserialization, so we just need
1352
+ # to pass in the functions for each.
1353
+ if "delete_key_event" not in self._stubs:
1354
+ self._stubs["delete_key_event"] = self._logged_channel.unary_unary(
1355
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteKeyEvent",
1356
+ request_serializer=analytics_admin.DeleteKeyEventRequest.serialize,
1357
+ response_deserializer=empty_pb2.Empty.FromString,
1358
+ )
1359
+ return self._stubs["delete_key_event"]
1360
+
1361
+ @property
1362
+ def list_key_events(
1363
+ self,
1364
+ ) -> Callable[
1365
+ [analytics_admin.ListKeyEventsRequest], analytics_admin.ListKeyEventsResponse
1366
+ ]:
1367
+ r"""Return a callable for the list key events method over gRPC.
1368
+
1369
+ Returns a list of Key Events in the specified parent
1370
+ property. Returns an empty list if no Key Events are
1371
+ found.
1372
+
1373
+ Returns:
1374
+ Callable[[~.ListKeyEventsRequest],
1375
+ ~.ListKeyEventsResponse]:
1376
+ A function that, when called, will call the underlying RPC
1377
+ on the server.
1378
+ """
1379
+ # Generate a "stub function" on-the-fly which will actually make
1380
+ # the request.
1381
+ # gRPC handles serialization and deserialization, so we just need
1382
+ # to pass in the functions for each.
1383
+ if "list_key_events" not in self._stubs:
1384
+ self._stubs["list_key_events"] = self._logged_channel.unary_unary(
1385
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListKeyEvents",
1386
+ request_serializer=analytics_admin.ListKeyEventsRequest.serialize,
1387
+ response_deserializer=analytics_admin.ListKeyEventsResponse.deserialize,
1388
+ )
1389
+ return self._stubs["list_key_events"]
1390
+
1391
+ @property
1392
+ def create_custom_dimension(
1393
+ self,
1394
+ ) -> Callable[
1395
+ [analytics_admin.CreateCustomDimensionRequest], resources.CustomDimension
1396
+ ]:
1397
+ r"""Return a callable for the create custom dimension method over gRPC.
1398
+
1399
+ Creates a CustomDimension.
1400
+
1401
+ Returns:
1402
+ Callable[[~.CreateCustomDimensionRequest],
1403
+ ~.CustomDimension]:
1404
+ A function that, when called, will call the underlying RPC
1405
+ on the server.
1406
+ """
1407
+ # Generate a "stub function" on-the-fly which will actually make
1408
+ # the request.
1409
+ # gRPC handles serialization and deserialization, so we just need
1410
+ # to pass in the functions for each.
1411
+ if "create_custom_dimension" not in self._stubs:
1412
+ self._stubs["create_custom_dimension"] = self._logged_channel.unary_unary(
1413
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateCustomDimension",
1414
+ request_serializer=analytics_admin.CreateCustomDimensionRequest.serialize,
1415
+ response_deserializer=resources.CustomDimension.deserialize,
1416
+ )
1417
+ return self._stubs["create_custom_dimension"]
1418
+
1419
+ @property
1420
+ def update_custom_dimension(
1421
+ self,
1422
+ ) -> Callable[
1423
+ [analytics_admin.UpdateCustomDimensionRequest], resources.CustomDimension
1424
+ ]:
1425
+ r"""Return a callable for the update custom dimension method over gRPC.
1426
+
1427
+ Updates a CustomDimension on a property.
1428
+
1429
+ Returns:
1430
+ Callable[[~.UpdateCustomDimensionRequest],
1431
+ ~.CustomDimension]:
1432
+ A function that, when called, will call the underlying RPC
1433
+ on the server.
1434
+ """
1435
+ # Generate a "stub function" on-the-fly which will actually make
1436
+ # the request.
1437
+ # gRPC handles serialization and deserialization, so we just need
1438
+ # to pass in the functions for each.
1439
+ if "update_custom_dimension" not in self._stubs:
1440
+ self._stubs["update_custom_dimension"] = self._logged_channel.unary_unary(
1441
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateCustomDimension",
1442
+ request_serializer=analytics_admin.UpdateCustomDimensionRequest.serialize,
1443
+ response_deserializer=resources.CustomDimension.deserialize,
1444
+ )
1445
+ return self._stubs["update_custom_dimension"]
1446
+
1447
+ @property
1448
+ def list_custom_dimensions(
1449
+ self,
1450
+ ) -> Callable[
1451
+ [analytics_admin.ListCustomDimensionsRequest],
1452
+ analytics_admin.ListCustomDimensionsResponse,
1453
+ ]:
1454
+ r"""Return a callable for the list custom dimensions method over gRPC.
1455
+
1456
+ Lists CustomDimensions on a property.
1457
+
1458
+ Returns:
1459
+ Callable[[~.ListCustomDimensionsRequest],
1460
+ ~.ListCustomDimensionsResponse]:
1461
+ A function that, when called, will call the underlying RPC
1462
+ on the server.
1463
+ """
1464
+ # Generate a "stub function" on-the-fly which will actually make
1465
+ # the request.
1466
+ # gRPC handles serialization and deserialization, so we just need
1467
+ # to pass in the functions for each.
1468
+ if "list_custom_dimensions" not in self._stubs:
1469
+ self._stubs["list_custom_dimensions"] = self._logged_channel.unary_unary(
1470
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListCustomDimensions",
1471
+ request_serializer=analytics_admin.ListCustomDimensionsRequest.serialize,
1472
+ response_deserializer=analytics_admin.ListCustomDimensionsResponse.deserialize,
1473
+ )
1474
+ return self._stubs["list_custom_dimensions"]
1475
+
1476
+ @property
1477
+ def archive_custom_dimension(
1478
+ self,
1479
+ ) -> Callable[[analytics_admin.ArchiveCustomDimensionRequest], empty_pb2.Empty]:
1480
+ r"""Return a callable for the archive custom dimension method over gRPC.
1481
+
1482
+ Archives a CustomDimension on a property.
1483
+
1484
+ Returns:
1485
+ Callable[[~.ArchiveCustomDimensionRequest],
1486
+ ~.Empty]:
1487
+ A function that, when called, will call the underlying RPC
1488
+ on the server.
1489
+ """
1490
+ # Generate a "stub function" on-the-fly which will actually make
1491
+ # the request.
1492
+ # gRPC handles serialization and deserialization, so we just need
1493
+ # to pass in the functions for each.
1494
+ if "archive_custom_dimension" not in self._stubs:
1495
+ self._stubs["archive_custom_dimension"] = self._logged_channel.unary_unary(
1496
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ArchiveCustomDimension",
1497
+ request_serializer=analytics_admin.ArchiveCustomDimensionRequest.serialize,
1498
+ response_deserializer=empty_pb2.Empty.FromString,
1499
+ )
1500
+ return self._stubs["archive_custom_dimension"]
1501
+
1502
+ @property
1503
+ def get_custom_dimension(
1504
+ self,
1505
+ ) -> Callable[
1506
+ [analytics_admin.GetCustomDimensionRequest], resources.CustomDimension
1507
+ ]:
1508
+ r"""Return a callable for the get custom dimension method over gRPC.
1509
+
1510
+ Lookup for a single CustomDimension.
1511
+
1512
+ Returns:
1513
+ Callable[[~.GetCustomDimensionRequest],
1514
+ ~.CustomDimension]:
1515
+ A function that, when called, will call the underlying RPC
1516
+ on the server.
1517
+ """
1518
+ # Generate a "stub function" on-the-fly which will actually make
1519
+ # the request.
1520
+ # gRPC handles serialization and deserialization, so we just need
1521
+ # to pass in the functions for each.
1522
+ if "get_custom_dimension" not in self._stubs:
1523
+ self._stubs["get_custom_dimension"] = self._logged_channel.unary_unary(
1524
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetCustomDimension",
1525
+ request_serializer=analytics_admin.GetCustomDimensionRequest.serialize,
1526
+ response_deserializer=resources.CustomDimension.deserialize,
1527
+ )
1528
+ return self._stubs["get_custom_dimension"]
1529
+
1530
+ @property
1531
+ def create_custom_metric(
1532
+ self,
1533
+ ) -> Callable[[analytics_admin.CreateCustomMetricRequest], resources.CustomMetric]:
1534
+ r"""Return a callable for the create custom metric method over gRPC.
1535
+
1536
+ Creates a CustomMetric.
1537
+
1538
+ Returns:
1539
+ Callable[[~.CreateCustomMetricRequest],
1540
+ ~.CustomMetric]:
1541
+ A function that, when called, will call the underlying RPC
1542
+ on the server.
1543
+ """
1544
+ # Generate a "stub function" on-the-fly which will actually make
1545
+ # the request.
1546
+ # gRPC handles serialization and deserialization, so we just need
1547
+ # to pass in the functions for each.
1548
+ if "create_custom_metric" not in self._stubs:
1549
+ self._stubs["create_custom_metric"] = self._logged_channel.unary_unary(
1550
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateCustomMetric",
1551
+ request_serializer=analytics_admin.CreateCustomMetricRequest.serialize,
1552
+ response_deserializer=resources.CustomMetric.deserialize,
1553
+ )
1554
+ return self._stubs["create_custom_metric"]
1555
+
1556
+ @property
1557
+ def update_custom_metric(
1558
+ self,
1559
+ ) -> Callable[[analytics_admin.UpdateCustomMetricRequest], resources.CustomMetric]:
1560
+ r"""Return a callable for the update custom metric method over gRPC.
1561
+
1562
+ Updates a CustomMetric on a property.
1563
+
1564
+ Returns:
1565
+ Callable[[~.UpdateCustomMetricRequest],
1566
+ ~.CustomMetric]:
1567
+ A function that, when called, will call the underlying RPC
1568
+ on the server.
1569
+ """
1570
+ # Generate a "stub function" on-the-fly which will actually make
1571
+ # the request.
1572
+ # gRPC handles serialization and deserialization, so we just need
1573
+ # to pass in the functions for each.
1574
+ if "update_custom_metric" not in self._stubs:
1575
+ self._stubs["update_custom_metric"] = self._logged_channel.unary_unary(
1576
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateCustomMetric",
1577
+ request_serializer=analytics_admin.UpdateCustomMetricRequest.serialize,
1578
+ response_deserializer=resources.CustomMetric.deserialize,
1579
+ )
1580
+ return self._stubs["update_custom_metric"]
1581
+
1582
+ @property
1583
+ def list_custom_metrics(
1584
+ self,
1585
+ ) -> Callable[
1586
+ [analytics_admin.ListCustomMetricsRequest],
1587
+ analytics_admin.ListCustomMetricsResponse,
1588
+ ]:
1589
+ r"""Return a callable for the list custom metrics method over gRPC.
1590
+
1591
+ Lists CustomMetrics on a property.
1592
+
1593
+ Returns:
1594
+ Callable[[~.ListCustomMetricsRequest],
1595
+ ~.ListCustomMetricsResponse]:
1596
+ A function that, when called, will call the underlying RPC
1597
+ on the server.
1598
+ """
1599
+ # Generate a "stub function" on-the-fly which will actually make
1600
+ # the request.
1601
+ # gRPC handles serialization and deserialization, so we just need
1602
+ # to pass in the functions for each.
1603
+ if "list_custom_metrics" not in self._stubs:
1604
+ self._stubs["list_custom_metrics"] = self._logged_channel.unary_unary(
1605
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListCustomMetrics",
1606
+ request_serializer=analytics_admin.ListCustomMetricsRequest.serialize,
1607
+ response_deserializer=analytics_admin.ListCustomMetricsResponse.deserialize,
1608
+ )
1609
+ return self._stubs["list_custom_metrics"]
1610
+
1611
+ @property
1612
+ def archive_custom_metric(
1613
+ self,
1614
+ ) -> Callable[[analytics_admin.ArchiveCustomMetricRequest], empty_pb2.Empty]:
1615
+ r"""Return a callable for the archive custom metric method over gRPC.
1616
+
1617
+ Archives a CustomMetric on a property.
1618
+
1619
+ Returns:
1620
+ Callable[[~.ArchiveCustomMetricRequest],
1621
+ ~.Empty]:
1622
+ A function that, when called, will call the underlying RPC
1623
+ on the server.
1624
+ """
1625
+ # Generate a "stub function" on-the-fly which will actually make
1626
+ # the request.
1627
+ # gRPC handles serialization and deserialization, so we just need
1628
+ # to pass in the functions for each.
1629
+ if "archive_custom_metric" not in self._stubs:
1630
+ self._stubs["archive_custom_metric"] = self._logged_channel.unary_unary(
1631
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ArchiveCustomMetric",
1632
+ request_serializer=analytics_admin.ArchiveCustomMetricRequest.serialize,
1633
+ response_deserializer=empty_pb2.Empty.FromString,
1634
+ )
1635
+ return self._stubs["archive_custom_metric"]
1636
+
1637
+ @property
1638
+ def get_custom_metric(
1639
+ self,
1640
+ ) -> Callable[[analytics_admin.GetCustomMetricRequest], resources.CustomMetric]:
1641
+ r"""Return a callable for the get custom metric method over gRPC.
1642
+
1643
+ Lookup for a single CustomMetric.
1644
+
1645
+ Returns:
1646
+ Callable[[~.GetCustomMetricRequest],
1647
+ ~.CustomMetric]:
1648
+ A function that, when called, will call the underlying RPC
1649
+ on the server.
1650
+ """
1651
+ # Generate a "stub function" on-the-fly which will actually make
1652
+ # the request.
1653
+ # gRPC handles serialization and deserialization, so we just need
1654
+ # to pass in the functions for each.
1655
+ if "get_custom_metric" not in self._stubs:
1656
+ self._stubs["get_custom_metric"] = self._logged_channel.unary_unary(
1657
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetCustomMetric",
1658
+ request_serializer=analytics_admin.GetCustomMetricRequest.serialize,
1659
+ response_deserializer=resources.CustomMetric.deserialize,
1660
+ )
1661
+ return self._stubs["get_custom_metric"]
1662
+
1663
+ @property
1664
+ def get_data_retention_settings(
1665
+ self,
1666
+ ) -> Callable[
1667
+ [analytics_admin.GetDataRetentionSettingsRequest],
1668
+ resources.DataRetentionSettings,
1669
+ ]:
1670
+ r"""Return a callable for the get data retention settings method over gRPC.
1671
+
1672
+ Returns the singleton data retention settings for
1673
+ this property.
1674
+
1675
+ Returns:
1676
+ Callable[[~.GetDataRetentionSettingsRequest],
1677
+ ~.DataRetentionSettings]:
1678
+ A function that, when called, will call the underlying RPC
1679
+ on the server.
1680
+ """
1681
+ # Generate a "stub function" on-the-fly which will actually make
1682
+ # the request.
1683
+ # gRPC handles serialization and deserialization, so we just need
1684
+ # to pass in the functions for each.
1685
+ if "get_data_retention_settings" not in self._stubs:
1686
+ self._stubs[
1687
+ "get_data_retention_settings"
1688
+ ] = self._logged_channel.unary_unary(
1689
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetDataRetentionSettings",
1690
+ request_serializer=analytics_admin.GetDataRetentionSettingsRequest.serialize,
1691
+ response_deserializer=resources.DataRetentionSettings.deserialize,
1692
+ )
1693
+ return self._stubs["get_data_retention_settings"]
1694
+
1695
+ @property
1696
+ def update_data_retention_settings(
1697
+ self,
1698
+ ) -> Callable[
1699
+ [analytics_admin.UpdateDataRetentionSettingsRequest],
1700
+ resources.DataRetentionSettings,
1701
+ ]:
1702
+ r"""Return a callable for the update data retention settings method over gRPC.
1703
+
1704
+ Updates the singleton data retention settings for
1705
+ this property.
1706
+
1707
+ Returns:
1708
+ Callable[[~.UpdateDataRetentionSettingsRequest],
1709
+ ~.DataRetentionSettings]:
1710
+ A function that, when called, will call the underlying RPC
1711
+ on the server.
1712
+ """
1713
+ # Generate a "stub function" on-the-fly which will actually make
1714
+ # the request.
1715
+ # gRPC handles serialization and deserialization, so we just need
1716
+ # to pass in the functions for each.
1717
+ if "update_data_retention_settings" not in self._stubs:
1718
+ self._stubs[
1719
+ "update_data_retention_settings"
1720
+ ] = self._logged_channel.unary_unary(
1721
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateDataRetentionSettings",
1722
+ request_serializer=analytics_admin.UpdateDataRetentionSettingsRequest.serialize,
1723
+ response_deserializer=resources.DataRetentionSettings.deserialize,
1724
+ )
1725
+ return self._stubs["update_data_retention_settings"]
1726
+
1727
+ @property
1728
+ def create_data_stream(
1729
+ self,
1730
+ ) -> Callable[[analytics_admin.CreateDataStreamRequest], resources.DataStream]:
1731
+ r"""Return a callable for the create data stream method over gRPC.
1732
+
1733
+ Creates a DataStream.
1734
+
1735
+ Returns:
1736
+ Callable[[~.CreateDataStreamRequest],
1737
+ ~.DataStream]:
1738
+ A function that, when called, will call the underlying RPC
1739
+ on the server.
1740
+ """
1741
+ # Generate a "stub function" on-the-fly which will actually make
1742
+ # the request.
1743
+ # gRPC handles serialization and deserialization, so we just need
1744
+ # to pass in the functions for each.
1745
+ if "create_data_stream" not in self._stubs:
1746
+ self._stubs["create_data_stream"] = self._logged_channel.unary_unary(
1747
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/CreateDataStream",
1748
+ request_serializer=analytics_admin.CreateDataStreamRequest.serialize,
1749
+ response_deserializer=resources.DataStream.deserialize,
1750
+ )
1751
+ return self._stubs["create_data_stream"]
1752
+
1753
+ @property
1754
+ def delete_data_stream(
1755
+ self,
1756
+ ) -> Callable[[analytics_admin.DeleteDataStreamRequest], empty_pb2.Empty]:
1757
+ r"""Return a callable for the delete data stream method over gRPC.
1758
+
1759
+ Deletes a DataStream on a property.
1760
+
1761
+ Returns:
1762
+ Callable[[~.DeleteDataStreamRequest],
1763
+ ~.Empty]:
1764
+ A function that, when called, will call the underlying RPC
1765
+ on the server.
1766
+ """
1767
+ # Generate a "stub function" on-the-fly which will actually make
1768
+ # the request.
1769
+ # gRPC handles serialization and deserialization, so we just need
1770
+ # to pass in the functions for each.
1771
+ if "delete_data_stream" not in self._stubs:
1772
+ self._stubs["delete_data_stream"] = self._logged_channel.unary_unary(
1773
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/DeleteDataStream",
1774
+ request_serializer=analytics_admin.DeleteDataStreamRequest.serialize,
1775
+ response_deserializer=empty_pb2.Empty.FromString,
1776
+ )
1777
+ return self._stubs["delete_data_stream"]
1778
+
1779
+ @property
1780
+ def update_data_stream(
1781
+ self,
1782
+ ) -> Callable[[analytics_admin.UpdateDataStreamRequest], resources.DataStream]:
1783
+ r"""Return a callable for the update data stream method over gRPC.
1784
+
1785
+ Updates a DataStream on a property.
1786
+
1787
+ Returns:
1788
+ Callable[[~.UpdateDataStreamRequest],
1789
+ ~.DataStream]:
1790
+ A function that, when called, will call the underlying RPC
1791
+ on the server.
1792
+ """
1793
+ # Generate a "stub function" on-the-fly which will actually make
1794
+ # the request.
1795
+ # gRPC handles serialization and deserialization, so we just need
1796
+ # to pass in the functions for each.
1797
+ if "update_data_stream" not in self._stubs:
1798
+ self._stubs["update_data_stream"] = self._logged_channel.unary_unary(
1799
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/UpdateDataStream",
1800
+ request_serializer=analytics_admin.UpdateDataStreamRequest.serialize,
1801
+ response_deserializer=resources.DataStream.deserialize,
1802
+ )
1803
+ return self._stubs["update_data_stream"]
1804
+
1805
+ @property
1806
+ def list_data_streams(
1807
+ self,
1808
+ ) -> Callable[
1809
+ [analytics_admin.ListDataStreamsRequest],
1810
+ analytics_admin.ListDataStreamsResponse,
1811
+ ]:
1812
+ r"""Return a callable for the list data streams method over gRPC.
1813
+
1814
+ Lists DataStreams on a property.
1815
+
1816
+ Returns:
1817
+ Callable[[~.ListDataStreamsRequest],
1818
+ ~.ListDataStreamsResponse]:
1819
+ A function that, when called, will call the underlying RPC
1820
+ on the server.
1821
+ """
1822
+ # Generate a "stub function" on-the-fly which will actually make
1823
+ # the request.
1824
+ # gRPC handles serialization and deserialization, so we just need
1825
+ # to pass in the functions for each.
1826
+ if "list_data_streams" not in self._stubs:
1827
+ self._stubs["list_data_streams"] = self._logged_channel.unary_unary(
1828
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/ListDataStreams",
1829
+ request_serializer=analytics_admin.ListDataStreamsRequest.serialize,
1830
+ response_deserializer=analytics_admin.ListDataStreamsResponse.deserialize,
1831
+ )
1832
+ return self._stubs["list_data_streams"]
1833
+
1834
+ @property
1835
+ def get_data_stream(
1836
+ self,
1837
+ ) -> Callable[[analytics_admin.GetDataStreamRequest], resources.DataStream]:
1838
+ r"""Return a callable for the get data stream method over gRPC.
1839
+
1840
+ Lookup for a single DataStream.
1841
+
1842
+ Returns:
1843
+ Callable[[~.GetDataStreamRequest],
1844
+ ~.DataStream]:
1845
+ A function that, when called, will call the underlying RPC
1846
+ on the server.
1847
+ """
1848
+ # Generate a "stub function" on-the-fly which will actually make
1849
+ # the request.
1850
+ # gRPC handles serialization and deserialization, so we just need
1851
+ # to pass in the functions for each.
1852
+ if "get_data_stream" not in self._stubs:
1853
+ self._stubs["get_data_stream"] = self._logged_channel.unary_unary(
1854
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/GetDataStream",
1855
+ request_serializer=analytics_admin.GetDataStreamRequest.serialize,
1856
+ response_deserializer=resources.DataStream.deserialize,
1857
+ )
1858
+ return self._stubs["get_data_stream"]
1859
+
1860
+ @property
1861
+ def run_access_report(
1862
+ self,
1863
+ ) -> Callable[
1864
+ [analytics_admin.RunAccessReportRequest],
1865
+ analytics_admin.RunAccessReportResponse,
1866
+ ]:
1867
+ r"""Return a callable for the run access report method over gRPC.
1868
+
1869
+ Returns a customized report of data access records. The report
1870
+ provides records of each time a user reads Google Analytics
1871
+ reporting data. Access records are retained for up to 2 years.
1872
+
1873
+ Data Access Reports can be requested for a property. Reports may
1874
+ be requested for any property, but dimensions that aren't
1875
+ related to quota can only be requested on Google Analytics 360
1876
+ properties. This method is only available to Administrators.
1877
+
1878
+ These data access records include GA UI Reporting, GA UI
1879
+ Explorations, GA Data API, and other products like Firebase &
1880
+ Admob that can retrieve data from Google Analytics through a
1881
+ linkage. These records don't include property configuration
1882
+ changes like adding a stream or changing a property's time zone.
1883
+ For configuration change history, see
1884
+ `searchChangeHistoryEvents <https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents>`__.
1885
+
1886
+ To give your feedback on this API, complete the `Google
1887
+ Analytics Access Reports
1888
+ feedback <https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform>`__
1889
+ form.
1890
+
1891
+ Returns:
1892
+ Callable[[~.RunAccessReportRequest],
1893
+ ~.RunAccessReportResponse]:
1894
+ A function that, when called, will call the underlying RPC
1895
+ on the server.
1896
+ """
1897
+ # Generate a "stub function" on-the-fly which will actually make
1898
+ # the request.
1899
+ # gRPC handles serialization and deserialization, so we just need
1900
+ # to pass in the functions for each.
1901
+ if "run_access_report" not in self._stubs:
1902
+ self._stubs["run_access_report"] = self._logged_channel.unary_unary(
1903
+ "/google.analytics.admin.v1beta.AnalyticsAdminService/RunAccessReport",
1904
+ request_serializer=analytics_admin.RunAccessReportRequest.serialize,
1905
+ response_deserializer=analytics_admin.RunAccessReportResponse.deserialize,
1906
+ )
1907
+ return self._stubs["run_access_report"]
1908
+
1909
+ def close(self):
1910
+ self._logged_channel.close()
1911
+
1912
+ @property
1913
+ def kind(self) -> str:
1914
+ return "grpc"
1915
+
1916
+
1917
+ __all__ = ("AnalyticsAdminServiceGrpcTransport",)