
                         .   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Sr\R,                  " \R.                  R0                  5      \R2                   " S S\R4                  5      5       5       rg)zQImplementation of gcloud managed kafka schema registries subjects update command.    )absolute_import)division)unicode_literals)apis)base)	arguments)util)log)	resources)managedkafka_v1_messagesz	projects/z
locations/zschemaRegistries/z	subjects/z
/contexts/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 subject.

## EXAMPLES

Modify the mode of the subject to READONLY:

  $ {command} --registry=SCHEMA_REGISTRY --context=CONTEXT
  --project=PROJECT_ID --location=LOCATION_ID --mode=READONLY

Modify the compatibility of the subject to BACKWARDS:

  $ {command} --registry=SCHEMA_REGISTRY --context=CONTEXT
  --project=PROJECT_ID --location=LOCATION_ID --compatibility=BACKWARDS
c                    [         R                  " U 5        U R                  S[        SS9  U R	                  SS9nUR                  S[        SS9  UR                  S[        S	S9  UR                  S
SSS9  UR                  SSSS9  g)z Register flags for this command.z	--contextzThe context of the subject.)typehelpT)requiredz--modez"The mode of the subject to update.z--compatibilityz+The compatibility of the subject to update.z--delete-mode
store_truezDelete the mode of the subject.)actionr   z--delete-configz!Delete the config of the subject.N)r   AddSubjectArgToParseradd_argumentstradd_mutually_exclusive_group)parsergroups     >lib/surface/managed_kafka/schema_registries/subjects/update.pyArgsUpdate.Args6   s     ##F+
*   ///>E	1  
 
:  
 
.  
 
0      c           	      ~   [         R                  " SS5      nUR                  n[        R                  " UR
                  5      nUR                  nUR                  nUR                  R                  R                  5       R                  n[        R                  R                  UR                  SUUUUS.S9nUR                  5       R                  5       n	UR                   (       a  U	 ["         UR                    3n	UR$                  (       a!  [        R&                  " XyUR                   5        UR(                  (       a!  [        R*                  " XyUR                   5        UR,                  (       Ga  UR,                  R/                  5       n
U	 SUR                  R                  R                  5       R                   3nUR1                  5       n[2        R0                  R5                  U
5      Ul        UR                   (       a)  UR7                  XS9nUR8                  R;                  US9nO(UR=                  XS9nUR>                  R;                  US9n[@        RB                  " US	UR,                  -  S
9  URD                  (       Ga4  URD                  R/                  5       nU	 SUR                  R                  R                  5       R                   3nURG                  5       n[2        RF                  RI                  U5      Ul"        UR                   (       a*  URK                  UUS9nURL                  R;                  US9nO)URO                  UUS9nURP                  R;                  US9n[@        RB                  " USURD                  -  S
9  [@        RR                  RU                  SURD                  -  5        gg)zCalled when the user runs gcloud managed-kafka schema-registries subjects update ...

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

Returns:
  The updated subject.
managedkafkav1z9managedkafka.projects.locations.schemaRegistries.subjects)
projectsIdlocationsIdschemaRegistriesId
subjectsId)
collectionparamsz/mode/)nameupdateSchemaModeRequest)requestz
mode to %s)detailsz/config/)r)   updateSchemaConfigRequestzcompatibility to %sz-Current subject config: 
 - compatibility: %sN)+r   GetClientInstanceMESSAGES_MODULEr	   ParseProjectprojectlocationregistryCONCEPTSsubjectParser&   r   REGISTRYParentRelativeNamecontextCONTEXTS_RESOURCE_PATHdelete_configDeleteSubjectConfigdelete_modeDeleteSubjectModemodeupperUpdateSchemaModeRequestr   ModeValueValuesEnumFManagedkafkaProjectsLocationsSchemaRegistriesContextsModeUpdateRequest1projects_locations_schemaRegistries_contexts_moder   >ManagedkafkaProjectsLocationsSchemaRegistriesModeUpdateRequest(projects_locations_schemaRegistries_moder
   UpdatedResourcecompatibilityUpdateSchemaConfigRequestCompatibilityValueValuesEnumHManagedkafkaProjectsLocationsSchemaRegistriesContextsConfigUpdateRequest3projects_locations_schemaRegistries_contexts_config@ManagedkafkaProjectsLocationsSchemaRegistriesConfigUpdateRequest*projects_locations_schemaRegistries_configstatusPrint)selfargsclientmessage
project_idr2   schema_registry_idr5   subject_run_resourceschema_registry_resourcer@   r)   updatemoderequestr+   responserI   updateconfigrequests                    r   Run
Update.RunY   so    ##ND9F$$G""4<<0J}}Hmm##))+66G$--33N$#"4!	
 4 	  4::<IIK||%&'=&>t||n
M  
w$,,O
WMyyyYY__d()0E0E0K0K0M0X0X/YZd!99;
"
:
:
N
N  
`` a 
 DDKK L  	 XX Y 
 BBII J 
 
'<(--+GH((..0m()$--2G2G2M2M2O2Z2Z1[\d#==?*B*\*\*y*y
+' 
bb1D c 
 FFMM N  	 ZZ1D [ 
 DDKK L 
 

083I3II 
jj
:##%? r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r]   __static_attributes__r_   r   r   r   r   $   s"        Dfr   r   N)rd   
__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SUBJECTS_RESOURCE_PATHr;   ReleaseTracksReleaseTrackALPHADefaultUniverseOnlyUpdateCommandr   r_   r   r   <module>rv      s    X &  ' , ( > 9 # ) Z$ & "5 $ %  D%%++,YT Y  -Yr   