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

PhoneNumberType/Carrier not defined correctly in typescript def #395

Open
psaia opened this issue Nov 15, 2018 · 4 comments
Open

PhoneNumberType/Carrier not defined correctly in typescript def #395

psaia opened this issue Nov 15, 2018 · 4 comments
Labels
code-generation issue deals with generated code status: waiting for feedback waiting for feedback from the submitter type: twilio enhancement feature request on Twilio's roadmap

Comments

@psaia
Copy link

psaia commented Nov 15, 2018

Main issues:

  • It looks like PhoneNumberType is never used or exported.
  • The carrier property is defined as a string when it's in fact an object. I imagine the type property within that object should get the type PhoneNumberType.

Example:

const res = await twilioClient.lookups.phoneNumbers("some phone number").fetch({
  type: ["carrier"] // Also FYI, in the docs this is shown as a string instead of string[]
});

console.log(res.carrier); // => {mobile_country_code, mobile_network_code, name, type, error_code}

So maybe a new struct is needed to represent the carrier:

interface Carrier {
  mobile_country_code: string;
  mobile_network_code: string;
  name: string;
  type: PhoneNumberType;
  error_code: number | null; // ?
}
@childish-sambino childish-sambino added the type: bug bug in the library label Jun 21, 2019
@childish-sambino
Copy link
Contributor

Looks like the definition this is generated from is not complete and is missing the structure definition for both carrier and caller_name. Keeping this issue open as part of the backlog.

Regarding type: ["carrier"] showing as type string, I'm seeing this as fixed in the docs back in late 2016.

@childish-sambino childish-sambino added code-generation issue deals with generated code type: twilio enhancement feature request on Twilio's roadmap labels Aug 30, 2019
@childish-sambino childish-sambino added difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap and removed type: twilio enhancement feature request on Twilio's roadmap labels Sep 17, 2019
@childish-sambino
Copy link
Contributor

PhoneNumberType added to exports as part of #499 (source)

@childish-sambino childish-sambino added status: work in progress Twilio or the community is in the process of implementing type: twilio enhancement feature request on Twilio's roadmap and removed status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap difficulty: easy fix is easy in difficulty status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library labels Jul 9, 2020
@childish-sambino
Copy link
Contributor

Moving this to an enhancement request. Since this is generated code, adding a new nested type declaration is not currently supported.

This issue has been added to our internal backlog to be prioritized. +1s (👍 ) on the issue summary will help it move up the backlog.

@manisha1997
Copy link

Seems like this issue is resolved at the latest version.
Can you please review and comment?

@manisha1997 manisha1997 added the status: waiting for feedback waiting for feedback from the submitter label Jul 25, 2024
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 status: waiting for feedback waiting for feedback from the submitter type: twilio enhancement feature request on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

3 participants