def collect_user_event(self, request: Union[(user_event_service.CollectUserEventRequest, dict)]=None, *, parent: str=None, user_event: str=None, uri: str=None, ets: int=None, retry: retries.Retry=gapic_v1.method.DEFAULT, timeout: float=None, metadata: Sequence[Tuple[(str, str)]]=()) -> httpbody_pb2.HttpBody:
    "Writes a single user event from the browser. This\n        uses a GET request to due to browser restriction of\n        POST-ing to a 3rd party domain.\n        This method is used only by the Recommendations AI\n        JavaScript pixel. Users should not call this method\n        directly.\n\n        Args:\n            request (Union[google.cloud.recommendationengine_v1beta1.types.CollectUserEventRequest, dict]):\n                The request object. Request message for CollectUserEvent\n                method.\n            parent (str):\n                Required. The parent eventStore 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 (str):\n                Required. URL encoded UserEvent\n                proto.\n\n                This corresponds to the ``user_event`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            uri (str):\n                Optional. The url including cgi-\n                arameters but excluding the hash\n                fragment. The URL must be truncated to\n                1.5K bytes to conservatively be under\n                the 2K bytes. This is often more useful\n                than the referer url, because many\n                browsers only send the domain for 3rd\n                party requests.\n\n                This corresponds to the ``uri`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            ets (int):\n                Optional. The event timestamp in\n                milliseconds. This prevents browser\n                caching of otherwise identical get\n                requests. The name is abbreviated to\n                reduce the payload bytes.\n\n                This corresponds to the ``ets`` 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.api.httpbody_pb2.HttpBody:\n                Message that represents an arbitrary HTTP body. It should only be used for\n                   payload formats that can't be represented as JSON,\n                   such as raw binary or an HTML page.\n\n                   This message can be used both in streaming and\n                   non-streaming API methods in the request as well as\n                   the response.\n\n                   It can be used as a top-level request field, which is\n                   convenient if one wants to extract parameters from\n                   either the URL or HTTP template into the request\n                   fields and also want access to the raw HTTP body.\n\n                   Example:\n\n                      message GetResourceRequest {\n                         // A unique request id. string request_id = 1;\n\n                         // The raw HTTP body is bound to this field.\n                         google.api.HttpBody http_body = 2;\n\n                      }\n\n                      service ResourceService {\n                         rpc GetResource(GetResourceRequest)\n                            returns (google.api.HttpBody);\n\n                         rpc UpdateResource(google.api.HttpBody)\n                            returns (google.protobuf.Empty);\n\n                      }\n\n                   Example with streaming methods:\n\n                      service CaldavService {\n                         rpc GetCalendar(stream google.api.HttpBody)\n                            returns (stream google.api.HttpBody);\n\n                         rpc UpdateCalendar(stream google.api.HttpBody)\n                            returns (stream google.api.HttpBody);\n\n                      }\n\n                   Use of this type only changes how the request and\n                   response bodies are handled, all other features will\n                   continue to work unchanged.\n\n        "
    has_flattened_params = any([parent, user_event, uri, ets])
    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.CollectUserEventRequest)):
        request = user_event_service.CollectUserEventRequest(request)
        if (parent is not None):
            request.parent = parent
        if (user_event is not None):
            request.user_event = user_event
        if (uri is not None):
            request.uri = uri
        if (ets is not None):
            request.ets = ets
    rpc = self._transport._wrapped_methods[self._transport.collect_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 from the browser. This
uses a GET request to due to browser restriction of
POST-ing to a 3rd party domain.
This method is used only by the Recommendations AI
JavaScript pixel. Users should not call this method
directly.

Args:
    request (Union[google.cloud.recommendationengine_v1beta1.types.CollectUserEventRequest, dict]):
        The request object. Request message for CollectUserEvent
        method.
    parent (str):
        Required. The parent eventStore 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 (str):
        Required. URL encoded UserEvent
        proto.

        This corresponds to the ``user_event`` field
        on the ``request`` instance; if ``request`` is provided, this
        should not be set.
    uri (str):
        Optional. The url including cgi-
        arameters but excluding the hash
        fragment. The URL must be truncated to
        1.5K bytes to conservatively be under
        the 2K bytes. This is often more useful
        than the referer url, because many
        browsers only send the domain for 3rd
        party requests.

        This corresponds to the ``uri`` field
        on the ``request`` instance; if ``request`` is provided, this
        should not be set.
    ets (int):
        Optional. The event timestamp in
        milliseconds. This prevents browser
        caching of otherwise identical get
        requests. The name is abbreviated to
        reduce the payload bytes.

        This corresponds to the ``ets`` 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.api.httpbody_pb2.HttpBody:
        Message that represents an arbitrary HTTP body. It should only be used for
           payload formats that can't be represented as JSON,
           such as raw binary or an HTML page.

           This message can be used both in streaming and
           non-streaming API methods in the request as well as
           the response.

           It can be used as a top-level request field, which is
           convenient if one wants to extract parameters from
           either the URL or HTTP template into the request
           fields and also want access to the raw HTTP body.

           Example:

              message GetResourceRequest {
                 // A unique request id. string request_id = 1;

                 // The raw HTTP body is bound to this field.
                 google.api.HttpBody http_body = 2;

              }

              service ResourceService {
                 rpc GetResource(GetResourceRequest)
                    returns (google.api.HttpBody);

                 rpc UpdateResource(google.api.HttpBody)
                    returns (google.protobuf.Empty);

              }

           Example with streaming methods:

              service CaldavService {
                 rpc GetCalendar(stream google.api.HttpBody)
                    returns (stream google.api.HttpBody);

                 rpc UpdateCalendar(stream google.api.HttpBody)
                    returns (stream google.api.HttpBody);

              }

           Use of this type only changes how the request and
           response bodies are handled, all other features will
           continue to work unchanged.
def collect_user_event(self, request: Union[(user_event_service.CollectUserEventRequest, dict)]=None, *, parent: str=None, user_event: str=None, uri: str=None, ets: int=None, retry: retries.Retry=gapic_v1.method.DEFAULT, timeout: float=None, metadata: Sequence[Tuple[(str, str)]]=()) -> httpbody_pb2.HttpBody:
    "Writes a single user event from the browser. This\n        uses a GET request to due to browser restriction of\n        POST-ing to a 3rd party domain.\n        This method is used only by the Recommendations AI\n        JavaScript pixel. Users should not call this method\n        directly.\n\n        Args:\n            request (Union[google.cloud.recommendationengine_v1beta1.types.CollectUserEventRequest, dict]):\n                The request object. Request message for CollectUserEvent\n                method.\n            parent (str):\n                Required. The parent eventStore 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 (str):\n                Required. URL encoded UserEvent\n                proto.\n\n                This corresponds to the ``user_event`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            uri (str):\n                Optional. The url including cgi-\n                arameters but excluding the hash\n                fragment. The URL must be truncated to\n                1.5K bytes to conservatively be under\n                the 2K bytes. This is often more useful\n                than the referer url, because many\n                browsers only send the domain for 3rd\n                party requests.\n\n                This corresponds to the ``uri`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            ets (int):\n                Optional. The event timestamp in\n                milliseconds. This prevents browser\n                caching of otherwise identical get\n                requests. The name is abbreviated to\n                reduce the payload bytes.\n\n                This corresponds to the ``ets`` 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.api.httpbody_pb2.HttpBody:\n                Message that represents an arbitrary HTTP body. It should only be used for\n                   payload formats that can't be represented as JSON,\n                   such as raw binary or an HTML page.\n\n                   This message can be used both in streaming and\n                   non-streaming API methods in the request as well as\n                   the response.\n\n                   It can be used as a top-level request field, which is\n                   convenient if one wants to extract parameters from\n                   either the URL or HTTP template into the request\n                   fields and also want access to the raw HTTP body.\n\n                   Example:\n\n                      message GetResourceRequest {\n                         // A unique request id. string request_id = 1;\n\n                         // The raw HTTP body is bound to this field.\n                         google.api.HttpBody http_body = 2;\n\n                      }\n\n                      service ResourceService {\n                         rpc GetResource(GetResourceRequest)\n                            returns (google.api.HttpBody);\n\n                         rpc UpdateResource(google.api.HttpBody)\n                            returns (google.protobuf.Empty);\n\n                      }\n\n                   Example with streaming methods:\n\n                      service CaldavService {\n                         rpc GetCalendar(stream google.api.HttpBody)\n                            returns (stream google.api.HttpBody);\n\n                         rpc UpdateCalendar(stream google.api.HttpBody)\n                            returns (stream google.api.HttpBody);\n\n                      }\n\n                   Use of this type only changes how the request and\n                   response bodies are handled, all other features will\n                   continue to work unchanged.\n\n        "
    has_flattened_params = any([parent, user_event, uri, ets])
    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.CollectUserEventRequest)):
        request = user_event_service.CollectUserEventRequest(request)
        if (parent is not None):
            request.parent = parent
        if (user_event is not None):
            request.user_event = user_event
        if (uri is not None):
            request.uri = uri
        if (ets is not None):
            request.ets = ets
    rpc = self._transport._wrapped_methods[self._transport.collect_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