original_docstring: r"""Creates a sink that exports specified log entries to a
          destination. The export of newly-ingested log entries begins
          immediately, unless the sink's ``writer_identity`` is not
          permitted to write to the destination. A sink can export log
          entries only from the resource owning the sink.
  
          Args:
              request (Union[google.cloud.logging_v2.types.CreateSinkRequest, dict]):
                  The request object. The parameters to `CreateSink`.
              parent (:class:`str`):
                  Required. The resource in which to create the sink:
  
                  ::
  
                      "projects/[PROJECT_ID]"
                      "organizations/[ORGANIZATION_ID]"
                      "billingAccounts/[BILLING_ACCOUNT_ID]"
                      "folders/[FOLDER_ID]"
  
                  Examples: ``"projects/my-logging-project"``,
                  ``"organizations/123456789"``.
  
                  This corresponds to the ``parent`` field
                  on the ``request`` instance; if ``request`` is provided, this
                  should not be set.
              sink (:class:`google.cloud.logging_v2.types.LogSink`):
                  Required. The new sink, whose ``name`` parameter is a
                  sink identifier that is not already in use.
  
                  This corresponds to the ``sink`` 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.logging_v2.types.LogSink:
                  Describes a sink used to export log
                  entries to one of the following
                  destinations in any project: a Cloud
                  Storage bucket, a BigQuery dataset, or a
                  Cloud Pub/Sub topic. A logs filter
                  controls which log entries are exported.
                  The sink must be created within a
                  project, organization, billing account,
                  or folder.
  
          
docstring: r"""Creates a sink that exports specified log entries to a
  destination. The export of newly-ingested log entries begins
  immediately, unless the sink's ``writer_identity`` is not
  permitted to write to the destination. A sink can export log
  entries only from the resource owning the sink.
docstring_tokens: r " " " Creates a sink that exports specified log entries to a destination . The export of newly - ingested log entries begins immediately unless the sink ' s ` ` writer_identity ` ` is not permitted to write to the destination . A sink can export log entries only from the resource owning the sink .
code: async def create_sink(self,
              request: Union[logging_config.CreateSinkRequest, dict] = None,
              *,
              parent: str = None,
              sink: logging_config.LogSink = None,
              retry: OptionalRetry = gapic_v1.method.DEFAULT,
              timeout: float = None,
              metadata: Sequence[Tuple[str, str]] = (),
              ) -> logging_config.LogSink:
          r"""Creates a sink that exports specified log entries to a
          destination. The export of newly-ingested log entries begins
          immediately, unless the sink's ``writer_identity`` is not
          permitted to write to the destination. A sink can export log
          entries only from the resource owning the sink.
  
          Args:
              request (Union[google.cloud.logging_v2.types.CreateSinkRequest, dict]):
                  The request object. The parameters to `CreateSink`.
              parent (:class:`str`):
                  Required. The resource in which to create the sink:
  
                  ::
  
                      "projects/[PROJECT_ID]"
                      "organizations/[ORGANIZATION_ID]"
                      "billingAccounts/[BILLING_ACCOUNT_ID]"
                      "folders/[FOLDER_ID]"
  
                  Examples: ``"projects/my-logging-project"``,
                  ``"organizations/123456789"``.
  
                  This corresponds to the ``parent`` field
                  on the ``request`` instance; if ``request`` is provided, this
                  should not be set.
              sink (:class:`google.cloud.logging_v2.types.LogSink`):
                  Required. The new sink, whose ``name`` parameter is a
                  sink identifier that is not already in use.
  
                  This corresponds to the ``sink`` 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.logging_v2.types.LogSink:
                  Describes a sink used to export log
                  entries to one of the following
                  destinations in any project: a Cloud
                  Storage bucket, a BigQuery dataset, or a
                  Cloud Pub/Sub topic. A logs filter
                  controls which log entries are exported.
                  The sink must be created within a
                  project, organization, billing account,
                  or folder.
  
          """
          # Create or coerce a protobuf request object.
          # Sanity check: If we got a request object, we should *not* have
          # gotten any keyword arguments that map to the request.
          has_flattened_params = any([parent, sink])
          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.")
  
          request = logging_config.CreateSinkRequest(request)
  
          # If we have keyword arguments corresponding to fields on the
          # request, apply these.
          if parent is not None:
              request.parent = parent
          if sink is not None:
              request.sink = sink
  
          # Wrap the RPC method; this adds retry and timeout information,
          # and friendly error handling.
          rpc = gapic_v1.method_async.wrap_method(
              self._client._transport.create_sink,
              default_timeout=120.0,
              client_info=DEFAULT_CLIENT_INFO,
          )
  
          # Certain fields should be provided within the metadata header;
          # add these here.
          metadata = tuple(metadata) + (
              gapic_v1.routing_header.to_grpc_metadata((
                  ("parent", request.parent),
              )),
          )
  
          # Send the request.
          response = await rpc(
              request,
              retry=retry,
              timeout=timeout,
              metadata=metadata,
          )
  
          # Done; return the response.
          return response
code_tokens: async def create_sink ( self , request : Union [ logging_config . CreateSinkRequest , dict ] = None , * , parent : str = None , sink : logging_config . LogSink = None , retry : OptionalRetry = gapic_v1 . method . DEFAULT , timeout : float = None , metadata : Sequence [ Tuple [ str , str ] ] = ( ) , ) -> logging_config . LogSink : has_flattened_params = any ( [ parent , sink ] ) 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." ) request = logging_config . CreateSinkRequest ( request ) if parent is not None : request . parent = parent if sink is not None : request . sink = sink rpc = gapic_v1 . method_async . wrap_method ( self . _client . _transport . create_sink , default_timeout = 120.0 , client_info = DEFAULT_CLIENT_INFO , ) metadata = tuple ( metadata ) + ( gapic_v1 . routing_header . to_grpc_metadata ( ( ( "parent" , request . parent ) , ) ) , ) response = await rpc ( request , retry = retry , timeout = timeout , metadata = metadata , ) return response
short_docstring: r"""Creates a sink that exports specified log entries to a
  destination.
short_docstring_tokens: r " " " Creates a sink that exports specified log entries to a destination .
comment: r"""Creates a sink that exports specified log entries to a
          destination. The export of newly-ingested log entries begins
          immediately, unless the sink's ``writer_identity`` is not
          permitted to write to the destination. A sink can export log
          entries only from the resource owning the sink.
  
          Args:
              request (Union[google.cloud.logging_v2.types.CreateSinkRequest, dict]):
                  The request object. The parameters to `CreateSink`.
              parent (:class:`str`):
                  Required. The resource in which to create the sink:
  
                  ::
  
                      "projects/[PROJECT_ID]"
                      "organizations/[ORGANIZATION_ID]"
                      "billingAccounts/[BILLING_ACCOUNT_ID]"
                      "folders/[FOLDER_ID]"
  
                  Examples: ``"projects/my-logging-project"``,
                  ``"organizations/123456789"``.
  
                  This corresponds to the ``parent`` field
                  on the ``request`` instance; if ``request`` is provided, this
                  should not be set.
              sink (:class:`google.cloud.logging_v2.types.LogSink`):
                  Required. The new sink, whose ``name`` parameter is a
                  sink identifier that is not already in use.
  
                  This corresponds to the ``sink`` 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.logging_v2.types.LogSink:
                  Describes a sink used to export log
                  entries to one of the following
                  destinations in any project: a Cloud
                  Storage bucket, a BigQuery dataset, or a
                  Cloud Pub/Sub topic. A logs filter
                  controls which log entries are exported.
                  The sink must be created within a
                  project, organization, billing account,
                  or folder.
  
          """$SEP$# Create or coerce a protobuf request object.$SEP$# Sanity check: If we got a request object, we should *not* have$SEP$# gotten any keyword arguments that map to the request.$SEP$# If we have keyword arguments corresponding to fields on the$SEP$# request, apply these.$SEP$# Wrap the RPC method; this adds retry and timeout information,$SEP$# and friendly error handling.$SEP$# Certain fields should be provided within the metadata header;$SEP$# add these here.$SEP$# Send the request.$SEP$# Done; return the response.