ó
    €Ï	  ã                   ó\   • 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 rS rg	)
zEUtility functions for Functions specific to deploying Gen2 functions.é    )Úabsolute_import)Údivision)Úprint_function)Úunicode_literals)Úutilc                  ó¤   • SR                  [        R                  " [        R                  " 5       5      5      n [        R
                  " U SS/SS9  g)zÄEnsures the project's Pub/Sub service account has permission to create tokens.

If the permission is missing, prompts the user to grant it. If the console
cannot prompt, prints a warning instead.
z0service-{}@gcp-sa-pubsub.iam.gserviceaccount.comz$roles/iam.serviceAccountTokenCreatorzroles/pubsub.serviceAgentzˆPub/Sub needs this role to create identity tokens. For more details, please see https://cloud.google.com/pubsub/docs/push#authentication)Ú	alt_rolesÚreasonN)ÚformatÚprojects_utilÚGetProjectNumberÚapi_utilÚ
GetProjectÚPromptToBindRoleIfMissing)Ú	pubsub_sas    Ú:lib/googlecloudsdk/command_lib/functions/v2/deploy_util.pyÚ'ensure_pubsub_sa_has_token_creator_roler      sN   € ð A×GÑGÜ×$Ò$¤X×%8Ò%8Ó%:Ó;ó€)ô ×$Ò$ØØ,Ø,Ð-ðEó	ó    c                 óª   • U  Vs/ s H  oR                   S:X  d  M  UPM     nnU(       a$  [        R                  " US   R                  5        ggs  snf )z÷Ensures appropriate Data Access Audit Logs are enabled for the given event filters.

If they're not, the user will be prompted to enable them or warned if the
console cannot prompt.

Args:
  trigger_event_filters: the CAL trigger's event filters.
ÚserviceNamer   N)Ú	attributer   Ú!PromptToEnableDataAccessAuditLogsÚvalue)Útrigger_event_filtersÚfÚservice_filters      r   Ú#ensure_data_access_logs_are_enabledr   1   sR   € ñ 'óÚ&ˆA¯+©+¸Ñ*F‡aÑ&ð ð ö Ü×.Ò.¨~¸aÑ/@×/FÑ/FÕGð ùòs
   …AœAN)Ú__doc__Ú
__future__r   r   r   r   Ú#googlecloudsdk.api_lib.functions.v2r   r   Ú#googlecloudsdk.command_lib.projectsr   r   r   © r   r   Ú<module>r#      s*   ðñ Lõ 'Ý Ý %Ý 'å @Ý Eòó,Hr   