class_docstr: Create a new environment.
  
  :param project_id: Required. The ID of the Google Cloud project that the service belongs to.
  :param region: Required. The ID of the Google Cloud region that the service belongs to.
  :param environment_id: Required. The ID of the Google Cloud environment that the service belongs to.
  :param environment:  The environment to create.
  :param gcp_conn_id:
  :param impersonation_chain: Optional service account to impersonate using short-term
      credentials, or chained list of accounts required to get the access_token
      of the last account in the list, which will be impersonated in the request.
      If set as a string, the account must grant the originating account
      the Service Account Token Creator IAM role.
      If set as a sequence, the identities from the list must grant
      Service Account Token Creator IAM role to the directly preceding identity, with first
      account from the list granting this role to the originating account (templated).
  :param retry: Designation of what errors, if any, should be retried.
  :param timeout: The timeout for this request.
  :param metadata: Strings which should be sent along with the request as metadata.
  :param deferrable: Run operator in the deferrable mode
  :param pooling_period_seconds: Optional: Control the rate of the poll for the result of deferrable run.
      By default, the trigger will poll every 30 seconds.
class_docstr_tok: ["Create","a","new","environment",".",":","param","project_id",":","Required",".","The","ID","of","the","Google","Cloud","project","that","the","service","belongs","to",".",":","param","region",":","Required",".","The","ID","of","the","Google","Cloud","region","that","the","service","belongs","to",".",":","param","environment_id",":","Required",".","The","ID","of","the","Google","Cloud","environment","that","the","service","belongs","to",".",":","param","environment",":","The","environment","to","create",".",":","param","gcp_conn_id",":",":","param","impersonation_chain",":","Optional","service","account","to","impersonate","using","short-term","credentials",",","or","chained","list","of","accounts","required","to","get","the","access_token","of","the","last","account","in","the","list",",","which","will","be","impersonated","in","the","request",".","If","set","as","a","string",",","the","account","must","grant","the","originating","account","the","Service","Account","Token","Creator","IAM","role",".","If","set","as","a","sequence",",","the","identities","from","the","list","must","grant","Service","Account","Token","Creator","IAM","role","to","the","directly","preceding","identity",",","with","first","account","from","the","list","granting","this","role","to","the","originating","account","(","templated",")",".",":","param","retry",":","Designation","of","what","errors",",","if","any",",","should","be","retried",".",":","param","timeout",":","The","timeout","for","this","request",".",":","param","metadata",":","Strings","which","should","be","sent","along","with","the","request","as","metadata",".",":","param","deferrable",":","Run","operator","in","the","deferrable","mode",":","param","pooling_period_seconds",":","Optional",":","Control","the","rate","of","the","poll","for","the","result","of","deferrable","run",".","By","default",",","the","trigger","will","poll","every","30","seconds","."]
code: def execute(self, context: Context):
      hook = CloudComposerHook(
          gcp_conn_id=self.gcp_conn_id,
          impersonation_chain=self.impersonation_chain,
      )
  
      name = hook.get_environment_name(
          self.project_id, self.region, self.environment_id
      )
      if isinstance(self.environment, Environment):
          self.environment.name = name
      else:
          self.environment["name"] = name
  
      CloudComposerEnvironmentLink.persist(
          operator_instance=self, context=context
      )
      try:
          result = hook.create_environment(
              project_id=self.project_id,
              region=self.region,
              environment=self.environment,
              retry=self.retry,
              timeout=self.timeout,
              metadata=self.metadata,
          )
          context["ti"].xcom_push(
              key="operation_id", value=result.operation.name
          )
  
          if not self.deferrable:
              environment = hook.wait_for_operation(
                  timeout=self.timeout, operation=result
              )
              return Environment.to_dict(environment)
          else:
              self.defer(
                  trigger=CloudComposerExecutionTrigger(
                      project_id=self.project_id,
                      region=self.region,
                      operation_name=result.operation.name,
                      gcp_conn_id=self.gcp_conn_id,
                      impersonation_chain=self.impersonation_chain,
                      pooling_period_seconds=self.pooling_period_seconds,
                  ),
                  method_name=GOOGLE_DEFAULT_DEFERRABLE_METHOD_NAME,
              )
      except AlreadyExists:
          environment = hook.get_environment(
              project_id=self.project_id,
              region=self.region,
              environment_id=self.environment_id,
              retry=self.retry,
              timeout=self.timeout,
              metadata=self.metadata,
          )
          return Environment.to_dict(environment)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Sequence
  from google.api_core.exceptions import AlreadyExists
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud.orchestration.airflow.service_v1 import ImageVersion
  from google.cloud.orchestration.airflow.service_v1.types import Environment
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.providers.google.cloud.hooks.cloud_composer import CloudComposerHook
  from airflow.providers.google.cloud.links.base import BaseGoogleLink
  from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
  from airflow.providers.google.cloud.triggers.cloud_composer import CloudComposerExecutionTrigger
  from airflow.providers.google.common.consts import GOOGLE_DEFAULT_DEFERRABLE_METHOD_NAME
label_desc: Use image node_id 2 for calling the CloudComposerCreateEnvironmentOperator obj's underlying member method code with example usage: obj.execute(context) and returns: Environment, Environment