
    :                     &   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\R(                  " \R*                  R,                  5      \R.                   " S S\R0                  5      5       5       rg)zHImplementation of gcloud managed kafka schema registries update command.    )absolute_import)division)unicode_literals)apis)base)	arguments)util)log)	resources)managedkafka_v1_messagesz	projects/z
locations/zschemaRegistries/c                   .    \ rS rSrSr\S 5       rS rSrg)Update"   a  Update the mode and compatibility of a schema registry.

## EXAMPLES

Modify the mode of the schema registry to READONLY:

  $ {command} --mode=READONLY

Modify the compatibility of the schema registry to BACKWARDS:

  $ {command} --compatibility=BACKWARDS
c                     [         R                  " U 5        U R                  SS9nUR                  S[        SS9  UR                  S[        SS9  g)	z Register flags for this command.T)requiredz--modez*The mode of the schema registry to update.)typehelpz--compatibilityz3The compatibility of the schema registry to update.N)r   AddSchemaRegistryArgToParseradd_mutually_exclusive_groupadd_argumentstr)parsergroups     5lib/surface/managed_kafka/schema_registries/update.pyArgsUpdate.Args2   s_     **62///>E	9  
 
B      c                 *   [         R                  " SS5      nUR                  n[        R                  " UR
                  5      nUR                  n[        R                  R                  UR                  SUUUR                  S.S9nUR                  5       nUR                  (       a  US-   nUR                  5       n	[        R                  R                  UR                  5      U	l        UR!                  XS9n
UR"                  R%                  U
S9n[&        R(                  " UR                  S	UR                  -  S
9  UR*                  (       a  US-   nUR-                  5       n[        R,                  R/                  UR*                  5      Ul        UR1                  XS9n
UR2                  R%                  U
S9n[&        R(                  " UR                  SUR*                  -  S
9  [&        R4                  R7                  SUR*                  -  5        gg)zCalled when the user runs gcloud managed-kafka schema-registries update ...

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

Returns:
  The updated schema registry.
managedkafkav1z0managedkafka.projects.locations.schemaRegistries)
projectsIdlocationsIdschemaRegistriesId)
collectionparamsz/mode)nameupdateSchemaModeRequest)requestz
mode to %s)detailsz/config)r&   updateSchemaConfigRequestzcompatibility to %sz5Current schema registry config: 
 - compatibility: %sN)r   GetClientInstanceMESSAGES_MODULEr	   ParseProjectprojectlocationr   REGISTRYParseschema_registryRelativeNamemodeUpdateSchemaModeRequestr   ModeValueValuesEnumFManagedkafkaProjectsLocationsSchemaRegistriesContextsModeUpdateRequest1projects_locations_schemaRegistries_contexts_moder   r
   UpdatedResourcecompatibilityUpdateSchemaConfigRequestCompatibilityValueValuesEnumHManagedkafkaProjectsLocationsSchemaRegistriesContextsConfigUpdateRequest3projects_locations_schemaRegistries_contexts_configstatusPrint)selfargsclientmessage
project_idr/   schema_registry_resourceschema_registry_pathr&   updatemoderequestr(   responseupdateconfigrequests                r   Run
Update.RunD   s    ##ND9F$$G""4<<0J}}H(1177E$#"&"6"6
  8   4@@Byy!G+d!99;
"
:
:
N
Nii 
 ^^ _ g 
B
B
I
I J  
 



x}}(D !I-d#==?*B*\*\*y*y


+' `` a g 
D
D
K
K L  
 



'(*@*@@ 
jj
B##%) r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rK   __static_attributes__rM   r   r   r   r   "   s!      "Er   r   N)rR   
__future__r   r   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.managed_kafkar   r	   googlecloudsdk.corer
   r   5googlecloudsdk.generated_clients.apis.managedkafka.v1r   PROJECTS_RESOURCE_PATHLOCATIONS_RESOURCE_PATHSCHEMA_REGISTRIES_RESOURCE_PATHReleaseTracksReleaseTrackALPHADefaultUniverseOnlyUpdateCommandr   rM   r   r   <module>rc      s    O &  ' , ( > 9 # ) Z$ & "5  D%%++,eT e  -er   