Ë
    €Ïš  ã            
       óÔ   — d Z ddlmZ ddlmZ ddlmZ ddlmZ dZefdefd„Z	efdefd	„Z
efdefd
„Zded e«       j                  fd„Z	 ddededed e«       j                  fd„Zy)zCRM API Capability utilities.é    )Úabsolute_import)Údivision)Úunicode_literals)ÚapisÚv3Úapi_versionc                 ó.   — t        j                  d| «      S ©NÚcloudresourcemanager)r   ÚGetClientInstance©r   s    ú;lib/googlecloudsdk/api_lib/resource_manager/capabilities.pyÚCapabilitiesClientr      ó   € Ü	×	Ñ	Ð 6¸Ó	DÐDó    c                 ó,   — t        | «      j                  S )N)r   Úfolders_capabilitiesr   s    r   ÚCapabilitiesServicer      s   € Ü	˜KÓ	(×	=Ñ	=Ð=r   c                 ó.   — t        j                  d| «      S r
   )r   ÚGetMessagesModuler   s    r   ÚCapabilitiesMessagesr   !   r   r   Úcapability_idÚreturnc                 óŽ   — t        «       j                  t        «       j                  | ¬«      «      }|j                  sd|_        |S )a·  Get a particular Capability using capability_id.

  The method explicitly sets Capability.value to False in case Capability is not
  enabled, because the default response does not populate the value field if the
  capability is disabled.

  Args:
    capability_id: The capability_id to get.

  Returns:
    The response from the Get Request. In case the value is False, it is
    explicitly populated with the proper value for clarity.
  )ÚnameF)r   ÚGetr   Ú1CloudresourcemanagerFoldersCapabilitiesGetRequestÚvalue)r   Úget_capability_responses     r   ÚGetCapabilityr    %   sL   € ô 0Ó1×5Ñ5ÜÓ×NÑNØð Oó óÐð
 
!×	&Ò	&Ø$)ÐÔ!Ø	 Ð r   r   Úupdate_maskc           
      óš   — t        «       j                  t        «       j                  | |t        «       j	                  | |¬«      ¬«      «      S )aô  Send an Update Request for the capability.

  Capability is a singleton resource, and only certain capability_types are
  allowed. Currently, "app-management" is the only possible capability_type.

  Args:
    capability_id: The capability_id to update. Should be in the format:
        folders/{folder_id}/capabilities/{capability_type}.
    value: The value to set for the capability.
    update_mask: The update mask to use for the request.

  Returns:
    The response from the Update Request.
  )r   r   )r   Ú
updateMaskÚ
capability)r   ÚPatchr   Ú3CloudresourcemanagerFoldersCapabilitiesPatchRequestÚ
Capability)r   r   r!   s      r   ÚUpdateCapabilityr(   =   sR   € ô" 
Ó	×	$Ñ	$ÜÓ×PÑPØØ Ü)Ó+×6Ñ6Ø ¨ð 7ó ð Qó ó
ð r   N)Ú )Ú__doc__Ú
__future__r   r   r   Úgooglecloudsdk.api_lib.utilr   ÚAPI_VERSIONÚstrr   r   r   r'   r    ÚboolÚ	Operationr(   © r   r   Ú<module>r2      s¢   ðñ $å &Ý Ý 'Ý ,à€ð +6ñ E Có Eð ,7ñ > Só >ð -8ñ E có Eð! ð !Ñ)=Ó)?×)JÑ)Jó !ð2 9;ñØðØ#ðØ25ðáÓ×%Ñ%ôr   