def create_environment(
            self,
            request: environment.CreateEnvironmentRequest = None,
            *,
            retry: retries.Retry = gapic_v1.method.DEFAULT,
            timeout: float = None,
            metadata: Sequence[Tuple[str, str]] = (),
    ) -> environment.Environment:
        r"""Creates an agent environment.

        Args:
            request (google.cloud.dialogflow_v2.types.CreateEnvironmentRequest):
                The request object. The request message for
                [Environments.CreateEnvironment][google.cloud.dialogflow.v2.Environments.CreateEnvironment].
            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.dialogflow_v2.types.Environment:
                You can create multiple versions of your agent and publish them to separate
                   environments.

                   When you edit an agent, you are editing the draft
                   agent. At any point, you can save the draft agent as
                   an agent version, which is an immutable snapshot of
                   your agent.

                   When you save the draft agent, it is published to the
                   default environment. When you create agent versions,
                   you can publish them to custom environments. You can
                   create a variety of custom environments for:

                   -  testing
                   -  development
                   -  production
                   -  etc.

                   For more information, see the [versions and
                   environments
                   guide](\ https://cloud.google.com/dialogflow/docs/agents-versions).

        """
        # Create or coerce a protobuf request object.
        # Minor optimization to avoid making a copy if the user passes
        # in a environment.CreateEnvironmentRequest.
        # There's no risk of modifying the input as we've already verified
        # there are no flattened fields.
        if not isinstance(request, environment.CreateEnvironmentRequest):
            request = environment.CreateEnvironmentRequest(request)

        # Wrap the RPC method; this adds retry and timeout information,
        # and friendly error handling.
        rpc = self._transport._wrapped_methods[
            self._transport.create_environment]

        # 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 = rpc(
            request,
            retry=retry,
            timeout=timeout,
            metadata=metadata,
        )

        # Done; return the response.
        return response
    async def create_environment(
        self,
        request: Union[environment.CreateEnvironmentRequest, dict] = None,
        *,
        retry: OptionalRetry = gapic_v1.method.DEFAULT,
        timeout: float = None,
        metadata: Sequence[Tuple[str, str]] = (),
    ) -> environment.Environment:
        r"""Creates an agent environment.

        .. code-block:: python

            from google.cloud import dialogflow_v2

            async def sample_create_environment():
                # Create a client
                client = dialogflow_v2.EnvironmentsAsyncClient()

                # Initialize request argument(s)
                request = dialogflow_v2.CreateEnvironmentRequest(
                    parent="parent_value",
                    environment_id="environment_id_value",
                )

                # Make the request
                response = await client.create_environment(request=request)

                # Handle the response
                print(response)

        Args:
            request (Union[google.cloud.dialogflow_v2.types.CreateEnvironmentRequest, dict]):
                The request object. The request message for
                [Environments.CreateEnvironment][google.cloud.dialogflow.v2.Environments.CreateEnvironment].
            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.dialogflow_v2.types.Environment:
                You can create multiple versions of your agent and publish them to separate
                   environments.

                   When you edit an agent, you are editing the draft
                   agent. At any point, you can save the draft agent as
                   an agent version, which is an immutable snapshot of
                   your agent.

                   When you save the draft agent, it is published to the
                   default environment. When you create agent versions,
                   you can publish them to custom environments. You can
                   create a variety of custom environments for:

                   -  testing
                   -  development
                   -  production
                   -  etc.

                   For more information, see the [versions and
                   environments
                   guide](\ https://cloud.google.com/dialogflow/docs/agents-versions).

        """
        # Create or coerce a protobuf request object.
        request = environment.CreateEnvironmentRequest(request)

        # 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_environment,
            default_timeout=None,
            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