async authorizeWithCode (data) {
    data = data.oAuth
    if (!this.oAuth2Client) {
      this.oAuth2Client = new google.auth.OAuth2(data.client_id, data.client_secret, data.redirect_uri)
    }

    this.logger.debug('Retrieving access token')
    return new Promise((resolve, reject) => {
      this.oAuth2Client.getToken(data.code, (error, token) => {
        if (error) {
          this.logger.error('Error retrieving access token', error)
          reject(new Error('Error retrieving access token'))
          return
        }
        this.logger.debug('Got access token')
        this.logger.debug(token)
        this.oAuth2Client.setCredentials(token)

        resolve({
          client_id: data.client_id,
          client_secret: data.client_secret,
          redirect_uri: data.redirect_uri,
          token
        })
      })
    })
  }
Authorize with code

@param {Object} data Google Driver configuration

@returns {Object} Google Driver configuration