-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing inventory resources and methods
- Loading branch information
1 parent
4b029f3
commit 2d203d6
Showing
23 changed files
with
664 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
|
||
export const AvailablePhoneNumbersBlocks = TelnyxResource.extend({ | ||
path: 'available_phone_number_blocks', | ||
includeBasic: ['list'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,39 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
import {ResponsePayload, TelnyxObject} from '../Types'; | ||
import * as utils from '../utils'; | ||
|
||
const telnyxMethod = TelnyxResource.method; | ||
|
||
function transformResponseData( | ||
response: ResponsePayload, | ||
telnyx: TelnyxObject, | ||
) { | ||
return utils.addResourceToResponseData(response, telnyx, 'numberOrders', { | ||
update: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '/{number_order_id}', | ||
urlParams: ['number_order_id'], | ||
paramsValues: [response.data.id as string], | ||
paramsNames: ['number_order_id'], | ||
}), | ||
}); | ||
} | ||
|
||
export const NumberOrders = TelnyxResource.extend({ | ||
path: 'number_orders', | ||
includeBasic: ['list', 'retrieve', 'create', 'update'], | ||
includeBasic: ['list', 'update'], | ||
|
||
create: telnyxMethod({ | ||
method: 'POST', | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
|
||
retrieve: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{number_order_id}', | ||
urlParams: ['number_order_id'], | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,110 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
const telnyxMethod = TelnyxResource.method; | ||
import {ResponsePayload, TelnyxObject} from '../Types'; | ||
import * as utils from '../utils'; | ||
|
||
import {PhoneNumbersMessaging} from './PhoneNumbersMessaging'; | ||
import {PhoneNumbersVoice} from './PhoneNumbersVoice'; | ||
import {PhoneNumbersInboundChannels} from './PhoneNumbersInboundChannels'; | ||
|
||
const telnyxMethod = TelnyxResource.method; | ||
|
||
function transformResponseData( | ||
response: ResponsePayload, | ||
telnyx: TelnyxObject, | ||
) { | ||
return utils.addResourceToResponseData(response, telnyx, 'phoneNumbers', { | ||
del: telnyxMethod({ | ||
method: 'DELETE', | ||
path: '/{intId}', | ||
urlParams: ['intId'], | ||
paramsValues: [response.data.id as string], | ||
paramsNames: ['intId'], | ||
}), | ||
|
||
update: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '/{intId}', | ||
urlParams: ['intId'], | ||
paramsValues: [response.data.id as string], | ||
paramsNames: ['intId'], | ||
}), | ||
}); | ||
} | ||
|
||
export const PhoneNumbers = TelnyxResource.extend({ | ||
path: 'phone_numbers', | ||
includeBasic: ['list', 'retrieve', 'update', 'del'], | ||
includeBasic: ['list', 'update', 'del'], | ||
|
||
nestedResources: { | ||
Messaging: PhoneNumbersMessaging, | ||
Voice: PhoneNumbersVoice, | ||
Inbound: PhoneNumbersInboundChannels, | ||
}, | ||
|
||
retrieveVoiceSettings: telnyxMethod({ | ||
retrieve: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{id}/voice', | ||
path: '/{id}', | ||
urlParams: ['id'], | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
|
||
retrieveVoiceSettings: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{intId}/voice', | ||
urlParams: ['intId'], | ||
paramsNames: ['intId'], | ||
methodType: 'retrieve', | ||
}), | ||
|
||
updateVoiceSettings: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '/{id}/voice', | ||
urlParams: ['id'], | ||
path: '/{intId}/voice', | ||
urlParams: ['intId'], | ||
paramsNames: ['intId'], | ||
}), | ||
|
||
retrieveMessagingSettings: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{id}/messaging', | ||
urlParams: ['id'], | ||
path: '/{intId}/messaging', | ||
urlParams: ['intId'], | ||
paramsNames: ['intId'], | ||
methodType: 'retrieve', | ||
}), | ||
|
||
updateMessagingSettings: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '/{id}/messaging', | ||
urlParams: ['id'], | ||
path: '/{intId}/messaging', | ||
urlParams: ['intId'], | ||
paramsNames: ['intId'], | ||
}), | ||
|
||
setEmergencySettings: telnyxMethod({ | ||
enableEmergencySettings: telnyxMethod({ | ||
method: 'POST', | ||
path: '/{id}/actions/enable_emergency', | ||
urlParams: ['id'], | ||
path: '/{intId}/actions/enable_emergency', | ||
urlParams: ['intId'], | ||
paramsNames: ['intId'], | ||
}), | ||
|
||
retrieveVoicemail: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{phone_number_id}/voicemail', | ||
urlParams: ['phone_number_id'], | ||
paramsNames: ['phone_number_id'], | ||
methodType: 'retrieve', | ||
}), | ||
|
||
createVoicemail: telnyxMethod({ | ||
method: 'POST', | ||
path: '/{phone_number_id}/voicemail', | ||
urlParams: ['phone_number_id'], | ||
paramsNames: ['phone_number_id'], | ||
}), | ||
|
||
updateVoicemail: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '/{phone_number_id}/voicemail', | ||
urlParams: ['phone_number_id'], | ||
paramsNames: ['phone_number_id'], | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,13 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
import * as utils from '../utils'; | ||
const telnyxMethod = TelnyxResource.method; | ||
|
||
import {ResponsePayload, TelnyxObject} from '../Types'; | ||
|
||
function transformResponseData( | ||
response: ResponsePayload, | ||
telnyx: TelnyxObject, | ||
) { | ||
return utils.addResourceToResponseData( | ||
response, | ||
telnyx, | ||
'phoneNumbersInboundChannels', | ||
{ | ||
update: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '', | ||
urlParams: ['channels'], | ||
paramsValues: [response.data.id as string], | ||
paramsNames: ['channels'], | ||
}), | ||
}, | ||
); | ||
} | ||
const telnyxMethod = TelnyxResource.method; | ||
|
||
export const PhoneNumbersInboundChannels = TelnyxResource.extend({ | ||
path: 'phone_numbers/inbound_channels', | ||
includeBasic: ['list'], | ||
|
||
retrieve: telnyxMethod({ | ||
method: 'GET', | ||
path: '', | ||
urlParams: [], | ||
|
||
transformResponseData: transformResponseData, | ||
update: telnyxMethod({ | ||
method: 'PATCH', | ||
methodType: 'update', | ||
}), | ||
}); |
3 changes: 1 addition & 2 deletions
3
...rces/PhoneNumberRegulatoryRequirements.ts → ...ces/PhoneNumbersRegulatoryRequirements.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
|
||
export const PhoneNumberRegulatoryRequirements = TelnyxResource.extend({ | ||
export const PhoneNumbersRegulatoryRequirements = TelnyxResource.extend({ | ||
path: 'phone_numbers_regulatory_requirements', | ||
|
||
includeBasic: ['list'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
|
||
export const PhoneNumbersSlim = TelnyxResource.extend({ | ||
path: 'phone_numbers/slim', | ||
includeBasic: ['list'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.