
                         Z    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Zd	 Zy
)z)Helpers for interacting with the IAM API.    )absolute_import)division)unicode_literals)util)iam_util)log   c                    t        j                         \  }}|j                  |       }|j                  j	                  |      }d}|D ]'  }|t        j                  |j                  |||      z  }) |st        j                  d       yt        j                  d       |j                  | |j                  |            }	|j                  j                  |	      }y)	z?Adds IAM policy bindings for members with the role on resource.)resource)requestFz2Skipped setting IAM policy, no changes are needed.NzSetting the updated IAM policy.)policy)r   setIamPolicyRequest)iam_apiGetClientAndMessages-IamProjectsServiceAccountsGetIamPolicyRequestprojects_serviceAccountsGetIamPolicyr   AddBindingToIamPolicyBindingr   debug-IamProjectsServiceAccountsSetIamPolicyRequestSetIamPolicyRequestSetIamPolicy)
r   membersrole
iam_clientiam_messagesr   
iam_policybinding_updatedmemberset_requests
             2lib/googlecloudsdk/api_lib/dataproc/iam_helpers.pyAddIamPolicyBindingsr#      s    $99;*lFF G '22???P*/fx55l6J6J6@&$P PO  
IIBC
))-.JJ&::*:M K O+ 22?? @ *    N)__doc__
__future__r   r   r   googlecloudsdk.api_lib.iamr   r   googlecloudsdk.command_lib.iamr   googlecloudsdk.corer   !MAX_LIBRARY_IAM_SUPPORTED_VERSIONr#    r$   r"   <module>r,      s)    0 &  ' 6 3 # %& !r$   