google-analytics-admin 0.19.0__tar.gz → 0.20.0__tar.gz

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 (63) hide show
  1. {google-analytics-admin-0.19.0/google_analytics_admin.egg-info → google-analytics-admin-0.20.0}/PKG-INFO +1 -1
  2. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin/__init__.py +2 -0
  3. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin/gapic_version.py +1 -1
  4. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/__init__.py +2 -0
  5. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/gapic_metadata.json +15 -0
  6. {google-analytics-admin-0.19.0/google/analytics/admin_v1beta → google-analytics-admin-0.20.0/google/analytics/admin_v1alpha}/gapic_version.py +1 -1
  7. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/async_client.py +119 -0
  8. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/client.py +119 -0
  9. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/base.py +14 -0
  10. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc.py +29 -0
  11. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc_asyncio.py +30 -0
  12. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/rest.py +143 -0
  13. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/__init__.py +2 -0
  14. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/analytics_admin.py +27 -0
  15. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/resources.py +30 -3
  16. {google-analytics-admin-0.19.0/google/analytics/admin_v1alpha → google-analytics-admin-0.20.0/google/analytics/admin_v1beta}/gapic_version.py +1 -1
  17. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0/google_analytics_admin.egg-info}/PKG-INFO +1 -1
  18. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/unit/gapic/admin_v1alpha/test_analytics_admin_service.py +630 -6
  19. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/LICENSE +0 -0
  20. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/MANIFEST.in +0 -0
  21. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/README.rst +0 -0
  22. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin/py.typed +0 -0
  23. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/py.typed +0 -0
  24. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/__init__.py +0 -0
  25. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/__init__.py +0 -0
  26. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/pagers.py +0 -0
  27. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/services/analytics_admin_service/transports/__init__.py +0 -0
  28. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/access_report.py +0 -0
  29. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/audience.py +0 -0
  30. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/channel_group.py +0 -0
  31. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/event_create_and_edit.py +0 -0
  32. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1alpha/types/expanded_data_set.py +0 -0
  33. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/__init__.py +0 -0
  34. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/gapic_metadata.json +0 -0
  35. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/py.typed +0 -0
  36. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/__init__.py +0 -0
  37. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/__init__.py +0 -0
  38. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/async_client.py +0 -0
  39. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/client.py +0 -0
  40. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/pagers.py +0 -0
  41. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/__init__.py +0 -0
  42. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/base.py +0 -0
  43. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/grpc.py +0 -0
  44. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/grpc_asyncio.py +0 -0
  45. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/services/analytics_admin_service/transports/rest.py +0 -0
  46. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/types/__init__.py +0 -0
  47. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/types/access_report.py +0 -0
  48. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/types/analytics_admin.py +0 -0
  49. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google/analytics/admin_v1beta/types/resources.py +0 -0
  50. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google_analytics_admin.egg-info/SOURCES.txt +0 -0
  51. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google_analytics_admin.egg-info/dependency_links.txt +0 -0
  52. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google_analytics_admin.egg-info/namespace_packages.txt +0 -0
  53. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google_analytics_admin.egg-info/not-zip-safe +0 -0
  54. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google_analytics_admin.egg-info/requires.txt +0 -0
  55. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/google_analytics_admin.egg-info/top_level.txt +0 -0
  56. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/setup.cfg +0 -0
  57. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/setup.py +0 -0
  58. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/__init__.py +0 -0
  59. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/unit/__init__.py +0 -0
  60. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/unit/gapic/__init__.py +0 -0
  61. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/unit/gapic/admin_v1alpha/__init__.py +0 -0
  62. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/unit/gapic/admin_v1beta/__init__.py +0 -0
  63. {google-analytics-admin-0.19.0 → google-analytics-admin-0.20.0}/tests/unit/gapic/admin_v1beta/test_analytics_admin_service.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-analytics-admin
3
- Version: 0.19.0
3
+ Version: 0.20.0
4
4
  Summary: Google Analytics Admin API client library
5
5
  Home-page: https://github.com/googleapis/python-analytics-admin
6
6
  Author: Google LLC
@@ -192,6 +192,7 @@ from google.analytics.admin_v1alpha.types.analytics_admin import (
192
192
  UpdateAttributionSettingsRequest,
193
193
  UpdateAudienceRequest,
194
194
  UpdateChannelGroupRequest,
195
+ UpdateConversionEventRequest,
195
196
  UpdateCustomDimensionRequest,
196
197
  UpdateCustomMetricRequest,
197
198
  UpdateDataRetentionSettingsRequest,
@@ -447,6 +448,7 @@ __all__ = (
447
448
  "UpdateAttributionSettingsRequest",
448
449
  "UpdateAudienceRequest",
449
450
  "UpdateChannelGroupRequest",
451
+ "UpdateConversionEventRequest",
450
452
  "UpdateCustomDimensionRequest",
451
453
  "UpdateCustomMetricRequest",
452
454
  "UpdateDataRetentionSettingsRequest",
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.19.0" # {x-release-please-version}
16
+ __version__ = "0.20.0" # {x-release-please-version}
@@ -190,6 +190,7 @@ from .types.analytics_admin import (
190
190
  UpdateAttributionSettingsRequest,
191
191
  UpdateAudienceRequest,
192
192
  UpdateChannelGroupRequest,
193
+ UpdateConversionEventRequest,
193
194
  UpdateCustomDimensionRequest,
194
195
  UpdateCustomMetricRequest,
195
196
  UpdateDataRetentionSettingsRequest,
@@ -505,6 +506,7 @@ __all__ = (
505
506
  "UpdateAttributionSettingsRequest",
506
507
  "UpdateAudienceRequest",
507
508
  "UpdateChannelGroupRequest",
509
+ "UpdateConversionEventRequest",
508
510
  "UpdateCustomDimensionRequest",
509
511
  "UpdateCustomMetricRequest",
510
512
  "UpdateDataRetentionSettingsRequest",
@@ -550,6 +550,11 @@
550
550
  "update_channel_group"
551
551
  ]
552
552
  },
553
+ "UpdateConversionEvent": {
554
+ "methods": [
555
+ "update_conversion_event"
556
+ ]
557
+ },
553
558
  "UpdateCustomDimension": {
554
559
  "methods": [
555
560
  "update_custom_dimension"
@@ -1165,6 +1170,11 @@
1165
1170
  "update_channel_group"
1166
1171
  ]
1167
1172
  },
1173
+ "UpdateConversionEvent": {
1174
+ "methods": [
1175
+ "update_conversion_event"
1176
+ ]
1177
+ },
1168
1178
  "UpdateCustomDimension": {
1169
1179
  "methods": [
1170
1180
  "update_custom_dimension"
@@ -1780,6 +1790,11 @@
1780
1790
  "update_channel_group"
1781
1791
  ]
1782
1792
  },
1793
+ "UpdateConversionEvent": {
1794
+ "methods": [
1795
+ "update_conversion_event"
1796
+ ]
1797
+ },
1783
1798
  "UpdateCustomDimension": {
1784
1799
  "methods": [
1785
1800
  "update_custom_dimension"
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.19.0" # {x-release-please-version}
16
+ __version__ = "0.20.0" # {x-release-please-version}
@@ -4516,6 +4516,125 @@ class AnalyticsAdminServiceAsyncClient:
4516
4516
  # Done; return the response.
4517
4517
  return response
4518
4518
 
4519
+ async def update_conversion_event(
4520
+ self,
4521
+ request: Optional[
4522
+ Union[analytics_admin.UpdateConversionEventRequest, dict]
4523
+ ] = None,
4524
+ *,
4525
+ conversion_event: Optional[resources.ConversionEvent] = None,
4526
+ update_mask: Optional[field_mask_pb2.FieldMask] = None,
4527
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4528
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4529
+ metadata: Sequence[Tuple[str, str]] = (),
4530
+ ) -> resources.ConversionEvent:
4531
+ r"""Updates a conversion event with the specified
4532
+ attributes.
4533
+
4534
+ .. code-block:: python
4535
+
4536
+ # This snippet has been automatically generated and should be regarded as a
4537
+ # code template only.
4538
+ # It will require modifications to work:
4539
+ # - It may require correct/in-range values for request initialization.
4540
+ # - It may require specifying regional endpoints when creating the service
4541
+ # client as shown in:
4542
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4543
+ from google.analytics import admin_v1alpha
4544
+
4545
+ async def sample_update_conversion_event():
4546
+ # Create a client
4547
+ client = admin_v1alpha.AnalyticsAdminServiceAsyncClient()
4548
+
4549
+ # Initialize request argument(s)
4550
+ request = admin_v1alpha.UpdateConversionEventRequest(
4551
+ )
4552
+
4553
+ # Make the request
4554
+ response = await client.update_conversion_event(request=request)
4555
+
4556
+ # Handle the response
4557
+ print(response)
4558
+
4559
+ Args:
4560
+ request (Optional[Union[google.analytics.admin_v1alpha.types.UpdateConversionEventRequest, dict]]):
4561
+ The request object. Request message for
4562
+ UpdateConversionEvent RPC
4563
+ conversion_event (:class:`google.analytics.admin_v1alpha.types.ConversionEvent`):
4564
+ Required. The conversion event to update. The ``name``
4565
+ field is used to identify the settings to be updated.
4566
+
4567
+ This corresponds to the ``conversion_event`` field
4568
+ on the ``request`` instance; if ``request`` is provided, this
4569
+ should not be set.
4570
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
4571
+ Required. The list of fields to be updated. Field names
4572
+ must be in snake case (e.g., "field_to_update"). Omitted
4573
+ fields will not be updated. To replace the entire
4574
+ entity, use one path with the string "*" to match all
4575
+ fields.
4576
+
4577
+ This corresponds to the ``update_mask`` field
4578
+ on the ``request`` instance; if ``request`` is provided, this
4579
+ should not be set.
4580
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4581
+ should be retried.
4582
+ timeout (float): The timeout for this request.
4583
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
4584
+ sent along with the request as metadata.
4585
+
4586
+ Returns:
4587
+ google.analytics.admin_v1alpha.types.ConversionEvent:
4588
+ A conversion event in a Google
4589
+ Analytics property.
4590
+
4591
+ """
4592
+ # Create or coerce a protobuf request object.
4593
+ # Quick check: If we got a request object, we should *not* have
4594
+ # gotten any keyword arguments that map to the request.
4595
+ has_flattened_params = any([conversion_event, update_mask])
4596
+ if request is not None and has_flattened_params:
4597
+ raise ValueError(
4598
+ "If the `request` argument is set, then none of "
4599
+ "the individual field arguments should be set."
4600
+ )
4601
+
4602
+ request = analytics_admin.UpdateConversionEventRequest(request)
4603
+
4604
+ # If we have keyword arguments corresponding to fields on the
4605
+ # request, apply these.
4606
+ if conversion_event is not None:
4607
+ request.conversion_event = conversion_event
4608
+ if update_mask is not None:
4609
+ request.update_mask = update_mask
4610
+
4611
+ # Wrap the RPC method; this adds retry and timeout information,
4612
+ # and friendly error handling.
4613
+ rpc = gapic_v1.method_async.wrap_method(
4614
+ self._client._transport.update_conversion_event,
4615
+ default_timeout=None,
4616
+ client_info=DEFAULT_CLIENT_INFO,
4617
+ )
4618
+
4619
+ # Certain fields should be provided within the metadata header;
4620
+ # add these here.
4621
+ metadata = tuple(metadata) + (
4622
+ gapic_v1.routing_header.to_grpc_metadata(
4623
+ (("conversion_event.name", request.conversion_event.name),)
4624
+ ),
4625
+ )
4626
+
4627
+ # Send the request.
4628
+ response = await rpc(
4629
+ request,
4630
+ retry=retry,
4631
+ timeout=timeout,
4632
+ metadata=metadata,
4633
+ )
4634
+
4635
+ # Done; return the response.
4636
+ return response
4637
+
4519
4638
  async def get_conversion_event(
4520
4639
  self,
4521
4640
  request: Optional[
@@ -5129,6 +5129,125 @@ class AnalyticsAdminServiceClient(metaclass=AnalyticsAdminServiceClientMeta):
5129
5129
  # Done; return the response.
5130
5130
  return response
5131
5131
 
5132
+ def update_conversion_event(
5133
+ self,
5134
+ request: Optional[
5135
+ Union[analytics_admin.UpdateConversionEventRequest, dict]
5136
+ ] = None,
5137
+ *,
5138
+ conversion_event: Optional[resources.ConversionEvent] = None,
5139
+ update_mask: Optional[field_mask_pb2.FieldMask] = None,
5140
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
5141
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
5142
+ metadata: Sequence[Tuple[str, str]] = (),
5143
+ ) -> resources.ConversionEvent:
5144
+ r"""Updates a conversion event with the specified
5145
+ attributes.
5146
+
5147
+ .. code-block:: python
5148
+
5149
+ # This snippet has been automatically generated and should be regarded as a
5150
+ # code template only.
5151
+ # It will require modifications to work:
5152
+ # - It may require correct/in-range values for request initialization.
5153
+ # - It may require specifying regional endpoints when creating the service
5154
+ # client as shown in:
5155
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
5156
+ from google.analytics import admin_v1alpha
5157
+
5158
+ def sample_update_conversion_event():
5159
+ # Create a client
5160
+ client = admin_v1alpha.AnalyticsAdminServiceClient()
5161
+
5162
+ # Initialize request argument(s)
5163
+ request = admin_v1alpha.UpdateConversionEventRequest(
5164
+ )
5165
+
5166
+ # Make the request
5167
+ response = client.update_conversion_event(request=request)
5168
+
5169
+ # Handle the response
5170
+ print(response)
5171
+
5172
+ Args:
5173
+ request (Union[google.analytics.admin_v1alpha.types.UpdateConversionEventRequest, dict]):
5174
+ The request object. Request message for
5175
+ UpdateConversionEvent RPC
5176
+ conversion_event (google.analytics.admin_v1alpha.types.ConversionEvent):
5177
+ Required. The conversion event to update. The ``name``
5178
+ field is used to identify the settings to be updated.
5179
+
5180
+ This corresponds to the ``conversion_event`` field
5181
+ on the ``request`` instance; if ``request`` is provided, this
5182
+ should not be set.
5183
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
5184
+ Required. The list of fields to be updated. Field names
5185
+ must be in snake case (e.g., "field_to_update"). Omitted
5186
+ fields will not be updated. To replace the entire
5187
+ entity, use one path with the string "*" to match all
5188
+ fields.
5189
+
5190
+ This corresponds to the ``update_mask`` field
5191
+ on the ``request`` instance; if ``request`` is provided, this
5192
+ should not be set.
5193
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
5194
+ should be retried.
5195
+ timeout (float): The timeout for this request.
5196
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
5197
+ sent along with the request as metadata.
5198
+
5199
+ Returns:
5200
+ google.analytics.admin_v1alpha.types.ConversionEvent:
5201
+ A conversion event in a Google
5202
+ Analytics property.
5203
+
5204
+ """
5205
+ # Create or coerce a protobuf request object.
5206
+ # Quick check: If we got a request object, we should *not* have
5207
+ # gotten any keyword arguments that map to the request.
5208
+ has_flattened_params = any([conversion_event, update_mask])
5209
+ if request is not None and has_flattened_params:
5210
+ raise ValueError(
5211
+ "If the `request` argument is set, then none of "
5212
+ "the individual field arguments should be set."
5213
+ )
5214
+
5215
+ # Minor optimization to avoid making a copy if the user passes
5216
+ # in a analytics_admin.UpdateConversionEventRequest.
5217
+ # There's no risk of modifying the input as we've already verified
5218
+ # there are no flattened fields.
5219
+ if not isinstance(request, analytics_admin.UpdateConversionEventRequest):
5220
+ request = analytics_admin.UpdateConversionEventRequest(request)
5221
+ # If we have keyword arguments corresponding to fields on the
5222
+ # request, apply these.
5223
+ if conversion_event is not None:
5224
+ request.conversion_event = conversion_event
5225
+ if update_mask is not None:
5226
+ request.update_mask = update_mask
5227
+
5228
+ # Wrap the RPC method; this adds retry and timeout information,
5229
+ # and friendly error handling.
5230
+ rpc = self._transport._wrapped_methods[self._transport.update_conversion_event]
5231
+
5232
+ # Certain fields should be provided within the metadata header;
5233
+ # add these here.
5234
+ metadata = tuple(metadata) + (
5235
+ gapic_v1.routing_header.to_grpc_metadata(
5236
+ (("conversion_event.name", request.conversion_event.name),)
5237
+ ),
5238
+ )
5239
+
5240
+ # Send the request.
5241
+ response = rpc(
5242
+ request,
5243
+ retry=retry,
5244
+ timeout=timeout,
5245
+ metadata=metadata,
5246
+ )
5247
+
5248
+ # Done; return the response.
5249
+ return response
5250
+
5132
5251
  def get_conversion_event(
5133
5252
  self,
5134
5253
  request: Optional[
@@ -338,6 +338,11 @@ class AnalyticsAdminServiceTransport(abc.ABC):
338
338
  default_timeout=None,
339
339
  client_info=client_info,
340
340
  ),
341
+ self.update_conversion_event: gapic_v1.method.wrap_method(
342
+ self.update_conversion_event,
343
+ default_timeout=None,
344
+ client_info=client_info,
345
+ ),
341
346
  self.get_conversion_event: gapic_v1.method.wrap_method(
342
347
  self.get_conversion_event,
343
348
  default_timeout=None,
@@ -1174,6 +1179,15 @@ class AnalyticsAdminServiceTransport(abc.ABC):
1174
1179
  ]:
1175
1180
  raise NotImplementedError()
1176
1181
 
1182
+ @property
1183
+ def update_conversion_event(
1184
+ self,
1185
+ ) -> Callable[
1186
+ [analytics_admin.UpdateConversionEventRequest],
1187
+ Union[resources.ConversionEvent, Awaitable[resources.ConversionEvent]],
1188
+ ]:
1189
+ raise NotImplementedError()
1190
+
1177
1191
  @property
1178
1192
  def get_conversion_event(
1179
1193
  self,
@@ -1429,6 +1429,35 @@ class AnalyticsAdminServiceGrpcTransport(AnalyticsAdminServiceTransport):
1429
1429
  )
1430
1430
  return self._stubs["create_conversion_event"]
1431
1431
 
1432
+ @property
1433
+ def update_conversion_event(
1434
+ self,
1435
+ ) -> Callable[
1436
+ [analytics_admin.UpdateConversionEventRequest], resources.ConversionEvent
1437
+ ]:
1438
+ r"""Return a callable for the update conversion event method over gRPC.
1439
+
1440
+ Updates a conversion event with the specified
1441
+ attributes.
1442
+
1443
+ Returns:
1444
+ Callable[[~.UpdateConversionEventRequest],
1445
+ ~.ConversionEvent]:
1446
+ A function that, when called, will call the underlying RPC
1447
+ on the server.
1448
+ """
1449
+ # Generate a "stub function" on-the-fly which will actually make
1450
+ # the request.
1451
+ # gRPC handles serialization and deserialization, so we just need
1452
+ # to pass in the functions for each.
1453
+ if "update_conversion_event" not in self._stubs:
1454
+ self._stubs["update_conversion_event"] = self.grpc_channel.unary_unary(
1455
+ "/google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateConversionEvent",
1456
+ request_serializer=analytics_admin.UpdateConversionEventRequest.serialize,
1457
+ response_deserializer=resources.ConversionEvent.deserialize,
1458
+ )
1459
+ return self._stubs["update_conversion_event"]
1460
+
1432
1461
  @property
1433
1462
  def get_conversion_event(
1434
1463
  self,
@@ -1459,6 +1459,36 @@ class AnalyticsAdminServiceGrpcAsyncIOTransport(AnalyticsAdminServiceTransport):
1459
1459
  )
1460
1460
  return self._stubs["create_conversion_event"]
1461
1461
 
1462
+ @property
1463
+ def update_conversion_event(
1464
+ self,
1465
+ ) -> Callable[
1466
+ [analytics_admin.UpdateConversionEventRequest],
1467
+ Awaitable[resources.ConversionEvent],
1468
+ ]:
1469
+ r"""Return a callable for the update conversion event method over gRPC.
1470
+
1471
+ Updates a conversion event with the specified
1472
+ attributes.
1473
+
1474
+ Returns:
1475
+ Callable[[~.UpdateConversionEventRequest],
1476
+ Awaitable[~.ConversionEvent]]:
1477
+ A function that, when called, will call the underlying RPC
1478
+ on the server.
1479
+ """
1480
+ # Generate a "stub function" on-the-fly which will actually make
1481
+ # the request.
1482
+ # gRPC handles serialization and deserialization, so we just need
1483
+ # to pass in the functions for each.
1484
+ if "update_conversion_event" not in self._stubs:
1485
+ self._stubs["update_conversion_event"] = self.grpc_channel.unary_unary(
1486
+ "/google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateConversionEvent",
1487
+ request_serializer=analytics_admin.UpdateConversionEventRequest.serialize,
1488
+ response_deserializer=resources.ConversionEvent.deserialize,
1489
+ )
1490
+ return self._stubs["update_conversion_event"]
1491
+
1462
1492
  @property
1463
1493
  def get_conversion_event(
1464
1494
  self,
@@ -855,6 +855,14 @@ class AnalyticsAdminServiceRestInterceptor:
855
855
  logging.log(f"Received response: {response}")
856
856
  return response
857
857
 
858
+ def pre_update_conversion_event(self, request, metadata):
859
+ logging.log(f"Received request: {request}")
860
+ return request, metadata
861
+
862
+ def post_update_conversion_event(self, response):
863
+ logging.log(f"Received response: {response}")
864
+ return response
865
+
858
866
  def pre_update_custom_dimension(self, request, metadata):
859
867
  logging.log(f"Received request: {request}")
860
868
  return request, metadata
@@ -3296,6 +3304,29 @@ class AnalyticsAdminServiceRestInterceptor:
3296
3304
  """
3297
3305
  return response
3298
3306
 
3307
+ def pre_update_conversion_event(
3308
+ self,
3309
+ request: analytics_admin.UpdateConversionEventRequest,
3310
+ metadata: Sequence[Tuple[str, str]],
3311
+ ) -> Tuple[analytics_admin.UpdateConversionEventRequest, Sequence[Tuple[str, str]]]:
3312
+ """Pre-rpc interceptor for update_conversion_event
3313
+
3314
+ Override in a subclass to manipulate the request or metadata
3315
+ before they are sent to the AnalyticsAdminService server.
3316
+ """
3317
+ return request, metadata
3318
+
3319
+ def post_update_conversion_event(
3320
+ self, response: resources.ConversionEvent
3321
+ ) -> resources.ConversionEvent:
3322
+ """Post-rpc interceptor for update_conversion_event
3323
+
3324
+ Override in a subclass to manipulate the response
3325
+ after it is returned by the AnalyticsAdminService server but before
3326
+ it is returned to user code.
3327
+ """
3328
+ return response
3329
+
3299
3330
  def pre_update_custom_dimension(
3300
3331
  self,
3301
3332
  request: analytics_admin.UpdateCustomDimensionRequest,
@@ -13870,6 +13901,108 @@ class AnalyticsAdminServiceRestTransport(AnalyticsAdminServiceTransport):
13870
13901
  resp = self._interceptor.post_update_channel_group(resp)
13871
13902
  return resp
13872
13903
 
13904
+ class _UpdateConversionEvent(AnalyticsAdminServiceRestStub):
13905
+ def __hash__(self):
13906
+ return hash("UpdateConversionEvent")
13907
+
13908
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
13909
+ "updateMask": {},
13910
+ }
13911
+
13912
+ @classmethod
13913
+ def _get_unset_required_fields(cls, message_dict):
13914
+ return {
13915
+ k: v
13916
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
13917
+ if k not in message_dict
13918
+ }
13919
+
13920
+ def __call__(
13921
+ self,
13922
+ request: analytics_admin.UpdateConversionEventRequest,
13923
+ *,
13924
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
13925
+ timeout: Optional[float] = None,
13926
+ metadata: Sequence[Tuple[str, str]] = (),
13927
+ ) -> resources.ConversionEvent:
13928
+ r"""Call the update conversion event method over HTTP.
13929
+
13930
+ Args:
13931
+ request (~.analytics_admin.UpdateConversionEventRequest):
13932
+ The request object. Request message for
13933
+ UpdateConversionEvent RPC
13934
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
13935
+ should be retried.
13936
+ timeout (float): The timeout for this request.
13937
+ metadata (Sequence[Tuple[str, str]]): Strings which should be
13938
+ sent along with the request as metadata.
13939
+
13940
+ Returns:
13941
+ ~.resources.ConversionEvent:
13942
+ A conversion event in a Google
13943
+ Analytics property.
13944
+
13945
+ """
13946
+
13947
+ http_options: List[Dict[str, str]] = [
13948
+ {
13949
+ "method": "patch",
13950
+ "uri": "/v1alpha/{conversion_event.name=properties/*/conversionEvents/*}",
13951
+ "body": "conversion_event",
13952
+ },
13953
+ ]
13954
+ request, metadata = self._interceptor.pre_update_conversion_event(
13955
+ request, metadata
13956
+ )
13957
+ pb_request = analytics_admin.UpdateConversionEventRequest.pb(request)
13958
+ transcoded_request = path_template.transcode(http_options, pb_request)
13959
+
13960
+ # Jsonify the request body
13961
+
13962
+ body = json_format.MessageToJson(
13963
+ transcoded_request["body"],
13964
+ including_default_value_fields=False,
13965
+ use_integers_for_enums=True,
13966
+ )
13967
+ uri = transcoded_request["uri"]
13968
+ method = transcoded_request["method"]
13969
+
13970
+ # Jsonify the query params
13971
+ query_params = json.loads(
13972
+ json_format.MessageToJson(
13973
+ transcoded_request["query_params"],
13974
+ including_default_value_fields=False,
13975
+ use_integers_for_enums=True,
13976
+ )
13977
+ )
13978
+ query_params.update(self._get_unset_required_fields(query_params))
13979
+
13980
+ query_params["$alt"] = "json;enum-encoding=int"
13981
+
13982
+ # Send the request
13983
+ headers = dict(metadata)
13984
+ headers["Content-Type"] = "application/json"
13985
+ response = getattr(self._session, method)(
13986
+ "{host}{uri}".format(host=self._host, uri=uri),
13987
+ timeout=timeout,
13988
+ headers=headers,
13989
+ params=rest_helpers.flatten_query_params(query_params, strict=True),
13990
+ data=body,
13991
+ )
13992
+
13993
+ # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
13994
+ # subclass.
13995
+ if response.status_code >= 400:
13996
+ raise core_exceptions.from_http_response(response)
13997
+
13998
+ # Return the response
13999
+ resp = resources.ConversionEvent()
14000
+ pb_resp = resources.ConversionEvent.pb(resp)
14001
+
14002
+ json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
14003
+ resp = self._interceptor.post_update_conversion_event(resp)
14004
+ return resp
14005
+
13873
14006
  class _UpdateCustomDimension(AnalyticsAdminServiceRestStub):
13874
14007
  def __hash__(self):
13875
14008
  return hash("UpdateCustomDimension")
@@ -16379,6 +16512,16 @@ class AnalyticsAdminServiceRestTransport(AnalyticsAdminServiceTransport):
16379
16512
  # In C++ this would require a dynamic_cast
16380
16513
  return self._UpdateChannelGroup(self._session, self._host, self._interceptor) # type: ignore
16381
16514
 
16515
+ @property
16516
+ def update_conversion_event(
16517
+ self,
16518
+ ) -> Callable[
16519
+ [analytics_admin.UpdateConversionEventRequest], resources.ConversionEvent
16520
+ ]:
16521
+ # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
16522
+ # In C++ this would require a dynamic_cast
16523
+ return self._UpdateConversionEvent(self._session, self._host, self._interceptor) # type: ignore
16524
+
16382
16525
  @property
16383
16526
  def update_custom_dimension(
16384
16527
  self,
@@ -181,6 +181,7 @@ from .analytics_admin import (
181
181
  UpdateAttributionSettingsRequest,
182
182
  UpdateAudienceRequest,
183
183
  UpdateChannelGroupRequest,
184
+ UpdateConversionEventRequest,
184
185
  UpdateCustomDimensionRequest,
185
186
  UpdateCustomMetricRequest,
186
187
  UpdateDataRetentionSettingsRequest,
@@ -430,6 +431,7 @@ __all__ = (
430
431
  "UpdateAttributionSettingsRequest",
431
432
  "UpdateAudienceRequest",
432
433
  "UpdateChannelGroupRequest",
434
+ "UpdateConversionEventRequest",
433
435
  "UpdateCustomDimensionRequest",
434
436
  "UpdateCustomMetricRequest",
435
437
  "UpdateDataRetentionSettingsRequest",
@@ -89,6 +89,7 @@ __protobuf__ = proto.module(
89
89
  "GetGoogleSignalsSettingsRequest",
90
90
  "UpdateGoogleSignalsSettingsRequest",
91
91
  "CreateConversionEventRequest",
92
+ "UpdateConversionEventRequest",
92
93
  "GetConversionEventRequest",
93
94
  "DeleteConversionEventRequest",
94
95
  "ListConversionEventsRequest",
@@ -1770,6 +1771,32 @@ class CreateConversionEventRequest(proto.Message):
1770
1771
  )
1771
1772
 
1772
1773
 
1774
+ class UpdateConversionEventRequest(proto.Message):
1775
+ r"""Request message for UpdateConversionEvent RPC
1776
+
1777
+ Attributes:
1778
+ conversion_event (google.analytics.admin_v1alpha.types.ConversionEvent):
1779
+ Required. The conversion event to update. The ``name`` field
1780
+ is used to identify the settings to be updated.
1781
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
1782
+ Required. The list of fields to be updated. Field names must
1783
+ be in snake case (e.g., "field_to_update"). Omitted fields
1784
+ will not be updated. To replace the entire entity, use one
1785
+ path with the string "*" to match all fields.
1786
+ """
1787
+
1788
+ conversion_event: resources.ConversionEvent = proto.Field(
1789
+ proto.MESSAGE,
1790
+ number=1,
1791
+ message=resources.ConversionEvent,
1792
+ )
1793
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
1794
+ proto.MESSAGE,
1795
+ number=2,
1796
+ message=field_mask_pb2.FieldMask,
1797
+ )
1798
+
1799
+
1773
1800
  class GetConversionEventRequest(proto.Message):
1774
1801
  r"""Request message for GetConversionEvent RPC
1775
1802