├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── feature-request.yml └── workflows │ ├── pr-lint.yml │ └── test-and-deploy.yml ├── .gitignore ├── .jshintignore ├── .jshintrc ├── .nycrc.json ├── .prettierignore ├── CHANGES.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── ISSUE_TEMPLATE.md ├── LICENSE ├── Makefile ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── UPGRADE.md ├── VERSIONS.md ├── advanced-examples └── custom-http-client.md ├── babel.config.js ├── examples ├── example.js ├── express.js ├── orgs_api.js ├── pkcv.js ├── public_oauth.js └── typescript │ └── example.ts ├── index.d.ts ├── index.js ├── package.json ├── sonar-project.properties ├── spec ├── cluster │ ├── orgs_api.spec.ts │ ├── package.json │ ├── public_oauth.spec.ts │ ├── test.spec.ts │ ├── tsconfig.json │ └── webhook.spec.ts ├── integration.spec.js ├── integration │ └── holodeck.js ├── unit │ ├── auth_strategy │ │ ├── BasicAuthStrategy.spec.ts │ │ ├── NoAuthStrategy.spec.ts │ │ └── TokenAuthStrategy.spec.ts │ ├── base │ │ ├── RequestClient.spec.js │ │ ├── RestException.spec.ts │ │ ├── Version.spec.js │ │ ├── deserialize.spec.js │ │ ├── serialize.spec.js │ │ └── utility.spec.ts │ ├── credential_provider │ │ ├── ClientCredentialProvider.spec.ts │ │ ├── NoAuthCredentialProvider.spec.ts │ │ └── OrgsCredentialProvider.spec.ts │ ├── http │ │ └── bearer_token │ │ │ ├── ApiTokenManager.spec.ts │ │ │ └── OrgsTokenManager.spec.ts │ ├── jwt │ │ ├── AccessToken.spec.js │ │ ├── ClientCapability.spec.js │ │ ├── taskrouter │ │ │ ├── TaskRouterCapability.spec.js │ │ │ └── util.spec.js │ │ └── validation │ │ │ └── ValidationToken.spec.js │ ├── rest │ │ ├── Twilio.spec.js │ │ └── incomingPhoneNumber.spec.js │ ├── twiml │ │ ├── MessagingResponse.spec.js │ │ └── VoiceResponse.spec.js │ └── webhooks │ │ └── webhooks.spec.js └── validation.spec.js ├── src ├── auth_strategy │ ├── AuthStrategy.ts │ ├── BasicAuthStrategy.ts │ ├── NoAuthStrategy.ts │ └── TokenAuthStrategy.ts ├── base │ ├── BaseTwilio.ts │ ├── Domain.ts │ ├── Page.ts │ ├── RequestClient.ts │ ├── RestException.ts │ ├── ValidationClient.ts │ ├── Version.ts │ ├── deserialize.ts │ ├── serialize.ts │ ├── utility.ts │ └── values.ts ├── credential_provider │ ├── ClientCredentialProvider.ts │ ├── CredentialProvider.ts │ ├── NoAuthCredentialProvider.ts │ └── OrgsCredentialProvider.ts ├── http │ ├── bearer_token │ │ ├── ApiTokenManager.ts │ │ ├── OrgsTokenManager.ts │ │ └── TokenManager.ts │ ├── request.ts │ └── response.ts ├── index.ts ├── interfaces.ts ├── jwt │ ├── AccessToken.ts │ ├── ClientCapability.ts │ ├── taskrouter │ │ ├── TaskRouterCapability.ts │ │ └── util.ts │ └── validation │ │ ├── RequestCanonicalizer.ts │ │ └── ValidationToken.ts ├── rest │ ├── Accounts.ts │ ├── AccountsBase.ts │ ├── Api.ts │ ├── ApiBase.ts │ ├── Assistants.ts │ ├── AssistantsBase.ts │ ├── Bulkexports.ts │ ├── BulkexportsBase.ts │ ├── Chat.ts │ ├── ChatBase.ts │ ├── Content.ts │ ├── ContentBase.ts │ ├── Conversations.ts │ ├── ConversationsBase.ts │ ├── Events.ts │ ├── EventsBase.ts │ ├── FlexApi.ts │ ├── FlexApiBase.ts │ ├── FrontlineApi.ts │ ├── FrontlineApiBase.ts │ ├── Iam.ts │ ├── IamBase.ts │ ├── Insights.ts │ ├── InsightsBase.ts │ ├── Intelligence.ts │ ├── IntelligenceBase.ts │ ├── IpMessaging.ts │ ├── IpMessagingBase.ts │ ├── Knowledge.ts │ ├── KnowledgeBase.ts │ ├── Lookups.ts │ ├── LookupsBase.ts │ ├── Marketplace.ts │ ├── MarketplaceBase.ts │ ├── Messaging.ts │ ├── MessagingBase.ts │ ├── Microvisor.ts │ ├── MicrovisorBase.ts │ ├── Monitor.ts │ ├── MonitorBase.ts │ ├── Notify.ts │ ├── NotifyBase.ts │ ├── Numbers.ts │ ├── NumbersBase.ts │ ├── Oauth.ts │ ├── OauthBase.ts │ ├── Preview.ts │ ├── PreviewBase.ts │ ├── PreviewIam.ts │ ├── PreviewIamBase.ts │ ├── Pricing.ts │ ├── PricingBase.ts │ ├── Proxy.ts │ ├── ProxyBase.ts │ ├── Routes.ts │ ├── RoutesBase.ts │ ├── Serverless.ts │ ├── ServerlessBase.ts │ ├── Studio.ts │ ├── StudioBase.ts │ ├── Supersim.ts │ ├── SupersimBase.ts │ ├── Sync.ts │ ├── SyncBase.ts │ ├── Taskrouter.ts │ ├── TaskrouterBase.ts │ ├── Trunking.ts │ ├── TrunkingBase.ts │ ├── Trusthub.ts │ ├── TrusthubBase.ts │ ├── Twilio.ts │ ├── Verify.ts │ ├── VerifyBase.ts │ ├── Video.ts │ ├── VideoBase.ts │ ├── Voice.ts │ ├── VoiceBase.ts │ ├── Wireless.ts │ ├── WirelessBase.ts │ ├── accounts │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── authTokenPromotion.ts │ │ │ ├── bulkConsents.ts │ │ │ ├── bulkContacts.ts │ │ │ ├── credential.ts │ │ │ ├── credential │ │ │ ├── aws.ts │ │ │ └── publicKey.ts │ │ │ ├── safelist.ts │ │ │ └── secondaryAuthToken.ts │ ├── api │ │ ├── V2010.ts │ │ └── v2010 │ │ │ ├── account.ts │ │ │ └── account │ │ │ ├── address.ts │ │ │ ├── address │ │ │ └── dependentPhoneNumber.ts │ │ │ ├── application.ts │ │ │ ├── authorizedConnectApp.ts │ │ │ ├── availablePhoneNumberCountry.ts │ │ │ ├── availablePhoneNumberCountry │ │ │ ├── local.ts │ │ │ ├── machineToMachine.ts │ │ │ ├── mobile.ts │ │ │ ├── national.ts │ │ │ ├── sharedCost.ts │ │ │ ├── tollFree.ts │ │ │ └── voip.ts │ │ │ ├── balance.ts │ │ │ ├── call.ts │ │ │ ├── call │ │ │ ├── event.ts │ │ │ ├── notification.ts │ │ │ ├── payment.ts │ │ │ ├── recording.ts │ │ │ ├── siprec.ts │ │ │ ├── stream.ts │ │ │ ├── transcription.ts │ │ │ ├── userDefinedMessage.ts │ │ │ └── userDefinedMessageSubscription.ts │ │ │ ├── conference.ts │ │ │ ├── conference │ │ │ ├── participant.ts │ │ │ └── recording.ts │ │ │ ├── connectApp.ts │ │ │ ├── incomingPhoneNumber.ts │ │ │ ├── incomingPhoneNumber │ │ │ ├── assignedAddOn.ts │ │ │ ├── assignedAddOn │ │ │ │ └── assignedAddOnExtension.ts │ │ │ ├── local.ts │ │ │ ├── mobile.ts │ │ │ └── tollFree.ts │ │ │ ├── key.ts │ │ │ ├── message.ts │ │ │ ├── message │ │ │ ├── feedback.ts │ │ │ └── media.ts │ │ │ ├── newKey.ts │ │ │ ├── newSigningKey.ts │ │ │ ├── notification.ts │ │ │ ├── outgoingCallerId.ts │ │ │ ├── queue.ts │ │ │ ├── queue │ │ │ └── member.ts │ │ │ ├── recording.ts │ │ │ ├── recording │ │ │ ├── addOnResult.ts │ │ │ ├── addOnResult │ │ │ │ ├── payload.ts │ │ │ │ └── payload │ │ │ │ │ └── data.ts │ │ │ └── transcription.ts │ │ │ ├── shortCode.ts │ │ │ ├── signingKey.ts │ │ │ ├── sip.ts │ │ │ ├── sip │ │ │ ├── credentialList.ts │ │ │ ├── credentialList │ │ │ │ └── credential.ts │ │ │ ├── domain.ts │ │ │ ├── domain │ │ │ │ ├── authTypes.ts │ │ │ │ ├── authTypes │ │ │ │ │ ├── authTypeCalls.ts │ │ │ │ │ ├── authTypeCalls │ │ │ │ │ │ ├── authCallsCredentialListMapping.ts │ │ │ │ │ │ └── authCallsIpAccessControlListMapping.ts │ │ │ │ │ ├── authTypeRegistrations.ts │ │ │ │ │ └── authTypeRegistrations │ │ │ │ │ │ └── authRegistrationsCredentialListMapping.ts │ │ │ │ ├── credentialListMapping.ts │ │ │ │ └── ipAccessControlListMapping.ts │ │ │ ├── ipAccessControlList.ts │ │ │ └── ipAccessControlList │ │ │ │ └── ipAddress.ts │ │ │ ├── token.ts │ │ │ ├── transcription.ts │ │ │ ├── usage.ts │ │ │ ├── usage │ │ │ ├── record.ts │ │ │ ├── record │ │ │ │ ├── allTime.ts │ │ │ │ ├── daily.ts │ │ │ │ ├── lastMonth.ts │ │ │ │ ├── monthly.ts │ │ │ │ ├── thisMonth.ts │ │ │ │ ├── today.ts │ │ │ │ ├── yearly.ts │ │ │ │ └── yesterday.ts │ │ │ └── trigger.ts │ │ │ └── validationRequest.ts │ ├── assistants │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── assistant.ts │ │ │ ├── assistant │ │ │ ├── assistantsKnowledge.ts │ │ │ ├── assistantsTool.ts │ │ │ ├── feedback.ts │ │ │ └── message.ts │ │ │ ├── knowledge.ts │ │ │ ├── knowledge │ │ │ ├── chunk.ts │ │ │ └── knowledgeStatus.ts │ │ │ ├── policy.ts │ │ │ ├── session.ts │ │ │ ├── session │ │ │ └── message.ts │ │ │ └── tool.ts │ ├── bulkexports │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── export.ts │ │ │ ├── export │ │ │ ├── day.ts │ │ │ ├── exportCustomJob.ts │ │ │ └── job.ts │ │ │ └── exportConfiguration.ts │ ├── chat │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── V3.ts │ │ ├── v1 │ │ │ ├── credential.ts │ │ │ ├── service.ts │ │ │ └── service │ │ │ │ ├── channel.ts │ │ │ │ ├── channel │ │ │ │ ├── invite.ts │ │ │ │ ├── member.ts │ │ │ │ └── message.ts │ │ │ │ ├── role.ts │ │ │ │ ├── user.ts │ │ │ │ └── user │ │ │ │ └── userChannel.ts │ │ ├── v2 │ │ │ ├── credential.ts │ │ │ ├── service.ts │ │ │ └── service │ │ │ │ ├── binding.ts │ │ │ │ ├── channel.ts │ │ │ │ ├── channel │ │ │ │ ├── invite.ts │ │ │ │ ├── member.ts │ │ │ │ ├── message.ts │ │ │ │ └── webhook.ts │ │ │ │ ├── role.ts │ │ │ │ ├── user.ts │ │ │ │ └── user │ │ │ │ ├── userBinding.ts │ │ │ │ └── userChannel.ts │ │ └── v3 │ │ │ └── channel.ts │ ├── content │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── content.ts │ │ │ ├── content │ │ │ │ ├── approvalCreate.ts │ │ │ │ └── approvalFetch.ts │ │ │ ├── contentAndApprovals.ts │ │ │ └── legacyContent.ts │ │ └── v2 │ │ │ ├── content.ts │ │ │ └── contentAndApprovals.ts │ ├── conversations │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── addressConfiguration.ts │ │ │ ├── configuration.ts │ │ │ ├── configuration │ │ │ └── webhook.ts │ │ │ ├── conversation.ts │ │ │ ├── conversation │ │ │ ├── message.ts │ │ │ ├── message │ │ │ │ └── deliveryReceipt.ts │ │ │ ├── participant.ts │ │ │ └── webhook.ts │ │ │ ├── conversationWithParticipants.ts │ │ │ ├── credential.ts │ │ │ ├── participantConversation.ts │ │ │ ├── role.ts │ │ │ ├── service.ts │ │ │ ├── service │ │ │ ├── binding.ts │ │ │ ├── configuration.ts │ │ │ ├── configuration │ │ │ │ ├── notification.ts │ │ │ │ └── webhook.ts │ │ │ ├── conversation.ts │ │ │ ├── conversation │ │ │ │ ├── message.ts │ │ │ │ ├── message │ │ │ │ │ └── deliveryReceipt.ts │ │ │ │ ├── participant.ts │ │ │ │ └── webhook.ts │ │ │ ├── conversationWithParticipants.ts │ │ │ ├── participantConversation.ts │ │ │ ├── role.ts │ │ │ ├── user.ts │ │ │ └── user │ │ │ │ └── userConversation.ts │ │ │ ├── user.ts │ │ │ └── user │ │ │ └── userConversation.ts │ ├── events │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── eventType.ts │ │ │ ├── schema.ts │ │ │ ├── schema │ │ │ └── schemaVersion.ts │ │ │ ├── sink.ts │ │ │ ├── sink │ │ │ ├── sinkTest.ts │ │ │ └── sinkValidate.ts │ │ │ ├── subscription.ts │ │ │ └── subscription │ │ │ └── subscribedEvent.ts │ ├── flexApi │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── assessments.ts │ │ │ ├── channel.ts │ │ │ ├── configuration.ts │ │ │ ├── flexFlow.ts │ │ │ ├── insightsAssessmentsComment.ts │ │ │ ├── insightsConversations.ts │ │ │ ├── insightsQuestionnaires.ts │ │ │ ├── insightsQuestionnairesCategory.ts │ │ │ ├── insightsQuestionnairesQuestion.ts │ │ │ ├── insightsSegments.ts │ │ │ ├── insightsSession.ts │ │ │ ├── insightsSettingsAnswerSets.ts │ │ │ ├── insightsSettingsComment.ts │ │ │ ├── insightsUserRoles.ts │ │ │ ├── interaction.ts │ │ │ ├── interaction │ │ │ │ ├── interactionChannel.ts │ │ │ │ └── interactionChannel │ │ │ │ │ ├── interactionChannelInvite.ts │ │ │ │ │ ├── interactionChannelParticipant.ts │ │ │ │ │ └── interactionTransfer.ts │ │ │ ├── plugin.ts │ │ │ ├── plugin │ │ │ │ └── pluginVersions.ts │ │ │ ├── pluginArchive.ts │ │ │ ├── pluginConfiguration.ts │ │ │ ├── pluginConfiguration │ │ │ │ └── configuredPlugin.ts │ │ │ ├── pluginConfigurationArchive.ts │ │ │ ├── pluginRelease.ts │ │ │ ├── pluginVersionArchive.ts │ │ │ ├── provisioningStatus.ts │ │ │ └── webChannel.ts │ │ └── v2 │ │ │ ├── flexUser.ts │ │ │ └── webChannels.ts │ ├── frontlineApi │ │ ├── V1.ts │ │ └── v1 │ │ │ └── user.ts │ ├── iam │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── apiKey.ts │ │ │ ├── getApiKeys.ts │ │ │ ├── newApiKey.ts │ │ │ └── token.ts │ ├── insights │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── call.ts │ │ │ ├── call │ │ │ ├── annotation.ts │ │ │ ├── callSummary.ts │ │ │ ├── event.ts │ │ │ └── metric.ts │ │ │ ├── callSummaries.ts │ │ │ ├── conference.ts │ │ │ ├── conference │ │ │ └── conferenceParticipant.ts │ │ │ ├── room.ts │ │ │ ├── room │ │ │ └── participant.ts │ │ │ └── setting.ts │ ├── intelligence │ │ ├── V2.ts │ │ └── v2 │ │ │ ├── customOperator.ts │ │ │ ├── operator.ts │ │ │ ├── operatorAttachment.ts │ │ │ ├── operatorAttachments.ts │ │ │ ├── operatorType.ts │ │ │ ├── prebuiltOperator.ts │ │ │ ├── service.ts │ │ │ ├── transcript.ts │ │ │ └── transcript │ │ │ ├── media.ts │ │ │ ├── operatorResult.ts │ │ │ └── sentence.ts │ ├── ipMessaging │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── credential.ts │ │ │ ├── service.ts │ │ │ └── service │ │ │ │ ├── channel.ts │ │ │ │ ├── channel │ │ │ │ ├── invite.ts │ │ │ │ ├── member.ts │ │ │ │ └── message.ts │ │ │ │ ├── role.ts │ │ │ │ ├── user.ts │ │ │ │ └── user │ │ │ │ └── userChannel.ts │ │ └── v2 │ │ │ ├── credential.ts │ │ │ ├── service.ts │ │ │ └── service │ │ │ ├── binding.ts │ │ │ ├── channel.ts │ │ │ ├── channel │ │ │ ├── invite.ts │ │ │ ├── member.ts │ │ │ ├── message.ts │ │ │ └── webhook.ts │ │ │ ├── role.ts │ │ │ ├── user.ts │ │ │ └── user │ │ │ ├── userBinding.ts │ │ │ └── userChannel.ts │ ├── knowledge │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── knowledge.ts │ │ │ └── knowledge │ │ │ ├── chunk.ts │ │ │ └── knowledgeStatus.ts │ ├── lookups │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ └── phoneNumber.ts │ │ └── v2 │ │ │ └── phoneNumber.ts │ ├── marketplace │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── availableAddOn.ts │ │ │ ├── availableAddOn │ │ │ └── availableAddOnExtension.ts │ │ │ ├── installedAddOn.ts │ │ │ ├── installedAddOn │ │ │ ├── installedAddOnExtension.ts │ │ │ └── installedAddOnUsage.ts │ │ │ ├── moduleData.ts │ │ │ ├── moduleDataManagement.ts │ │ │ └── referralConversion.ts │ ├── messaging │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── brandRegistration.ts │ │ │ ├── brandRegistration │ │ │ │ ├── brandRegistrationOtp.ts │ │ │ │ └── brandVetting.ts │ │ │ ├── deactivations.ts │ │ │ ├── domainCerts.ts │ │ │ ├── domainConfig.ts │ │ │ ├── domainConfigMessagingService.ts │ │ │ ├── externalCampaign.ts │ │ │ ├── linkshorteningMessagingService.ts │ │ │ ├── linkshorteningMessagingServiceDomainAssociation.ts │ │ │ ├── requestManagedCert.ts │ │ │ ├── service.ts │ │ │ ├── service │ │ │ │ ├── alphaSender.ts │ │ │ │ ├── channelSender.ts │ │ │ │ ├── destinationAlphaSender.ts │ │ │ │ ├── phoneNumber.ts │ │ │ │ ├── shortCode.ts │ │ │ │ ├── usAppToPerson.ts │ │ │ │ └── usAppToPersonUsecase.ts │ │ │ ├── tollfreeVerification.ts │ │ │ └── usecase.ts │ │ └── v2 │ │ │ └── channelsSender.ts │ ├── microvisor │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── accountConfig.ts │ │ │ ├── accountSecret.ts │ │ │ ├── app.ts │ │ │ ├── app │ │ │ └── appManifest.ts │ │ │ ├── device.ts │ │ │ └── device │ │ │ ├── deviceConfig.ts │ │ │ └── deviceSecret.ts │ ├── monitor │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── alert.ts │ │ │ └── event.ts │ ├── notify │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── credential.ts │ │ │ ├── service.ts │ │ │ └── service │ │ │ ├── binding.ts │ │ │ └── notification.ts │ ├── numbers │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── bulkEligibility.ts │ │ │ ├── eligibility.ts │ │ │ ├── portingPortIn.ts │ │ │ ├── portingPortInPhoneNumber.ts │ │ │ ├── portingPortability.ts │ │ │ ├── portingWebhookConfiguration.ts │ │ │ ├── portingWebhookConfigurationDelete.ts │ │ │ ├── signingRequestConfiguration.ts │ │ │ └── webhook.ts │ │ └── v2 │ │ │ ├── authorizationDocument.ts │ │ │ ├── authorizationDocument │ │ │ └── dependentHostedNumberOrder.ts │ │ │ ├── bulkHostedNumberOrder.ts │ │ │ ├── bundleClone.ts │ │ │ ├── hostedNumberOrder.ts │ │ │ ├── regulatoryCompliance.ts │ │ │ └── regulatoryCompliance │ │ │ ├── bundle.ts │ │ │ ├── bundle │ │ │ ├── bundleCopy.ts │ │ │ ├── evaluation.ts │ │ │ ├── itemAssignment.ts │ │ │ └── replaceItems.ts │ │ │ ├── endUser.ts │ │ │ ├── endUserType.ts │ │ │ ├── regulation.ts │ │ │ ├── supportingDocument.ts │ │ │ └── supportingDocumentType.ts │ ├── oauth │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── authorize.ts │ │ │ └── token.ts │ ├── preview │ │ ├── HostedNumbers.ts │ │ ├── Marketplace.ts │ │ ├── Wireless.ts │ │ ├── hosted_numbers │ │ │ ├── authorizationDocument.ts │ │ │ ├── authorizationDocument │ │ │ │ └── dependentHostedNumberOrder.ts │ │ │ └── hostedNumberOrder.ts │ │ ├── marketplace │ │ │ ├── availableAddOn.ts │ │ │ ├── availableAddOn │ │ │ │ └── availableAddOnExtension.ts │ │ │ ├── installedAddOn.ts │ │ │ └── installedAddOn │ │ │ │ └── installedAddOnExtension.ts │ │ └── wireless │ │ │ ├── command.ts │ │ │ ├── ratePlan.ts │ │ │ ├── sim.ts │ │ │ └── sim │ │ │ └── usage.ts │ ├── previewIam │ │ ├── V1.ts │ │ ├── Versionless.ts │ │ ├── v1 │ │ │ ├── authorize.ts │ │ │ └── token.ts │ │ └── versionless │ │ │ ├── organization.ts │ │ │ └── organization │ │ │ ├── account.ts │ │ │ ├── roleAssignment.ts │ │ │ └── user.ts │ ├── pricing │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── messaging.ts │ │ │ ├── messaging │ │ │ │ └── country.ts │ │ │ ├── phoneNumber.ts │ │ │ ├── phoneNumber │ │ │ │ └── country.ts │ │ │ ├── voice.ts │ │ │ └── voice │ │ │ │ ├── country.ts │ │ │ │ └── number.ts │ │ └── v2 │ │ │ ├── country.ts │ │ │ ├── number.ts │ │ │ ├── voice.ts │ │ │ └── voice │ │ │ ├── country.ts │ │ │ └── number.ts │ ├── proxy │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── service.ts │ │ │ └── service │ │ │ ├── phoneNumber.ts │ │ │ ├── session.ts │ │ │ ├── session │ │ │ ├── interaction.ts │ │ │ ├── participant.ts │ │ │ └── participant │ │ │ │ └── messageInteraction.ts │ │ │ └── shortCode.ts │ ├── routes │ │ ├── V2.ts │ │ └── v2 │ │ │ ├── phoneNumber.ts │ │ │ ├── sipDomain.ts │ │ │ └── trunk.ts │ ├── serverless │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── service.ts │ │ │ └── service │ │ │ ├── asset.ts │ │ │ ├── asset │ │ │ └── assetVersion.ts │ │ │ ├── build.ts │ │ │ ├── build │ │ │ └── buildStatus.ts │ │ │ ├── environment.ts │ │ │ ├── environment │ │ │ ├── deployment.ts │ │ │ ├── log.ts │ │ │ └── variable.ts │ │ │ ├── function.ts │ │ │ └── function │ │ │ ├── functionVersion.ts │ │ │ └── functionVersion │ │ │ └── functionVersionContent.ts │ ├── studio │ │ ├── V1.ts │ │ ├── V2.ts │ │ ├── v1 │ │ │ ├── flow.ts │ │ │ └── flow │ │ │ │ ├── engagement.ts │ │ │ │ ├── engagement │ │ │ │ ├── engagementContext.ts │ │ │ │ ├── step.ts │ │ │ │ └── step │ │ │ │ │ └── stepContext.ts │ │ │ │ ├── execution.ts │ │ │ │ └── execution │ │ │ │ ├── executionContext.ts │ │ │ │ ├── executionStep.ts │ │ │ │ └── executionStep │ │ │ │ └── executionStepContext.ts │ │ └── v2 │ │ │ ├── flow.ts │ │ │ ├── flow │ │ │ ├── execution.ts │ │ │ ├── execution │ │ │ │ ├── executionContext.ts │ │ │ │ ├── executionStep.ts │ │ │ │ └── executionStep │ │ │ │ │ └── executionStepContext.ts │ │ │ ├── flowRevision.ts │ │ │ └── flowTestUser.ts │ │ │ └── flowValidate.ts │ ├── supersim │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── esimProfile.ts │ │ │ ├── fleet.ts │ │ │ ├── ipCommand.ts │ │ │ ├── network.ts │ │ │ ├── networkAccessProfile.ts │ │ │ ├── networkAccessProfile │ │ │ └── networkAccessProfileNetwork.ts │ │ │ ├── settingsUpdate.ts │ │ │ ├── sim.ts │ │ │ ├── sim │ │ │ ├── billingPeriod.ts │ │ │ └── simIpAddress.ts │ │ │ ├── smsCommand.ts │ │ │ └── usageRecord.ts │ ├── sync │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── service.ts │ │ │ └── service │ │ │ ├── document.ts │ │ │ ├── document │ │ │ └── documentPermission.ts │ │ │ ├── syncList.ts │ │ │ ├── syncList │ │ │ ├── syncListItem.ts │ │ │ └── syncListPermission.ts │ │ │ ├── syncMap.ts │ │ │ ├── syncMap │ │ │ ├── syncMapItem.ts │ │ │ └── syncMapPermission.ts │ │ │ ├── syncStream.ts │ │ │ └── syncStream │ │ │ └── streamMessage.ts │ ├── taskrouter │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── workspace.ts │ │ │ └── workspace │ │ │ ├── activity.ts │ │ │ ├── event.ts │ │ │ ├── task.ts │ │ │ ├── task │ │ │ └── reservation.ts │ │ │ ├── taskChannel.ts │ │ │ ├── taskQueue.ts │ │ │ ├── taskQueue │ │ │ ├── taskQueueBulkRealTimeStatistics.ts │ │ │ ├── taskQueueCumulativeStatistics.ts │ │ │ ├── taskQueueRealTimeStatistics.ts │ │ │ ├── taskQueueStatistics.ts │ │ │ └── taskQueuesStatistics.ts │ │ │ ├── worker.ts │ │ │ ├── worker │ │ │ ├── reservation.ts │ │ │ ├── workerChannel.ts │ │ │ ├── workerStatistics.ts │ │ │ ├── workersCumulativeStatistics.ts │ │ │ ├── workersRealTimeStatistics.ts │ │ │ └── workersStatistics.ts │ │ │ ├── workflow.ts │ │ │ ├── workflow │ │ │ ├── workflowCumulativeStatistics.ts │ │ │ ├── workflowRealTimeStatistics.ts │ │ │ └── workflowStatistics.ts │ │ │ ├── workspaceCumulativeStatistics.ts │ │ │ ├── workspaceRealTimeStatistics.ts │ │ │ └── workspaceStatistics.ts │ ├── trunking │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── trunk.ts │ │ │ └── trunk │ │ │ ├── credentialList.ts │ │ │ ├── ipAccessControlList.ts │ │ │ ├── originationUrl.ts │ │ │ ├── phoneNumber.ts │ │ │ └── recording.ts │ ├── trusthub │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── complianceInquiries.ts │ │ │ ├── complianceRegistrationInquiries.ts │ │ │ ├── complianceTollfreeInquiries.ts │ │ │ ├── customerProfiles.ts │ │ │ ├── customerProfiles │ │ │ ├── customerProfilesChannelEndpointAssignment.ts │ │ │ ├── customerProfilesEntityAssignments.ts │ │ │ └── customerProfilesEvaluations.ts │ │ │ ├── endUser.ts │ │ │ ├── endUserType.ts │ │ │ ├── policies.ts │ │ │ ├── supportingDocument.ts │ │ │ ├── supportingDocumentType.ts │ │ │ ├── trustProducts.ts │ │ │ └── trustProducts │ │ │ ├── trustProductsChannelEndpointAssignment.ts │ │ │ ├── trustProductsEntityAssignments.ts │ │ │ └── trustProductsEvaluations.ts │ ├── verify │ │ ├── V2.ts │ │ └── v2 │ │ │ ├── form.ts │ │ │ ├── safelist.ts │ │ │ ├── service.ts │ │ │ ├── service │ │ │ ├── accessToken.ts │ │ │ ├── entity.ts │ │ │ ├── entity │ │ │ │ ├── challenge.ts │ │ │ │ ├── challenge │ │ │ │ │ └── notification.ts │ │ │ │ ├── factor.ts │ │ │ │ └── newFactor.ts │ │ │ ├── messagingConfiguration.ts │ │ │ ├── rateLimit.ts │ │ │ ├── rateLimit │ │ │ │ └── bucket.ts │ │ │ ├── verification.ts │ │ │ ├── verificationCheck.ts │ │ │ └── webhook.ts │ │ │ ├── template.ts │ │ │ ├── verificationAttempt.ts │ │ │ └── verificationAttemptsSummary.ts │ ├── video │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── composition.ts │ │ │ ├── compositionHook.ts │ │ │ ├── compositionSettings.ts │ │ │ ├── recording.ts │ │ │ ├── recordingSettings.ts │ │ │ ├── room.ts │ │ │ └── room │ │ │ ├── participant.ts │ │ │ ├── participant │ │ │ ├── anonymize.ts │ │ │ ├── publishedTrack.ts │ │ │ ├── subscribeRules.ts │ │ │ └── subscribedTrack.ts │ │ │ ├── recordingRules.ts │ │ │ └── roomRecording.ts │ ├── voice │ │ ├── V1.ts │ │ └── v1 │ │ │ ├── archivedCall.ts │ │ │ ├── byocTrunk.ts │ │ │ ├── connectionPolicy.ts │ │ │ ├── connectionPolicy │ │ │ └── connectionPolicyTarget.ts │ │ │ ├── dialingPermissions.ts │ │ │ ├── dialingPermissions │ │ │ ├── bulkCountryUpdate.ts │ │ │ ├── country.ts │ │ │ ├── country │ │ │ │ └── highriskSpecialPrefix.ts │ │ │ └── settings.ts │ │ │ ├── ipRecord.ts │ │ │ └── sourceIpMapping.ts │ └── wireless │ │ ├── V1.ts │ │ └── v1 │ │ ├── command.ts │ │ ├── ratePlan.ts │ │ ├── sim.ts │ │ ├── sim │ │ ├── dataSession.ts │ │ └── usageRecord.ts │ │ └── usageRecord.ts ├── twiml │ ├── FaxResponse.ts │ ├── MessagingResponse.ts │ ├── TwiML.ts │ └── VoiceResponse.ts └── webhooks │ └── webhooks.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "es6": true 4 | }, 5 | "rules": { 6 | "space-before-function-paren": [ 7 | 2, 8 | { 9 | "anonymous": "ignore", 10 | "named": "never" 11 | } 12 | ], 13 | "no-empty": [ 14 | 2, 15 | { 16 | "allowEmptyCatch": true 17 | } 18 | ], 19 | "no-spaced-func": 2, 20 | "array-bracket-spacing": [ 21 | 2, 22 | "never", 23 | {} 24 | ], 25 | "space-in-parens": [ 26 | 2, 27 | "never" 28 | ], 29 | "quote-props": [ 30 | 2, 31 | "as-needed" 32 | ], 33 | "key-spacing": [ 34 | 2, 35 | { 36 | "beforeColon": false, 37 | "afterColon": true 38 | } 39 | ], 40 | "space-unary-ops": [ 41 | 2, 42 | { 43 | "words": false, 44 | "nonwords": false 45 | } 46 | ], 47 | "no-mixed-spaces-and-tabs": 2, 48 | "no-trailing-spaces": 2, 49 | "comma-dangle": [ 50 | 2, 51 | "always-multiline" 52 | ], 53 | "comma-spacing": [ 54 | 2, 55 | { 56 | "after": true, 57 | "before": false 58 | } 59 | ], 60 | "yoda": [ 61 | 2, 62 | "never" 63 | ], 64 | "no-with": 2, 65 | "brace-style": [ 66 | 2, 67 | "1tbs", 68 | { 69 | "allowSingleLine": true 70 | } 71 | ], 72 | "no-multiple-empty-lines": 2, 73 | "no-multi-str": 2, 74 | "one-var": [ 75 | 2, 76 | "never" 77 | ], 78 | "semi-spacing": [ 79 | 2, 80 | { 81 | "before": false, 82 | "after": true 83 | } 84 | ], 85 | "space-before-blocks": [ 86 | 2, 87 | "always" 88 | ], 89 | "wrap-iife": 2, 90 | "comma-style": [ 91 | 2, 92 | "last" 93 | ], 94 | "space-infix-ops": 2, 95 | "camelcase": 0, 96 | "eol-last": 2, 97 | "dot-notation": 0, 98 | "curly": [ 99 | 2, 100 | "all" 101 | ], 102 | "keyword-spacing": [ 103 | 2, 104 | {} 105 | ], 106 | "semi": [ 107 | 2, 108 | "always" 109 | ], 110 | "consistent-this": [ 111 | 2, 112 | "_this" 113 | ], 114 | "linebreak-style": [ 115 | 2, 116 | "unix" 117 | ], 118 | "quotes": [ 119 | 2, 120 | "double" 121 | ], 122 | "indent": [ 123 | 2, 124 | 2, 125 | { 126 | "SwitchCase": 1 127 | } 128 | ] 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Twilio Support 3 | url: https://twilio.com/help/contact 4 | about: Get Support 5 | - name: Stack Overflow 6 | url: https://stackoverflow.com/questions/tagged/twilio-node+or+twilio+node 7 | about: Ask questions on Stack Overflow 8 | - name: Documentation 9 | url: https://www.twilio.com/docs/libraries/reference/twilio-node 10 | about: View Reference Documentation 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest an idea for twilio-node 3 | title: "[Feature Request]: " 4 | labels: "type: community enhancement" 5 | body: 6 | - type: checkboxes 7 | attributes: 8 | label: Preflight Checklist 9 | description: Please ensure you've completed all of the following. 10 | options: 11 | - label: I have read the [Contributing Guidelines](https://github.com/twilio/twilio-node/blob/main/CONTRIBUTING.md) for this project. 12 | required: true 13 | - label: I agree to follow the [Code of Conduct](https://github.com/twilio/twilio-node/blob/main/CODE_OF_CONDUCT.md) that this project adheres to. 14 | required: true 15 | - label: I have searched the [issue tracker](https://github.com/twilio/twilio-node/issues) for a feature request that matches the one I want to file, without success. 16 | required: true 17 | - label: This is not a general Twilio feature request or bug report. It is a feature request for the twilio-node JavaScript package. 18 | required: true 19 | - type: textarea 20 | attributes: 21 | label: Problem Description 22 | description: Please add a clear and concise description of the problem you are seeking to solve with this feature request. 23 | validations: 24 | required: true 25 | - type: textarea 26 | attributes: 27 | label: Proposed Solution 28 | description: Describe the solution you would like in a clear and concise manner. 29 | validations: 30 | required: true 31 | - type: textarea 32 | attributes: 33 | label: Alternatives Considered 34 | description: A clear and concise description of any alternative solutions or features you have considered. 35 | validations: 36 | required: true 37 | - type: textarea 38 | attributes: 39 | label: Additional Information 40 | description: Add any other context about the problem here. 41 | validations: 42 | required: false -------------------------------------------------------------------------------- /.github/workflows/pr-lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint PR 2 | on: 3 | pull_request_target: 4 | types: [ opened, edited, synchronize, reopened ] 5 | 6 | jobs: 7 | validate: 8 | name: Validate title 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: amannn/action-semantic-pull-request@v5 12 | with: 13 | types: | 14 | chore 15 | docs 16 | fix 17 | feat 18 | misc 19 | test 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Dot files ### 2 | .* 3 | 4 | ### Logs ### 5 | logs 6 | *.log 7 | 8 | ### Backup package.json files created during release ### 9 | *.bak 10 | 11 | ### Runtime data ### 12 | pids 13 | *.pid 14 | *.seed 15 | 16 | ### NPM modules ### 17 | node_modules 18 | 19 | ### Spec and test coverage ### 20 | spec 21 | 22 | ### Test coverage ### 23 | coverage 24 | 25 | ### Custom ignores ### 26 | config.js 27 | .idea 28 | 29 | ### typedoc dir ### 30 | docs 31 | 32 | ### ide / editors ### 33 | .vscode 34 | 35 | ### Libraries don't need locks files ### 36 | yarn.lock 37 | package-lock.json 38 | 39 | **/.openapi-generator* 40 | lib 41 | -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | spec/integration/** 2 | lib/**/* 3 | index.d.ts 4 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | /* 3 | * ENVIRONMENTS 4 | * ================= 5 | */ 6 | 7 | // Define globals exposed by modern browsers. 8 | "browser": true, 9 | 10 | // Define globals exposed by jQuery. 11 | "jquery": true, 12 | 13 | // Define globals exposed by Node.js. 14 | "node": true, 15 | 16 | // Allow ES6. 17 | "esnext": true, 18 | 19 | // Allow tests. 20 | "jasmine": true, 21 | 22 | /* 23 | * ENFORCING OPTIONS 24 | * ================= 25 | */ 26 | 27 | // Force all variable names to use either camelCase style or UPPER_CASE 28 | // with underscores. 29 | "camelcase": true, 30 | 31 | // Prohibit use of == and != in favor of === and !==. 32 | "eqeqeq": true, 33 | 34 | // Enforce tab width of 2 spaces. 35 | "indent": 2, 36 | 37 | // Prohibit use of a variable before it is defined. 38 | "latedef": true, 39 | 40 | // Enforce line length to 100 characters 41 | "maxlen": 120, 42 | 43 | // Require capitalized names for constructor functions. 44 | "newcap": true, 45 | 46 | // Enforce use of single quotation marks for strings. 47 | "quotmark": "double", 48 | 49 | // Enforce placing 'use strict' at the top function scope 50 | "strict": true, 51 | 52 | // Prohibit use of explicitly undeclared variables. 53 | "undef": true, 54 | 55 | // Warn when variables are defined but never used. 56 | "unused": true, 57 | 58 | /* 59 | * RELAXING OPTIONS 60 | * ================= 61 | */ 62 | 63 | // Suppress warnings about == null comparisons. 64 | "eqnull": true, 65 | 66 | // Supress errors regarding the use of bracket notation over dot notation 67 | "sub": true 68 | } 69 | -------------------------------------------------------------------------------- /.nycrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | "src/rest/**/*.js", 4 | "**/*.spec.js" 5 | ], 6 | "reporter": [ 7 | "lcovonly", 8 | "text" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .github 2 | coverage 3 | lib 4 | docs 5 | 6 | babel.config.js 7 | *.md 8 | *.json 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20 2 | 3 | RUN mkdir /twilio 4 | WORKDIR /twilio 5 | 6 | ENV NODE_PATH /usr/local/lib/node_modules 7 | 8 | COPY src ./src 9 | COPY spec ./spec 10 | COPY examples ./examples 11 | COPY index.* package.json babel.config.js tsconfig.json ./ 12 | 13 | RUN npm install --unsafe-perm true # Needed to run prepublish as root. 14 | 15 | RUN npm install . --include=dev 16 | RUN npm install -g . 17 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | ### Issue Summary 10 | A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples. 11 | 12 | ### Steps to Reproduce 13 | 1. This is the first step 14 | 2. This is the second step 15 | 3. Further steps, etc. 16 | 17 | ### Code Snippet 18 | ```node 19 | # paste code here 20 | ``` 21 | 22 | ### Exception/Log 23 | ``` 24 | # paste exception/log here 25 | ``` 26 | 27 | ### Technical details: 28 | * twilio-node version: 29 | * node version: 30 | 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2023, Twilio, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: test-install install test test-docker docs clean prettier 2 | 3 | test-install: 4 | npm install --only=dev 5 | 6 | install: 7 | @node --version || (echo "Node is not installed, please install Node >= 14"; exit 1); 8 | rm -f package-lock.json 9 | npm install 10 | 11 | test: 12 | npm test 13 | 14 | test-docker: 15 | docker build -t twilio/twilio-node . 16 | docker run twilio/twilio-node npm run ci 17 | 18 | docs: 19 | npm run typedoc 20 | 21 | clean: 22 | rm -rf node_modules lib 23 | 24 | prettier: 25 | npm run prettier 26 | 27 | API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5) 28 | CURRENT_TAG=$(shell expr "${GITHUB_TAG}" : ".*-rc.*" >/dev/null && echo "rc" || echo "latest") 29 | docker-build: 30 | docker build -t twilio/twilio-node . 31 | docker tag twilio/twilio-node twilio/twilio-node:${GITHUB_TAG} 32 | docker tag twilio/twilio-node twilio/twilio-node:apidefs-${API_DEFINITIONS_SHA} 33 | docker tag twilio/twilio-node twilio/twilio-node:${CURRENT_TAG} 34 | 35 | docker-push: 36 | docker push twilio/twilio-node:${GITHUB_TAG} 37 | docker push twilio/twilio-node:apidefs-${API_DEFINITIONS_SHA} 38 | docker push twilio/twilio-node:${CURRENT_TAG} 39 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 18 | 19 | # Fixes # 20 | 21 | A short description of what this PR does. 22 | 23 | ### Checklist 24 | - [x] I acknowledge that all my contributions will be made under the project's license 25 | - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) 26 | - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-node/blob/main/CONTRIBUTING.md) and my PR follows them 27 | - [ ] I have titled the PR appropriately 28 | - [ ] I have updated my branch with the main branch 29 | - [ ] I have added tests that prove my fix is effective or that my feature works 30 | - [ ] I have added the necessary documentation about the functionality in the appropriate .md file 31 | - [ ] I have added inline documentation to the code I modified 32 | 33 | If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. 34 | -------------------------------------------------------------------------------- /VERSIONS.md: -------------------------------------------------------------------------------- 1 | # Versioning Strategy 2 | 3 | `twilio-node` uses a modified version of [Semantic Versioning][semver] for 4 | all changes to the helper library. It is strongly encouraged that you pin at 5 | least the major version and potentially the minor version to avoid pulling in 6 | breaking changes. 7 | 8 | Semantic Versions take the form of `MAJOR.MINOR.PATCH` 9 | 10 | When bugs are fixed in the library in a backwards-compatible way, the `PATCH` 11 | level will be incremented by one. When new features are added to the library 12 | in a backwards-compatible way, the `PATCH` level will be incremented by one. 13 | `PATCH` changes should _not_ break your code and are generally safe for upgrade. 14 | 15 | When a new large feature set comes online or a small breaking change is 16 | introduced, the `MINOR` version will be incremented by one and the `PATCH` 17 | version reset to zero. `MINOR` changes _may_ require some amount of manual code 18 | change for upgrade. These backwards-incompatible changes will generally be 19 | limited to a small number of function signature changes. 20 | 21 | The `MAJOR` version is used to indicate the family of technology represented by 22 | the helper library. Breaking changes that require extensive reworking of code 23 | will cause the `MAJOR` version to be incremented by one, and the `MINOR` and 24 | `PATCH` versions will be reset to zero. Twilio understands that this can be very 25 | disruptive, so we will only introduce this type of breaking change when 26 | absolutely necessary. New `MAJOR` versions will be communicated in advance with 27 | `Release Candidates` and a schedule. 28 | 29 | ## Supported Versions 30 | 31 | Only the current `MAJOR` version of `twilio-node` is supported. New 32 | features, functionality, bug fixes, and security updates will only be added to 33 | the current `MAJOR` version. 34 | 35 | [semver]: https://semver.org -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | ['@babel/preset-env', {targets: {node: 'current'}}], 4 | '@babel/preset-typescript', 5 | ], 6 | plugins: [ 7 | 'babel-plugin-replace-ts-export-assignment', 8 | ], 9 | }; 10 | -------------------------------------------------------------------------------- /examples/express.js: -------------------------------------------------------------------------------- 1 | const twilio = require("twilio"); 2 | const bodyParser = require("body-parser"); 3 | const MessagingResponse = require("twilio").twiml.MessagingResponse; 4 | 5 | const authToken = process.env.TWILIO_AUTH_TOKEN; 6 | 7 | const express = require("express"); 8 | const app = express(); 9 | const port = 3000; 10 | 11 | app.use( 12 | bodyParser.json({ 13 | verify: (req, res, buf) => { 14 | req.rawBody = buf; 15 | }, 16 | }) 17 | ); 18 | 19 | app.get("/", (req, res) => { 20 | res.send("Hello World!"); 21 | }); 22 | 23 | app.post("/message", twilio.webhook(authToken), (req, res) => { 24 | // Twilio Messaging URL - receives incoming messages from Twilio 25 | const response = new MessagingResponse(); 26 | 27 | response.message(`Your text to me was ${req.body.Body}. 28 | Webhooks are neat :)`); 29 | 30 | res.set("Content-Type", "text/xml"); 31 | res.send(response.toString()); 32 | }); 33 | 34 | app.listen(port, () => { 35 | console.log(`Example app listening at http://localhost:${port}`); 36 | }); 37 | -------------------------------------------------------------------------------- /examples/orgs_api.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var Twilio = require("../lib"); 3 | 4 | const clientId = process.env.ORGS_CLIENT_ID; 5 | const clientSecret = process.env.ORGS_CLIENT_SECRET; 6 | const accountSid = process.env.TWILIO_ACCOUNT_SID; 7 | const organizationSid = process.env.TWILIO_ORG_SID; 8 | 9 | const orgsCredentialProvider = new Twilio.OrgsCredentialProviderBuilder() 10 | .setClientId(clientId) 11 | .setClientSecret(clientSecret) 12 | .build(); 13 | 14 | const client = new Twilio(); 15 | client.setCredentialProvider(orgsCredentialProvider); 16 | client.setAccountSid(accountSid); 17 | 18 | client.previewIam 19 | .organization(organizationSid) 20 | .accounts.list() 21 | .then((accounts) => { 22 | console.log(accounts); 23 | }) 24 | .catch((error) => { 25 | console.log(error); 26 | }); 27 | 28 | client.previewIam 29 | .organization(organizationSid) 30 | .accounts(accountSid) 31 | .fetch() 32 | .then((account) => { 33 | console.log(account); 34 | }) 35 | .catch((error) => { 36 | console.log(error); 37 | }); 38 | -------------------------------------------------------------------------------- /examples/pkcv.js: -------------------------------------------------------------------------------- 1 | var Twilio = require("../lib"); 2 | const crypto = require("crypto"); 3 | 4 | var accountSid = process.env.TWILIO_ACCOUNT_SID; 5 | var token = process.env.TWILIO_AUTH_TOKEN; 6 | 7 | // Uncomment the following line to specify a custom CA bundle for HTTPS requests: 8 | // process.env.TWILIO_CA_BUNDLE = '/path/to/cert.pem'; 9 | // You can also set this as a regular environment variable outside of the code 10 | 11 | // Generate public and private key pair 12 | const { publicKey, privateKey } = crypto.generateKeyPairSync("rsa", { 13 | modulusLength: 2048, 14 | publicKeyEncoding: { type: "spki", format: "pem" }, 15 | privateKeyEncoding: { type: "pkcs8", format: "pem" }, 16 | }); 17 | 18 | // Create a default rest client 19 | var client = new Twilio(accountSid, token); 20 | 21 | // Submit the public key using the default client 22 | client.accounts.v1.credentials.publicKey 23 | .create({ 24 | friendlyName: "Public Key", 25 | publicKey: publicKey, 26 | }) 27 | .then((key) => { 28 | // Create a new signing key using the default client 29 | client.newSigningKeys.create().then((signingKey) => { 30 | // Switch to the Validation Client to validate API calls 31 | const validationClient = new Twilio(signingKey.sid, signingKey.secret, { 32 | accountSid: accountSid, 33 | validationClient: { 34 | accountSid: accountSid, 35 | credentialSid: key.sid, 36 | signingKey: signingKey.sid, 37 | privateKey: privateKey, 38 | algorithm: "PS256", // Validation client supports RS256 or PS256 algorithm. Default is RS256. 39 | }, 40 | }); 41 | validationClient.setAccountSid(accountSid); 42 | 43 | validationClient.messages 44 | .list({ 45 | from: process.env.TWILIO_PHONE_NUMBER, 46 | limit: 10, 47 | }) 48 | .then((messages) => { 49 | console.log(messages); 50 | }) 51 | .catch((err) => { 52 | console.log("Error making API request: ", err); 53 | }); 54 | }); 55 | }) 56 | .catch((err) => { 57 | console.log("Error creating public key: ", err); 58 | }); 59 | -------------------------------------------------------------------------------- /examples/public_oauth.js: -------------------------------------------------------------------------------- 1 | var Twilio = require("../lib"); 2 | 3 | const clientId = process.env.OAUTH_CLIENT_ID; 4 | const clientSecret = process.env.OAUTH_CLIENT_SECRET; 5 | const accountSid = process.env.TWILIO_ACCOUNT_SID; 6 | 7 | const clientCredentialProvider = new Twilio.ClientCredentialProviderBuilder() 8 | .setClientId(clientId) 9 | .setClientSecret(clientSecret) 10 | .build(); 11 | 12 | const client = new Twilio(); 13 | client.setCredentialProvider(clientCredentialProvider); 14 | client.setAccountSid(accountSid); 15 | 16 | const messageId = "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 17 | client 18 | .messages(messageId) 19 | .fetch() 20 | .then((message) => { 21 | console.log(message); 22 | }) 23 | .catch((error) => { 24 | console.log(error); 25 | }); 26 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | import lib from "./lib"; 2 | export = lib; 3 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __importDefault = 3 | (this && this.__importDefault) || 4 | function (mod) { 5 | return mod && mod.__esModule ? mod : { default: mod }; 6 | }; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | const lib_1 = __importDefault(require("./lib")); 9 | module.exports = lib_1.default; 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twilio", 3 | "description": "A Twilio helper library", 4 | "version": "5.7.0", 5 | "author": "API Team ", 6 | "contributors": [ 7 | { 8 | "name": "twilio-node contributors", 9 | "url": "https://github.com/twilio/twilio-node/graphs/contributors" 10 | } 11 | ], 12 | "keywords": [ 13 | "twilio", 14 | "sms", 15 | "rest", 16 | "api" 17 | ], 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/twilio/twilio-node.git" 21 | }, 22 | "dependencies": { 23 | "axios": "^1.8.3", 24 | "dayjs": "^1.11.9", 25 | "https-proxy-agent": "^5.0.0", 26 | "jsonwebtoken": "^9.0.2", 27 | "qs": "^6.9.4", 28 | "scmp": "^2.1.0", 29 | "xmlbuilder": "^13.0.2" 30 | }, 31 | "devDependencies": { 32 | "@babel/preset-env": "^7.23.0", 33 | "@babel/preset-typescript": "^7.18.6", 34 | "@types/jest": "^29.5.5", 35 | "@types/jsonwebtoken": "^9.0.2", 36 | "@types/node": "22.9.0", 37 | "@types/qs": "^6.9.7", 38 | "babel-plugin-replace-ts-export-assignment": "^0.0.2", 39 | "eslint": "^8.31.0", 40 | "express": "^4.17.1", 41 | "jest": "^29.5.5", 42 | "jshint": "^2.11.0", 43 | "mock-fs": "^5.2.0", 44 | "nock": "^13.2.9", 45 | "node-mocks-http": "^1.8.1", 46 | "prettier": "^2.7.1", 47 | "ts-jest": "^29.1.1", 48 | "typescript": "5.0.4", 49 | "typedoc": "^0.23.21" 50 | }, 51 | "scripts": { 52 | "test": "npm run test:javascript && npm run test:typescript", 53 | "test:javascript": "jest spec --coverage --detectOpenHandles --testPathIgnorePatterns=spec/cluster", 54 | "test:typescript": "tsc --noEmit", 55 | "jshint": "jshint src/rest/** src/base/** src/http/**", 56 | "jscs": "eslint src/base/**/**.js src/http/**/**.js --fix", 57 | "prepublish": "npm run build", 58 | "build": "tsc", 59 | "check": "npm run jshint && npm run jscs", 60 | "ci": "npm run test && npm run nsp && npm run prettier-check", 61 | "nsp": "npm audit --production", 62 | "prettier": "prettier --write .", 63 | "prettier-check": "prettier --check .", 64 | "typedoc": "typedoc --entryPointStrategy expand src --out docs --logLevel Error" 65 | }, 66 | "files": [ 67 | "lib", 68 | "index.js", 69 | "index.d.ts" 70 | ], 71 | "main": "./lib", 72 | "types": "./index.d.ts", 73 | "engines": { 74 | "node": ">=14.0" 75 | }, 76 | "license": "MIT" 77 | } 78 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.projectKey=twilio_twilio-node 2 | sonar.projectName=twilio-node 3 | sonar.organization=twilio 4 | 5 | sonar.sources=src 6 | sonar.exclusions=src/rest/**/*.*,lib/twiml/*Response.ts 7 | sonar.tests=spec 8 | 9 | # For Code Coverage analysis 10 | sonar.javascript.lcov.reportPaths=coverage/lcov.info 11 | -------------------------------------------------------------------------------- /spec/cluster/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "jest": "^29.4.3", 4 | "localtunnel": "^2.0.2", 5 | "twilio": "../../package" 6 | }, 7 | "scripts": { 8 | "prepare": "tsc", 9 | "test": "jest lib --testPathIgnorePatterns=lib/webhook", 10 | "webhook-test": "jest --testPathPattern=lib/webhook" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spec/cluster/public_oauth.spec.ts: -------------------------------------------------------------------------------- 1 | jest.setTimeout(15000); 2 | 3 | import twilio from "twilio"; 4 | 5 | const clientId = process.env.TWILIO_CLIENT_ID; 6 | const clientSecret = process.env.TWILIO_CLIENT_SECRET; 7 | const accountSid = process.env.TWILIO_ACCOUNT_SID; 8 | 9 | const clientCredentialProvider = new twilio.ClientCredentialProviderBuilder() 10 | .setClientId(clientId) 11 | .setClientSecret(clientSecret) 12 | .build(); 13 | 14 | const client = twilio(); 15 | client.setCredentialProvider(clientCredentialProvider); 16 | client.setAccountSid(accountSid); 17 | 18 | test("Should fetch message", () => { 19 | const messageId = process.env.TWILIO_MESSAGE_SID; 20 | return client 21 | .messages(messageId) 22 | .fetch() 23 | .then((message) => { 24 | expect(message).not.toBeNull(); 25 | expect(message).not.toBeUndefined(); 26 | expect(message.sid).toEqual(messageId); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /spec/cluster/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "outDir": "lib", 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /spec/integration/holodeck.js: -------------------------------------------------------------------------------- 1 | import util from "util"; 2 | import Request from "../../src/http/request"; 3 | import moduleInfo from "../../package.json"; 4 | import os from "os"; 5 | 6 | class Hologram { 7 | constructor(request, response) { 8 | this.request = request; 9 | this.response = response; 10 | } 11 | } 12 | 13 | class Holodeck { 14 | constructor() { 15 | this.requests = []; 16 | this.holograms = []; 17 | } 18 | 19 | mock(response, request) { 20 | request = request || new Request(); 21 | this.holograms.push(new Hologram(request, response)); 22 | } 23 | 24 | addStandardHeaders(request) { 25 | var standardHeaders = { 26 | Accept: "application/json", 27 | "Accept-Charset": "utf-8", 28 | "User-Agent": util.format( 29 | "twilio-node/%s (%s %s) node/%s", 30 | moduleInfo.version, 31 | os.platform(), 32 | os.arch(), 33 | process.version 34 | ), 35 | }; 36 | if (request.method === "POST") { 37 | standardHeaders["Content-Type"] = "application/x-www-form-urlencoded"; 38 | } 39 | request.headers = Object.assign(request.headers, standardHeaders); 40 | return request; 41 | } 42 | 43 | assertHasRequest(request) { 44 | var requestWithHeaders = this.addStandardHeaders(request); 45 | var matchedRequest = this.requests.find(function (req) { 46 | return req.isEqual(request) || req.isEqual(requestWithHeaders); 47 | }); 48 | 49 | if (!matchedRequest) { 50 | return; 51 | } 52 | 53 | const message = `\nHolodeck has never received a request matching: \n ${request}>\n`; 54 | 55 | throw new Error(message); 56 | } 57 | 58 | async request(opts) { 59 | opts = opts || {}; 60 | 61 | const Auth = { 62 | auth: { 63 | username: opts.username, 64 | password: opts.password, 65 | }, 66 | }; 67 | 68 | var request = new Request(Object.assign(opts, Auth)); 69 | this.requests.push(request); 70 | 71 | const matchedHologramIndex = this.holograms.findIndex((hologram) => 72 | hologram.request.isEqual(request) 73 | ); 74 | 75 | if (matchedHologramIndex >= 0) { 76 | const matchedHologram = this.holograms[matchedHologramIndex]; 77 | this.holograms.splice(matchedHologram, 1); 78 | 79 | const response = matchedHologram.response; 80 | return { 81 | statusCode: response.statusCode, 82 | body: response.body, 83 | }; 84 | } else { 85 | throw new Error("Failure: holodeck does not contain response"); 86 | } 87 | } 88 | } 89 | 90 | module.exports = Holodeck; 91 | -------------------------------------------------------------------------------- /spec/unit/auth_strategy/BasicAuthStrategy.spec.ts: -------------------------------------------------------------------------------- 1 | import BasicAuthStrategy from "../../../src/auth_strategy/BasicAuthStrategy"; 2 | 3 | describe("BasicAuthStrategy constructor", function () { 4 | const username = "username"; 5 | const password = "password"; 6 | const basicAuthStrategy = new BasicAuthStrategy(username, password); 7 | 8 | it("Should have basic as its authType", function () { 9 | expect(basicAuthStrategy.getAuthType()).toEqual("basic"); 10 | }); 11 | 12 | it("Should return basic auth string", function (done) { 13 | const auth = Buffer.from(username + ":" + password).toString("base64"); 14 | basicAuthStrategy.getAuthString().then(function (authString) { 15 | expect(authString).toEqual(`Basic ${auth}`); 16 | done(); 17 | }); 18 | }); 19 | 20 | it("Should return true for requiresAuthentication", function () { 21 | expect(basicAuthStrategy.requiresAuthentication()).toBe(true); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /spec/unit/auth_strategy/NoAuthStrategy.spec.ts: -------------------------------------------------------------------------------- 1 | import NoAuthStrategy from "../../../src/auth_strategy/NoAuthStrategy"; 2 | 3 | describe("NoAuthStrategy constructor", function () { 4 | const noAuthStrategy = new NoAuthStrategy(); 5 | 6 | it("Should have noauth as its authType", function () { 7 | expect(noAuthStrategy.getAuthType()).toEqual("noauth"); 8 | }); 9 | 10 | it("Should return an empty string for getAuthString", function (done) { 11 | noAuthStrategy.getAuthString().then(function (authString) { 12 | expect(authString).toEqual(""); 13 | done(); 14 | }); 15 | }); 16 | 17 | it("Should return false for requiresAuthentication", function () { 18 | expect(noAuthStrategy.requiresAuthentication()).toBe(false); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /spec/unit/base/RestException.spec.ts: -------------------------------------------------------------------------------- 1 | import RestException from "../../../src/base/RestException"; 2 | 3 | describe("exception gets created from string", function () { 4 | it("should test serialize without details", function () { 5 | const response = { 6 | statusCode: 200, 7 | body: '{"message":"test", "code":81022,"more_info": "https://www.twilio.com/docs/errors/81022"}', 8 | }; 9 | 10 | const exception = new RestException(response); 11 | expect(exception.status).toEqual(200); 12 | expect(exception.message).toEqual("test"); 13 | expect(exception.code).toEqual(81022); 14 | expect(exception.moreInfo).toEqual( 15 | "https://www.twilio.com/docs/errors/81022" 16 | ); 17 | }); 18 | it("should test serialize from improper json string", function () { 19 | const response = { 20 | statusCode: 200, 21 | body: '{message":test", "code:81022,"more_info": "https://www.twilio.com/docs/errors/81022"}', 22 | }; 23 | const exception = new RestException(response); 24 | expect(exception.status).toEqual(200); 25 | expect(exception.message).toEqual( 26 | `[HTTP ${response.statusCode}] Failed to execute request` 27 | ); 28 | expect(exception.code).toEqual(undefined); 29 | expect(exception.moreInfo).toEqual(undefined); 30 | }); 31 | }); 32 | 33 | describe("exception gets created from json error", function () { 34 | it("should create exception without details", function () { 35 | const response = { 36 | statusCode: 200, 37 | body: { 38 | message: "test", 39 | code: 81022, 40 | more_info: "https://www.twilio.com/docs/errors/81022", 41 | }, 42 | }; 43 | 44 | var exception = new RestException(response); 45 | expect(exception.status).toEqual(200); 46 | expect(exception.message).toEqual("test"); 47 | expect(exception.code).toEqual(81022); 48 | expect(exception.moreInfo).toEqual( 49 | "https://www.twilio.com/docs/errors/81022" 50 | ); 51 | expect(exception.details).toEqual(undefined); 52 | }); 53 | 54 | it("should create exception with details", function () { 55 | const details = { 56 | foo: "bar", 57 | }; 58 | 59 | const response = { 60 | statusCode: 200, 61 | body: { 62 | message: "test", 63 | code: 81022, 64 | more_info: "https://www.twilio.com/docs/errors/81022", 65 | details: details, 66 | }, 67 | }; 68 | 69 | const exception = new RestException(response); 70 | expect(exception.details).toEqual(details); 71 | }); 72 | }); 73 | -------------------------------------------------------------------------------- /spec/unit/base/utility.spec.ts: -------------------------------------------------------------------------------- 1 | import { isValidPathParam } from "../../../src/base/utility"; 2 | 3 | describe("isValidPathParam", () => { 4 | it("should validate path params", () => { 5 | expect(isValidPathParam(null)).toBeFalsy(); 6 | expect(isValidPathParam(undefined)).toBeFalsy(); 7 | expect(isValidPathParam("with/slash")).toBeFalsy(); 8 | expect(isValidPathParam("with?question")).toBeFalsy(); 9 | 10 | expect(isValidPathParam("AC123")).toBeTruthy(); 11 | expect(isValidPathParam("space in name")).toBeTruthy(); 12 | expect(isValidPathParam(123)).toBeTruthy(); 13 | expect(isValidPathParam({})).toBeTruthy(); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /spec/unit/credential_provider/ClientCredentialProvider.spec.ts: -------------------------------------------------------------------------------- 1 | import ClientCredentialProvider from "../../../src/credential_provider/ClientCredentialProvider"; 2 | import TokenAuthStrategy from "../../../src/auth_strategy/TokenAuthStrategy"; 3 | 4 | describe("ClientCredentialProvider Constructor", () => { 5 | const clientCredentialProvider = 6 | new ClientCredentialProvider.ClientCredentialProviderBuilder() 7 | .setClientId("clientId") 8 | .setClientSecret("clientSecret") 9 | .build(); 10 | 11 | it("Should have client-credentials as its authType", () => { 12 | expect(clientCredentialProvider.getAuthType()).toEqual( 13 | "client-credentials" 14 | ); 15 | }); 16 | 17 | it("Should return TokenAuthStrategy as its auth strategy", () => { 18 | expect(clientCredentialProvider.toAuthStrategy()).toBeInstanceOf( 19 | TokenAuthStrategy 20 | ); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /spec/unit/credential_provider/NoAuthCredentialProvider.spec.ts: -------------------------------------------------------------------------------- 1 | import NoAuthCredentialProvider from "../../../src/credential_provider/NoAuthCredentialProvider"; 2 | import NoAuthStrategy from "../../../src/auth_strategy/NoAuthStrategy"; 3 | import Twilio from "../../../src"; 4 | 5 | describe("NoAuthCredentialProvider Constructor", () => { 6 | const noAuthCredentialProvider = 7 | new NoAuthCredentialProvider.NoAuthCredentialProvider(); 8 | 9 | it("Should have noauth as its authType", () => { 10 | expect(noAuthCredentialProvider.getAuthType()).toEqual("noauth"); 11 | }); 12 | 13 | it("Should return NoAuthStrategy as its auth strategy", () => { 14 | expect(noAuthCredentialProvider.toAuthStrategy()).toBeInstanceOf( 15 | NoAuthStrategy 16 | ); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /spec/unit/credential_provider/OrgsCredentialProvider.spec.ts: -------------------------------------------------------------------------------- 1 | import OrgsCredentialProvider from "../../../src/credential_provider/OrgsCredentialProvider"; 2 | import TokenAuthStrategy from "../../../src/auth_strategy/TokenAuthStrategy"; 3 | 4 | describe("OrgsCredentialProvider Constructor", () => { 5 | const orgsCredentialProvider = 6 | new OrgsCredentialProvider.OrgsCredentialProviderBuilder() 7 | .setClientId("clientId") 8 | .setClientSecret("clientSecret") 9 | .build(); 10 | 11 | it("Should have client-credentials as its authType", () => { 12 | expect(orgsCredentialProvider.getAuthType()).toEqual("client-credentials"); 13 | }); 14 | 15 | it("Should return TokenAuthStrategy as its auth strategy", () => { 16 | expect(orgsCredentialProvider.toAuthStrategy()).toBeInstanceOf( 17 | TokenAuthStrategy 18 | ); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /src/auth_strategy/AuthStrategy.ts: -------------------------------------------------------------------------------- 1 | export default abstract class AuthStrategy { 2 | private authType: string; 3 | protected constructor(authType: string) { 4 | this.authType = authType; 5 | } 6 | getAuthType(): string { 7 | return this.authType; 8 | } 9 | abstract getAuthString(): Promise; 10 | abstract requiresAuthentication(): boolean; 11 | } 12 | -------------------------------------------------------------------------------- /src/auth_strategy/BasicAuthStrategy.ts: -------------------------------------------------------------------------------- 1 | import AuthStrategy from "./AuthStrategy"; 2 | 3 | export default class BasicAuthStrategy extends AuthStrategy { 4 | private username: string; 5 | private password: string; 6 | 7 | constructor(username: string, password: string) { 8 | super("basic"); 9 | this.username = username; 10 | this.password = password; 11 | } 12 | 13 | getAuthString(): Promise { 14 | const auth = Buffer.from(this.username + ":" + this.password).toString( 15 | "base64" 16 | ); 17 | return Promise.resolve(`Basic ${auth}`); 18 | } 19 | 20 | requiresAuthentication(): boolean { 21 | return true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/auth_strategy/NoAuthStrategy.ts: -------------------------------------------------------------------------------- 1 | import AuthStrategy from "./AuthStrategy"; 2 | 3 | export default class NoAuthStrategy extends AuthStrategy { 4 | constructor() { 5 | super("noauth"); 6 | } 7 | 8 | getAuthString(): Promise { 9 | return Promise.resolve(""); 10 | } 11 | 12 | requiresAuthentication(): boolean { 13 | return false; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/auth_strategy/TokenAuthStrategy.ts: -------------------------------------------------------------------------------- 1 | import AuthStrategy from "./AuthStrategy"; 2 | import TokenManager from "../http/bearer_token/TokenManager"; 3 | import jwt, { JwtPayload } from "jsonwebtoken"; 4 | 5 | export default class TokenAuthStrategy extends AuthStrategy { 6 | private token: string; 7 | private tokenManager: TokenManager; 8 | 9 | constructor(tokenManager: TokenManager) { 10 | super("token"); 11 | this.token = ""; 12 | this.tokenManager = tokenManager; 13 | } 14 | 15 | async getAuthString(): Promise { 16 | return this.fetchToken() 17 | .then((token) => { 18 | this.token = token; 19 | return `Bearer ${this.token}`; 20 | }) 21 | .catch((error) => { 22 | throw new Error(`Failed to fetch access token: ${error.message}`); 23 | }); 24 | } 25 | 26 | requiresAuthentication(): boolean { 27 | return true; 28 | } 29 | 30 | async fetchToken(): Promise { 31 | if ( 32 | this.token == null || 33 | this.token.length === 0 || 34 | this.isTokenExpired(this.token) 35 | ) { 36 | return this.tokenManager.fetchToken(); 37 | } 38 | return Promise.resolve(this.token); 39 | } 40 | 41 | /** 42 | * Function to check if the token is expired with a buffer of 30 seconds. 43 | * @param token - The JWT token as a string. 44 | * @returns Boolean indicating if the token is expired. 45 | */ 46 | isTokenExpired(token: string): boolean { 47 | try { 48 | // Decode the token without verifying the signature, as we only want to read the expiration for this check 49 | const decoded = jwt.decode(token) as JwtPayload; 50 | 51 | if (!decoded || !decoded.exp) { 52 | // If the token doesn't have an expiration, consider it expired 53 | return true; 54 | } 55 | 56 | const expiresAt = decoded.exp * 1000; 57 | const bufferMilliseconds = 30 * 1000; 58 | const bufferExpiresAt = expiresAt - bufferMilliseconds; 59 | 60 | // Return true if the current time is after the expiration time with buffer 61 | return Date.now() > bufferExpiresAt; 62 | } catch (error) { 63 | // If there's an error decoding the token, consider it expired 64 | return true; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/base/Domain.ts: -------------------------------------------------------------------------------- 1 | import { Client as BaseTwilio, RequestOpts } from "./BaseTwilio"; 2 | import { trim } from "./utility"; 3 | 4 | /** 5 | * Base domain object 6 | */ 7 | export default class Domain { 8 | /** 9 | * Creates a Domain instance 10 | * 11 | * @param twilio - A Twilio Client 12 | * @param baseUrl - Base url for this domain 13 | */ 14 | constructor(public twilio: BaseTwilio, public baseUrl: string) {} 15 | 16 | /** 17 | * Turn a uri into an absolute url 18 | * 19 | * @param uri - uri to transform 20 | * @returns absolute url 21 | */ 22 | absoluteUrl(uri?: string): string { 23 | var result = ""; 24 | if (typeof this.baseUrl === "string") { 25 | const cleanBaseUrl = trim(this.baseUrl, "/"); 26 | result += cleanBaseUrl; 27 | result += "/"; 28 | } 29 | if (typeof uri === "string") { 30 | uri = trim(uri, "/"); 31 | if (result === "") { 32 | result += "/"; 33 | } 34 | result += uri; 35 | } 36 | return result; 37 | } 38 | 39 | /** 40 | * Make request to this domain 41 | * 42 | * @param opts - request options 43 | * @returns request promise 44 | */ 45 | request(opts: RequestOpts): Promise { 46 | return this.twilio.request({ 47 | ...opts, 48 | uri: this.absoluteUrl(opts.uri), 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/base/RestException.ts: -------------------------------------------------------------------------------- 1 | interface RestExceptionError { 2 | status: number; 3 | message?: string; 4 | code?: number; 5 | moreInfo?: string; 6 | details?: object; 7 | } 8 | 9 | export default class RestException extends Error implements RestExceptionError { 10 | status: number; 11 | message: string; 12 | code?: number; 13 | moreInfo?: string; 14 | details?: object; 15 | 16 | constructor(response: any) { 17 | super("[HTTP " + response.statusCode + "] Failed to execute request"); 18 | const isResponseBodyString = typeof response.body == "string"; 19 | const body = isResponseBodyString 20 | ? parseResponseBody(response.body) 21 | : response.body; 22 | 23 | this.status = response.statusCode; 24 | if (body !== null) { 25 | this.message = body.message; 26 | this.code = body.code; 27 | this.moreInfo = body.more_info; /* jshint ignore:line */ 28 | this.details = body.details; 29 | } else { 30 | this.message = 31 | "[HTTP " + response.statusCode + "] Failed to execute request"; 32 | } 33 | } 34 | } 35 | 36 | function parseResponseBody(response_body: string): RestExceptionError | null { 37 | let body = null; 38 | try { 39 | body = JSON.parse(response_body); 40 | } catch (catchError) { 41 | body = null; 42 | } 43 | 44 | return body; 45 | } 46 | -------------------------------------------------------------------------------- /src/base/ValidationClient.ts: -------------------------------------------------------------------------------- 1 | namespace ValidationClient { 2 | export interface ValidationClientOptions { 3 | accountSid: string; 4 | credentialSid: string; 5 | signingKey: string; 6 | privateKey: string; 7 | algorithm?: string; 8 | } 9 | } 10 | 11 | export = ValidationClient; 12 | -------------------------------------------------------------------------------- /src/base/deserialize.ts: -------------------------------------------------------------------------------- 1 | import dayjs from "dayjs"; 2 | import utc from "dayjs/plugin/utc"; 3 | 4 | dayjs.extend(utc); 5 | 6 | export interface NumberParser { 7 | (n: string): number; 8 | } 9 | 10 | /** 11 | * @namespace deserialize 12 | */ 13 | 14 | /** 15 | * Parse a string into a Date object 16 | * 17 | * @param s - Date string in YYYY-MM-DD format 18 | * @returns Date object, or the original date string if the argument is not a valid date 19 | */ 20 | export function iso8601Date(s: string) { 21 | return parseDate(s, "YYYY-MM-DD"); 22 | } 23 | 24 | /** 25 | * Parse a string into a Date object 26 | * 27 | * @param s - Date string in YYYY-MM-DD[T]HH:mm:ss[Z] format 28 | * @returns Date object, or the original date string if the argument is not a valid date 29 | */ 30 | export function iso8601DateTime(s: string) { 31 | return parseDate(s, "YYYY-MM-DD[T]HH:mm:ss[Z]"); 32 | } 33 | 34 | /** 35 | * Parse a string into a Date object 36 | * 37 | * @param s - Date string in ddd, DD MMM YYYY HH:mm:ss [+0000] format 38 | * @returns Date object, or the original date string if the argument is not a valid date 39 | */ 40 | export function rfc2822DateTime(s: string) { 41 | return parseDate(s, "ddd, DD MMM YYYY HH:mm:ss [+0000]"); 42 | } 43 | 44 | /** 45 | * Parse a string into a decimal 46 | * 47 | * @param d - Decimal value as string 48 | * @returns Number, or the original string if the argument is NaN 49 | */ 50 | export function decimal(d: string) { 51 | return parseNumber(d, parseFloat); 52 | } 53 | 54 | /** 55 | * Parse a string into a integer 56 | * 57 | * @param i - Integer value as string 58 | * @returns Number, or the original string if the argument is NaN 59 | */ 60 | export function integer(i: string) { 61 | return parseNumber(i, parseInt); 62 | } 63 | 64 | function parseDate(s: string, format: string): Date | string { 65 | var m = dayjs.utc(s, format); 66 | if (m.isValid()) { 67 | return m.toDate(); 68 | } 69 | 70 | return s; 71 | } 72 | 73 | function parseNumber(n: string, parser: NumberParser) { 74 | var parsed = parser(n); 75 | if (typeof parsed === "number" && isNaN(parsed)) { 76 | return n; 77 | } 78 | 79 | return parsed; 80 | } 81 | -------------------------------------------------------------------------------- /src/base/utility.ts: -------------------------------------------------------------------------------- 1 | const INVALID_PATH_PARAM_CHARS = ["/", "?"]; 2 | 3 | export const trim = (str: string, c = "\\s") => 4 | str.replace(new RegExp(`^([${c}]*)(.*?)([${c}]*)$`), "$2"); 5 | 6 | export function isValidPathParam(param: any): boolean { 7 | if (param === null || param === undefined) return false; 8 | 9 | const paramString = param.toString(); 10 | 11 | return INVALID_PATH_PARAM_CHARS.every( 12 | (invalidChar) => !paramString.includes(invalidChar) 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /src/base/values.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace values 3 | */ 4 | 5 | /** 6 | * Removes all undefined values of an object 7 | * 8 | * @param obj - object to filter 9 | * @returns object with no undefined values 10 | */ 11 | export function of(obj: Object): Object { 12 | return Object.fromEntries( 13 | Object.entries(obj).filter((entry) => entry[1] !== undefined) 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /src/credential_provider/ClientCredentialProvider.ts: -------------------------------------------------------------------------------- 1 | import CredentialProvider from "./CredentialProvider"; 2 | import TokenManager from "../http/bearer_token/TokenManager"; 3 | import AuthStrategy from "../auth_strategy/AuthStrategy"; 4 | import ApiTokenManager from "../http/bearer_token/ApiTokenManager"; 5 | import TokenAuthStrategy from "../auth_strategy/TokenAuthStrategy"; 6 | 7 | class ClientCredentialProvider extends CredentialProvider { 8 | grantType: string; 9 | clientId: string; 10 | clientSecret: string; 11 | tokenManager: TokenManager | null; 12 | 13 | constructor() { 14 | super("client-credentials"); 15 | this.grantType = "client_credentials"; 16 | this.clientId = ""; 17 | this.clientSecret = ""; 18 | this.tokenManager = null; 19 | } 20 | 21 | public toAuthStrategy(): AuthStrategy { 22 | if (this.tokenManager == null) { 23 | this.tokenManager = new ApiTokenManager({ 24 | grantType: this.grantType, 25 | clientId: this.clientId, 26 | clientSecret: this.clientSecret, 27 | }); 28 | } 29 | return new TokenAuthStrategy(this.tokenManager); 30 | } 31 | } 32 | 33 | namespace ClientCredentialProvider { 34 | export class ClientCredentialProviderBuilder { 35 | private readonly instance: ClientCredentialProvider; 36 | 37 | constructor() { 38 | this.instance = new ClientCredentialProvider(); 39 | } 40 | 41 | public setClientId(clientId: string): ClientCredentialProviderBuilder { 42 | this.instance.clientId = clientId; 43 | return this; 44 | } 45 | 46 | public setClientSecret( 47 | clientSecret: string 48 | ): ClientCredentialProviderBuilder { 49 | this.instance.clientSecret = clientSecret; 50 | return this; 51 | } 52 | 53 | public setTokenManager( 54 | tokenManager: TokenManager 55 | ): ClientCredentialProviderBuilder { 56 | this.instance.tokenManager = tokenManager; 57 | return this; 58 | } 59 | 60 | public build(): ClientCredentialProvider { 61 | return this.instance; 62 | } 63 | } 64 | } 65 | 66 | export = ClientCredentialProvider; 67 | -------------------------------------------------------------------------------- /src/credential_provider/CredentialProvider.ts: -------------------------------------------------------------------------------- 1 | import AuthStrategy from "../auth_strategy/AuthStrategy"; 2 | 3 | export default abstract class CredentialProvider { 4 | private authType: string; 5 | protected constructor(authType: string) { 6 | this.authType = authType; 7 | } 8 | getAuthType(): string { 9 | return this.authType; 10 | } 11 | abstract toAuthStrategy(): AuthStrategy; 12 | } 13 | -------------------------------------------------------------------------------- /src/credential_provider/NoAuthCredentialProvider.ts: -------------------------------------------------------------------------------- 1 | import CredentialProvider from "./CredentialProvider"; 2 | import AuthStrategy from "../auth_strategy/AuthStrategy"; 3 | import NoAuthStrategy from "../auth_strategy/NoAuthStrategy"; 4 | 5 | namespace NoAuthCredentialProvider { 6 | export class NoAuthCredentialProvider extends CredentialProvider { 7 | constructor() { 8 | super("noauth"); 9 | } 10 | 11 | public toAuthStrategy(): AuthStrategy { 12 | return new NoAuthStrategy(); 13 | } 14 | } 15 | } 16 | 17 | export = NoAuthCredentialProvider; 18 | -------------------------------------------------------------------------------- /src/credential_provider/OrgsCredentialProvider.ts: -------------------------------------------------------------------------------- 1 | import CredentialProvider from "./CredentialProvider"; 2 | import TokenManager from "../http/bearer_token/TokenManager"; 3 | import AuthStrategy from "../auth_strategy/AuthStrategy"; 4 | import OrgsTokenManager from "../http/bearer_token/OrgsTokenManager"; 5 | import TokenAuthStrategy from "../auth_strategy/TokenAuthStrategy"; 6 | 7 | class OrgsCredentialProvider extends CredentialProvider { 8 | grantType: string; 9 | clientId: string; 10 | clientSecret: string; 11 | tokenManager: TokenManager | null; 12 | 13 | constructor() { 14 | super("client-credentials"); 15 | this.grantType = "client_credentials"; 16 | this.clientId = ""; 17 | this.clientSecret = ""; 18 | this.tokenManager = null; 19 | } 20 | 21 | public toAuthStrategy(): AuthStrategy { 22 | if (this.tokenManager == null) { 23 | this.tokenManager = new OrgsTokenManager({ 24 | grantType: this.grantType, 25 | clientId: this.clientId, 26 | clientSecret: this.clientSecret, 27 | }); 28 | } 29 | return new TokenAuthStrategy(this.tokenManager); 30 | } 31 | } 32 | 33 | namespace OrgsCredentialProvider { 34 | export class OrgsCredentialProviderBuilder { 35 | private readonly instance: OrgsCredentialProvider; 36 | 37 | constructor() { 38 | this.instance = new OrgsCredentialProvider(); 39 | } 40 | 41 | public setClientId(clientId: string): OrgsCredentialProviderBuilder { 42 | this.instance.clientId = clientId; 43 | return this; 44 | } 45 | 46 | public setClientSecret( 47 | clientSecret: string 48 | ): OrgsCredentialProviderBuilder { 49 | this.instance.clientSecret = clientSecret; 50 | return this; 51 | } 52 | 53 | public setTokenManager( 54 | tokenManager: TokenManager 55 | ): OrgsCredentialProviderBuilder { 56 | this.instance.tokenManager = tokenManager; 57 | return this; 58 | } 59 | 60 | public build(): OrgsCredentialProvider { 61 | return this.instance; 62 | } 63 | } 64 | } 65 | 66 | export = OrgsCredentialProvider; 67 | -------------------------------------------------------------------------------- /src/http/bearer_token/ApiTokenManager.ts: -------------------------------------------------------------------------------- 1 | import TokenManager from "./TokenManager"; 2 | import { 3 | TokenListInstance, 4 | TokenListInstanceCreateOptions, 5 | } from "../../rest/iam/v1/token"; 6 | import IamBase from "../../rest/IamBase"; 7 | import V1 from "../../rest/iam/V1"; 8 | import NoAuthCredentialProvider from "../../credential_provider/NoAuthCredentialProvider"; 9 | import { Client } from "../../base/BaseTwilio"; 10 | 11 | export default class ApiTokenManager implements TokenManager { 12 | private params: TokenListInstanceCreateOptions; 13 | 14 | constructor(params: TokenListInstanceCreateOptions) { 15 | this.params = params; 16 | } 17 | 18 | getParams(): TokenListInstanceCreateOptions { 19 | return this.params; 20 | } 21 | 22 | async fetchToken(): Promise { 23 | const noAuthCredentialProvider = 24 | new NoAuthCredentialProvider.NoAuthCredentialProvider(); 25 | const client = new Client(); 26 | client.setCredentialProvider(noAuthCredentialProvider); 27 | 28 | const tokenListInstance = TokenListInstance(new V1(new IamBase(client))); 29 | return tokenListInstance 30 | .create(this.params) 31 | .then((token) => { 32 | return token.accessToken; 33 | }) 34 | .catch((error) => { 35 | throw new Error( 36 | `Error Status Code: ${error.status}\nFailed to fetch access token: ${error.message}` 37 | ); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/http/bearer_token/OrgsTokenManager.ts: -------------------------------------------------------------------------------- 1 | import TokenManager from "./TokenManager"; 2 | import { 3 | TokenListInstance, 4 | TokenListInstanceCreateOptions, 5 | } from "../../rest/iam/v1/token"; 6 | import IamBase from "../../rest/IamBase"; 7 | import V1 from "../../rest/iam/V1"; 8 | import NoAuthCredentialProvider from "../../credential_provider/NoAuthCredentialProvider"; 9 | import { Client } from "../../base/BaseTwilio"; 10 | 11 | export default class OrgsTokenManager implements TokenManager { 12 | private readonly params: TokenListInstanceCreateOptions; 13 | 14 | constructor(params: TokenListInstanceCreateOptions) { 15 | this.params = params; 16 | } 17 | 18 | getParams(): TokenListInstanceCreateOptions { 19 | return this.params; 20 | } 21 | 22 | async fetchToken(): Promise { 23 | const noAuthCredentialProvider = 24 | new NoAuthCredentialProvider.NoAuthCredentialProvider(); 25 | const client = new Client(); 26 | client.setCredentialProvider(noAuthCredentialProvider); 27 | 28 | const tokenListInstance = TokenListInstance(new V1(new IamBase(client))); 29 | return tokenListInstance 30 | .create(this.params) 31 | .then((token) => { 32 | return token.accessToken; 33 | }) 34 | .catch((error) => { 35 | throw new Error( 36 | `Error Status Code: ${error.status}\nFailed to fetch access token: ${error.message}` 37 | ); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/http/bearer_token/TokenManager.ts: -------------------------------------------------------------------------------- 1 | export default abstract class TokenManager { 2 | abstract fetchToken(): Promise; 3 | } 4 | -------------------------------------------------------------------------------- /src/http/response.ts: -------------------------------------------------------------------------------- 1 | export default class Response { 2 | constructor( 3 | public statusCode: number, 4 | public body: TPayload, 5 | public headers: any 6 | ) {} 7 | 8 | toString(): string { 9 | return "HTTP " + this.statusCode + " " + this.body; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/rest/Accounts.ts: -------------------------------------------------------------------------------- 1 | import { AuthTokenPromotionListInstance } from "./accounts/v1/authTokenPromotion"; 2 | import { CredentialListInstance } from "./accounts/v1/credential"; 3 | import { SecondaryAuthTokenListInstance } from "./accounts/v1/secondaryAuthToken"; 4 | import AccountsBase from "./AccountsBase"; 5 | 6 | class Accounts extends AccountsBase { 7 | /** 8 | * @deprecated - Use v1.authTokenPromotion; instead 9 | */ 10 | get authTokenPromotion(): AuthTokenPromotionListInstance { 11 | console.warn( 12 | "authTokenPromotion is deprecated. Use v1.authTokenPromotion; instead." 13 | ); 14 | return this.v1.authTokenPromotion; 15 | } 16 | 17 | /** 18 | * @deprecated - Use v1.credentials; instead 19 | */ 20 | get credentials(): CredentialListInstance { 21 | console.warn("credentials is deprecated. Use v1.credentials; instead."); 22 | return this.v1.credentials; 23 | } 24 | 25 | /** 26 | * @deprecated - Use v1.secondaryAuthToken; instead 27 | */ 28 | get secondaryAuthToken(): SecondaryAuthTokenListInstance { 29 | console.warn( 30 | "secondaryAuthToken is deprecated. Use v1.secondaryAuthToken; instead." 31 | ); 32 | return this.v1.secondaryAuthToken; 33 | } 34 | } 35 | 36 | export = Accounts; 37 | -------------------------------------------------------------------------------- /src/rest/AccountsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./accounts/V1"; 14 | 15 | class AccountsBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize accounts domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://accounts.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = AccountsBase; 34 | -------------------------------------------------------------------------------- /src/rest/ApiBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V2010 from "./api/V2010"; 14 | 15 | class ApiBase extends Domain { 16 | _v2010?: V2010; 17 | 18 | /** 19 | * Initialize api domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://api.twilio.com"); 25 | } 26 | 27 | get v2010(): V2010 { 28 | this._v2010 = this._v2010 || new V2010(this); 29 | return this._v2010; 30 | } 31 | } 32 | 33 | export = ApiBase; 34 | -------------------------------------------------------------------------------- /src/rest/Assistants.ts: -------------------------------------------------------------------------------- 1 | import AssistantsBase from "./AssistantsBase"; 2 | 3 | class Assistants extends AssistantsBase {} 4 | 5 | export = Assistants; 6 | -------------------------------------------------------------------------------- /src/rest/AssistantsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./assistants/V1"; 14 | 15 | class AssistantsBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize assistants domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://assistants.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = AssistantsBase; 34 | -------------------------------------------------------------------------------- /src/rest/Bulkexports.ts: -------------------------------------------------------------------------------- 1 | import { ExportListInstance } from "./bulkexports/v1/export"; 2 | import { ExportConfigurationListInstance } from "./bulkexports/v1/exportConfiguration"; 3 | import BulkexportsBase from "./BulkexportsBase"; 4 | 5 | class Bulkexports extends BulkexportsBase { 6 | /** 7 | * @deprecated - Use v1.exports instead 8 | */ 9 | get exports(): ExportListInstance { 10 | console.warn("exports is deprecated. Use v1.exports instead."); 11 | return this.v1.exports; 12 | } 13 | 14 | /** 15 | * @deprecated - Use v1.exportConfiguration instead 16 | */ 17 | get exportConfiguration(): ExportConfigurationListInstance { 18 | console.warn( 19 | "exportConfiguration is deprecated. Use v1.exportConfiguration instead." 20 | ); 21 | return this.v1.exportConfiguration; 22 | } 23 | } 24 | 25 | export = Bulkexports; 26 | -------------------------------------------------------------------------------- /src/rest/BulkexportsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./bulkexports/V1"; 14 | 15 | class BulkexportsBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize bulkexports domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://bulkexports.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = BulkexportsBase; 34 | -------------------------------------------------------------------------------- /src/rest/Chat.ts: -------------------------------------------------------------------------------- 1 | import { CredentialListInstance } from "./chat/v2/credential"; 2 | import { ServiceListInstance } from "./chat/v2/service"; 3 | import { ChannelListInstance } from "./chat/v3/channel"; 4 | import ChatBase from "./ChatBase"; 5 | 6 | class Chat extends ChatBase { 7 | /** 8 | * @deprecated - Use v2.credentials instead 9 | */ 10 | get credentials(): CredentialListInstance { 11 | console.warn("credentials is deprecated. Use v2.credentials instead."); 12 | return this.v2.credentials; 13 | } 14 | 15 | /** 16 | * @deprecated - Use v2.services instead 17 | */ 18 | get services(): ServiceListInstance { 19 | console.warn("services is deprecated. Use v2.services instead."); 20 | return this.v2.services; 21 | } 22 | 23 | /** 24 | * @deprecated - Use v3.channels instead 25 | */ 26 | get channels(): ChannelListInstance { 27 | console.warn("channels is deprecated. Use v3.channels instead."); 28 | return this.v3.channels; 29 | } 30 | } 31 | 32 | export = Chat; 33 | -------------------------------------------------------------------------------- /src/rest/ChatBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./chat/V1"; 14 | import V2 from "./chat/V2"; 15 | import V3 from "./chat/V3"; 16 | 17 | class ChatBase extends Domain { 18 | _v1?: V1; 19 | _v2?: V2; 20 | _v3?: V3; 21 | 22 | /** 23 | * Initialize chat domain 24 | * 25 | * @param twilio - The twilio client 26 | */ 27 | constructor(twilio: any) { 28 | super(twilio, "https://chat.twilio.com"); 29 | } 30 | 31 | get v1(): V1 { 32 | this._v1 = this._v1 || new V1(this); 33 | return this._v1; 34 | } 35 | get v2(): V2 { 36 | this._v2 = this._v2 || new V2(this); 37 | return this._v2; 38 | } 39 | get v3(): V3 { 40 | this._v3 = this._v3 || new V3(this); 41 | return this._v3; 42 | } 43 | } 44 | 45 | export = ChatBase; 46 | -------------------------------------------------------------------------------- /src/rest/Content.ts: -------------------------------------------------------------------------------- 1 | import ContentBase from "./ContentBase"; 2 | import { ContentListInstance } from "./content/v1/content"; 3 | 4 | class Content extends ContentBase { 5 | /** 6 | * @deprecated - Use v1.contents instead 7 | */ 8 | get contents(): ContentListInstance { 9 | console.warn("contents is deprecated. Use v1.contents instead."); 10 | return this.v1.contents; 11 | } 12 | } 13 | 14 | export = Content; 15 | -------------------------------------------------------------------------------- /src/rest/ContentBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./content/V1"; 14 | import V2 from "./content/V2"; 15 | 16 | class ContentBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize content domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://content.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = ContentBase; 40 | -------------------------------------------------------------------------------- /src/rest/ConversationsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./conversations/V1"; 14 | 15 | class ConversationsBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize conversations domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://conversations.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = ConversationsBase; 34 | -------------------------------------------------------------------------------- /src/rest/Events.ts: -------------------------------------------------------------------------------- 1 | import { EventTypeListInstance } from "./events/v1/eventType"; 2 | import { SchemaListInstance } from "./events/v1/schema"; 3 | import { SinkListInstance } from "./events/v1/sink"; 4 | import { SubscriptionListInstance } from "./events/v1/subscription"; 5 | import EventsBase from "./EventsBase"; 6 | 7 | class Events extends EventsBase { 8 | /** 9 | * @deprecated - Use v1.eventTypes instead 10 | */ 11 | get eventTypes(): EventTypeListInstance { 12 | console.warn("eventTypes is deprecated. Use v1.eventTypes instead."); 13 | return this.v1.eventTypes; 14 | } 15 | 16 | /** 17 | * @deprecated - Use v1.schemas instead 18 | */ 19 | get schemas(): SchemaListInstance { 20 | console.warn("schemas is deprecated. Use v1.schemas instead."); 21 | return this.v1.schemas; 22 | } 23 | 24 | /** 25 | * @deprecated - Use v1.sinks instead 26 | */ 27 | get sinks(): SinkListInstance { 28 | console.warn("sinks is deprecated. Use v1.sinks instead."); 29 | return this.v1.sinks; 30 | } 31 | 32 | /** 33 | * @deprecated - Use v1.subscriptions instead 34 | */ 35 | get subscriptions(): SubscriptionListInstance { 36 | console.warn("subscriptions is deprecated. Use v1.subscriptions instead."); 37 | return this.v1.subscriptions; 38 | } 39 | } 40 | 41 | export = Events; 42 | -------------------------------------------------------------------------------- /src/rest/EventsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./events/V1"; 14 | 15 | class EventsBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize events domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://events.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = EventsBase; 34 | -------------------------------------------------------------------------------- /src/rest/FlexApi.ts: -------------------------------------------------------------------------------- 1 | import { ChannelListInstance } from "./flexApi/v1/channel"; 2 | import { ConfigurationListInstance } from "./flexApi/v1/configuration"; 3 | import { FlexFlowListInstance } from "./flexApi/v1/flexFlow"; 4 | import { InteractionListInstance } from "./flexApi/v1/interaction"; 5 | import { WebChannelListInstance } from "./flexApi/v1/webChannel"; 6 | import { AssessmentsListInstance } from "./flexApi/v1/assessments"; 7 | import { WebChannelsListInstance } from "./flexApi/v2/webChannels"; 8 | 9 | import FlexApiBase from "./FlexApiBase"; 10 | 11 | class FlexApi extends FlexApiBase { 12 | /** 13 | * @deprecated - Use v1.assessments instead 14 | */ 15 | get assessments(): AssessmentsListInstance { 16 | console.warn("assessments is deprecated. Use v1.assessments instead."); 17 | return this.v1.assessments; 18 | } 19 | 20 | /** 21 | * @deprecated - Use v1.channel instead 22 | */ 23 | get channel(): ChannelListInstance { 24 | console.warn("channel is deprecated. Use v1.channel instead."); 25 | return this.v1.channel; 26 | } 27 | 28 | /** 29 | * @deprecated - Use v1.configuration instead 30 | */ 31 | get configuration(): ConfigurationListInstance { 32 | console.warn("configuration is deprecated. Use v1.configuration instead."); 33 | return this.v1.configuration; 34 | } 35 | 36 | /** 37 | * @deprecated - Use v1.flexFlow instead 38 | */ 39 | get flexFlow(): FlexFlowListInstance { 40 | console.warn("flexFlow is deprecated. Use v1.flexFlow instead."); 41 | return this.v1.flexFlow; 42 | } 43 | 44 | /** 45 | * @deprecated - Use v1.interaction instead 46 | */ 47 | get interaction(): InteractionListInstance { 48 | console.warn("interaction is deprecated. Use v1.interaction instead."); 49 | return this.v1.interaction; 50 | } 51 | 52 | /** 53 | * @deprecated - Use v1.webChannel instead 54 | */ 55 | get webChannel(): WebChannelListInstance { 56 | console.warn("webChannel is deprecated. Use v1.webChannel instead."); 57 | return this.v1.webChannel; 58 | } 59 | 60 | /** 61 | * @deprecated - Use v2.webChannels instead 62 | */ 63 | get webChannels(): WebChannelsListInstance { 64 | console.warn("webChannels is deprecated. Use v2.webChannels instead."); 65 | return this.v2.webChannels; 66 | } 67 | } 68 | 69 | export = FlexApi; 70 | -------------------------------------------------------------------------------- /src/rest/FlexApiBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./flexApi/V1"; 14 | import V2 from "./flexApi/V2"; 15 | 16 | class FlexApiBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize flexApi domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://flex-api.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = FlexApiBase; 40 | -------------------------------------------------------------------------------- /src/rest/FrontlineApi.ts: -------------------------------------------------------------------------------- 1 | import { UserListInstance } from "./frontlineApi/v1/user"; 2 | import FrontlineApiBase from "./FrontlineApiBase"; 3 | 4 | class FrontlineApi extends FrontlineApiBase { 5 | /** 6 | * @deprecated - Use v1.users instead 7 | */ 8 | get users(): UserListInstance { 9 | console.warn("users is deprecated. Use v1.users instead."); 10 | return this.v1.users; 11 | } 12 | } 13 | 14 | export = FrontlineApi; 15 | -------------------------------------------------------------------------------- /src/rest/FrontlineApiBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./frontlineApi/V1"; 14 | 15 | class FrontlineApiBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize frontlineApi domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://frontline-api.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = FrontlineApiBase; 34 | -------------------------------------------------------------------------------- /src/rest/Iam.ts: -------------------------------------------------------------------------------- 1 | import IamBase from "./IamBase"; 2 | 3 | class Iam extends IamBase {} 4 | 5 | export = Iam; 6 | -------------------------------------------------------------------------------- /src/rest/IamBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./iam/V1"; 14 | 15 | class IamBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize iam domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://iam.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = IamBase; 34 | -------------------------------------------------------------------------------- /src/rest/Insights.ts: -------------------------------------------------------------------------------- 1 | import { CallListInstance } from "./insights/v1/call"; 2 | import { CallSummariesListInstance } from "./insights/v1/callSummaries"; 3 | import { ConferenceListInstance } from "./insights/v1/conference"; 4 | import { RoomListInstance } from "./insights/v1/room"; 5 | import { SettingListInstance } from "./insights/v1/setting"; 6 | import InsightsBase from "./InsightsBase"; 7 | 8 | class Insights extends InsightsBase { 9 | /** 10 | * @deprecated - Use v1.settings instead 11 | */ 12 | get settings(): SettingListInstance { 13 | console.warn("settings is deprecated. Use v1.settings instead."); 14 | return this.v1.settings; 15 | } 16 | 17 | /** 18 | * @deprecated - Use v1.calls instead 19 | */ 20 | get calls(): CallListInstance { 21 | console.warn("calls is deprecated. Use v1.calls instead."); 22 | return this.v1.calls; 23 | } 24 | 25 | /** 26 | * @deprecated - Use v1.callSummaries instead 27 | */ 28 | get callSummaries(): CallSummariesListInstance { 29 | console.warn("callSummaries is deprecated. Use v1.callSummaries instead."); 30 | return this.v1.callSummaries; 31 | } 32 | 33 | /** 34 | * @deprecated - Use v1.conferences instead 35 | */ 36 | get conferences(): ConferenceListInstance { 37 | console.warn("conferences is deprecated. Use v1.conferences instead."); 38 | return this.v1.conferences; 39 | } 40 | 41 | /** 42 | * @deprecated - Use v1.rooms instead 43 | */ 44 | get rooms(): RoomListInstance { 45 | console.warn("rooms is deprecated. Use v1.rooms instead."); 46 | return this.v1.rooms; 47 | } 48 | } 49 | 50 | export = Insights; 51 | -------------------------------------------------------------------------------- /src/rest/InsightsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./insights/V1"; 14 | 15 | class InsightsBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize insights domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://insights.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = InsightsBase; 34 | -------------------------------------------------------------------------------- /src/rest/Intelligence.ts: -------------------------------------------------------------------------------- 1 | import IntelligenceBase from "./IntelligenceBase"; 2 | 3 | class Intelligence extends IntelligenceBase {} 4 | 5 | export = Intelligence; 6 | -------------------------------------------------------------------------------- /src/rest/IntelligenceBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V2 from "./intelligence/V2"; 14 | 15 | class IntelligenceBase extends Domain { 16 | _v2?: V2; 17 | 18 | /** 19 | * Initialize intelligence domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://intelligence.twilio.com"); 25 | } 26 | 27 | get v2(): V2 { 28 | this._v2 = this._v2 || new V2(this); 29 | return this._v2; 30 | } 31 | } 32 | 33 | export = IntelligenceBase; 34 | -------------------------------------------------------------------------------- /src/rest/IpMessaging.ts: -------------------------------------------------------------------------------- 1 | import { CredentialListInstance } from "./ipMessaging/v2/credential"; 2 | import { ServiceListInstance } from "./ipMessaging/v2/service"; 3 | import IpMessagingBase from "./IpMessagingBase"; 4 | 5 | class IpMessaging extends IpMessagingBase { 6 | /** 7 | * @deprecated - Use v2.credentials instead 8 | */ 9 | get credentials(): CredentialListInstance { 10 | console.warn("credentials is deprecated. Use v2.credentials instead."); 11 | return this.v2.credentials; 12 | } 13 | 14 | /** 15 | * @deprecated - Use v2.services instead 16 | */ 17 | get services(): ServiceListInstance { 18 | console.warn("services is deprecated. Use v2.services instead."); 19 | return this.v2.services; 20 | } 21 | } 22 | 23 | export = IpMessaging; 24 | -------------------------------------------------------------------------------- /src/rest/IpMessagingBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./ipMessaging/V1"; 14 | import V2 from "./ipMessaging/V2"; 15 | 16 | class IpMessagingBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize ipMessaging domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://ip-messaging.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = IpMessagingBase; 40 | -------------------------------------------------------------------------------- /src/rest/Knowledge.ts: -------------------------------------------------------------------------------- 1 | import KnowledgeBase from "./KnowledgeBase"; 2 | 3 | class Knowledge extends KnowledgeBase {} 4 | 5 | export = Knowledge; 6 | -------------------------------------------------------------------------------- /src/rest/KnowledgeBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./knowledge/V1"; 14 | 15 | class KnowledgeBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize knowledge domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://knowledge.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = KnowledgeBase; 34 | -------------------------------------------------------------------------------- /src/rest/Lookups.ts: -------------------------------------------------------------------------------- 1 | import { PhoneNumberListInstance } from "./lookups/v1/phoneNumber"; 2 | import LookupsBase from "./LookupsBase"; 3 | 4 | class Lookups extends LookupsBase { 5 | /** 6 | * @deprecated - Use v1.phoneNumbers instead 7 | */ 8 | get phoneNumbers(): PhoneNumberListInstance { 9 | console.warn("phoneNumbers is deprecated. Use v1.phoneNumbers instead."); 10 | return this.v1.phoneNumbers; 11 | } 12 | } 13 | 14 | export = Lookups; 15 | -------------------------------------------------------------------------------- /src/rest/LookupsBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./lookups/V1"; 14 | import V2 from "./lookups/V2"; 15 | 16 | class LookupsBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize lookups domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://lookups.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = LookupsBase; 40 | -------------------------------------------------------------------------------- /src/rest/Marketplace.ts: -------------------------------------------------------------------------------- 1 | import MarketplaceBase from "./MarketplaceBase"; 2 | 3 | class Marketplace extends MarketplaceBase {} 4 | 5 | export = Marketplace; 6 | -------------------------------------------------------------------------------- /src/rest/MarketplaceBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./marketplace/V1"; 14 | 15 | class MarketplaceBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize marketplace domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://marketplace.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = MarketplaceBase; 34 | -------------------------------------------------------------------------------- /src/rest/Messaging.ts: -------------------------------------------------------------------------------- 1 | import { BrandRegistrationListInstance } from "./messaging/v1/brandRegistration"; 2 | import { DeactivationsListInstance } from "./messaging/v1/deactivations"; 3 | import { ExternalCampaignListInstance } from "./messaging/v1/externalCampaign"; 4 | import { ServiceListInstance } from "./messaging/v1/service"; 5 | import { UsecaseListInstance } from "./messaging/v1/usecase"; 6 | import { DomainCertsListInstance } from "./messaging/v1/domainCerts"; 7 | import { DomainConfigListInstance } from "./messaging/v1/domainConfig"; 8 | import MessagingBase from "./MessagingBase"; 9 | 10 | class Messaging extends MessagingBase { 11 | /** 12 | * @deprecated - Use v1.brandRegistrations instead 13 | */ 14 | get brandRegistrations(): BrandRegistrationListInstance { 15 | console.warn( 16 | "brandRegistrations is deprecated. Use v1.brandRegistrations instead." 17 | ); 18 | return this.v1.brandRegistrations; 19 | } 20 | 21 | /** 22 | * @deprecated - Use v1.deactivations instead 23 | */ 24 | get deactivations(): DeactivationsListInstance { 25 | console.warn("deactivations is deprecated. Use v1.deactivations instead."); 26 | return this.v1.deactivations; 27 | } 28 | 29 | /** 30 | * @deprecated - Use v1.domainCerts instead 31 | */ 32 | get domainCerts(): DomainCertsListInstance { 33 | console.warn("domainCerts is deprecated. Use v1.domainCerts instead."); 34 | return this.v1.domainCerts; 35 | } 36 | 37 | /** 38 | * @deprecated - Use v1.domainConfig instead 39 | */ 40 | get domainConfig(): DomainConfigListInstance { 41 | console.warn("domainConfig is deprecated. Use v1.domainConfig instead."); 42 | return this.v1.domainConfig; 43 | } 44 | 45 | /** 46 | * @deprecated - Use v1.externalCampaign instead 47 | */ 48 | get externalCampaign(): ExternalCampaignListInstance { 49 | console.warn( 50 | "externalCampaign is deprecated. Use v1.externalCampaign instead." 51 | ); 52 | return this.v1.externalCampaign; 53 | } 54 | 55 | /** 56 | * @deprecated - Use v1.services instead 57 | */ 58 | get services(): ServiceListInstance { 59 | console.warn("services is deprecated. Use v1.services instead."); 60 | return this.v1.services; 61 | } 62 | 63 | /** 64 | * @deprecated - Use v1.usecases instead 65 | */ 66 | get usecases(): UsecaseListInstance { 67 | console.warn("usecases is deprecated. Use v1.usecases instead."); 68 | return this.v1.usecases; 69 | } 70 | } 71 | 72 | export = Messaging; 73 | -------------------------------------------------------------------------------- /src/rest/MessagingBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./messaging/V1"; 14 | import V2 from "./messaging/V2"; 15 | 16 | class MessagingBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize messaging domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://messaging.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = MessagingBase; 40 | -------------------------------------------------------------------------------- /src/rest/Microvisor.ts: -------------------------------------------------------------------------------- 1 | import { AppListInstance } from "./microvisor/v1/app"; 2 | import { DeviceListInstance } from "./microvisor/v1/device"; 3 | import MicrovisorBase from "./MicrovisorBase"; 4 | 5 | class Microvisor extends MicrovisorBase { 6 | /** 7 | * @deprecated - Use v1.apps instead 8 | */ 9 | get apps(): AppListInstance { 10 | console.warn("apps is deprecated. Use v1.apps instead."); 11 | return this.v1.apps; 12 | } 13 | 14 | /** 15 | * @deprecated - Use v1.devices instead 16 | */ 17 | get devices(): DeviceListInstance { 18 | console.warn("devices is deprecated. Use v1.devices instead."); 19 | return this.v1.devices; 20 | } 21 | } 22 | 23 | export = Microvisor; 24 | -------------------------------------------------------------------------------- /src/rest/MicrovisorBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./microvisor/V1"; 14 | 15 | class MicrovisorBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize microvisor domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://microvisor.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = MicrovisorBase; 34 | -------------------------------------------------------------------------------- /src/rest/Monitor.ts: -------------------------------------------------------------------------------- 1 | import { AlertListInstance } from "./monitor/v1/alert"; 2 | import { EventListInstance } from "./monitor/v1/event"; 3 | import MonitorBase from "./MonitorBase"; 4 | 5 | class Monitor extends MonitorBase { 6 | /** 7 | * @deprecated - Use v1.alerts instead 8 | */ 9 | get alerts(): AlertListInstance { 10 | console.warn("alerts is deprecated. Use v1.alerts instead."); 11 | return this.v1.alerts; 12 | } 13 | 14 | /** 15 | * @deprecated - Use v1.events instead 16 | */ 17 | get events(): EventListInstance { 18 | console.warn("events is deprecated. Use v1.events instead."); 19 | return this.v1.events; 20 | } 21 | } 22 | 23 | export = Monitor; 24 | -------------------------------------------------------------------------------- /src/rest/MonitorBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./monitor/V1"; 14 | 15 | class MonitorBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize monitor domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://monitor.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = MonitorBase; 34 | -------------------------------------------------------------------------------- /src/rest/Notify.ts: -------------------------------------------------------------------------------- 1 | import { CredentialListInstance } from "./notify/v1/credential"; 2 | import { ServiceListInstance } from "./notify/v1/service"; 3 | import NotifyBase from "./NotifyBase"; 4 | 5 | class Notify extends NotifyBase { 6 | /** 7 | * @deprecated - Use v1.credentials instead 8 | */ 9 | get credentials(): CredentialListInstance { 10 | console.warn("credentials is deprecated. Use v1.credentials instead."); 11 | return this.v1.credentials; 12 | } 13 | 14 | /** 15 | * @deprecated - Use v1.services instead 16 | */ 17 | get services(): ServiceListInstance { 18 | console.warn("services is deprecated. Use v1.services instead."); 19 | return this.v1.services; 20 | } 21 | } 22 | 23 | export = Notify; 24 | -------------------------------------------------------------------------------- /src/rest/NotifyBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./notify/V1"; 14 | 15 | class NotifyBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize notify domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://notify.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = NotifyBase; 34 | -------------------------------------------------------------------------------- /src/rest/Numbers.ts: -------------------------------------------------------------------------------- 1 | import { RegulatoryComplianceListInstance } from "./numbers/v2/regulatoryCompliance"; 2 | import NumbersBase from "./NumbersBase"; 3 | 4 | class Numbers extends NumbersBase { 5 | /** 6 | * @deprecated - Use v2.regulatoryCompliance instead 7 | */ 8 | get regulatoryCompliance(): RegulatoryComplianceListInstance { 9 | console.warn( 10 | "regulatoryCompliance is deprecated. Use v2.regulatoryCompliance instead." 11 | ); 12 | return this.v2.regulatoryCompliance; 13 | } 14 | } 15 | 16 | export = Numbers; 17 | -------------------------------------------------------------------------------- /src/rest/NumbersBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./numbers/V1"; 14 | import V2 from "./numbers/V2"; 15 | 16 | class NumbersBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize numbers domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://numbers.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = NumbersBase; 40 | -------------------------------------------------------------------------------- /src/rest/Oauth.ts: -------------------------------------------------------------------------------- 1 | import OauthBase from "./OauthBase"; 2 | 3 | class Oauth extends OauthBase {} 4 | 5 | export = Oauth; 6 | -------------------------------------------------------------------------------- /src/rest/OauthBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./oauth/V1"; 14 | 15 | class OauthBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize oauth domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://oauth.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = OauthBase; 34 | -------------------------------------------------------------------------------- /src/rest/Preview.ts: -------------------------------------------------------------------------------- 1 | import { AuthorizationDocumentListInstance } from "./preview/hosted_numbers/authorizationDocument"; 2 | import { HostedNumberOrderListInstance } from "./preview/hosted_numbers/hostedNumberOrder"; 3 | import { AvailableAddOnListInstance } from "./preview/marketplace/availableAddOn"; 4 | import { InstalledAddOnListInstance } from "./preview/marketplace/installedAddOn"; 5 | import { CommandListInstance } from "./preview/wireless/command"; 6 | import { RatePlanListInstance } from "./preview/wireless/ratePlan"; 7 | import { SimListInstance } from "./preview/wireless/sim"; 8 | import PreviewBase from "./PreviewBase"; 9 | 10 | class Preview extends PreviewBase { 11 | /** 12 | * @deprecated - Use hosted_numbers.authorizationDocuments instead 13 | */ 14 | get authorizationDocuments(): AuthorizationDocumentListInstance { 15 | console.warn( 16 | "authorizationDocuments is deprecated. Use hosted_numbers.authorizationDocuments instead." 17 | ); 18 | return this.hosted_numbers.authorizationDocuments; 19 | } 20 | 21 | /** 22 | * @deprecated - Use hosted_numbers.hostedNumberOrders instead 23 | */ 24 | get hostedNumberOrders(): HostedNumberOrderListInstance { 25 | console.warn( 26 | "hostedNumberOrders is deprecated. Use hosted_numbers.hostedNumberOrders instead." 27 | ); 28 | return this.hosted_numbers.hostedNumberOrders; 29 | } 30 | 31 | /** 32 | * @deprecated - Use marketplace.availableAddOns instead 33 | */ 34 | get availableAddOns(): AvailableAddOnListInstance { 35 | console.warn( 36 | "availableAddOns is deprecated. Use marketplace.availableAddOns instead." 37 | ); 38 | return this.marketplace.availableAddOns; 39 | } 40 | 41 | /** 42 | * @deprecated - Use marketplace.installedAddOns instead 43 | */ 44 | get installedAddOns(): InstalledAddOnListInstance { 45 | console.warn( 46 | "installedAddOns is deprecated. Use marketplace.installedAddOns instead." 47 | ); 48 | return this.marketplace.installedAddOns; 49 | } 50 | 51 | /** 52 | * @deprecated - Use wireless.commands instead 53 | */ 54 | get commands(): CommandListInstance { 55 | console.warn("commands is deprecated. Use wireless.commands instead."); 56 | return this.wireless.commands; 57 | } 58 | 59 | /** 60 | * @deprecated - Use wireless.ratePlans instead 61 | */ 62 | get ratePlans(): RatePlanListInstance { 63 | console.warn("ratePlans is deprecated. Use wireless.ratePlans instead."); 64 | return this.wireless.ratePlans; 65 | } 66 | 67 | /** 68 | * @deprecated - Use wireless.sims instead 69 | */ 70 | get sims(): SimListInstance { 71 | console.warn("sims is deprecated. Use wireless.sims instead."); 72 | return this.wireless.sims; 73 | } 74 | } 75 | 76 | export = Preview; 77 | -------------------------------------------------------------------------------- /src/rest/PreviewBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import HostedNumbers from "./preview/HostedNumbers"; 14 | import Marketplace from "./preview/Marketplace"; 15 | import Wireless from "./preview/Wireless"; 16 | 17 | class PreviewBase extends Domain { 18 | _hosted_numbers?: HostedNumbers; 19 | _marketplace?: Marketplace; 20 | _wireless?: Wireless; 21 | 22 | /** 23 | * Initialize preview domain 24 | * 25 | * @param twilio - The twilio client 26 | */ 27 | constructor(twilio: any) { 28 | super(twilio, "https://preview.twilio.com"); 29 | } 30 | 31 | get hosted_numbers(): HostedNumbers { 32 | this._hosted_numbers = this._hosted_numbers || new HostedNumbers(this); 33 | return this._hosted_numbers; 34 | } 35 | get marketplace(): Marketplace { 36 | this._marketplace = this._marketplace || new Marketplace(this); 37 | return this._marketplace; 38 | } 39 | get wireless(): Wireless { 40 | this._wireless = this._wireless || new Wireless(this); 41 | return this._wireless; 42 | } 43 | } 44 | 45 | export = PreviewBase; 46 | -------------------------------------------------------------------------------- /src/rest/PreviewIam.ts: -------------------------------------------------------------------------------- 1 | import { TokenListInstance } from "./previewIam/v1/token"; 2 | import { AuthorizeListInstance } from "./previewIam/v1/authorize"; 3 | import PreviewIamBase from "./PreviewIamBase"; 4 | import { OrganizationListInstance } from "./previewIam/versionless/organization"; 5 | import Versionless from "./previewIam/Versionless"; 6 | 7 | class PreviewIam extends PreviewIamBase { 8 | _organization?: OrganizationListInstance; 9 | /** 10 | * @deprecated - Use v1.tokens instead 11 | */ 12 | get tokens(): TokenListInstance { 13 | console.warn("tokens is deprecated. Use v1.tokens instead."); 14 | return this.v1.token; 15 | } 16 | 17 | /** 18 | * @deprecated - Use v1.authorize instead 19 | */ 20 | get authorize(): AuthorizeListInstance { 21 | console.warn("authorize is deprecated. Use v1.authorize instead."); 22 | return this.v1.authorize; 23 | } 24 | 25 | /** Getter for organization resource */ 26 | get organization(): OrganizationListInstance { 27 | this._organization = 28 | this._organization || new Versionless(this).organization; 29 | return this._organization; 30 | } 31 | } 32 | 33 | export = PreviewIam; 34 | -------------------------------------------------------------------------------- /src/rest/PreviewIamBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./previewIam/V1"; 14 | 15 | class PreviewIamBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize previewIam domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://preview-iam.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = PreviewIamBase; 34 | -------------------------------------------------------------------------------- /src/rest/Pricing.ts: -------------------------------------------------------------------------------- 1 | import { MessagingListInstance } from "./pricing/v1/messaging"; 2 | import { PhoneNumberListInstance } from "./pricing/v1/phoneNumber"; 3 | import { VoiceListInstance } from "./pricing/v2/voice"; 4 | import { CountryListInstance } from "./pricing/v2/country"; 5 | import { NumberListInstance } from "./pricing/v2/number"; 6 | import PricingBase from "./PricingBase"; 7 | 8 | class Pricing extends PricingBase { 9 | /** 10 | * @deprecated - Use v1.messaging instead 11 | */ 12 | get messaging(): MessagingListInstance { 13 | console.warn("messaging is deprecated. Use v1.messaging instead."); 14 | return this.v1.messaging; 15 | } 16 | 17 | /** 18 | * @deprecated - Use v1.phoneNumbers instead 19 | */ 20 | get phoneNumbers(): PhoneNumberListInstance { 21 | console.warn("phoneNumbers is deprecated. Use v1.phoneNumbers instead."); 22 | return this.v1.phoneNumbers; 23 | } 24 | 25 | /** 26 | * @deprecated - Use v2.voice instead 27 | */ 28 | get voice(): VoiceListInstance { 29 | console.warn("voice is deprecated. Use v2.voice instead."); 30 | return this.v2.voice; 31 | } 32 | 33 | /** 34 | * @deprecated - Use v2.countries instead 35 | */ 36 | get countries(): CountryListInstance { 37 | console.warn("countries is deprecated. Use v2.countries instead."); 38 | return this.v2.countries; 39 | } 40 | 41 | /** 42 | * @deprecated - Use v2.numbers instead 43 | */ 44 | get numbers(): NumberListInstance { 45 | console.warn("numbers is deprecated. Use v2.numbers instead."); 46 | return this.v2.numbers; 47 | } 48 | } 49 | 50 | export = Pricing; 51 | -------------------------------------------------------------------------------- /src/rest/PricingBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./pricing/V1"; 14 | import V2 from "./pricing/V2"; 15 | 16 | class PricingBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize pricing domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://pricing.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = PricingBase; 40 | -------------------------------------------------------------------------------- /src/rest/Proxy.ts: -------------------------------------------------------------------------------- 1 | import { ServiceListInstance } from "./proxy/v1/service"; 2 | import ProxyBase from "./ProxyBase"; 3 | 4 | class Proxy extends ProxyBase { 5 | /** 6 | * @deprecated - Use v1.services instead 7 | */ 8 | get services(): ServiceListInstance { 9 | console.warn("services is deprecated. Use v1.services instead."); 10 | return this.v1.services; 11 | } 12 | } 13 | 14 | export = Proxy; 15 | -------------------------------------------------------------------------------- /src/rest/ProxyBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./proxy/V1"; 14 | 15 | class ProxyBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize proxy domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://proxy.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = ProxyBase; 34 | -------------------------------------------------------------------------------- /src/rest/Routes.ts: -------------------------------------------------------------------------------- 1 | import { PhoneNumberListInstance } from "./routes/v2/phoneNumber"; 2 | import { SipDomainListInstance } from "./routes/v2/sipDomain"; 3 | import { TrunkListInstance } from "./routes/v2/trunk"; 4 | import RoutesBase from "./RoutesBase"; 5 | 6 | class Routes extends RoutesBase { 7 | /** 8 | * @deprecated - Use v1.phoneNumbers instead 9 | */ 10 | get phoneNumbers(): PhoneNumberListInstance { 11 | console.warn("phoneNumbers is deprecated. Use v1.phoneNumbers instead."); 12 | return this.v2.phoneNumbers; 13 | } 14 | 15 | /** 16 | * @deprecated - Use v1.sipDomains instead 17 | */ 18 | get sipDomains(): SipDomainListInstance { 19 | console.warn("sipDomains is deprecated. Use v1.sipDomains instead."); 20 | return this.v2.sipDomains; 21 | } 22 | 23 | /** 24 | * @deprecated - Use v1.trunks instead 25 | */ 26 | get trunks(): TrunkListInstance { 27 | console.warn("trunks is deprecated. Use v1.trunks instead."); 28 | return this.v2.trunks; 29 | } 30 | } 31 | 32 | export = Routes; 33 | -------------------------------------------------------------------------------- /src/rest/RoutesBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V2 from "./routes/V2"; 14 | 15 | class RoutesBase extends Domain { 16 | _v2?: V2; 17 | 18 | /** 19 | * Initialize routes domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://routes.twilio.com"); 25 | } 26 | 27 | get v2(): V2 { 28 | this._v2 = this._v2 || new V2(this); 29 | return this._v2; 30 | } 31 | } 32 | 33 | export = RoutesBase; 34 | -------------------------------------------------------------------------------- /src/rest/Serverless.ts: -------------------------------------------------------------------------------- 1 | import { ServiceListInstance } from "./serverless/v1/service"; 2 | import ServerlessBase from "./ServerlessBase"; 3 | 4 | class Serverless extends ServerlessBase { 5 | /** 6 | * @deprecated - Use v1.services instead 7 | */ 8 | get services(): ServiceListInstance { 9 | console.warn("services is deprecated. Use v1.services instead."); 10 | return this.v1.services; 11 | } 12 | } 13 | 14 | export = Serverless; 15 | -------------------------------------------------------------------------------- /src/rest/ServerlessBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./serverless/V1"; 14 | 15 | class ServerlessBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize serverless domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://serverless.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = ServerlessBase; 34 | -------------------------------------------------------------------------------- /src/rest/Studio.ts: -------------------------------------------------------------------------------- 1 | import { FlowListInstance } from "./studio/v2/flow"; 2 | import { FlowValidateListInstance } from "./studio/v2/flowValidate"; 3 | import StudioBase from "./StudioBase"; 4 | 5 | class Studio extends StudioBase { 6 | /** 7 | * @deprecated - Use v2.flows instead 8 | */ 9 | get flows(): FlowListInstance { 10 | console.warn("flows is deprecated. Use v2.flows instead."); 11 | return this.v2.flows; 12 | } 13 | 14 | /** 15 | * @deprecated - Use v2.flowValidate instead 16 | */ 17 | get flowValidate(): FlowValidateListInstance { 18 | console.warn("flowValidate is deprecated. Use v2.flowValidate instead."); 19 | return this.v2.flowValidate; 20 | } 21 | } 22 | 23 | export = Studio; 24 | -------------------------------------------------------------------------------- /src/rest/StudioBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./studio/V1"; 14 | import V2 from "./studio/V2"; 15 | 16 | class StudioBase extends Domain { 17 | _v1?: V1; 18 | _v2?: V2; 19 | 20 | /** 21 | * Initialize studio domain 22 | * 23 | * @param twilio - The twilio client 24 | */ 25 | constructor(twilio: any) { 26 | super(twilio, "https://studio.twilio.com"); 27 | } 28 | 29 | get v1(): V1 { 30 | this._v1 = this._v1 || new V1(this); 31 | return this._v1; 32 | } 33 | get v2(): V2 { 34 | this._v2 = this._v2 || new V2(this); 35 | return this._v2; 36 | } 37 | } 38 | 39 | export = StudioBase; 40 | -------------------------------------------------------------------------------- /src/rest/SupersimBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./supersim/V1"; 14 | 15 | class SupersimBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize supersim domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://supersim.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = SupersimBase; 34 | -------------------------------------------------------------------------------- /src/rest/Sync.ts: -------------------------------------------------------------------------------- 1 | import { ServiceListInstance } from "./sync/v1/service"; 2 | import SyncBase from "./SyncBase"; 3 | 4 | class Sync extends SyncBase { 5 | /** 6 | * @deprecated - Use v1.services instead 7 | */ 8 | get services(): ServiceListInstance { 9 | console.warn("services is deprecated. Use v1.services instead."); 10 | return this.v1.services; 11 | } 12 | } 13 | 14 | export = Sync; 15 | -------------------------------------------------------------------------------- /src/rest/SyncBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./sync/V1"; 14 | 15 | class SyncBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize sync domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://sync.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = SyncBase; 34 | -------------------------------------------------------------------------------- /src/rest/Taskrouter.ts: -------------------------------------------------------------------------------- 1 | import { WorkspaceListInstance } from "./taskrouter/v1/workspace"; 2 | import TaskrouterBase from "./TaskrouterBase"; 3 | 4 | class Taskrouter extends TaskrouterBase { 5 | /** 6 | * @deprecated - Use v1.workspaces instead 7 | */ 8 | get workspaces(): WorkspaceListInstance { 9 | console.warn("workspaces is deprecated. Use v1.workspaces instead."); 10 | return this.v1.workspaces; 11 | } 12 | } 13 | 14 | export = Taskrouter; 15 | -------------------------------------------------------------------------------- /src/rest/TaskrouterBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./taskrouter/V1"; 14 | 15 | class TaskrouterBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize taskrouter domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://taskrouter.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = TaskrouterBase; 34 | -------------------------------------------------------------------------------- /src/rest/Trunking.ts: -------------------------------------------------------------------------------- 1 | import { TrunkListInstance } from "./trunking/v1/trunk"; 2 | import TrunkingBase from "./TrunkingBase"; 3 | 4 | class Trunking extends TrunkingBase { 5 | /** 6 | * @deprecated - Use v1.trunks instead 7 | */ 8 | get trunks(): TrunkListInstance { 9 | console.warn("trunks is deprecated. Use v1.trunks instead."); 10 | return this.v1.trunks; 11 | } 12 | } 13 | 14 | export = Trunking; 15 | -------------------------------------------------------------------------------- /src/rest/TrunkingBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./trunking/V1"; 14 | 15 | class TrunkingBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize trunking domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://trunking.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = TrunkingBase; 34 | -------------------------------------------------------------------------------- /src/rest/Trusthub.ts: -------------------------------------------------------------------------------- 1 | import { CustomerProfilesListInstance } from "./trusthub/v1/customerProfiles"; 2 | import { EndUserListInstance } from "./trusthub/v1/endUser"; 3 | import { EndUserTypeListInstance } from "./trusthub/v1/endUserType"; 4 | import { PoliciesListInstance } from "./trusthub/v1/policies"; 5 | import { SupportingDocumentListInstance } from "./trusthub/v1/supportingDocument"; 6 | import { SupportingDocumentTypeListInstance } from "./trusthub/v1/supportingDocumentType"; 7 | import { TrustProductsListInstance } from "./trusthub/v1/trustProducts"; 8 | import TrusthubBase from "./TrusthubBase"; 9 | 10 | class Trusthub extends TrusthubBase { 11 | /** 12 | * @deprecated - Use v1.customerProfiles instead 13 | */ 14 | get customerProfiles(): CustomerProfilesListInstance { 15 | console.warn( 16 | "customerProfiles is deprecated. Use v1.customerProfiles instead." 17 | ); 18 | return this.v1.customerProfiles; 19 | } 20 | 21 | /** 22 | * @deprecated - Use v1.endUsers instead 23 | */ 24 | get endUsers(): EndUserListInstance { 25 | console.warn("endUsers is deprecated. Use v1.endUsers instead."); 26 | return this.v1.endUsers; 27 | } 28 | 29 | /** 30 | * @deprecated - Use v1.endUserTypes instead 31 | */ 32 | get endUserTypes(): EndUserTypeListInstance { 33 | console.warn("endUserTypes is deprecated. Use v1.endUserTypes instead."); 34 | return this.v1.endUserTypes; 35 | } 36 | 37 | /** 38 | * @deprecated - Use v1.policies instead 39 | */ 40 | get policies(): PoliciesListInstance { 41 | console.warn("policies is deprecated. Use v1.policies instead."); 42 | return this.v1.policies; 43 | } 44 | 45 | /** 46 | * @deprecated - Use v1.supportingDocuments instead 47 | */ 48 | get supportingDocuments(): SupportingDocumentListInstance { 49 | console.warn( 50 | "supportingDocuments is deprecated. Use v1.supportingDocuments instead." 51 | ); 52 | return this.v1.supportingDocuments; 53 | } 54 | 55 | /** 56 | * @deprecated - Use v1.supportingDocumentTypes instead 57 | */ 58 | get supportingDocumentTypes(): SupportingDocumentTypeListInstance { 59 | console.warn( 60 | "supportingDocumentTypes is deprecated. Use v1.supportingDocumentTypes instead." 61 | ); 62 | return this.v1.supportingDocumentTypes; 63 | } 64 | 65 | /** 66 | * @deprecated - Use v1.trustProducts instead 67 | */ 68 | get trustProducts(): TrustProductsListInstance { 69 | console.warn("trustProducts is deprecated. Use v1.trustProducts instead."); 70 | return this.v1.trustProducts; 71 | } 72 | } 73 | 74 | export = Trusthub; 75 | -------------------------------------------------------------------------------- /src/rest/TrusthubBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./trusthub/V1"; 14 | 15 | class TrusthubBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize trusthub domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://trusthub.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = TrusthubBase; 34 | -------------------------------------------------------------------------------- /src/rest/Verify.ts: -------------------------------------------------------------------------------- 1 | import { FormListInstance } from "./verify/v2/form"; 2 | import { ServiceListInstance } from "./verify/v2/service"; 3 | import { TemplateListInstance } from "./verify/v2/template"; 4 | import { VerificationAttemptListInstance } from "./verify/v2/verificationAttempt"; 5 | import { VerificationAttemptsSummaryListInstance } from "./verify/v2/verificationAttemptsSummary"; 6 | import VerifyBase from "./VerifyBase"; 7 | 8 | class Verify extends VerifyBase { 9 | /** 10 | * @deprecated - Use v2.forms instead 11 | */ 12 | get forms(): FormListInstance { 13 | console.warn("forms is deprecated. Use v2.forms instead."); 14 | return this.v2.forms; 15 | } 16 | 17 | /** 18 | * @deprecated - Use v2.services instead 19 | */ 20 | get services(): ServiceListInstance { 21 | console.warn("services is deprecated. Use v2.services instead."); 22 | return this.v2.services; 23 | } 24 | 25 | /** 26 | * @deprecated - Use v2.verificationAttempts instead 27 | */ 28 | get verificationAttempts(): VerificationAttemptListInstance { 29 | console.warn( 30 | "verificationAttempts is deprecated. Use v2.verificationAttempts instead." 31 | ); 32 | return this.v2.verificationAttempts; 33 | } 34 | 35 | /** 36 | * @deprecated - Use v2.verificationAttemptsSummary instead 37 | */ 38 | get verificationAttemptsSummary(): VerificationAttemptsSummaryListInstance { 39 | console.warn( 40 | "verificationAttemptsSummary is deprecated. Use v2.verificationAttemptsSummary instead." 41 | ); 42 | return this.v2.verificationAttemptsSummary; 43 | } 44 | 45 | /** 46 | * @deprecated - Use v2.templates instead 47 | */ 48 | get templates(): TemplateListInstance { 49 | console.warn("templates is deprecated. Use v2.templates instead."); 50 | return this.v2.templates; 51 | } 52 | } 53 | 54 | export = Verify; 55 | -------------------------------------------------------------------------------- /src/rest/VerifyBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V2 from "./verify/V2"; 14 | 15 | class VerifyBase extends Domain { 16 | _v2?: V2; 17 | 18 | /** 19 | * Initialize verify domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://verify.twilio.com"); 25 | } 26 | 27 | get v2(): V2 { 28 | this._v2 = this._v2 || new V2(this); 29 | return this._v2; 30 | } 31 | } 32 | 33 | export = VerifyBase; 34 | -------------------------------------------------------------------------------- /src/rest/Video.ts: -------------------------------------------------------------------------------- 1 | import { CompositionListInstance } from "./video/v1/composition"; 2 | import { CompositionHookListInstance } from "./video/v1/compositionHook"; 3 | import { CompositionSettingsListInstance } from "./video/v1/compositionSettings"; 4 | import { RecordingListInstance } from "./video/v1/recording"; 5 | import { RecordingSettingsListInstance } from "./video/v1/recordingSettings"; 6 | import { RoomListInstance } from "./video/v1/room"; 7 | import VideoBase from "./VideoBase"; 8 | 9 | class Video extends VideoBase { 10 | /** 11 | * @deprecated - Use v1.compositions instead 12 | */ 13 | get compositions(): CompositionListInstance { 14 | console.warn("compositions is deprecated. Use v1.compositions instead."); 15 | return this.v1.compositions; 16 | } 17 | 18 | /** 19 | * @deprecated - Use v1.compositionHooks instead 20 | */ 21 | get compositionHooks(): CompositionHookListInstance { 22 | console.warn( 23 | "compositionHooks is deprecated. Use v1.compositionHooks instead." 24 | ); 25 | return this.v1.compositionHooks; 26 | } 27 | 28 | /** 29 | * @deprecated - Use v1.compositionSettings instead 30 | */ 31 | get compositionSettings(): CompositionSettingsListInstance { 32 | console.warn( 33 | "compositionSettings is deprecated. Use v1.compositionSettings instead." 34 | ); 35 | return this.v1.compositionSettings; 36 | } 37 | 38 | /** 39 | * @deprecated - Use v1.recordings instead 40 | */ 41 | get recordings(): RecordingListInstance { 42 | console.warn("recordings is deprecated. Use v1.recordings instead."); 43 | return this.v1.recordings; 44 | } 45 | 46 | /** 47 | * @deprecated - Use v1.recordingSettings instead 48 | */ 49 | get recordingSettings(): RecordingSettingsListInstance { 50 | console.warn( 51 | "recordingSettings is deprecated. Use v1.recordingSettings instead." 52 | ); 53 | return this.v1.recordingSettings; 54 | } 55 | 56 | /** 57 | * @deprecated - Use v1.rooms instead 58 | */ 59 | get rooms(): RoomListInstance { 60 | console.warn("rooms is deprecated. Use v1.rooms instead."); 61 | return this.v1.rooms; 62 | } 63 | } 64 | 65 | export = Video; 66 | -------------------------------------------------------------------------------- /src/rest/VideoBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./video/V1"; 14 | 15 | class VideoBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize video domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://video.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = VideoBase; 34 | -------------------------------------------------------------------------------- /src/rest/Voice.ts: -------------------------------------------------------------------------------- 1 | import { ArchivedCallListInstance } from "./voice/v1/archivedCall"; 2 | import { ByocTrunkListInstance } from "./voice/v1/byocTrunk"; 3 | import { ConnectionPolicyListInstance } from "./voice/v1/connectionPolicy"; 4 | import { DialingPermissionsListInstance } from "./voice/v1/dialingPermissions"; 5 | import { IpRecordListInstance } from "./voice/v1/ipRecord"; 6 | import { SourceIpMappingListInstance } from "./voice/v1/sourceIpMapping"; 7 | import VoiceBase from "./VoiceBase"; 8 | 9 | class Voice extends VoiceBase { 10 | /** 11 | * @deprecated - Use v1.archivedCalls instead 12 | */ 13 | get archivedCalls(): ArchivedCallListInstance { 14 | console.warn("archivedCalls is deprecated. Use v1.archivedCalls instead."); 15 | return this.v1.archivedCalls; 16 | } 17 | 18 | /** 19 | * @deprecated - Use v1.byocTrunks instead 20 | */ 21 | get byocTrunks(): ByocTrunkListInstance { 22 | console.warn("byocTrunks is deprecated. Use v1.byocTrunks instead."); 23 | return this.v1.byocTrunks; 24 | } 25 | 26 | /** 27 | * @deprecated - Use v1.connectionPolicies instead 28 | */ 29 | get connectionPolicies(): ConnectionPolicyListInstance { 30 | console.warn( 31 | "connectionPolicies is deprecated. Use v1.connectionPolicies instead." 32 | ); 33 | return this.v1.connectionPolicies; 34 | } 35 | 36 | /** 37 | * @deprecated - Use v1.dialingPermissions instead 38 | */ 39 | get dialingPermissions(): DialingPermissionsListInstance { 40 | console.warn( 41 | "dialingPermissions is deprecated. Use v1.dialingPermissions instead." 42 | ); 43 | return this.v1.dialingPermissions; 44 | } 45 | 46 | /** 47 | * @deprecated - Use v1.ipRecords instead 48 | */ 49 | get ipRecords(): IpRecordListInstance { 50 | console.warn("ipRecords is deprecated. Use v1.ipRecords instead."); 51 | return this.v1.ipRecords; 52 | } 53 | 54 | /** 55 | * @deprecated - Use v1.sourceIpMappings instead 56 | */ 57 | get sourceIpMappings(): SourceIpMappingListInstance { 58 | console.warn( 59 | "sourceIpMappings is deprecated. Use v1.sourceIpMappings instead." 60 | ); 61 | return this.v1.sourceIpMappings; 62 | } 63 | } 64 | 65 | export = Voice; 66 | -------------------------------------------------------------------------------- /src/rest/VoiceBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./voice/V1"; 14 | 15 | class VoiceBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize voice domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://voice.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = VoiceBase; 34 | -------------------------------------------------------------------------------- /src/rest/Wireless.ts: -------------------------------------------------------------------------------- 1 | import { CommandListInstance } from "./wireless/v1/command"; 2 | import { RatePlanListInstance } from "./wireless/v1/ratePlan"; 3 | import { SimListInstance } from "./wireless/v1/sim"; 4 | import { UsageRecordListInstance } from "./wireless/v1/usageRecord"; 5 | import WirelessBase from "./WirelessBase"; 6 | 7 | class Wireless extends WirelessBase { 8 | /** 9 | * @deprecated - Use v1.usageRecords instead 10 | */ 11 | get usageRecords(): UsageRecordListInstance { 12 | console.warn("usageRecords is deprecated. Use v1.usageRecords instead."); 13 | return this.v1.usageRecords; 14 | } 15 | 16 | /** 17 | * @deprecated - Use v1.commands instead 18 | */ 19 | get commands(): CommandListInstance { 20 | console.warn("commands is deprecated. Use v1.commands instead."); 21 | return this.v1.commands; 22 | } 23 | 24 | /** 25 | * @deprecated - Use v1.ratePlans instead 26 | */ 27 | get ratePlans(): RatePlanListInstance { 28 | console.warn("ratePlans is deprecated. Use v1.ratePlans instead."); 29 | return this.v1.ratePlans; 30 | } 31 | 32 | /** 33 | * @deprecated - Use v1.sims instead 34 | */ 35 | get sims(): SimListInstance { 36 | console.warn("sims is deprecated. Use v1.sims instead."); 37 | return this.v1.sims; 38 | } 39 | } 40 | 41 | export = Wireless; 42 | -------------------------------------------------------------------------------- /src/rest/WirelessBase.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | 12 | import Domain from "../base/Domain"; 13 | import V1 from "./wireless/V1"; 14 | 15 | class WirelessBase extends Domain { 16 | _v1?: V1; 17 | 18 | /** 19 | * Initialize wireless domain 20 | * 21 | * @param twilio - The twilio client 22 | */ 23 | constructor(twilio: any) { 24 | super(twilio, "https://wireless.twilio.com"); 25 | } 26 | 27 | get v1(): V1 { 28 | this._v1 = this._v1 || new V1(this); 29 | return this._v1; 30 | } 31 | } 32 | 33 | export = WirelessBase; 34 | -------------------------------------------------------------------------------- /src/rest/accounts/v1/credential.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Accounts 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import { inspect, InspectOptions } from "util"; 16 | import V1 from "../V1"; 17 | const deserialize = require("../../../base/deserialize"); 18 | const serialize = require("../../../base/serialize"); 19 | import { isValidPathParam } from "../../../base/utility"; 20 | import { AwsListInstance } from "./credential/aws"; 21 | import { PublicKeyListInstance } from "./credential/publicKey"; 22 | 23 | export interface CredentialSolution {} 24 | 25 | export interface CredentialListInstance { 26 | _version: V1; 27 | _solution: CredentialSolution; 28 | _uri: string; 29 | 30 | _aws?: AwsListInstance; 31 | aws: AwsListInstance; 32 | _publicKey?: PublicKeyListInstance; 33 | publicKey: PublicKeyListInstance; 34 | 35 | /** 36 | * Provide a user-friendly representation 37 | */ 38 | toJSON(): any; 39 | [inspect.custom](_depth: any, options: InspectOptions): any; 40 | } 41 | 42 | export function CredentialListInstance(version: V1): CredentialListInstance { 43 | const instance = {} as CredentialListInstance; 44 | 45 | instance._version = version; 46 | instance._solution = {}; 47 | instance._uri = `/Credentials`; 48 | 49 | Object.defineProperty(instance, "aws", { 50 | get: function aws() { 51 | if (!instance._aws) { 52 | instance._aws = AwsListInstance(instance._version); 53 | } 54 | return instance._aws; 55 | }, 56 | }); 57 | 58 | Object.defineProperty(instance, "publicKey", { 59 | get: function publicKey() { 60 | if (!instance._publicKey) { 61 | instance._publicKey = PublicKeyListInstance(instance._version); 62 | } 63 | return instance._publicKey; 64 | }, 65 | }); 66 | 67 | instance.toJSON = function toJSON() { 68 | return instance._solution; 69 | }; 70 | 71 | instance[inspect.custom] = function inspectImpl( 72 | _depth: any, 73 | options: InspectOptions 74 | ) { 75 | return inspect(instance.toJSON(), options); 76 | }; 77 | 78 | return instance; 79 | } 80 | -------------------------------------------------------------------------------- /src/rest/api/V2010.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Api 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ApiBase from "../ApiBase"; 16 | import Version from "../../base/Version"; 17 | import { AccountListInstance } from "./v2010/account"; 18 | import { AccountContext } from "./v2010/account"; 19 | 20 | export default class V2010 extends Version { 21 | /** 22 | * Initialize the V2010 version of Api 23 | * 24 | * @param domain - The Twilio (Twilio.Api) domain 25 | */ 26 | constructor(domain: ApiBase) { 27 | super(domain, "2010-04-01"); 28 | } 29 | 30 | /** accounts - { Twilio.Api.V2010.AccountListInstance } resource */ 31 | protected _accounts?: AccountListInstance; 32 | /** account - { Twilio.Api.V2010.AccountContext } resource */ 33 | protected _account?: AccountContext; 34 | 35 | /** Getter for accounts resource */ 36 | get accounts(): AccountListInstance { 37 | this._accounts = this._accounts || AccountListInstance(this); 38 | return this._accounts; 39 | } 40 | 41 | /** Getter for account resource */ 42 | get account(): AccountContext { 43 | this._account = 44 | this._account || AccountListInstance(this)(this.domain.twilio.accountSid); 45 | return this._account; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/rest/bulkexports/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Bulkexports 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import BulkexportsBase from "../BulkexportsBase"; 16 | import Version from "../../base/Version"; 17 | import { ExportListInstance } from "./v1/export"; 18 | import { ExportConfigurationListInstance } from "./v1/exportConfiguration"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of Bulkexports 23 | * 24 | * @param domain - The Twilio (Twilio.Bulkexports) domain 25 | */ 26 | constructor(domain: BulkexportsBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** exports - { Twilio.Bulkexports.V1.ExportListInstance } resource */ 31 | protected _exports?: ExportListInstance; 32 | /** exportConfiguration - { Twilio.Bulkexports.V1.ExportConfigurationListInstance } resource */ 33 | protected _exportConfiguration?: ExportConfigurationListInstance; 34 | 35 | /** Getter for exports resource */ 36 | get exports(): ExportListInstance { 37 | this._exports = this._exports || ExportListInstance(this); 38 | return this._exports; 39 | } 40 | 41 | /** Getter for exportConfiguration resource */ 42 | get exportConfiguration(): ExportConfigurationListInstance { 43 | this._exportConfiguration = 44 | this._exportConfiguration || ExportConfigurationListInstance(this); 45 | return this._exportConfiguration; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/rest/chat/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Chat 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ChatBase from "../ChatBase"; 16 | import Version from "../../base/Version"; 17 | import { CredentialListInstance } from "./v1/credential"; 18 | import { ServiceListInstance } from "./v1/service"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of Chat 23 | * 24 | * @param domain - The Twilio (Twilio.Chat) domain 25 | */ 26 | constructor(domain: ChatBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** credentials - { Twilio.Chat.V1.CredentialListInstance } resource */ 31 | protected _credentials?: CredentialListInstance; 32 | /** services - { Twilio.Chat.V1.ServiceListInstance } resource */ 33 | protected _services?: ServiceListInstance; 34 | 35 | /** Getter for credentials resource */ 36 | get credentials(): CredentialListInstance { 37 | this._credentials = this._credentials || CredentialListInstance(this); 38 | return this._credentials; 39 | } 40 | 41 | /** Getter for services resource */ 42 | get services(): ServiceListInstance { 43 | this._services = this._services || ServiceListInstance(this); 44 | return this._services; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/chat/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Chat 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ChatBase from "../ChatBase"; 16 | import Version from "../../base/Version"; 17 | import { CredentialListInstance } from "./v2/credential"; 18 | import { ServiceListInstance } from "./v2/service"; 19 | 20 | export default class V2 extends Version { 21 | /** 22 | * Initialize the V2 version of Chat 23 | * 24 | * @param domain - The Twilio (Twilio.Chat) domain 25 | */ 26 | constructor(domain: ChatBase) { 27 | super(domain, "v2"); 28 | } 29 | 30 | /** credentials - { Twilio.Chat.V2.CredentialListInstance } resource */ 31 | protected _credentials?: CredentialListInstance; 32 | /** services - { Twilio.Chat.V2.ServiceListInstance } resource */ 33 | protected _services?: ServiceListInstance; 34 | 35 | /** Getter for credentials resource */ 36 | get credentials(): CredentialListInstance { 37 | this._credentials = this._credentials || CredentialListInstance(this); 38 | return this._credentials; 39 | } 40 | 41 | /** Getter for services resource */ 42 | get services(): ServiceListInstance { 43 | this._services = this._services || ServiceListInstance(this); 44 | return this._services; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/chat/V3.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Chat 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ChatBase from "../ChatBase"; 16 | import Version from "../../base/Version"; 17 | import { ChannelListInstance } from "./v3/channel"; 18 | 19 | export default class V3 extends Version { 20 | /** 21 | * Initialize the V3 version of Chat 22 | * 23 | * @param domain - The Twilio (Twilio.Chat) domain 24 | */ 25 | constructor(domain: ChatBase) { 26 | super(domain, "v3"); 27 | } 28 | 29 | /** channels - { Twilio.Chat.V3.ChannelListInstance } resource */ 30 | protected _channels?: ChannelListInstance; 31 | 32 | /** Getter for channels resource */ 33 | get channels(): ChannelListInstance { 34 | this._channels = this._channels || ChannelListInstance(this); 35 | return this._channels; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/content/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Content 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ContentBase from "../ContentBase"; 16 | import Version from "../../base/Version"; 17 | import { ContentListInstance } from "./v1/content"; 18 | import { ContentAndApprovalsListInstance } from "./v1/contentAndApprovals"; 19 | import { LegacyContentListInstance } from "./v1/legacyContent"; 20 | 21 | export default class V1 extends Version { 22 | /** 23 | * Initialize the V1 version of Content 24 | * 25 | * @param domain - The Twilio (Twilio.Content) domain 26 | */ 27 | constructor(domain: ContentBase) { 28 | super(domain, "v1"); 29 | } 30 | 31 | /** contents - { Twilio.Content.V1.ContentListInstance } resource */ 32 | protected _contents?: ContentListInstance; 33 | /** contentAndApprovals - { Twilio.Content.V1.ContentAndApprovalsListInstance } resource */ 34 | protected _contentAndApprovals?: ContentAndApprovalsListInstance; 35 | /** legacyContents - { Twilio.Content.V1.LegacyContentListInstance } resource */ 36 | protected _legacyContents?: LegacyContentListInstance; 37 | 38 | /** Getter for contents resource */ 39 | get contents(): ContentListInstance { 40 | this._contents = this._contents || ContentListInstance(this); 41 | return this._contents; 42 | } 43 | 44 | /** Getter for contentAndApprovals resource */ 45 | get contentAndApprovals(): ContentAndApprovalsListInstance { 46 | this._contentAndApprovals = 47 | this._contentAndApprovals || ContentAndApprovalsListInstance(this); 48 | return this._contentAndApprovals; 49 | } 50 | 51 | /** Getter for legacyContents resource */ 52 | get legacyContents(): LegacyContentListInstance { 53 | this._legacyContents = 54 | this._legacyContents || LegacyContentListInstance(this); 55 | return this._legacyContents; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/rest/content/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Content 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ContentBase from "../ContentBase"; 16 | import Version from "../../base/Version"; 17 | import { ContentListInstance } from "./v2/content"; 18 | import { ContentAndApprovalsListInstance } from "./v2/contentAndApprovals"; 19 | 20 | export default class V2 extends Version { 21 | /** 22 | * Initialize the V2 version of Content 23 | * 24 | * @param domain - The Twilio (Twilio.Content) domain 25 | */ 26 | constructor(domain: ContentBase) { 27 | super(domain, "v2"); 28 | } 29 | 30 | /** contents - { Twilio.Content.V2.ContentListInstance } resource */ 31 | protected _contents?: ContentListInstance; 32 | /** contentAndApprovals - { Twilio.Content.V2.ContentAndApprovalsListInstance } resource */ 33 | protected _contentAndApprovals?: ContentAndApprovalsListInstance; 34 | 35 | /** Getter for contents resource */ 36 | get contents(): ContentListInstance { 37 | this._contents = this._contents || ContentListInstance(this); 38 | return this._contents; 39 | } 40 | 41 | /** Getter for contentAndApprovals resource */ 42 | get contentAndApprovals(): ContentAndApprovalsListInstance { 43 | this._contentAndApprovals = 44 | this._contentAndApprovals || ContentAndApprovalsListInstance(this); 45 | return this._contentAndApprovals; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/rest/events/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Events 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import EventsBase from "../EventsBase"; 16 | import Version from "../../base/Version"; 17 | import { EventTypeListInstance } from "./v1/eventType"; 18 | import { SchemaListInstance } from "./v1/schema"; 19 | import { SinkListInstance } from "./v1/sink"; 20 | import { SubscriptionListInstance } from "./v1/subscription"; 21 | 22 | export default class V1 extends Version { 23 | /** 24 | * Initialize the V1 version of Events 25 | * 26 | * @param domain - The Twilio (Twilio.Events) domain 27 | */ 28 | constructor(domain: EventsBase) { 29 | super(domain, "v1"); 30 | } 31 | 32 | /** eventTypes - { Twilio.Events.V1.EventTypeListInstance } resource */ 33 | protected _eventTypes?: EventTypeListInstance; 34 | /** schemas - { Twilio.Events.V1.SchemaListInstance } resource */ 35 | protected _schemas?: SchemaListInstance; 36 | /** sinks - { Twilio.Events.V1.SinkListInstance } resource */ 37 | protected _sinks?: SinkListInstance; 38 | /** subscriptions - { Twilio.Events.V1.SubscriptionListInstance } resource */ 39 | protected _subscriptions?: SubscriptionListInstance; 40 | 41 | /** Getter for eventTypes resource */ 42 | get eventTypes(): EventTypeListInstance { 43 | this._eventTypes = this._eventTypes || EventTypeListInstance(this); 44 | return this._eventTypes; 45 | } 46 | 47 | /** Getter for schemas resource */ 48 | get schemas(): SchemaListInstance { 49 | this._schemas = this._schemas || SchemaListInstance(this); 50 | return this._schemas; 51 | } 52 | 53 | /** Getter for sinks resource */ 54 | get sinks(): SinkListInstance { 55 | this._sinks = this._sinks || SinkListInstance(this); 56 | return this._sinks; 57 | } 58 | 59 | /** Getter for subscriptions resource */ 60 | get subscriptions(): SubscriptionListInstance { 61 | this._subscriptions = this._subscriptions || SubscriptionListInstance(this); 62 | return this._subscriptions; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/rest/flexApi/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Flex 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import FlexApiBase from "../FlexApiBase"; 16 | import Version from "../../base/Version"; 17 | import { FlexUserListInstance } from "./v2/flexUser"; 18 | import { WebChannelsListInstance } from "./v2/webChannels"; 19 | 20 | export default class V2 extends Version { 21 | /** 22 | * Initialize the V2 version of FlexApi 23 | * 24 | * @param domain - The Twilio (Twilio.FlexApi) domain 25 | */ 26 | constructor(domain: FlexApiBase) { 27 | super(domain, "v2"); 28 | } 29 | 30 | /** flexUser - { Twilio.FlexApi.V2.FlexUserListInstance } resource */ 31 | protected _flexUser?: FlexUserListInstance; 32 | /** webChannels - { Twilio.FlexApi.V2.WebChannelsListInstance } resource */ 33 | protected _webChannels?: WebChannelsListInstance; 34 | 35 | /** Getter for flexUser resource */ 36 | get flexUser(): FlexUserListInstance { 37 | this._flexUser = this._flexUser || FlexUserListInstance(this); 38 | return this._flexUser; 39 | } 40 | 41 | /** Getter for webChannels resource */ 42 | get webChannels(): WebChannelsListInstance { 43 | this._webChannels = this._webChannels || WebChannelsListInstance(this); 44 | return this._webChannels; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/frontlineApi/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Frontline 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import FrontlineApiBase from "../FrontlineApiBase"; 16 | import Version from "../../base/Version"; 17 | import { UserListInstance } from "./v1/user"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of FrontlineApi 22 | * 23 | * @param domain - The Twilio (Twilio.FrontlineApi) domain 24 | */ 25 | constructor(domain: FrontlineApiBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** users - { Twilio.FrontlineApi.V1.UserListInstance } resource */ 30 | protected _users?: UserListInstance; 31 | 32 | /** Getter for users resource */ 33 | get users(): UserListInstance { 34 | this._users = this._users || UserListInstance(this); 35 | return this._users; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/iam/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Iam 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import IamBase from "../IamBase"; 16 | import Version from "../../base/Version"; 17 | import { ApiKeyListInstance } from "./v1/apiKey"; 18 | import { GetApiKeysListInstance } from "./v1/getApiKeys"; 19 | import { NewApiKeyListInstance } from "./v1/newApiKey"; 20 | import { TokenListInstance } from "./v1/token"; 21 | 22 | export default class V1 extends Version { 23 | /** 24 | * Initialize the V1 version of Iam 25 | * 26 | * @param domain - The Twilio (Twilio.Iam) domain 27 | */ 28 | constructor(domain: IamBase) { 29 | super(domain, "v1"); 30 | } 31 | 32 | /** apiKey - { Twilio.Iam.V1.ApiKeyListInstance } resource */ 33 | protected _apiKey?: ApiKeyListInstance; 34 | /** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */ 35 | protected _getApiKeys?: GetApiKeysListInstance; 36 | /** newApiKey - { Twilio.Iam.V1.NewApiKeyListInstance } resource */ 37 | protected _newApiKey?: NewApiKeyListInstance; 38 | /** token - { Twilio.Iam.V1.TokenListInstance } resource */ 39 | protected _token?: TokenListInstance; 40 | 41 | /** Getter for apiKey resource */ 42 | get apiKey(): ApiKeyListInstance { 43 | this._apiKey = this._apiKey || ApiKeyListInstance(this); 44 | return this._apiKey; 45 | } 46 | 47 | /** Getter for getApiKeys resource */ 48 | get getApiKeys(): GetApiKeysListInstance { 49 | this._getApiKeys = this._getApiKeys || GetApiKeysListInstance(this); 50 | return this._getApiKeys; 51 | } 52 | 53 | /** Getter for newApiKey resource */ 54 | get newApiKey(): NewApiKeyListInstance { 55 | this._newApiKey = this._newApiKey || NewApiKeyListInstance(this); 56 | return this._newApiKey; 57 | } 58 | 59 | /** Getter for token resource */ 60 | get token(): TokenListInstance { 61 | this._token = this._token || TokenListInstance(this); 62 | return this._token; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/rest/ipMessaging/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Ip_messaging 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import IpMessagingBase from "../IpMessagingBase"; 16 | import Version from "../../base/Version"; 17 | import { CredentialListInstance } from "./v1/credential"; 18 | import { ServiceListInstance } from "./v1/service"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of IpMessaging 23 | * 24 | * @param domain - The Twilio (Twilio.IpMessaging) domain 25 | */ 26 | constructor(domain: IpMessagingBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** credentials - { Twilio.IpMessaging.V1.CredentialListInstance } resource */ 31 | protected _credentials?: CredentialListInstance; 32 | /** services - { Twilio.IpMessaging.V1.ServiceListInstance } resource */ 33 | protected _services?: ServiceListInstance; 34 | 35 | /** Getter for credentials resource */ 36 | get credentials(): CredentialListInstance { 37 | this._credentials = this._credentials || CredentialListInstance(this); 38 | return this._credentials; 39 | } 40 | 41 | /** Getter for services resource */ 42 | get services(): ServiceListInstance { 43 | this._services = this._services || ServiceListInstance(this); 44 | return this._services; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/ipMessaging/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Ip_messaging 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import IpMessagingBase from "../IpMessagingBase"; 16 | import Version from "../../base/Version"; 17 | import { CredentialListInstance } from "./v2/credential"; 18 | import { ServiceListInstance } from "./v2/service"; 19 | 20 | export default class V2 extends Version { 21 | /** 22 | * Initialize the V2 version of IpMessaging 23 | * 24 | * @param domain - The Twilio (Twilio.IpMessaging) domain 25 | */ 26 | constructor(domain: IpMessagingBase) { 27 | super(domain, "v2"); 28 | } 29 | 30 | /** credentials - { Twilio.IpMessaging.V2.CredentialListInstance } resource */ 31 | protected _credentials?: CredentialListInstance; 32 | /** services - { Twilio.IpMessaging.V2.ServiceListInstance } resource */ 33 | protected _services?: ServiceListInstance; 34 | 35 | /** Getter for credentials resource */ 36 | get credentials(): CredentialListInstance { 37 | this._credentials = this._credentials || CredentialListInstance(this); 38 | return this._credentials; 39 | } 40 | 41 | /** Getter for services resource */ 42 | get services(): ServiceListInstance { 43 | this._services = this._services || ServiceListInstance(this); 44 | return this._services; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/knowledge/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Knowledge 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import KnowledgeBase from "../KnowledgeBase"; 16 | import Version from "../../base/Version"; 17 | import { KnowledgeListInstance } from "./v1/knowledge"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Knowledge 22 | * 23 | * @param domain - The Twilio (Twilio.Knowledge) domain 24 | */ 25 | constructor(domain: KnowledgeBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** knowledge - { Twilio.Knowledge.V1.KnowledgeListInstance } resource */ 30 | protected _knowledge?: KnowledgeListInstance; 31 | 32 | /** Getter for knowledge resource */ 33 | get knowledge(): KnowledgeListInstance { 34 | this._knowledge = this._knowledge || KnowledgeListInstance(this); 35 | return this._knowledge; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/lookups/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Lookups 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import LookupsBase from "../LookupsBase"; 16 | import Version from "../../base/Version"; 17 | import { PhoneNumberListInstance } from "./v1/phoneNumber"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Lookups 22 | * 23 | * @param domain - The Twilio (Twilio.Lookups) domain 24 | */ 25 | constructor(domain: LookupsBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** phoneNumbers - { Twilio.Lookups.V1.PhoneNumberListInstance } resource */ 30 | protected _phoneNumbers?: PhoneNumberListInstance; 31 | 32 | /** Getter for phoneNumbers resource */ 33 | get phoneNumbers(): PhoneNumberListInstance { 34 | this._phoneNumbers = this._phoneNumbers || PhoneNumberListInstance(this); 35 | return this._phoneNumbers; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/lookups/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Lookups 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import LookupsBase from "../LookupsBase"; 16 | import Version from "../../base/Version"; 17 | import { PhoneNumberListInstance } from "./v2/phoneNumber"; 18 | 19 | export default class V2 extends Version { 20 | /** 21 | * Initialize the V2 version of Lookups 22 | * 23 | * @param domain - The Twilio (Twilio.Lookups) domain 24 | */ 25 | constructor(domain: LookupsBase) { 26 | super(domain, "v2"); 27 | } 28 | 29 | /** phoneNumbers - { Twilio.Lookups.V2.PhoneNumberListInstance } resource */ 30 | protected _phoneNumbers?: PhoneNumberListInstance; 31 | 32 | /** Getter for phoneNumbers resource */ 33 | get phoneNumbers(): PhoneNumberListInstance { 34 | this._phoneNumbers = this._phoneNumbers || PhoneNumberListInstance(this); 35 | return this._phoneNumbers; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/messaging/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Messaging 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import MessagingBase from "../MessagingBase"; 16 | import Version from "../../base/Version"; 17 | import { ChannelsSenderListInstance } from "./v2/channelsSender"; 18 | 19 | export default class V2 extends Version { 20 | /** 21 | * Initialize the V2 version of Messaging 22 | * 23 | * @param domain - The Twilio (Twilio.Messaging) domain 24 | */ 25 | constructor(domain: MessagingBase) { 26 | super(domain, "v2"); 27 | } 28 | 29 | /** channelsSenders - { Twilio.Messaging.V2.ChannelsSenderListInstance } resource */ 30 | protected _channelsSenders?: ChannelsSenderListInstance; 31 | 32 | /** Getter for channelsSenders resource */ 33 | get channelsSenders(): ChannelsSenderListInstance { 34 | this._channelsSenders = 35 | this._channelsSenders || ChannelsSenderListInstance(this); 36 | return this._channelsSenders; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/rest/microvisor/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Microvisor 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import MicrovisorBase from "../MicrovisorBase"; 16 | import Version from "../../base/Version"; 17 | import { AccountConfigListInstance } from "./v1/accountConfig"; 18 | import { AccountSecretListInstance } from "./v1/accountSecret"; 19 | import { AppListInstance } from "./v1/app"; 20 | import { DeviceListInstance } from "./v1/device"; 21 | 22 | export default class V1 extends Version { 23 | /** 24 | * Initialize the V1 version of Microvisor 25 | * 26 | * @param domain - The Twilio (Twilio.Microvisor) domain 27 | */ 28 | constructor(domain: MicrovisorBase) { 29 | super(domain, "v1"); 30 | } 31 | 32 | /** accountConfigs - { Twilio.Microvisor.V1.AccountConfigListInstance } resource */ 33 | protected _accountConfigs?: AccountConfigListInstance; 34 | /** accountSecrets - { Twilio.Microvisor.V1.AccountSecretListInstance } resource */ 35 | protected _accountSecrets?: AccountSecretListInstance; 36 | /** apps - { Twilio.Microvisor.V1.AppListInstance } resource */ 37 | protected _apps?: AppListInstance; 38 | /** devices - { Twilio.Microvisor.V1.DeviceListInstance } resource */ 39 | protected _devices?: DeviceListInstance; 40 | 41 | /** Getter for accountConfigs resource */ 42 | get accountConfigs(): AccountConfigListInstance { 43 | this._accountConfigs = 44 | this._accountConfigs || AccountConfigListInstance(this); 45 | return this._accountConfigs; 46 | } 47 | 48 | /** Getter for accountSecrets resource */ 49 | get accountSecrets(): AccountSecretListInstance { 50 | this._accountSecrets = 51 | this._accountSecrets || AccountSecretListInstance(this); 52 | return this._accountSecrets; 53 | } 54 | 55 | /** Getter for apps resource */ 56 | get apps(): AppListInstance { 57 | this._apps = this._apps || AppListInstance(this); 58 | return this._apps; 59 | } 60 | 61 | /** Getter for devices resource */ 62 | get devices(): DeviceListInstance { 63 | this._devices = this._devices || DeviceListInstance(this); 64 | return this._devices; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/rest/monitor/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Monitor 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import MonitorBase from "../MonitorBase"; 16 | import Version from "../../base/Version"; 17 | import { AlertListInstance } from "./v1/alert"; 18 | import { EventListInstance } from "./v1/event"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of Monitor 23 | * 24 | * @param domain - The Twilio (Twilio.Monitor) domain 25 | */ 26 | constructor(domain: MonitorBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** alerts - { Twilio.Monitor.V1.AlertListInstance } resource */ 31 | protected _alerts?: AlertListInstance; 32 | /** events - { Twilio.Monitor.V1.EventListInstance } resource */ 33 | protected _events?: EventListInstance; 34 | 35 | /** Getter for alerts resource */ 36 | get alerts(): AlertListInstance { 37 | this._alerts = this._alerts || AlertListInstance(this); 38 | return this._alerts; 39 | } 40 | 41 | /** Getter for events resource */ 42 | get events(): EventListInstance { 43 | this._events = this._events || EventListInstance(this); 44 | return this._events; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/notify/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Notify 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import NotifyBase from "../NotifyBase"; 16 | import Version from "../../base/Version"; 17 | import { CredentialListInstance } from "./v1/credential"; 18 | import { ServiceListInstance } from "./v1/service"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of Notify 23 | * 24 | * @param domain - The Twilio (Twilio.Notify) domain 25 | */ 26 | constructor(domain: NotifyBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** credentials - { Twilio.Notify.V1.CredentialListInstance } resource */ 31 | protected _credentials?: CredentialListInstance; 32 | /** services - { Twilio.Notify.V1.ServiceListInstance } resource */ 33 | protected _services?: ServiceListInstance; 34 | 35 | /** Getter for credentials resource */ 36 | get credentials(): CredentialListInstance { 37 | this._credentials = this._credentials || CredentialListInstance(this); 38 | return this._credentials; 39 | } 40 | 41 | /** Getter for services resource */ 42 | get services(): ServiceListInstance { 43 | this._services = this._services || ServiceListInstance(this); 44 | return this._services; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/oauth/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Oauth 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import OauthBase from "../OauthBase"; 16 | import Version from "../../base/Version"; 17 | import { AuthorizeListInstance } from "./v1/authorize"; 18 | import { TokenListInstance } from "./v1/token"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of Oauth 23 | * 24 | * @param domain - The Twilio (Twilio.Oauth) domain 25 | */ 26 | constructor(domain: OauthBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** authorize - { Twilio.Oauth.V1.AuthorizeListInstance } resource */ 31 | protected _authorize?: AuthorizeListInstance; 32 | /** token - { Twilio.Oauth.V1.TokenListInstance } resource */ 33 | protected _token?: TokenListInstance; 34 | 35 | /** Getter for authorize resource */ 36 | get authorize(): AuthorizeListInstance { 37 | this._authorize = this._authorize || AuthorizeListInstance(this); 38 | return this._authorize; 39 | } 40 | 41 | /** Getter for token resource */ 42 | get token(): TokenListInstance { 43 | this._token = this._token || TokenListInstance(this); 44 | return this._token; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/preview/HostedNumbers.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Preview 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PreviewBase from "../PreviewBase"; 16 | import Version from "../../base/Version"; 17 | import { AuthorizationDocumentListInstance } from "./hosted_numbers/authorizationDocument"; 18 | import { HostedNumberOrderListInstance } from "./hosted_numbers/hostedNumberOrder"; 19 | 20 | export default class HostedNumbers extends Version { 21 | /** 22 | * Initialize the HostedNumbers version of Preview 23 | * 24 | * @param domain - The Twilio (Twilio.Preview) domain 25 | */ 26 | constructor(domain: PreviewBase) { 27 | super(domain, "HostedNumbers"); 28 | } 29 | 30 | /** authorizationDocuments - { Twilio.Preview.HostedNumbers.AuthorizationDocumentListInstance } resource */ 31 | protected _authorizationDocuments?: AuthorizationDocumentListInstance; 32 | /** hostedNumberOrders - { Twilio.Preview.HostedNumbers.HostedNumberOrderListInstance } resource */ 33 | protected _hostedNumberOrders?: HostedNumberOrderListInstance; 34 | 35 | /** Getter for authorizationDocuments resource */ 36 | get authorizationDocuments(): AuthorizationDocumentListInstance { 37 | this._authorizationDocuments = 38 | this._authorizationDocuments || AuthorizationDocumentListInstance(this); 39 | return this._authorizationDocuments; 40 | } 41 | 42 | /** Getter for hostedNumberOrders resource */ 43 | get hostedNumberOrders(): HostedNumberOrderListInstance { 44 | this._hostedNumberOrders = 45 | this._hostedNumberOrders || HostedNumberOrderListInstance(this); 46 | return this._hostedNumberOrders; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/rest/preview/Marketplace.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Preview 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PreviewBase from "../PreviewBase"; 16 | import Version from "../../base/Version"; 17 | import { AvailableAddOnListInstance } from "./marketplace/availableAddOn"; 18 | import { InstalledAddOnListInstance } from "./marketplace/installedAddOn"; 19 | 20 | export default class Marketplace extends Version { 21 | /** 22 | * Initialize the Marketplace version of Preview 23 | * 24 | * @param domain - The Twilio (Twilio.Preview) domain 25 | */ 26 | constructor(domain: PreviewBase) { 27 | super(domain, "marketplace"); 28 | } 29 | 30 | /** availableAddOns - { Twilio.Preview.Marketplace.AvailableAddOnListInstance } resource */ 31 | protected _availableAddOns?: AvailableAddOnListInstance; 32 | /** installedAddOns - { Twilio.Preview.Marketplace.InstalledAddOnListInstance } resource */ 33 | protected _installedAddOns?: InstalledAddOnListInstance; 34 | 35 | /** Getter for availableAddOns resource */ 36 | get availableAddOns(): AvailableAddOnListInstance { 37 | this._availableAddOns = 38 | this._availableAddOns || AvailableAddOnListInstance(this); 39 | return this._availableAddOns; 40 | } 41 | 42 | /** Getter for installedAddOns resource */ 43 | get installedAddOns(): InstalledAddOnListInstance { 44 | this._installedAddOns = 45 | this._installedAddOns || InstalledAddOnListInstance(this); 46 | return this._installedAddOns; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/rest/preview/Wireless.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Preview 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PreviewBase from "../PreviewBase"; 16 | import Version from "../../base/Version"; 17 | import { CommandListInstance } from "./wireless/command"; 18 | import { RatePlanListInstance } from "./wireless/ratePlan"; 19 | import { SimListInstance } from "./wireless/sim"; 20 | 21 | export default class Wireless extends Version { 22 | /** 23 | * Initialize the Wireless version of Preview 24 | * 25 | * @param domain - The Twilio (Twilio.Preview) domain 26 | */ 27 | constructor(domain: PreviewBase) { 28 | super(domain, "wireless"); 29 | } 30 | 31 | /** commands - { Twilio.Preview.Wireless.CommandListInstance } resource */ 32 | protected _commands?: CommandListInstance; 33 | /** ratePlans - { Twilio.Preview.Wireless.RatePlanListInstance } resource */ 34 | protected _ratePlans?: RatePlanListInstance; 35 | /** sims - { Twilio.Preview.Wireless.SimListInstance } resource */ 36 | protected _sims?: SimListInstance; 37 | 38 | /** Getter for commands resource */ 39 | get commands(): CommandListInstance { 40 | this._commands = this._commands || CommandListInstance(this); 41 | return this._commands; 42 | } 43 | 44 | /** Getter for ratePlans resource */ 45 | get ratePlans(): RatePlanListInstance { 46 | this._ratePlans = this._ratePlans || RatePlanListInstance(this); 47 | return this._ratePlans; 48 | } 49 | 50 | /** Getter for sims resource */ 51 | get sims(): SimListInstance { 52 | this._sims = this._sims || SimListInstance(this); 53 | return this._sims; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/rest/previewIam/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Organization Public API 8 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PreviewIamBase from "../PreviewIamBase"; 16 | import Version from "../../base/Version"; 17 | import { AuthorizeListInstance } from "./v1/authorize"; 18 | import { TokenListInstance } from "./v1/token"; 19 | 20 | export default class V1 extends Version { 21 | /** 22 | * Initialize the V1 version of PreviewIam 23 | * 24 | * @param domain - The Twilio (Twilio.PreviewIam) domain 25 | */ 26 | constructor(domain: PreviewIamBase) { 27 | super(domain, "v1"); 28 | } 29 | 30 | /** authorize - { Twilio.PreviewIam.V1.AuthorizeListInstance } resource */ 31 | protected _authorize?: AuthorizeListInstance; 32 | /** token - { Twilio.PreviewIam.V1.TokenListInstance } resource */ 33 | protected _token?: TokenListInstance; 34 | 35 | /** Getter for authorize resource */ 36 | get authorize(): AuthorizeListInstance { 37 | this._authorize = this._authorize || AuthorizeListInstance(this); 38 | return this._authorize; 39 | } 40 | 41 | /** Getter for token resource */ 42 | get token(): TokenListInstance { 43 | this._token = this._token || TokenListInstance(this); 44 | return this._token; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/previewIam/Versionless.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Organization Public API 8 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PreviewIamBase from "../PreviewIamBase"; 16 | import Version from "../../base/Version"; 17 | import { OrganizationListInstance } from "./versionless/organization"; 18 | 19 | export default class Versionless extends Version { 20 | /** 21 | * Initialize the Versionless version of PreviewIam 22 | * 23 | * @param domain - The Twilio (Twilio.PreviewIam) domain 24 | */ 25 | constructor(domain: PreviewIamBase) { 26 | super(domain, "Organizations"); 27 | } 28 | 29 | /** organization - { Twilio.PreviewIam.Versionless.OrganizationListInstance } resource */ 30 | protected _organization?: OrganizationListInstance; 31 | 32 | /** Getter for organization resource */ 33 | get organization(): OrganizationListInstance { 34 | this._organization = this._organization || OrganizationListInstance(this); 35 | return this._organization; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/pricing/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Pricing 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PricingBase from "../PricingBase"; 16 | import Version from "../../base/Version"; 17 | import { MessagingListInstance } from "./v1/messaging"; 18 | import { PhoneNumberListInstance } from "./v1/phoneNumber"; 19 | import { VoiceListInstance } from "./v1/voice"; 20 | 21 | export default class V1 extends Version { 22 | /** 23 | * Initialize the V1 version of Pricing 24 | * 25 | * @param domain - The Twilio (Twilio.Pricing) domain 26 | */ 27 | constructor(domain: PricingBase) { 28 | super(domain, "v1"); 29 | } 30 | 31 | /** messaging - { Twilio.Pricing.V1.MessagingListInstance } resource */ 32 | protected _messaging?: MessagingListInstance; 33 | /** phoneNumbers - { Twilio.Pricing.V1.PhoneNumberListInstance } resource */ 34 | protected _phoneNumbers?: PhoneNumberListInstance; 35 | /** voice - { Twilio.Pricing.V1.VoiceListInstance } resource */ 36 | protected _voice?: VoiceListInstance; 37 | 38 | /** Getter for messaging resource */ 39 | get messaging(): MessagingListInstance { 40 | this._messaging = this._messaging || MessagingListInstance(this); 41 | return this._messaging; 42 | } 43 | 44 | /** Getter for phoneNumbers resource */ 45 | get phoneNumbers(): PhoneNumberListInstance { 46 | this._phoneNumbers = this._phoneNumbers || PhoneNumberListInstance(this); 47 | return this._phoneNumbers; 48 | } 49 | 50 | /** Getter for voice resource */ 51 | get voice(): VoiceListInstance { 52 | this._voice = this._voice || VoiceListInstance(this); 53 | return this._voice; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/rest/pricing/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Pricing 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import PricingBase from "../PricingBase"; 16 | import Version from "../../base/Version"; 17 | import { CountryListInstance } from "./v2/country"; 18 | import { NumberListInstance } from "./v2/number"; 19 | import { VoiceListInstance } from "./v2/voice"; 20 | 21 | export default class V2 extends Version { 22 | /** 23 | * Initialize the V2 version of Pricing 24 | * 25 | * @param domain - The Twilio (Twilio.Pricing) domain 26 | */ 27 | constructor(domain: PricingBase) { 28 | super(domain, "v2"); 29 | } 30 | 31 | /** countries - { Twilio.Pricing.V2.CountryListInstance } resource */ 32 | protected _countries?: CountryListInstance; 33 | /** numbers - { Twilio.Pricing.V2.NumberListInstance } resource */ 34 | protected _numbers?: NumberListInstance; 35 | /** voice - { Twilio.Pricing.V2.VoiceListInstance } resource */ 36 | protected _voice?: VoiceListInstance; 37 | 38 | /** Getter for countries resource */ 39 | get countries(): CountryListInstance { 40 | this._countries = this._countries || CountryListInstance(this); 41 | return this._countries; 42 | } 43 | 44 | /** Getter for numbers resource */ 45 | get numbers(): NumberListInstance { 46 | this._numbers = this._numbers || NumberListInstance(this); 47 | return this._numbers; 48 | } 49 | 50 | /** Getter for voice resource */ 51 | get voice(): VoiceListInstance { 52 | this._voice = this._voice || VoiceListInstance(this); 53 | return this._voice; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/rest/pricing/v1/messaging.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Pricing 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import { inspect, InspectOptions } from "util"; 16 | import V1 from "../V1"; 17 | const deserialize = require("../../../base/deserialize"); 18 | const serialize = require("../../../base/serialize"); 19 | import { isValidPathParam } from "../../../base/utility"; 20 | import { CountryListInstance } from "./messaging/country"; 21 | 22 | export interface MessagingSolution {} 23 | 24 | export interface MessagingListInstance { 25 | _version: V1; 26 | _solution: MessagingSolution; 27 | _uri: string; 28 | 29 | _countries?: CountryListInstance; 30 | countries: CountryListInstance; 31 | 32 | /** 33 | * Provide a user-friendly representation 34 | */ 35 | toJSON(): any; 36 | [inspect.custom](_depth: any, options: InspectOptions): any; 37 | } 38 | 39 | export function MessagingListInstance(version: V1): MessagingListInstance { 40 | const instance = {} as MessagingListInstance; 41 | 42 | instance._version = version; 43 | instance._solution = {}; 44 | instance._uri = `/Messaging`; 45 | 46 | Object.defineProperty(instance, "countries", { 47 | get: function countries() { 48 | if (!instance._countries) { 49 | instance._countries = CountryListInstance(instance._version); 50 | } 51 | return instance._countries; 52 | }, 53 | }); 54 | 55 | instance.toJSON = function toJSON() { 56 | return instance._solution; 57 | }; 58 | 59 | instance[inspect.custom] = function inspectImpl( 60 | _depth: any, 61 | options: InspectOptions 62 | ) { 63 | return inspect(instance.toJSON(), options); 64 | }; 65 | 66 | return instance; 67 | } 68 | -------------------------------------------------------------------------------- /src/rest/pricing/v1/phoneNumber.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Pricing 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import { inspect, InspectOptions } from "util"; 16 | import V1 from "../V1"; 17 | const deserialize = require("../../../base/deserialize"); 18 | const serialize = require("../../../base/serialize"); 19 | import { isValidPathParam } from "../../../base/utility"; 20 | import { CountryListInstance } from "./phoneNumber/country"; 21 | 22 | export interface PhoneNumberSolution {} 23 | 24 | export interface PhoneNumberListInstance { 25 | _version: V1; 26 | _solution: PhoneNumberSolution; 27 | _uri: string; 28 | 29 | _countries?: CountryListInstance; 30 | countries: CountryListInstance; 31 | 32 | /** 33 | * Provide a user-friendly representation 34 | */ 35 | toJSON(): any; 36 | [inspect.custom](_depth: any, options: InspectOptions): any; 37 | } 38 | 39 | export function PhoneNumberListInstance(version: V1): PhoneNumberListInstance { 40 | const instance = {} as PhoneNumberListInstance; 41 | 42 | instance._version = version; 43 | instance._solution = {}; 44 | instance._uri = `/PhoneNumbers`; 45 | 46 | Object.defineProperty(instance, "countries", { 47 | get: function countries() { 48 | if (!instance._countries) { 49 | instance._countries = CountryListInstance(instance._version); 50 | } 51 | return instance._countries; 52 | }, 53 | }); 54 | 55 | instance.toJSON = function toJSON() { 56 | return instance._solution; 57 | }; 58 | 59 | instance[inspect.custom] = function inspectImpl( 60 | _depth: any, 61 | options: InspectOptions 62 | ) { 63 | return inspect(instance.toJSON(), options); 64 | }; 65 | 66 | return instance; 67 | } 68 | -------------------------------------------------------------------------------- /src/rest/pricing/v1/voice.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Pricing 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import { inspect, InspectOptions } from "util"; 16 | import V1 from "../V1"; 17 | const deserialize = require("../../../base/deserialize"); 18 | const serialize = require("../../../base/serialize"); 19 | import { isValidPathParam } from "../../../base/utility"; 20 | import { CountryListInstance } from "./voice/country"; 21 | import { NumberListInstance } from "./voice/number"; 22 | 23 | export interface VoiceSolution {} 24 | 25 | export interface VoiceListInstance { 26 | _version: V1; 27 | _solution: VoiceSolution; 28 | _uri: string; 29 | 30 | _countries?: CountryListInstance; 31 | countries: CountryListInstance; 32 | _numbers?: NumberListInstance; 33 | numbers: NumberListInstance; 34 | 35 | /** 36 | * Provide a user-friendly representation 37 | */ 38 | toJSON(): any; 39 | [inspect.custom](_depth: any, options: InspectOptions): any; 40 | } 41 | 42 | export function VoiceListInstance(version: V1): VoiceListInstance { 43 | const instance = {} as VoiceListInstance; 44 | 45 | instance._version = version; 46 | instance._solution = {}; 47 | instance._uri = `/Voice`; 48 | 49 | Object.defineProperty(instance, "countries", { 50 | get: function countries() { 51 | if (!instance._countries) { 52 | instance._countries = CountryListInstance(instance._version); 53 | } 54 | return instance._countries; 55 | }, 56 | }); 57 | 58 | Object.defineProperty(instance, "numbers", { 59 | get: function numbers() { 60 | if (!instance._numbers) { 61 | instance._numbers = NumberListInstance(instance._version); 62 | } 63 | return instance._numbers; 64 | }, 65 | }); 66 | 67 | instance.toJSON = function toJSON() { 68 | return instance._solution; 69 | }; 70 | 71 | instance[inspect.custom] = function inspectImpl( 72 | _depth: any, 73 | options: InspectOptions 74 | ) { 75 | return inspect(instance.toJSON(), options); 76 | }; 77 | 78 | return instance; 79 | } 80 | -------------------------------------------------------------------------------- /src/rest/pricing/v2/voice.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Pricing 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import { inspect, InspectOptions } from "util"; 16 | import V2 from "../V2"; 17 | const deserialize = require("../../../base/deserialize"); 18 | const serialize = require("../../../base/serialize"); 19 | import { isValidPathParam } from "../../../base/utility"; 20 | import { CountryListInstance } from "./voice/country"; 21 | import { NumberListInstance } from "./voice/number"; 22 | 23 | export interface VoiceSolution {} 24 | 25 | export interface VoiceListInstance { 26 | _version: V2; 27 | _solution: VoiceSolution; 28 | _uri: string; 29 | 30 | _countries?: CountryListInstance; 31 | countries: CountryListInstance; 32 | _numbers?: NumberListInstance; 33 | numbers: NumberListInstance; 34 | 35 | /** 36 | * Provide a user-friendly representation 37 | */ 38 | toJSON(): any; 39 | [inspect.custom](_depth: any, options: InspectOptions): any; 40 | } 41 | 42 | export function VoiceListInstance(version: V2): VoiceListInstance { 43 | const instance = {} as VoiceListInstance; 44 | 45 | instance._version = version; 46 | instance._solution = {}; 47 | instance._uri = `/Voice`; 48 | 49 | Object.defineProperty(instance, "countries", { 50 | get: function countries() { 51 | if (!instance._countries) { 52 | instance._countries = CountryListInstance(instance._version); 53 | } 54 | return instance._countries; 55 | }, 56 | }); 57 | 58 | Object.defineProperty(instance, "numbers", { 59 | get: function numbers() { 60 | if (!instance._numbers) { 61 | instance._numbers = NumberListInstance(instance._version); 62 | } 63 | return instance._numbers; 64 | }, 65 | }); 66 | 67 | instance.toJSON = function toJSON() { 68 | return instance._solution; 69 | }; 70 | 71 | instance[inspect.custom] = function inspectImpl( 72 | _depth: any, 73 | options: InspectOptions 74 | ) { 75 | return inspect(instance.toJSON(), options); 76 | }; 77 | 78 | return instance; 79 | } 80 | -------------------------------------------------------------------------------- /src/rest/proxy/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Proxy 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ProxyBase from "../ProxyBase"; 16 | import Version from "../../base/Version"; 17 | import { ServiceListInstance } from "./v1/service"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Proxy 22 | * 23 | * @param domain - The Twilio (Twilio.Proxy) domain 24 | */ 25 | constructor(domain: ProxyBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** services - { Twilio.Proxy.V1.ServiceListInstance } resource */ 30 | protected _services?: ServiceListInstance; 31 | 32 | /** Getter for services resource */ 33 | get services(): ServiceListInstance { 34 | this._services = this._services || ServiceListInstance(this); 35 | return this._services; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/routes/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Routes 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import RoutesBase from "../RoutesBase"; 16 | import Version from "../../base/Version"; 17 | import { PhoneNumberListInstance } from "./v2/phoneNumber"; 18 | import { SipDomainListInstance } from "./v2/sipDomain"; 19 | import { TrunkListInstance } from "./v2/trunk"; 20 | 21 | export default class V2 extends Version { 22 | /** 23 | * Initialize the V2 version of Routes 24 | * 25 | * @param domain - The Twilio (Twilio.Routes) domain 26 | */ 27 | constructor(domain: RoutesBase) { 28 | super(domain, "v2"); 29 | } 30 | 31 | /** phoneNumbers - { Twilio.Routes.V2.PhoneNumberListInstance } resource */ 32 | protected _phoneNumbers?: PhoneNumberListInstance; 33 | /** sipDomains - { Twilio.Routes.V2.SipDomainListInstance } resource */ 34 | protected _sipDomains?: SipDomainListInstance; 35 | /** trunks - { Twilio.Routes.V2.TrunkListInstance } resource */ 36 | protected _trunks?: TrunkListInstance; 37 | 38 | /** Getter for phoneNumbers resource */ 39 | get phoneNumbers(): PhoneNumberListInstance { 40 | this._phoneNumbers = this._phoneNumbers || PhoneNumberListInstance(this); 41 | return this._phoneNumbers; 42 | } 43 | 44 | /** Getter for sipDomains resource */ 45 | get sipDomains(): SipDomainListInstance { 46 | this._sipDomains = this._sipDomains || SipDomainListInstance(this); 47 | return this._sipDomains; 48 | } 49 | 50 | /** Getter for trunks resource */ 51 | get trunks(): TrunkListInstance { 52 | this._trunks = this._trunks || TrunkListInstance(this); 53 | return this._trunks; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/rest/serverless/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Serverless 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import ServerlessBase from "../ServerlessBase"; 16 | import Version from "../../base/Version"; 17 | import { ServiceListInstance } from "./v1/service"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Serverless 22 | * 23 | * @param domain - The Twilio (Twilio.Serverless) domain 24 | */ 25 | constructor(domain: ServerlessBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** services - { Twilio.Serverless.V1.ServiceListInstance } resource */ 30 | protected _services?: ServiceListInstance; 31 | 32 | /** Getter for services resource */ 33 | get services(): ServiceListInstance { 34 | this._services = this._services || ServiceListInstance(this); 35 | return this._services; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/studio/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Studio 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import StudioBase from "../StudioBase"; 16 | import Version from "../../base/Version"; 17 | import { FlowListInstance } from "./v1/flow"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Studio 22 | * 23 | * @param domain - The Twilio (Twilio.Studio) domain 24 | */ 25 | constructor(domain: StudioBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** flows - { Twilio.Studio.V1.FlowListInstance } resource */ 30 | protected _flows?: FlowListInstance; 31 | 32 | /** Getter for flows resource */ 33 | get flows(): FlowListInstance { 34 | this._flows = this._flows || FlowListInstance(this); 35 | return this._flows; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/studio/V2.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Studio 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import StudioBase from "../StudioBase"; 16 | import Version from "../../base/Version"; 17 | import { FlowListInstance } from "./v2/flow"; 18 | import { FlowValidateListInstance } from "./v2/flowValidate"; 19 | 20 | export default class V2 extends Version { 21 | /** 22 | * Initialize the V2 version of Studio 23 | * 24 | * @param domain - The Twilio (Twilio.Studio) domain 25 | */ 26 | constructor(domain: StudioBase) { 27 | super(domain, "v2"); 28 | } 29 | 30 | /** flows - { Twilio.Studio.V2.FlowListInstance } resource */ 31 | protected _flows?: FlowListInstance; 32 | /** flowValidate - { Twilio.Studio.V2.FlowValidateListInstance } resource */ 33 | protected _flowValidate?: FlowValidateListInstance; 34 | 35 | /** Getter for flows resource */ 36 | get flows(): FlowListInstance { 37 | this._flows = this._flows || FlowListInstance(this); 38 | return this._flows; 39 | } 40 | 41 | /** Getter for flowValidate resource */ 42 | get flowValidate(): FlowValidateListInstance { 43 | this._flowValidate = this._flowValidate || FlowValidateListInstance(this); 44 | return this._flowValidate; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/rest/sync/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Sync 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import SyncBase from "../SyncBase"; 16 | import Version from "../../base/Version"; 17 | import { ServiceListInstance } from "./v1/service"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Sync 22 | * 23 | * @param domain - The Twilio (Twilio.Sync) domain 24 | */ 25 | constructor(domain: SyncBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** services - { Twilio.Sync.V1.ServiceListInstance } resource */ 30 | protected _services?: ServiceListInstance; 31 | 32 | /** Getter for services resource */ 33 | get services(): ServiceListInstance { 34 | this._services = this._services || ServiceListInstance(this); 35 | return this._services; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/taskrouter/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Taskrouter 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import TaskrouterBase from "../TaskrouterBase"; 16 | import Version from "../../base/Version"; 17 | import { WorkspaceListInstance } from "./v1/workspace"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Taskrouter 22 | * 23 | * @param domain - The Twilio (Twilio.Taskrouter) domain 24 | */ 25 | constructor(domain: TaskrouterBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** workspaces - { Twilio.Taskrouter.V1.WorkspaceListInstance } resource */ 30 | protected _workspaces?: WorkspaceListInstance; 31 | 32 | /** Getter for workspaces resource */ 33 | get workspaces(): WorkspaceListInstance { 34 | this._workspaces = this._workspaces || WorkspaceListInstance(this); 35 | return this._workspaces; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/trunking/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Trunking 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import TrunkingBase from "../TrunkingBase"; 16 | import Version from "../../base/Version"; 17 | import { TrunkListInstance } from "./v1/trunk"; 18 | 19 | export default class V1 extends Version { 20 | /** 21 | * Initialize the V1 version of Trunking 22 | * 23 | * @param domain - The Twilio (Twilio.Trunking) domain 24 | */ 25 | constructor(domain: TrunkingBase) { 26 | super(domain, "v1"); 27 | } 28 | 29 | /** trunks - { Twilio.Trunking.V1.TrunkListInstance } resource */ 30 | protected _trunks?: TrunkListInstance; 31 | 32 | /** Getter for trunks resource */ 33 | get trunks(): TrunkListInstance { 34 | this._trunks = this._trunks || TrunkListInstance(this); 35 | return this._trunks; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/rest/wireless/V1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Wireless 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | import WirelessBase from "../WirelessBase"; 16 | import Version from "../../base/Version"; 17 | import { CommandListInstance } from "./v1/command"; 18 | import { RatePlanListInstance } from "./v1/ratePlan"; 19 | import { SimListInstance } from "./v1/sim"; 20 | import { UsageRecordListInstance } from "./v1/usageRecord"; 21 | 22 | export default class V1 extends Version { 23 | /** 24 | * Initialize the V1 version of Wireless 25 | * 26 | * @param domain - The Twilio (Twilio.Wireless) domain 27 | */ 28 | constructor(domain: WirelessBase) { 29 | super(domain, "v1"); 30 | } 31 | 32 | /** commands - { Twilio.Wireless.V1.CommandListInstance } resource */ 33 | protected _commands?: CommandListInstance; 34 | /** ratePlans - { Twilio.Wireless.V1.RatePlanListInstance } resource */ 35 | protected _ratePlans?: RatePlanListInstance; 36 | /** sims - { Twilio.Wireless.V1.SimListInstance } resource */ 37 | protected _sims?: SimListInstance; 38 | /** usageRecords - { Twilio.Wireless.V1.UsageRecordListInstance } resource */ 39 | protected _usageRecords?: UsageRecordListInstance; 40 | 41 | /** Getter for commands resource */ 42 | get commands(): CommandListInstance { 43 | this._commands = this._commands || CommandListInstance(this); 44 | return this._commands; 45 | } 46 | 47 | /** Getter for ratePlans resource */ 48 | get ratePlans(): RatePlanListInstance { 49 | this._ratePlans = this._ratePlans || RatePlanListInstance(this); 50 | return this._ratePlans; 51 | } 52 | 53 | /** Getter for sims resource */ 54 | get sims(): SimListInstance { 55 | this._sims = this._sims || SimListInstance(this); 56 | return this._sims; 57 | } 58 | 59 | /** Getter for usageRecords resource */ 60 | get usageRecords(): UsageRecordListInstance { 61 | this._usageRecords = this._usageRecords || UsageRecordListInstance(this); 62 | return this._usageRecords; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/twiml/FaxResponse.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | import { XMLElement } from "xmlbuilder"; 9 | import TwiML from "./TwiML"; 10 | 11 | class FaxResponse extends TwiML { 12 | /** 13 | * TwiML for Faxes 14 | */ 15 | constructor() { 16 | super(); 17 | this._propertyName = "response"; 18 | } 19 | /** 20 | * Comments in 21 | * 22 | * @param comment - XML Comment 23 | */ 24 | comment(comment: string): XMLElement { 25 | return this.response.comment(comment); 26 | } 27 | /** 28 | * Comments after 29 | * 30 | * @param comment - XML Comment 31 | */ 32 | commentAfter(comment: string): XMLElement { 33 | return this.response.commentAfter(comment); 34 | } 35 | /** 36 | * Comments before 37 | * 38 | * @param comment - XML Comment 39 | */ 40 | commentBefore(comment: string): XMLElement { 41 | return this.response.commentBefore(comment); 42 | } 43 | /** 44 | * TwiML Verb 45 | * 46 | * @param attributes - TwiML attributes 47 | */ 48 | receive(attributes?: FaxResponse.ReceiveAttributes): FaxResponse.Receive { 49 | return new FaxResponse.Receive(this.response.ele("Receive", attributes)); 50 | } 51 | } 52 | 53 | namespace FaxResponse { 54 | type ReceiveMediaType = "application/pdf" | "image/tiff"; 55 | 56 | type ReceivePageSize = "letter" | "legal" | "a4"; 57 | 58 | /** 59 | * Attributes to pass to receive 60 | */ 61 | export interface ReceiveAttributes { 62 | /** action - Receive action URL */ 63 | action?: string; 64 | /** mediaType - The media type used to store media in the fax media store */ 65 | mediaType?: ReceiveMediaType; 66 | /** method - Receive action URL method */ 67 | method?: string; 68 | /** pageSize - What size to interpret received pages as */ 69 | pageSize?: ReceivePageSize; 70 | /** storeMedia - Whether or not to store received media in the fax media store */ 71 | storeMedia?: boolean; 72 | } 73 | 74 | export class Receive extends TwiML { 75 | receive: XMLElement; 76 | /** 77 | * TwiML Verb 78 | */ 79 | constructor(receive: XMLElement) { 80 | super(); 81 | this.receive = receive; 82 | this._propertyName = "receive"; 83 | } 84 | } 85 | } 86 | 87 | export = FaxResponse; 88 | -------------------------------------------------------------------------------- /src/twiml/TwiML.ts: -------------------------------------------------------------------------------- 1 | import builder from "xmlbuilder"; 2 | 3 | /* jshint ignore:start */ 4 | /** 5 | * Parent TwiML object 6 | */ 7 | /* jshint ignore:end */ 8 | 9 | export default class TwiML { 10 | [key: string]: any; 11 | response: any; 12 | _propertyName: string; 13 | 14 | constructor() { 15 | this._propertyName = ""; 16 | this.response = builder 17 | .create("Response", { 18 | stringify: { 19 | attValue: function (value) { 20 | if (Array.isArray(value)) { 21 | value = value.join(" "); 22 | } 23 | return this.attEscape?.("" + value || "") || ""; 24 | }, 25 | }, 26 | }) 27 | .dec("1.0", "UTF-8"); 28 | } 29 | 30 | /* jshint ignore:start */ 31 | /** 32 | * Because child elements have properties named after their class names, we need 33 | * to translate that when we want to access that at the parent prototype level. 34 | * So this will translate something like Say to 'say' and VoiceResponse to 35 | * 'response'. 36 | */ 37 | /* jshint ignore:end */ 38 | _getXml() { 39 | return this[this._propertyName]; 40 | } 41 | 42 | /* jshint ignore:start */ 43 | /** 44 | * Convert to TwiML 45 | * 46 | * @returns TwiML XML 47 | */ 48 | /* jshint ignore:end */ 49 | toString() { 50 | return this._getXml().end(); 51 | } 52 | 53 | /* jshint ignore:start */ 54 | /** 55 | * Add text under the TwiML node 56 | * 57 | * @param {string} content 58 | */ 59 | /* jshint ignore:end */ 60 | addText(content: string) { 61 | this._getXml().txt(content); 62 | } 63 | 64 | /* jshint ignore:start */ 65 | /** 66 | * Add an arbitrary tag as a child. 67 | * 68 | * @param {string} content 69 | */ 70 | /* jshint ignore:end */ 71 | addChild(tagName: string, attributes: Object) { 72 | return new GenericNode(this._getXml().ele(tagName, attributes)); 73 | } 74 | } 75 | 76 | /* jshint ignore:start */ 77 | /** 78 | * Generic node 79 | */ 80 | /* jshint ignore:end */ 81 | class GenericNode extends TwiML { 82 | // must match variable name for _getPropertyName 83 | constructor(public node: any) { 84 | super(); 85 | this._propertyName = "node"; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "lib": ["es2020"], 5 | "module": "commonjs", 6 | "declaration": true, 7 | "esModuleInterop": true, 8 | "moduleResolution": "node", 9 | "allowJs": true, 10 | "rootDir": "src", 11 | "outDir": "lib", 12 | "strict": true 13 | }, 14 | "include": ["src"], 15 | } 16 | --------------------------------------------------------------------------------