
                         z    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr	  SSK
Jr   " S S	\R                  5      rg
)z?Client for interaction with Api Config CRUD on API Gateway API.    )absolute_import)division)unicode_literals)base)
exceptions)common_flagsc                   <    \ rS rSrSrSS jr   S	S jrSS jrSrg)
ApiConfigClient   z7Client for Api Config objects on Cloud API Gateway API.Nc                 \   [         R                  R                  U USSS9  U R                  5         U R	                  S5        U R                  S5        U R                  R                  R                  R                  U R                  R                  R                  R                  S.U l        g )N&ApigatewayProjectsLocationsApisConfigsprojects_locations_apis_configs)clientmessage_baseservice_name
apiConfigsapigatewayApiConfig)FULLBASIC)r   
BaseClient__init__DefineDelete
DefineListDefineUpdatemessages0ApigatewayProjectsLocationsApisConfigsGetRequestViewValueValuesEnumr   r   supported_views)selfr   s     5lib/googlecloudsdk/api_lib/api_gateway/api_configs.pyr   ApiConfigClient.__init__   s    OO=6	  8
 	OOL!+, MMJJ  MMJJ  D    c           
      r   [         R                  " UU R                  R                  R                  5      nU R                  R                  UR                  5       UUUUUUS9nU R                  UR                  5       UUR                  5       R                  5       S9n	U R                  R                  U	5      $ )a  Creates an Api Config object.

Args:
  api_config_ref: A parsed resource reference for the api
  display_name: Optional string display name
  labels: Optional cloud labels (as provided in the labels argument)
  backend_auth: Optional string to set the service account for backend auth
  managed_service_configs: Optional field to send in a list of managed
   service configurations. Should be in the form of the
   ApigatewayApiConfigFileMessage's generated from the discovery document
  grpc_service_defs: Optional field to send in a list of GRPC service
   definitions. Should be in the form of
   ApigatewayApiConfigGrpcServiceDefinition's generated from the discovery
   document
  open_api_docs: Optional field to send in a list of Open API documents.
   Should be in the form of ApigatewayApiConfigOpenApiDocument's generated
   from the discovery document


Returns:
  Long running operation
)namedisplayNamelabelsgatewayServiceAccountmanagedServiceConfigsgrpcServicesopenapiDocuments)apiConfigIdr   parent)r   ProcessLabelsFlagr   ApigatewayApiConfigLabelsValueRelativeNamecreate_requestNameParentserviceCreate)
r   api_config_refdisplay_namer&   backend_authmanaged_service_configsgrpc_service_defsopen_api_docs
api_configreqs
             r    r5   ApiConfigClient.Create0   s    2 ++))557F 22((* *5&& 3 (J 

"'')&$$&335  7C
 <<s##r"   c                    SnUb   U R                   UR                  5          nU R                  UR                  5       US9nU R                  R                  U5      $ ! [         a    [        R                  " SS5      ef = f)aR  Returns an API Config object.

Args:
  api_config_ref: A parsed resource reference for the API.
  view: Optional string. If specified as FULL, the source config files will
    be returned.

Returns:
  An API Config object.

Raises:
  calliope.InvalidArgumentException: If an invalid view (i.e. not FULL,
  BASIC, or none) was
  provided.
Nz--viewz'View must be one of: "FULL" or "BASIC".)r$   view)	r   upperKeyErrorcalliope_exceptionsInvalidArgumentExceptionget_requestr0   r4   Get)r   r6   r@   	view_enumr=   s        r    rF   ApiConfigClient.Get\   s    " IA((6	 

 ; ; =I

NC<<C    A!::?A 	AAs   A "A?)r   )N)NNNNNN)	__name__
__module____qualname____firstlineno____doc__r   r5   rF   __static_attributes__ r"   r    r
   r
      s!    ?$ >B8<37*$X!r"   r
   N)rM   
__future__r   r   r   "googlecloudsdk.api_lib.api_gatewayr   googlecloudsdk.callioper   rC   &googlecloudsdk.command_lib.api_gatewayr   r   r
   rO   r"   r    <module>rT      s/     F &  ' 3 E ?[!doo [!r"   