# Path: google/cloud/recommendationengine_v1beta1/types/user_event.py
# class UserEvent(proto.Message):
#     class EventSource(proto.Enum):
# class UserInfo(proto.Message):
# class EventDetail(proto.Message):
# class ProductEventDetail(proto.Message):
# class PurchaseTransaction(proto.Message):
# class ProductDetail(proto.Message):
#         EVENT_SOURCE_UNSPECIFIED = 0
#         AUTOML = 1
#         ECOMMERCE = 2
#         BATCH_UPLOAD = 3
# 
# Path: google/cloud/recommendationengine_v1beta1/types/user_event_service.py
# class PurgeUserEventsRequest(proto.Message):
# class PurgeUserEventsMetadata(proto.Message):
# class PurgeUserEventsResponse(proto.Message):
# class WriteUserEventRequest(proto.Message):
# class CollectUserEventRequest(proto.Message):
# class ListUserEventsRequest(proto.Message):
# class ListUserEventsResponse(proto.Message):
#     def raw_page(self):


from typing import (
    Any,
    AsyncIterator,
    Awaitable,
    Callable,
    Sequence,
    Tuple,
    Optional,
    Iterator,
)
from google.cloud.recommendationengine_v1beta1.types import user_event
from google.cloud.recommendationengine_v1beta1.types import user_event_service
        metadata: Sequence[Tuple[str, str]] = ()
    ):
        """Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.cloud.recommendationengine_v1beta1.types.ListUserEventsRequest):
                The initial request object.
            response (google.cloud.recommendationengine_v1beta1.types.ListUserEventsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        """
        self._method = method
        self._request = user_event_service.ListUserEventsRequest(request)
        self._response = response
        self._metadata = metadata

    def __getattr__(self, name: str) -> Any:
        return getattr(self._response, name)

    @property
    def pages(self) -> Iterator[user_event_service.ListUserEventsResponse]:
        yield self._response
        while self._response.next_page_token:
            self._request.page_token = self._response.next_page_token
            self._response = self._method(self._request, metadata=self._metadata)
            yield self._response


# Path: google/cloud/recommendationengine_v1beta1/types/user_event.py
# class UserEvent(proto.Message):
#     class EventSource(proto.Enum):
# class UserInfo(proto.Message):
# class EventDetail(proto.Message):
# class ProductEventDetail(proto.Message):
# class PurchaseTransaction(proto.Message):
# class ProductDetail(proto.Message):
#         EVENT_SOURCE_UNSPECIFIED = 0
#         AUTOML = 1
#         ECOMMERCE = 2
#         BATCH_UPLOAD = 3
# 
# Path: google/cloud/recommendationengine_v1beta1/types/user_event_service.py
# class PurgeUserEventsRequest(proto.Message):
# class PurgeUserEventsMetadata(proto.Message):
# class PurgeUserEventsResponse(proto.Message):
# class WriteUserEventRequest(proto.Message):
# class CollectUserEventRequest(proto.Message):
# class ListUserEventsRequest(proto.Message):
# class ListUserEventsResponse(proto.Message):
#     def raw_page(self):


# Path: google/cloud/recommendationengine_v1beta1/services/user_event_service/pagers.py
from typing import (
    Any,
    AsyncIterator,
    Awaitable,
    Callable,
    Sequence,
    Tuple,
    Optional,
    Iterator,
)
from google.cloud.recommendationengine_v1beta1.types import user_event
from google.cloud.recommendationengine_v1beta1.types import user_event_service

        metadata: Sequence[Tuple[str, str]] = ()
    ):
        """Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.cloud.recommendationengine_v1beta1.types.ListUserEventsRequest):
                The initial request object.
            response (google.cloud.recommendationengine_v1beta1.types.ListUserEventsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        """
        self._method = method
        self._request = user_event_service.ListUserEventsRequest(request)
        self._response = response
        self._metadata = metadata

    def __getattr__(self, name: str) -> Any:
        return getattr(self._response, name)

    @property
    def pages(self) -> Iterator[user_event_service.ListUserEventsResponse]:
        yield self._response
        while self._response.next_page_token:
            self._request.page_token = self._response.next_page_token
            self._response = self._method(self._request, metadata=self._metadata)
            yield self._response


    def __iter__(self) -> Iterator[user_event.UserEvent]: