def _item_to_sink(iterator, resource): """Convert a sink resource to the native object. Args: iterator (google.api_core.page_iterator.Iterator): The iterator that is currently in use. resource (dict): Sink JSON resource returned from the API. Returns: ~logging_v2.sink.Sink: The next sink in the page. """ return Sink.from_api_repr(resource, iterator.client)
def sink(self, name, *, filter_=None, destination=None): """Creates a sink bound to the current client. Args: name (str): the name of the sink to be constructed. filter_ (Optional[str]): the advanced logs filter expression defining the entries exported by the sink. If not passed, the instance should already exist, to be refreshed via :meth:`Sink.reload`. destination (str): destination URI for the entries exported by the sink. If not passed, the instance should already exist, to be refreshed via :meth:`Sink.reload`. Returns: ~logging_v2.sink.Sink: Sink created with the current client. """ return Sink(name, filter_=filter_, destination=destination, client=self)
def sinks_pager(page_iter): for page in page_iter: # Convert the GAPIC sink type into the handwritten `Sink` type yield Sink.from_api_repr(LogSink.to_dict(page), client=self._client)