Google Reports API - reports.customerUsageReports.get issue
<p>I am having some issues with the Google Reports API. I have no issues running the sample code provided in the <a href="https://developers.google.com/admin-sdk/reports/v1/quickstart/python" rel="nofollow">documentation</a> to get the reports.activities.list data, but when I change to program to to try and pull full domain data (reports.customerUsageReports.get) I get an error stating that "'Resource' object has no attribute 'usage'". </p>

<p>I have no issue with auth and have changed the api scopes in the program to <a href="https://www.googleapis.com/auth/admin.reports.usage.readonly" rel="nofollow">https://www.googleapis.com/auth/admin.reports.usage.readonly</a> as required.</p>

<p>I am running the following snippet to try and access the data</p>

<pre><code>credentials = get_credentials()
    http = credentials.authorize(httplib2.Http())
    service = discovery.build('admin', 'reports_v1', http=http)

    print('Getting data')
    results = service.usage().list(date='2016-01-01').execute()
    usage = results.get('items', [])

    if not usage:
        print('No data found.')
    else:
        print('Data:')
        for use in usageReports:
            print(use)
</code></pre>

<p>Make sure you follow these steps:</p>

<ol>
<li><p>According to the <a href="https://developers.google.com/admin-sdk/reports/v1/quickstart/python" rel="nofollow">Python quickstart</a>, if you modify the scopes, you need to delete the previously saved credentials at ~/.credentials/admin-reports_v1-python-quickstart.json</p></li>
<li><p>For the Scopes, in requesting access using OAuth 2.0, your application needs the scope information, as well as information that Google supplies when you register your application (such as the client ID and the client secret).</p></li>
</ol>

<p>For more information check this <a href="https://developers.google.com/admin-sdk/reports/v1/guides/authorizing" rel="nofollow">link</a> and the documentation about <a href="https://developers.google.com/admin-sdk/reports/v1/reference/customerUsageReports/get" rel="nofollow">CustomerUsageReports: get</a> to know how to use these parameter correctly.</p>

python google-api google-apps google-reporting-api