code: def ReplacePermission(self, permission_link, permission, options=None):
          
          if options is None:
              options = {}
  
          CosmosClient.__ValidateResource(permission)
          path = base.GetPathFromLink(permission_link)
          permission_id = base.GetResourceIdOrFullNameFromLink(permission_link)
          return self.Replace(permission,
                              path,
                              'permissions',
                              permission_id,
                              None,
                              options)
docs: Replaces a permission and return it.
  
          :param str permission_link:
              The link to the permission.
          :param dict permission:
          :param dict options:
              The request options for the request.
  
          :return:
              The new Permission.
          :rtype:
              dict