title: Error "permission type field is required" when attempting to create permission via Google Drive API
body: <p>I adapted code from the Google Drive API Quickstart for Node.js found <a href="https://developers.google.com/drive/v3/web/quickstart/nodejs%20%22here%22." rel="nofollow noreferrer">here</a> to try and create a new permission on an existing file in Google Drive.</p>
  <p>No matter what I change in the code, I always get the same response saying <code>The permission type field is required</code> even though I've specified it via <code>resource</code> as mentioned in documentation for the npm <code>googleapis</code> <a href="https://www.npmjs.com/package/googleapis" rel="nofollow noreferrer">client library</a> and other examples I've found.</p>
  <p>Is this just not working or am I missing something obvious?</p>
  <h3>Code to update permission</h3>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function updateFilePermissions(auth) {
  
    var drive = google.drive({
      version: 'v3',
      auth: auth
    });
  
    var resourceContents = {
      role: 'writer',
      type: 'user',
      emailAddress: 'user@example.com'
    };
  
    drive.permissions.create({
  
      resource: resourceContents,
      fileId: aValidFileId,
      sendNotificationEmail: false,
      fields: 'id',
  
    }, function(err, res) {
  
      if (err) {
  
        // Handle error...
        console.error(err);
  
      } else {
  
        console.log('Permission ID: ', res.id);
  
      }
  
    });
  
  }</code></pre>
  </div>
  </div>
  </p>
  <h3>Response from Google Drive API</h3>
  <pre><code>code: 400,
  errors: 
   [ { domain: 'global',
       reason: 'required',
       message: 'The permission type field is required.',
       locationType: 'other',
       location: 'permission.type' } ]
  </code></pre>