
                         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K
Jr  SS	K
Jr  SS
KJr  SSKJr  S\R"                  S\	R$                  S\R&                  S\R&                  4S jrS\R"                  S\	R$                  S\R*                  S\R*                  4S jrS rg)z#Bigtable schema bundles API helper.    )absolute_import)division)unicode_literals)descriptor_pb2)text_format)parser_extensions)log)	resources)files)bigtableadmin_v2_messages
unused_refargsreqreturnc                     UR                   (       aY  [        R                  " UR                   5      n[        R                  R                  U5        X2R                  R                  l        U$ )a  Parse argument and construct create schema bundle request.

This function is used to modify the create schema bundle request to include
the proto descriptors file content if provided.

Args:
  unused_ref: the gcloud resource (unused).
  args: input arguments.
  req: the real request to be sent to backend service.

Returns:
  The modified request to be sent to backend service.

Raises:
  ValueError: if the proto descriptors file is invalid.
)	proto_descriptors_filer   ReadBinaryFileContentsr   FileDescriptorSet
FromStringschemaBundleprotoSchemaprotoDescriptorsr   r   r   proto_desc_contents       5lib/googlecloudsdk/api_lib/bigtable/schema_bundles.pyModifyCreateSchemaBundleRequestr      sW    . 
  55## $$//0BC4F  1
 
*    c                 
   UR                   (       aY  [        R                  " UR                   5      n[        R                  R                  U5        X2R                  R                  l        UR                  (       a  SUl
        U$ )a  Parse argument and construct update schema bundle request.

This function is used to modify the update schema bundle request to include
the proto descriptors file content if provided.

Args:
  unused_ref: the gcloud resource (unused).
  args: input arguments.
  req: the real request to be sent to backend service.

Returns:
  The modified request to be sent to backend service.

Raises:
  ValueError: if the proto descriptors file is invalid.
T)r   r   r   r   r   r   r   r   r   ignore_warningsignoreWarningsr   s       r   ModifyUpdateSchemaBundleRequestr!   D   sf    . 
  55## $$//0BC4F  1	C	*r   c                    U R                   b}  U R                   R                  bf  [        R                  R	                  U R                   R                  5      n[
        R                  R                  [        R                  " U5      5        U $ )zParse the proto descriptors in the Get response and print it.

Args:
  response: the response from the backend service.
  _: unused.

Returns:
  The original response.
)
r   r   r   r   r   r	   statusPrintr   MessageToString)response_descriptorss      r   (PrintParsedProtoDescriptorsInGetResponser)   h   sk     &



/
/
; 22==--K JJ[00=>	/r   N)__doc__
__future__r   r   r   cloudsdk.google.protobufr   r   googlecloudsdk.callioper   googlecloudsdk.corer	   r
   googlecloudsdk.core.utilr   6googlecloudsdk.generated_clients.apis.bigtableadmin.v2r   Resource	Namespace>BigtableadminProjectsInstancesTablesSchemaBundlesCreateRequestr   =BigtableadminProjectsInstancesTablesSchemaBundlesPatchRequestr!   r)    r   r   <module>r6      s     * &  ' 3 0 5 # ) * \""""

%
%" 
#	a	a"
 \\"J!""!

%
%! 
#	`	`!
 [[!Hr   