title: Google Sheet Api get function returns undefined value in NestJs
body: <p>I have async function getTables() which using Google Sheet API to get google spreadsheet data. But on response it returns undefined value. this.getClient() returns OAuth2Client data. Could you check my async function, maybe it is written not properly?</p>
  <pre><code>async getTables(): Promise&lt;any&gt; {
      try {
        const sheets = google.sheets({
          version: &quot;v4&quot;,
          auth: await this.getClient()
        });
  
        const res = await sheets.spreadsheets.values.get({
          spreadsheetId: &quot;sheetId&quot;,
          range: &quot;A1:B100&quot;
        });
  
        return res;
        } catch (err) {
         throw new HttpException(&quot;The API returned an error: &quot; + err, 500);
      }
  </code></pre>
  <p>This is getClient async function which authorize client.</p>
  <pre><code>async getClient(): Promise&lt;OAuth2Client&gt; {
      if (!this.oAuth2Client) {
        return await this.authorize();
      }
  
      return this.oAuth2Client;
    }
  
  
  private async authorize() {
      const credentials = {
        access_token: this.auth.access_token,
        refresh_token: null
      };
  
      this.oAuth2Client = new google.auth.OAuth2(this.CLIENT_ID, this.clientSecret, this.redirectUrl);
      this.oAuth2Client.setCredentials(credentials);
      return this.oAuth2Client;
    }
  </code></pre>