public function setIamPolicy($resource, Google_Service_Iam_SetIamPolicyRequest $postBody, $optParams = array())
  {
    $params = array('resource' => $resource, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('setIamPolicy', array($params), "Google_Service_Iam_Policy");
  }
public function setIamPolicy($resource, Google_Service_Iam_SetIamPolicyRequest $postBody, $optParams = array())
  {
    $params = array('resource' => $resource, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('setIamPolicy', array($params), "Google_Service_Iam_Policy");
  }
public function setIamPolicy ( $ resource , Google_Service_Iam_SetIamPolicyRequest $ postBody , $ optParams = array ( ) ) { $ params = array ( 'resource' => $ resource , 'postBody' => $ postBody ) ; $ params = array_merge ( $ params , $ optParams ) ; return $ this -> call ( 'setIamPolicy' , array ( $ params ) , "Google_Service_Iam_Policy" ) ; }
Sets the Cloud IAM access control policy for a ServiceAccount.

Note: Service accounts are both [resources and identities](/iam/docs/service-
accounts#service_account_permissions). This method treats the service account
as a resource. Use it to grant members access to the service account, such as
when they need to impersonate it.

This method does not grant the service account access to other resources,
such as projects. To grant a service account access to resources, include the
service account in the Cloud IAM policy for the desired resource, then call
the appropriate `setIamPolicy` method on the target resource. For example, to
grant a service account access to a project, call the [projects.setIamPolicy
](/resource-manager/reference/rest/v1/projects/setIamPolicy) method.
(serviceAccounts.setIamPolicy)

@param string $resource REQUIRED: The resource for which the policy is being
specified. See the operation documentation for the appropriate value for this
field.
@param Google_Service_Iam_SetIamPolicyRequest $postBody
@param array $optParams Optional parameters.
@return Google_Service_Iam_Policy
Sets the Cloud IAM access control policy for a ServiceAccount .