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

fix: add overloaded TS definitions for non-required params #545

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions lib/rest/accounts/v1/credential/aws.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ interface AwsListInstance {
* @param callback - Callback to handle processed record
*/
create(opts: AwsListInstanceCreateOptions, callback?: (error: Error | null, item: AwsInstance) => any): Promise<AwsInstance>;
/**
* Streams AwsInstance records from the API.
*
* This operation lazily loads records as efficiently as possible until the limit
* is reached.
*
* The results are passed into the callback function, so this operation is memory
* efficient.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Function to process each record
*/
each(callback?: (item: AwsInstance, done: (err?: Error) => void) => void): void;
/**
* Streams AwsInstance records from the API.
*
Expand All @@ -60,6 +75,17 @@ interface AwsListInstance {
* @param sid - The unique string that identifies the resource
*/
get(sid: string): AwsContext;
/**
* Retrieve a single target page of AwsInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
getPage(callback?: (error: Error | null, items: AwsPage) => any): Promise<AwsPage>;
/**
* Retrieve a single target page of AwsInstance records from the API.
*
Expand All @@ -72,6 +98,15 @@ interface AwsListInstance {
* @param callback - Callback to handle list of records
*/
getPage(targetUrl?: string, callback?: (error: Error | null, items: AwsPage) => any): Promise<AwsPage>;
/**
* Lists AwsInstance records from the API as a list.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
list(callback?: (error: Error | null, items: AwsInstance[]) => any): Promise<AwsInstance[]>;
/**
* Lists AwsInstance records from the API as a list.
*
Expand All @@ -82,6 +117,17 @@ interface AwsListInstance {
* @param callback - Callback to handle list of records
*/
list(opts?: AwsListInstanceOptions, callback?: (error: Error | null, items: AwsInstance[]) => any): Promise<AwsInstance[]>;
/**
* Retrieve a single page of AwsInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
page(callback?: (error: Error | null, items: AwsPage) => any): Promise<AwsPage>;
/**
* Retrieve a single page of AwsInstance records from the API.
*
Expand Down Expand Up @@ -211,6 +257,12 @@ declare class AwsContext {
* Provide a user-friendly representation
*/
toJSON(): any;
/**
* update a AwsInstance
*
* @param callback - Callback to handle processed record
*/
update(callback?: (error: Error | null, items: AwsInstance) => any): Promise<AwsInstance>;
/**
* update a AwsInstance
*
Expand Down Expand Up @@ -253,6 +305,12 @@ declare class AwsInstance extends SerializableClass {
* Provide a user-friendly representation
*/
toJSON(): any;
/**
* update a AwsInstance
*
* @param callback - Callback to handle processed record
*/
update(callback?: (error: Error | null, items: AwsInstance) => any): Promise<AwsInstance>;
/**
* update a AwsInstance
*
Expand Down
58 changes: 58 additions & 0 deletions lib/rest/accounts/v1/credential/publicKey.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ interface PublicKeyListInstance {
* @param callback - Callback to handle processed record
*/
create(opts: PublicKeyListInstanceCreateOptions, callback?: (error: Error | null, item: PublicKeyInstance) => any): Promise<PublicKeyInstance>;
/**
* Streams PublicKeyInstance records from the API.
*
* This operation lazily loads records as efficiently as possible until the limit
* is reached.
*
* The results are passed into the callback function, so this operation is memory
* efficient.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Function to process each record
*/
each(callback?: (item: PublicKeyInstance, done: (err?: Error) => void) => void): void;
/**
* Streams PublicKeyInstance records from the API.
*
Expand All @@ -60,6 +75,17 @@ interface PublicKeyListInstance {
* @param sid - The unique string that identifies the resource
*/
get(sid: string): PublicKeyContext;
/**
* Retrieve a single target page of PublicKeyInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
getPage(callback?: (error: Error | null, items: PublicKeyPage) => any): Promise<PublicKeyPage>;
/**
* Retrieve a single target page of PublicKeyInstance records from the API.
*
Expand All @@ -72,6 +98,15 @@ interface PublicKeyListInstance {
* @param callback - Callback to handle list of records
*/
getPage(targetUrl?: string, callback?: (error: Error | null, items: PublicKeyPage) => any): Promise<PublicKeyPage>;
/**
* Lists PublicKeyInstance records from the API as a list.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
list(callback?: (error: Error | null, items: PublicKeyInstance[]) => any): Promise<PublicKeyInstance[]>;
/**
* Lists PublicKeyInstance records from the API as a list.
*
Expand All @@ -82,6 +117,17 @@ interface PublicKeyListInstance {
* @param callback - Callback to handle list of records
*/
list(opts?: PublicKeyListInstanceOptions, callback?: (error: Error | null, items: PublicKeyInstance[]) => any): Promise<PublicKeyInstance[]>;
/**
* Retrieve a single page of PublicKeyInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
page(callback?: (error: Error | null, items: PublicKeyPage) => any): Promise<PublicKeyPage>;
/**
* Retrieve a single page of PublicKeyInstance records from the API.
*
Expand Down Expand Up @@ -211,6 +257,12 @@ declare class PublicKeyContext {
* Provide a user-friendly representation
*/
toJSON(): any;
/**
* update a PublicKeyInstance
*
* @param callback - Callback to handle processed record
*/
update(callback?: (error: Error | null, items: PublicKeyInstance) => any): Promise<PublicKeyInstance>;
/**
* update a PublicKeyInstance
*
Expand Down Expand Up @@ -253,6 +305,12 @@ declare class PublicKeyInstance extends SerializableClass {
* Provide a user-friendly representation
*/
toJSON(): any;
/**
* update a PublicKeyInstance
*
* @param callback - Callback to handle processed record
*/
update(callback?: (error: Error | null, items: PublicKeyInstance) => any): Promise<PublicKeyInstance>;
/**
* update a PublicKeyInstance
*
Expand Down
64 changes: 64 additions & 0 deletions lib/rest/api/v2010/account.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,34 @@ interface AccountListInstance {
* @param sid - sid of instance
*/
(sid: string): AccountContext;
/**
* create a AccountInstance
*
* @param callback - Callback to handle processed record
*/
create(callback?: (error: Error | null, item: AccountInstance) => any): Promise<AccountInstance>;
/**
* create a AccountInstance
*
* @param opts - Options for request
* @param callback - Callback to handle processed record
*/
create(opts?: AccountListInstanceCreateOptions, callback?: (error: Error | null, item: AccountInstance) => any): Promise<AccountInstance>;
/**
* Streams AccountInstance records from the API.
*
* This operation lazily loads records as efficiently as possible until the limit
* is reached.
*
* The results are passed into the callback function, so this operation is memory
* efficient.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Function to process each record
*/
each(callback?: (item: AccountInstance, done: (err?: Error) => void) => void): void;
/**
* Streams AccountInstance records from the API.
*
Expand All @@ -114,6 +135,17 @@ interface AccountListInstance {
* @param sid - Fetch by unique Account Sid
*/
get(sid: string): AccountContext;
/**
* Retrieve a single target page of AccountInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
getPage(callback?: (error: Error | null, items: AccountPage) => any): Promise<AccountPage>;
/**
* Retrieve a single target page of AccountInstance records from the API.
*
Expand All @@ -126,6 +158,15 @@ interface AccountListInstance {
* @param callback - Callback to handle list of records
*/
getPage(targetUrl?: string, callback?: (error: Error | null, items: AccountPage) => any): Promise<AccountPage>;
/**
* Lists AccountInstance records from the API as a list.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
list(callback?: (error: Error | null, items: AccountInstance[]) => any): Promise<AccountInstance[]>;
/**
* Lists AccountInstance records from the API as a list.
*
Expand All @@ -136,6 +177,17 @@ interface AccountListInstance {
* @param callback - Callback to handle list of records
*/
list(opts?: AccountListInstanceOptions, callback?: (error: Error | null, items: AccountInstance[]) => any): Promise<AccountInstance[]>;
/**
* Retrieve a single page of AccountInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param callback - Callback to handle list of records
*/
page(callback?: (error: Error | null, items: AccountPage) => any): Promise<AccountPage>;
/**
* Retrieve a single page of AccountInstance records from the API.
*
Expand Down Expand Up @@ -293,6 +345,12 @@ declare class AccountContext {
toJSON(): any;
tokens: TokenListInstance;
transcriptions: TranscriptionListInstance;
/**
* update a AccountInstance
*
* @param callback - Callback to handle processed record
*/
update(callback?: (error: Error | null, items: AccountInstance) => any): Promise<AccountInstance>;
/**
* update a AccountInstance
*
Expand Down Expand Up @@ -423,6 +481,12 @@ declare class AccountInstance extends SerializableClass {
*/
transcriptions(): TranscriptionListInstance;
type: AccountType;
/**
* update a AccountInstance
*
* @param callback - Callback to handle processed record
*/
update(callback?: (error: Error | null, items: AccountInstance) => any): Promise<AccountInstance>;
/**
* update a AccountInstance
*
Expand Down
Loading