def write_user_event(self, request: Union[(user_event_service.WriteUserEventRequest, dict)]=None, *, parent: str=None, user_event: gcr_user_event.UserEvent=None, retry: retries.Retry=gapic_v1.method.DEFAULT, timeout: float=None, metadata: Sequence[Tuple[(str, str)]]=()) -> gcr_user_event.UserEvent:
    "Writes a single user event.\n\n        Args:\n            request (Union[google.cloud.recommendationengine_v1beta1.types.WriteUserEventRequest, dict]):\n                The request object. Request message for WriteUserEvent\n                method.\n            parent (str):\n                Required. The parent eventStore resource name, such as\n                ``projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store``.\n\n                This corresponds to the ``parent`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            user_event (google.cloud.recommendationengine_v1beta1.types.UserEvent):\n                Required. User event to write.\n                This corresponds to the ``user_event`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            retry (google.api_core.retry.Retry): Designation of what errors, if any,\n                should be retried.\n            timeout (float): The timeout for this request.\n            metadata (Sequence[Tuple[str, str]]): Strings which should be\n                sent along with the request as metadata.\n\n        Returns:\n            google.cloud.recommendationengine_v1beta1.types.UserEvent:\n                UserEvent captures all metadata\n                information recommendation engine needs\n                to know about how end users interact\n                with customers' website.\n\n        "
    has_flattened_params = any([parent, user_event])
    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.')
    if (not isinstance(request, user_event_service.WriteUserEventRequest)):
        request = user_event_service.WriteUserEventRequest(request)
        if (parent is not None):
            request.parent = parent
        if (user_event is not None):
            request.user_event = user_event
    rpc = self._transport._wrapped_methods[self._transport.write_user_event]
    metadata = (tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata((('parent', request.parent),)),))
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)
    return response
Writes a single user event.

Args:
    request (Union[google.cloud.recommendationengine_v1beta1.types.WriteUserEventRequest, dict]):
        The request object. Request message for WriteUserEvent
        method.
    parent (str):
        Required. The parent eventStore resource name, such as
        ``projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store``.

        This corresponds to the ``parent`` field
        on the ``request`` instance; if ``request`` is provided, this
        should not be set.
    user_event (google.cloud.recommendationengine_v1beta1.types.UserEvent):
        Required. User event to write.
        This corresponds to the ``user_event`` 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.cloud.recommendationengine_v1beta1.types.UserEvent:
        UserEvent captures all metadata
        information recommendation engine needs
        to know about how end users interact
        with customers' website.
def write_user_event(self, request: Union[(user_event_service.WriteUserEventRequest, dict)]=None, *, parent: str=None, user_event: gcr_user_event.UserEvent=None, retry: retries.Retry=gapic_v1.method.DEFAULT, timeout: float=None, metadata: Sequence[Tuple[(str, str)]]=()) -> gcr_user_event.UserEvent:
    "Writes a single user event.\n\n        Args:\n            request (Union[google.cloud.recommendationengine_v1beta1.types.WriteUserEventRequest, dict]):\n                The request object. Request message for WriteUserEvent\n                method.\n            parent (str):\n                Required. The parent eventStore resource name, such as\n                ``projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store``.\n\n                This corresponds to the ``parent`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            user_event (google.cloud.recommendationengine_v1beta1.types.UserEvent):\n                Required. User event to write.\n                This corresponds to the ``user_event`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            retry (google.api_core.retry.Retry): Designation of what errors, if any,\n                should be retried.\n            timeout (float): The timeout for this request.\n            metadata (Sequence[Tuple[str, str]]): Strings which should be\n                sent along with the request as metadata.\n\n        Returns:\n            google.cloud.recommendationengine_v1beta1.types.UserEvent:\n                UserEvent captures all metadata\n                information recommendation engine needs\n                to know about how end users interact\n                with customers' website.\n\n        "
    has_flattened_params = any([parent, user_event])
    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.')
    if (not isinstance(request, user_event_service.WriteUserEventRequest)):
        request = user_event_service.WriteUserEventRequest(request)
        if (parent is not None):
            request.parent = parent
        if (user_event is not None):
            request.user_event = user_event
    rpc = self._transport._wrapped_methods[self._transport.write_user_event]
    metadata = (tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata((('parent', request.parent),)),))
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)
    return response