
    i                     ^   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ dd	lmZ dd
lmZ dZdZdZdZ G d de      Z ej*                  ej,                  j.                  ej,                  j0                        ej2                   G d dej4                                      Zy)zJImplementation of gcloud managed kafka schema registries describe command.    )absolute_import)division)unicode_literals)apis)base)	arguments)util)log)	resourcesz	projects/z
locations/zschemaRegistries/z
    table(
      schema_registry:format='yaml(compatibility, schema_registry.compatibility, mode, schema_registry.mode, name, schema_registry.name, contexts, schema_registry.contexts)'
    )
c                       e Zd ZdZd Zy)_Resultsz@Encapsulate results into a single object to fit the Run() model.c                     || _         y )N)schema_registry)selfr   s     7lib/surface/managed_kafka/schema_registries/describe.py__init__z_Results.__init__*   s
    *D    N)__name__
__module____qualname____doc__r    r   r   r   r   '   s
    H+r   r   c                   &    e Zd ZdZed        Zd Zy)DescribezDescribe a schema registry with all of its fields.

  ## EXAMPLES

   Describe the schema registry with all of its fields:

    $ {command} --project=PROJECT_ID --location=LOCATION_ID
    --schema_registry=SCHEMA_REGISTRY_ID
  c                 l    | j                   j                  t               t        j                  |        y)z Register flags for this command.N)display_info	AddFormatSCHEMA_REGISTRY_FORMATr   AddSchemaRegistryArgToParser)parsers    r   ArgszDescribe.Args;   s'     !!"89**62r   c                 j   t        j                  dd      }|j                  }t        j                  |j
                        }|j                  }|j                  }t        j                  j                  |d|||d      }|j                         }t        j                  j                  dj                  |      dz          |j!                  |      }	|j#                  | d	      }
|j%                  | d
      }|j&                  j)                  |	      }|j*                  j)                  |
      }|j,                  j)                  |      }t        j.                  |j0                        }t        j2                  |j4                        }|j6                  |j8                  ||d}t;        |      S )zCalled when the user runs gcloud managed-kafka schema-registries describe ...

    Args:
      args: all the arguments that were provided to this command invocation.

    Returns:
      The schema registry.
    managedkafkav1z0managedkafka.projects.locations.schemaRegistries)
projectsIdlocationsIdschemaRegistriesId)
collectionparamsz Describing schema registry [{}].
)namez/modez/config)request)r+   contextsmodecompatibility)r   GetClientInstanceMESSAGES_MODULEr	   ParseProjectprojectlocationr   r   REGISTRYParseRelativeNamer
   statusPrintformat7ManagedkafkaProjectsLocationsSchemaRegistriesGetRequest;ManagedkafkaProjectsLocationsSchemaRegistriesModeGetRequest=ManagedkafkaProjectsLocationsSchemaRegistriesConfigGetRequest#projects_locations_schemaRegistriesGet(projects_locations_schemaRegistries_mode*projects_locations_schemaRegistries_config	ParseModer.   ParseCompatibilityr/   r+   r-   r   )r   argsclientmessage
project_idr4   schema_registry_idschema_registry_resourceschema_registry_pathschema_registry_requestschema_registry_mode_requestschema_registry_config_requestr   schema_registry_modeschema_registry_configr.   r/   s                    r   RunzDescribe.RunC   s    ##ND9F$$G""4<<0J}}H--(1177E$#"4
  8   4@@BJJ*112DEL
 	GG% 	H 	
  	KK()/ 	L 	
 ! 	MM()1 	N 	
 # @@DD' E O "JJNN, O  	99==2 	> 	
  >>.334D++,,M
  $$#,,&	O O$$r   N)r   r   r   r   staticmethodr!   rP   r   r   r   r   r   .   s!     3 3H%r   r   N)r   
__future__r   r   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.managed_kafkar   r	   googlecloudsdk.corer
   r   PROJECTS_RESOURCE_PATHLOCATIONS_RESOURCE_PATHSCHEMA_REGISTRIES_RESOURCE_PATHr   objectr   ReleaseTracksReleaseTrackALPHABETADefaultUniverseOnlyDescribeCommandr   r   r   r   <module>ra      s    Q &  ' , ( > 9 # )$ & "5  +v + D%%++T->->-C-CD[%t## [%  E[%r   