Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taskrouter statistics method expecting SID parameter #697

Closed
serdar opened this issue Oct 7, 2021 · 4 comments
Closed

Taskrouter statistics method expecting SID parameter #697

serdar opened this issue Oct 7, 2021 · 4 comments
Labels
code-generation issue deals with generated code type: bug bug in the library

Comments

@serdar
Copy link

serdar commented Oct 7, 2021

Issue Summary

The documentation to retrieve the statistics for a specific worker (https://www.twilio.com/docs/taskrouter/api/worker/statistics#fetch-a-specific-workers-statistics) states no additional parameters for the .statistics() method, however, the current version of the Node library requires an SID parameter.

Can the documentation please be updated to refer to the current published version of the Node library, or please specify what the SID should be to gather the statistics.

Code Snippet from Documentation

// Download the helper library from https://www.twilio.com/docs/node/install
// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

client.taskrouter.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
      .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
      .statistics()
      .fetch()
      .then(worker_statistics => console.log(worker_statistics.cumulative));

Code Snippet from workerStatistics.d.ts

interface WorkerStatisticsListInstance {
  /**
   * @param sid - sid of instance
   */
  (sid: string): WorkerStatisticsContext;
  /**
   * Constructs a worker_statistics
   */
  get(): WorkerStatisticsContext;
  /**
   * Provide a user-friendly representation
   */
  toJSON(): any;
}

Technical details:

  • twilio-node version: 3.67.1
  • node version: v16.10.0
@eshanholtz
Copy link
Contributor

Ah. This appears to be a bug in our autogenerated code. Thanks for pointing this out, @serdar. This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@eshanholtz eshanholtz added code-generation issue deals with generated code status: help wanted requesting help from the community type: bug bug in the library labels Oct 14, 2021
@Alex-Bond
Copy link

Same problem for client.messaging.deactivations()

@childish-sambino
Copy link
Contributor

Bumping internally (DI-2172).

@Hunga1
Copy link
Contributor

Hunga1 commented Sep 20, 2022

Update: This is now work-in-progress and will be ready for the next release candidate.

@Hunga1 Hunga1 added status: work in progress Twilio or the community is in the process of implementing and removed status: help wanted requesting help from the community labels Sep 21, 2022
@childish-sambino childish-sambino removed the status: work in progress Twilio or the community is in the process of implementing label Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation issue deals with generated code type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

5 participants