'General python api client interaction function.
For use with google-api-python-client, or clients created
with get_google_api_client function
Not for use with Google Cloud client libraries
For long-running operations, we make an immediate query and then
sleep poll_interval before re-querying.  After the request is done
we rebuild the request with a get method and return the result.'

@staticmethod
def execute_api_client_req(req, client=None, raw=True, operation_timeout=180, poll_interval=5, raise_404=True):

    try:
        resp = req.execute()
        if (not resp):
            return None
        if raw:
            return resp
        if (resp['kind'] == 'compute#operation'):
            resp = GCPUtils.execute_api_client_operation_req(req, resp, client, operation_timeout, poll_interval)
        if ('items' in resp):
            return resp['items']
        return resp
    except HttpError as h:
        if ((h.resp.status == 404) and (not raise_404)):
            return None
        else:
            raise
    except Exception:
        raise
