def purge_user_events(self, request: Union[(user_event_service.PurgeUserEventsRequest, dict)]=None, *, parent: str=None, filter: str=None, force: bool=None, retry: retries.Retry=gapic_v1.method.DEFAULT, timeout: float=None, metadata: Sequence[Tuple[(str, str)]]=()) -> operation.Operation:
    'Deletes permanently all user events specified by the\n        filter provided. Depending on the number of events\n        specified by the filter, this operation could take hours\n        or days to complete. To test a filter, use the list\n        command first.\n\n        Args:\n            request (Union[google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsRequest, dict]):\n                The request object. Request message for PurgeUserEvents\n                method.\n            parent (str):\n                Required. The resource name of the event_store under\n                which the events are created. The format is\n                ``projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}``\n\n                This corresponds to the ``parent`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            filter (str):\n                Required. The filter string to specify the events to be\n                deleted. Empty string filter is not allowed. This filter\n                can also be used with ListUserEvents API to list events\n                that will be deleted. The eligible fields for filtering\n                are:\n\n                -  eventType - UserEvent.eventType field of type string.\n                -  eventTime - in ISO 8601 "zulu" format.\n                -  visitorId - field of type string. Specifying this\n                   will delete all events associated with a visitor.\n                -  userId - field of type string. Specifying this will\n                   delete all events associated with a user. Example 1:\n                   Deleting all events in a time range.\n                   ``eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"``\n                   Example 2: Deleting specific eventType in time range.\n                   ``eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"``\n                   Example 3: Deleting all events for a specific visitor\n                   ``visitorId = visitor1024`` The filtering fields are\n                   assumed to have an implicit AND.\n\n                This corresponds to the ``filter`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            force (bool):\n                Optional. The default value is false.\n                Override this flag to true to actually\n                perform the purge. If the field is not\n                set to true, a sampling of events to be\n                deleted will be returned.\n\n                This corresponds to the ``force`` 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_core.operation.Operation:\n                An object representing a long-running operation.\n\n                The result type for the operation will be :class:`google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsResponse` Response of the PurgeUserEventsRequest. If the long running operation is\n                   successfully done, then this message is returned by\n                   the google.longrunning.Operations.response field.\n\n        '
    has_flattened_params = any([parent, filter, force])
    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.PurgeUserEventsRequest)):
        request = user_event_service.PurgeUserEventsRequest(request)
        if (parent is not None):
            request.parent = parent
        if (filter is not None):
            request.filter = filter
        if (force is not None):
            request.force = force
    rpc = self._transport._wrapped_methods[self._transport.purge_user_events]
    metadata = (tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata((('parent', request.parent),)),))
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)
    response = operation.from_gapic(response, self._transport.operations_client, user_event_service.PurgeUserEventsResponse, metadata_type=user_event_service.PurgeUserEventsMetadata)
    return response
Deletes permanently all user events specified by the
filter provided. Depending on the number of events
specified by the filter, this operation could take hours
or days to complete. To test a filter, use the list
command first.

Args:
    request (Union[google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsRequest, dict]):
        The request object. Request message for PurgeUserEvents
        method.
    parent (str):
        Required. The resource name of the event_store under
        which the events are created. The format is
        ``projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}``

        This corresponds to the ``parent`` field
        on the ``request`` instance; if ``request`` is provided, this
        should not be set.
    filter (str):
        Required. The filter string to specify the events to be
        deleted. Empty string filter is not allowed. This filter
        can also be used with ListUserEvents API to list events
        that will be deleted. The eligible fields for filtering
        are:

        -  eventType - UserEvent.eventType field of type string.
        -  eventTime - in ISO 8601 "zulu" format.
        -  visitorId - field of type string. Specifying this
           will delete all events associated with a visitor.
        -  userId - field of type string. Specifying this will
           delete all events associated with a user. Example 1:
           Deleting all events in a time range.
           ``eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"``
           Example 2: Deleting specific eventType in time range.
           ``eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"``
           Example 3: Deleting all events for a specific visitor
           ``visitorId = visitor1024`` The filtering fields are
           assumed to have an implicit AND.

        This corresponds to the ``filter`` field
        on the ``request`` instance; if ``request`` is provided, this
        should not be set.
    force (bool):
        Optional. The default value is false.
        Override this flag to true to actually
        perform the purge. If the field is not
        set to true, a sampling of events to be
        deleted will be returned.

        This corresponds to the ``force`` 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_core.operation.Operation:
        An object representing a long-running operation.

        The result type for the operation will be :class:`google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsResponse` Response of the PurgeUserEventsRequest. If the long running operation is
           successfully done, then this message is returned by
           the google.longrunning.Operations.response field.
def purge_user_events(self, request: Union[(user_event_service.PurgeUserEventsRequest, dict)]=None, *, parent: str=None, filter: str=None, force: bool=None, retry: retries.Retry=gapic_v1.method.DEFAULT, timeout: float=None, metadata: Sequence[Tuple[(str, str)]]=()) -> operation.Operation:
    'Deletes permanently all user events specified by the\n        filter provided. Depending on the number of events\n        specified by the filter, this operation could take hours\n        or days to complete. To test a filter, use the list\n        command first.\n\n        Args:\n            request (Union[google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsRequest, dict]):\n                The request object. Request message for PurgeUserEvents\n                method.\n            parent (str):\n                Required. The resource name of the event_store under\n                which the events are created. The format is\n                ``projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}``\n\n                This corresponds to the ``parent`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            filter (str):\n                Required. The filter string to specify the events to be\n                deleted. Empty string filter is not allowed. This filter\n                can also be used with ListUserEvents API to list events\n                that will be deleted. The eligible fields for filtering\n                are:\n\n                -  eventType - UserEvent.eventType field of type string.\n                -  eventTime - in ISO 8601 "zulu" format.\n                -  visitorId - field of type string. Specifying this\n                   will delete all events associated with a visitor.\n                -  userId - field of type string. Specifying this will\n                   delete all events associated with a user. Example 1:\n                   Deleting all events in a time range.\n                   ``eventTime > "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"``\n                   Example 2: Deleting specific eventType in time range.\n                   ``eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"``\n                   Example 3: Deleting all events for a specific visitor\n                   ``visitorId = visitor1024`` The filtering fields are\n                   assumed to have an implicit AND.\n\n                This corresponds to the ``filter`` field\n                on the ``request`` instance; if ``request`` is provided, this\n                should not be set.\n            force (bool):\n                Optional. The default value is false.\n                Override this flag to true to actually\n                perform the purge. If the field is not\n                set to true, a sampling of events to be\n                deleted will be returned.\n\n                This corresponds to the ``force`` 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_core.operation.Operation:\n                An object representing a long-running operation.\n\n                The result type for the operation will be :class:`google.cloud.recommendationengine_v1beta1.types.PurgeUserEventsResponse` Response of the PurgeUserEventsRequest. If the long running operation is\n                   successfully done, then this message is returned by\n                   the google.longrunning.Operations.response field.\n\n        '
    has_flattened_params = any([parent, filter, force])
    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.PurgeUserEventsRequest)):
        request = user_event_service.PurgeUserEventsRequest(request)
        if (parent is not None):
            request.parent = parent
        if (filter is not None):
            request.filter = filter
        if (force is not None):
            request.force = force
    rpc = self._transport._wrapped_methods[self._transport.purge_user_events]
    metadata = (tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata((('parent', request.parent),)),))
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)
    response = operation.from_gapic(response, self._transport.operations_client, user_event_service.PurgeUserEventsResponse, metadata_type=user_event_service.PurgeUserEventsMetadata)
    return response