
    ,#                        S r SSK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  \R                  \R                  " \R                  R                   5       " S	 S
\R"                  5      5       5       r\R                  " \R                  R&                  5       " S S\5      5       r\R                  " \R                  R*                  5       " S S\5      5       rg)z%bigtable app profiles update command.    N)	HttpError)app_profiles)util)base)	arguments)logc                   \    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
S rSrg	)
UpdateAppProfile   Update a Bigtable app profile.EXAMPLESa            To update an app profile to use a multi-cluster routing policy, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any

          To update an app profile to use a single-cluster routing policy that
          routes all requests to `my-cluster-id` and allows transactional
          writes, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-to=my-cluster-id --transactional-writes

          To update the description for an app profile, run:

            $ {command} my-app-profile-id --instance=my-instance-id --description="New description"

          To update the request priority for an app profile to PRIORITY_LOW, run:

            $ {command} my-app-profile-id --instance=my-instance-id --priority=PRIORITY_LOW

          To update an app profile to enable row-affinity routing, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --row-affinity

          To update an app profile to enable Data Boost which bills usage to the host project, run:

            $ {command} my-app-profile-id --instance=my-instance-id --data-boost --data-boost-compute-billing-owner=HOST_PAYS

          c                     [         R                  " U S5        [         R                  " U 5      R                  SSS9R	                  SS9R                  5       R                  S5      R                  5         g N	to updateapp profileFrequiredupdater   AddAppProfileResourceArgArgAdderAddDescriptionAddAppProfileRoutingAddIsolationAddForceAddAsyncparsers    +lib/surface/bigtable/app_profiles/update.pyArgsUpdateAppProfile.Args@   T    &&v{;6"		6		u		-		(		    c                 2   [         R                  " U5        [        R                  " UUR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ m  Updates an AppProfile with the given arguments.

Args:
  app_profile_ref: A resource reference of the new app profile.
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Raises:
  ConflictingArgumentsException,
  OneOfArgumentsRequiredException:
    See app_profiles.Update(...)

Returns:
  Long running operation.
)
clusterdescriptionmulti_clusterrestrict_totransactional_writesrow_affinitypriority
data_boost data_boost_compute_billing_ownerforcer   ValidateStandardIsolationArgsr   Updateroute_tor(   	route_anyr*   r+   r,   r-   r.   r/   r0   selfapp_profile_refargss      r   _UpdateAppProfile"UpdateAppProfile._UpdateAppProfileL   x      ++D1$$nn$$!66&&??)-)N)Njj r#   c                    UR                   R                  R                  5       n U R                  X!5      n[        R
                  " U5      nUR                  (       a5  [        R                  " USR                  UR                  5       5      SS9  U$ [        R                  " USR                  UR                  5       5      5      $ ! [         a   n[        R                  " U5         SnAgSnAff = f)a/  This is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Raises:
  ConflictingArgumentsException,
  OneOfArgumentsRequiredException:
    See _UpdateAppProfile(...)

Returns:
  Updated resource.
zbigtable app profile {0}T)kindis_asyncz!Updating bigtable app profile {0}N)CONCEPTSapp_profileParser:   r   GetOperationRefasync_r   UpdatedResourceformatNameAwaitAppProfiler   FormatErrorMessages)r7   r9   r8   resultoperation_refes         r   RunUpdateAppProfile.Runk   s     mm//557O%%o<f **62m	+22?3G3G3IJ	

 !!

-
4
4_5I5I5K
L   "
q!!"s   C 
C1C,,C1 N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr    r:   rM   __static_attributes__rO   r#   r   r
   r
      sA     ' (// # -> 	 	>"r#   r
   c                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	UpdateAppProfileBeta   r   r   a            To update an app profile to use a multi-cluster routing policy, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any

          To update an app profile to use a single-cluster routing policy that
          routes all requests to `my-cluster-id` and allows transactional
          writes, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-to=my-cluster-id --transactional-writes

          To update the description for an app profile, run:

            $ {command} my-app-profile-id --instance=my-instance-id --description="New description"

          To update the request priority for an app profile to PRIORITY_LOW, run:

            $ {command} my-app-profile-id --instance=my-instance-id --priority=PRIORITY_LOW

          To update an app profile to enable Data Boost which bills usage to the host project, run:

            $ {command} my-app-profile-id --instance=my-instance-id --data-boost --data-boost-compute-billing-owner=HOST_PAYS

          To update an app profile to enable row-affinity routing, run:

            $ {command} my-app-profile-id --instance=my-instance-id --route-any --row-affinity

          c                     [         R                  " U S5        [         R                  " U 5      R                  SSS9R	                  SS9R                  5       R                  S5      R                  5         g r   r   r   s    r   r    UpdateAppProfileBeta.Args   r"   r#   c                 2   [         R                  " U5        [        R                  " UUR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ r%   r1   r6   s      r   r:   &UpdateAppProfileBeta._UpdateAppProfile   r<   r#   rO   N)rP   rQ   rR   rS   rT   rU   rV   rW   rX   r    r:   rY   rO   r#   r   r[   r[      s:    & (// # -> 	 	r#   r[   c                   .    \ rS rSrSr\S 5       rS rSrg)UpdateAppProfileAlpha   r   c                     [         R                  " U S5        [         R                  " U 5      R                  SSS9R	                  SS9R                  SS9R                  S5      R                  5         g )Nr   r   Fr   Tallow_memory_layerr   r   r   s    r   r    UpdateAppProfileAlpha.Args   s`    &&v{;6"		6		 
 

 
	.	(		r#   c                 F   [         R                  " USS9  [        R                  " UUR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9$ )r&   Tre   )r'   r(   r)   r*   r+   r,   r-   use_memory_layerr.   r/   r0   )r   r2   r   r3   r4   r(   r5   r*   r+   r,   r-   ri   r.   r/   r0   r6   s      r   r:   'UpdateAppProfileAlpha._UpdateAppProfile   s      ++DTJ$$nn$$!66&&..??)-)N)Njj r#   rO   N)	rP   rQ   rR   rS   rT   rX   r    r:   rY   rO   r#   r   rb   rb      s    & r#   rb   )rT   rU   apitools.base.py.exceptionsr   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler   googlecloudsdk.corer   DefaultUniverseOnlyReleaseTracksReleaseTrackGACreateCommandr
   BETAr[   ALPHArb   rO   r#   r   <module>rw      s    ,  1 8 0 ( 9 # D%%(()ot)) o * od D%%**+K+ K ,K\ D%%++,/0 / -/r#   