
                             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 ej                   G d	 d
ej                               Zy)z0Command to update a Transfer Service agent pool.    )absolute_import)division)unicode_literals)apis)base)agent_pools_flag_util)	name_utilc                   0    e Zd ZdZdddZed        Zd Zy)Updatez%Update a Transfer Service agent pool.z"      Update an agent pool.
      a        To remove the bandwidth limit for agent pool 'foo', run:

          $ {command} foo --clear-bandwidth-limit

      To remove the display name for agent pool 'foo', run:

          $ {command} foo --clear-display-name

      To update the bandwidth limit for agent pool 'foo' to 100 MB/s, run:

          $ {command} foo --bandwidth-limit=100

      To update the display name for agent pool 'foo' to 'example name', run:

          $ {command} foo --display-name="example name"
      )DESCRIPTIONEXAMPLESc                 ~    t        j                  |        | j                  ddd       | j                  ddd       y )Nz--clear-display-name
store_truez,Remove the display name from the agent pool.)actionhelpz--clear-bandwidth-limitzpRemove the agent pool's bandwidth limit, which enables the pool's agents to use all bandwidth available to them.)r   setup_parseradd_argument)parsers    *lib/surface/transfer/agent_pools/update.pyArgszUpdate.Args:   sL    &&v.
;  = !:  ;    c                 b   t        j                  dd      }t        j                  dd      }|j                         }g }|j                  s|j
                  r>|j                  d       |j                  r!|j                  |j                        |_        |j                  s|j                  r"|j                  d       |j                  |_        |rdj                  |      }nd }t        j                  |j                        }|j                   j#                  |j%                  |||            S )Ntransferv1bandwidth_limit)	limitMbpsdisplay_name,)	agentPoolname
updateMask)r   GetClientInstanceGetMessagesModule	AgentPoolr   clear_bandwidth_limitappendBandwidthLimitbandwidthLimitr   clear_display_namedisplayNamejoinr	   add_agent_pool_prefixr    projects_agentPoolsPatch-StoragetransferProjectsAgentPoolsPatchRequest)selfargsclientmessagesagent_pool_objectupdate_mask_listupdate_maskformatted_agent_pool_names           r   Runz
Update.RunG   s   ##J5F%%j$7H **,t99/0			+3+B+B** ,C ,,(D33n-&*&7&7#HH-.kk ) ? ?		 J%%++>>'*" 	? 	$% %r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r8    r   r   r   r      s/    -


-4 
; 
;%r   r   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.transferr   r	   UniverseCompatibleCommandr   r?   r   r   <module>rF      sG    7 &  ' , ( E 9 D%T\\ D% D%r   