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

Commit

Permalink
fix: rename the intraday_export_enabled field to `enterprise_export…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 10, 2023
1 parent 5759848 commit 7685881
Show file tree
Hide file tree
Showing 18 changed files with 1,436 additions and 11 deletions.
2 changes: 2 additions & 0 deletions google/analytics/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
UpdateAttributionSettingsRequest,
UpdateAudienceRequest,
UpdateChannelGroupRequest,
UpdateConversionEventRequest,
UpdateCustomDimensionRequest,
UpdateCustomMetricRequest,
UpdateDataRetentionSettingsRequest,
Expand Down Expand Up @@ -447,6 +448,7 @@
"UpdateAttributionSettingsRequest",
"UpdateAudienceRequest",
"UpdateChannelGroupRequest",
"UpdateConversionEventRequest",
"UpdateCustomDimensionRequest",
"UpdateCustomMetricRequest",
"UpdateDataRetentionSettingsRequest",
Expand Down
2 changes: 2 additions & 0 deletions google/analytics/admin_v1alpha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
UpdateAttributionSettingsRequest,
UpdateAudienceRequest,
UpdateChannelGroupRequest,
UpdateConversionEventRequest,
UpdateCustomDimensionRequest,
UpdateCustomMetricRequest,
UpdateDataRetentionSettingsRequest,
Expand Down Expand Up @@ -505,6 +506,7 @@
"UpdateAttributionSettingsRequest",
"UpdateAudienceRequest",
"UpdateChannelGroupRequest",
"UpdateConversionEventRequest",
"UpdateCustomDimensionRequest",
"UpdateCustomMetricRequest",
"UpdateDataRetentionSettingsRequest",
Expand Down
15 changes: 15 additions & 0 deletions google/analytics/admin_v1alpha/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,11 @@
"update_channel_group"
]
},
"UpdateConversionEvent": {
"methods": [
"update_conversion_event"
]
},
"UpdateCustomDimension": {
"methods": [
"update_custom_dimension"
Expand Down Expand Up @@ -1165,6 +1170,11 @@
"update_channel_group"
]
},
"UpdateConversionEvent": {
"methods": [
"update_conversion_event"
]
},
"UpdateCustomDimension": {
"methods": [
"update_custom_dimension"
Expand Down Expand Up @@ -1780,6 +1790,11 @@
"update_channel_group"
]
},
"UpdateConversionEvent": {
"methods": [
"update_conversion_event"
]
},
"UpdateCustomDimension": {
"methods": [
"update_custom_dimension"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4516,6 +4516,125 @@ async def sample_create_conversion_event():
# Done; return the response.
return response

async def update_conversion_event(
self,
request: Optional[
Union[analytics_admin.UpdateConversionEventRequest, dict]
] = None,
*,
conversion_event: Optional[resources.ConversionEvent] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.ConversionEvent:
r"""Updates a conversion event with the specified
attributes.

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import admin_v1alpha

async def sample_update_conversion_event():
# Create a client
client = admin_v1alpha.AnalyticsAdminServiceAsyncClient()

# Initialize request argument(s)
request = admin_v1alpha.UpdateConversionEventRequest(
)

# Make the request
response = await client.update_conversion_event(request=request)

# Handle the response
print(response)

Args:
request (Optional[Union[google.analytics.admin_v1alpha.types.UpdateConversionEventRequest, dict]]):
The request object. Request message for
UpdateConversionEvent RPC
conversion_event (:class:`google.analytics.admin_v1alpha.types.ConversionEvent`):
Required. The conversion event to update. The ``name``
field is used to identify the settings to be updated.

This corresponds to the ``conversion_event`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Required. The list of fields to be updated. Field names
must be in snake case (e.g., "field_to_update"). Omitted
fields will not be updated. To replace the entire
entity, use one path with the string "*" to match all
fields.

This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.

Returns:
google.analytics.admin_v1alpha.types.ConversionEvent:
A conversion event in a Google
Analytics property.

"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([conversion_event, update_mask])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = analytics_admin.UpdateConversionEventRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if conversion_event is not None:
request.conversion_event = conversion_event
if update_mask is not None:
request.update_mask = update_mask

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.update_conversion_event,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("conversion_event.name", request.conversion_event.name),)
),
)

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def get_conversion_event(
self,
request: Optional[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5129,6 +5129,125 @@ def sample_create_conversion_event():
# Done; return the response.
return response

def update_conversion_event(
self,
request: Optional[
Union[analytics_admin.UpdateConversionEventRequest, dict]
] = None,
*,
conversion_event: Optional[resources.ConversionEvent] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.ConversionEvent:
r"""Updates a conversion event with the specified
attributes.

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.analytics import admin_v1alpha

def sample_update_conversion_event():
# Create a client
client = admin_v1alpha.AnalyticsAdminServiceClient()

# Initialize request argument(s)
request = admin_v1alpha.UpdateConversionEventRequest(
)

# Make the request
response = client.update_conversion_event(request=request)

# Handle the response
print(response)

Args:
request (Union[google.analytics.admin_v1alpha.types.UpdateConversionEventRequest, dict]):
The request object. Request message for
UpdateConversionEvent RPC
conversion_event (google.analytics.admin_v1alpha.types.ConversionEvent):
Required. The conversion event to update. The ``name``
field is used to identify the settings to be updated.

This corresponds to the ``conversion_event`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. The list of fields to be updated. Field names
must be in snake case (e.g., "field_to_update"). Omitted
fields will not be updated. To replace the entire
entity, use one path with the string "*" to match all
fields.

This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.

Returns:
google.analytics.admin_v1alpha.types.ConversionEvent:
A conversion event in a Google
Analytics property.

"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([conversion_event, update_mask])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# Minor optimization to avoid making a copy if the user passes
# in a analytics_admin.UpdateConversionEventRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, analytics_admin.UpdateConversionEventRequest):
request = analytics_admin.UpdateConversionEventRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if conversion_event is not None:
request.conversion_event = conversion_event
if update_mask is not None:
request.update_mask = update_mask

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.update_conversion_event]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("conversion_event.name", request.conversion_event.name),)
),
)

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

def get_conversion_event(
self,
request: Optional[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=None,
client_info=client_info,
),
self.update_conversion_event: gapic_v1.method.wrap_method(
self.update_conversion_event,
default_timeout=None,
client_info=client_info,
),
self.get_conversion_event: gapic_v1.method.wrap_method(
self.get_conversion_event,
default_timeout=None,
Expand Down Expand Up @@ -1174,6 +1179,15 @@ def create_conversion_event(
]:
raise NotImplementedError()

@property
def update_conversion_event(
self,
) -> Callable[
[analytics_admin.UpdateConversionEventRequest],
Union[resources.ConversionEvent, Awaitable[resources.ConversionEvent]],
]:
raise NotImplementedError()

@property
def get_conversion_event(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,35 @@ def create_conversion_event(
)
return self._stubs["create_conversion_event"]

@property
def update_conversion_event(
self,
) -> Callable[
[analytics_admin.UpdateConversionEventRequest], resources.ConversionEvent
]:
r"""Return a callable for the update conversion event method over gRPC.
Updates a conversion event with the specified
attributes.
Returns:
Callable[[~.UpdateConversionEventRequest],
~.ConversionEvent]:
A function that, when called, will call the underlying RPC
on the server.
"""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "update_conversion_event" not in self._stubs:
self._stubs["update_conversion_event"] = self.grpc_channel.unary_unary(
"/google.analytics.admin.v1alpha.AnalyticsAdminService/UpdateConversionEvent",
request_serializer=analytics_admin.UpdateConversionEventRequest.serialize,
response_deserializer=resources.ConversionEvent.deserialize,
)
return self._stubs["update_conversion_event"]

@property
def get_conversion_event(
self,
Expand Down
Loading

0 comments on commit 7685881

Please sign in to comment.