Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 7685881

Browse files
fix: rename the intraday_export_enabled field to enterprise_export_enabled in the BigQueryLink resource (#372)
* fix!: rename the `enterprise_daily_export_enabled` field to `fresh_daily_export_enabled` in the `BigQueryLink` resource feat: add `UpdateConversionEvent` method to the Admin API v1 alpha feat: add the `counting_method` field to the `ConversionEvent` type feat: add the `ConversionCountingMethod` enum PiperOrigin-RevId: 555379699 Source-Link: googleapis/googleapis@a9a67de Source-Link: https://github.com/googleapis/googleapis-gen/commit/31b8966b65d9232b5b396d73be6578086ffc6718 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzFiODk2NmI2NWQ5MjMyYjViMzk2ZDczYmU2NTc4MDg2ZmZjNjcxOCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 5759848 commit 7685881

18 files changed

Lines changed: 1436 additions & 11 deletions

google/analytics/admin/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
UpdateAttributionSettingsRequest,
193193
UpdateAudienceRequest,
194194
UpdateChannelGroupRequest,
195+
UpdateConversionEventRequest,
195196
UpdateCustomDimensionRequest,
196197
UpdateCustomMetricRequest,
197198
UpdateDataRetentionSettingsRequest,
@@ -447,6 +448,7 @@
447448
"UpdateAttributionSettingsRequest",
448449
"UpdateAudienceRequest",
449450
"UpdateChannelGroupRequest",
451+
"UpdateConversionEventRequest",
450452
"UpdateCustomDimensionRequest",
451453
"UpdateCustomMetricRequest",
452454
"UpdateDataRetentionSettingsRequest",

google/analytics/admin_v1alpha/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
UpdateAttributionSettingsRequest,
191191
UpdateAudienceRequest,
192192
UpdateChannelGroupRequest,
193+
UpdateConversionEventRequest,
193194
UpdateCustomDimensionRequest,
194195
UpdateCustomMetricRequest,
195196
UpdateDataRetentionSettingsRequest,
@@ -505,6 +506,7 @@
505506
"UpdateAttributionSettingsRequest",
506507
"UpdateAudienceRequest",
507508
"UpdateChannelGroupRequest",
509+
"UpdateConversionEventRequest",
508510
"UpdateCustomDimensionRequest",
509511
"UpdateCustomMetricRequest",
510512
"UpdateDataRetentionSettingsRequest",

google/analytics/admin_v1alpha/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@
550550
"update_channel_group"
551551
]
552552
},
553+
"UpdateConversionEvent": {
554+
"methods": [
555+
"update_conversion_event"
556+
]
557+
},
553558
"UpdateCustomDimension": {
554559
"methods": [
555560
"update_custom_dimension"
@@ -1165,6 +1170,11 @@
11651170
"update_channel_group"
11661171
]
11671172
},
1173+
"UpdateConversionEvent": {
1174+
"methods": [
1175+
"update_conversion_event"
1176+
]
1177+
},
11681178
"UpdateCustomDimension": {
11691179
"methods": [
11701180
"update_custom_dimension"
@@ -1780,6 +1790,11 @@
17801790
"update_channel_group"
17811791
]
17821792
},
1793+
"UpdateConversionEvent": {
1794+
"methods": [
1795+
"update_conversion_event"
1796+
]
1797+
},
17831798
"UpdateCustomDimension": {
17841799
"methods": [
17851800
"update_custom_dimension"

google/analytics/admin_v1alpha/services/analytics_admin_service/async_client.py

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4516,6 +4516,125 @@ async def sample_create_conversion_event():
45164516
# Done; return the response.
45174517
return response
45184518

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+
45194638
async def get_conversion_event(
45204639
self,
45214640
request: Optional[

google/analytics/admin_v1alpha/services/analytics_admin_service/client.py

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5129,6 +5129,125 @@ def sample_create_conversion_event():
51295129
# Done; return the response.
51305130
return response
51315131

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+
51325251
def get_conversion_event(
51335252
self,
51345253
request: Optional[

google/analytics/admin_v1alpha/services/analytics_admin_service/transports/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,11 @@ def _prep_wrapped_messages(self, client_info):
338338
default_timeout=None,
339339
client_info=client_info,
340340
),
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+
),
341346
self.get_conversion_event: gapic_v1.method.wrap_method(
342347
self.get_conversion_event,
343348
default_timeout=None,
@@ -1174,6 +1179,15 @@ def create_conversion_event(
11741179
]:
11751180
raise NotImplementedError()
11761181

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+
11771191
@property
11781192
def get_conversion_event(
11791193
self,

google/analytics/admin_v1alpha/services/analytics_admin_service/transports/grpc.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,35 @@ def create_conversion_event(
14291429
)
14301430
return self._stubs["create_conversion_event"]
14311431

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+
14321461
@property
14331462
def get_conversion_event(
14341463
self,

0 commit comments

Comments
 (0)