telnyx 2.0.0__py2.py3-none-any.whl → 2.1.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of telnyx might be problematic. Click here for more details.

Files changed (105) hide show
  1. telnyx/__init__.py +1 -1
  2. telnyx/api_requestor.py +19 -17
  3. telnyx/api_resources/__init__.py +159 -19
  4. telnyx/api_resources/abstract/api_resource.py +5 -4
  5. telnyx/api_resources/abstract/nested_resource_class_methods.py +11 -1
  6. telnyx/api_resources/abstract/updateable_api_resource.py +2 -1
  7. telnyx/api_resources/{whatsapp_contact.py → access_token.py} +2 -2
  8. telnyx/api_resources/address.py +13 -0
  9. telnyx/api_resources/advanced_optinoptout.py +17 -0
  10. telnyx/api_resources/ai.py +36 -0
  11. telnyx/api_resources/autorechargepreference.py +7 -0
  12. telnyx/api_resources/{whatsapp_business_account.py → billing.py} +2 -2
  13. telnyx/api_resources/bucket.py +17 -0
  14. telnyx/api_resources/bucket_usage.py +7 -0
  15. telnyx/api_resources/bulk_credential.py +13 -0
  16. telnyx/api_resources/bulk_phone_number_campaign.py +7 -0
  17. telnyx/api_resources/bulk_phone_number_operation.py +7 -0
  18. telnyx/api_resources/bulk_sole_proprietor_creation.py +7 -0
  19. telnyx/api_resources/business_identity.py +17 -0
  20. telnyx/api_resources/call.py +87 -53
  21. telnyx/api_resources/call_information.py +7 -0
  22. telnyx/api_resources/call_recording.py +22 -0
  23. telnyx/api_resources/cdr_usage_report.py +7 -0
  24. telnyx/api_resources/credential_connection.py +9 -0
  25. telnyx/api_resources/csv_download.py +7 -0
  26. telnyx/api_resources/customer_service_record.py +7 -0
  27. telnyx/api_resources/debugging.py +7 -0
  28. telnyx/api_resources/detail_record.py +7 -0
  29. telnyx/api_resources/dialogflow_integration.py +17 -0
  30. telnyx/api_resources/document.py +0 -5
  31. telnyx/api_resources/dynamic_emergency_endpoint.py +13 -0
  32. telnyx/api_resources/enum.py +7 -0
  33. telnyx/api_resources/external_connection.py +17 -0
  34. telnyx/api_resources/fax.py +6 -8
  35. telnyx/api_resources/inventory_level.py +7 -0
  36. telnyx/api_resources/{whatsapp_media.py → ip_address.py} +3 -3
  37. telnyx/api_resources/ip_range.py +11 -0
  38. telnyx/api_resources/list_object.py +2 -1
  39. telnyx/api_resources/managed_account.py +2 -2
  40. telnyx/api_resources/mdr_detail_report.py +11 -0
  41. telnyx/api_resources/mdr_usage_report.py +11 -0
  42. telnyx/api_resources/media_storage_api.py +17 -0
  43. telnyx/api_resources/message.py +2 -2
  44. telnyx/api_resources/messaging_hosted_number.py +15 -2
  45. telnyx/api_resources/messaging_tollfree_verification.py +17 -0
  46. telnyx/api_resources/messaging_url_domain.py +7 -0
  47. telnyx/api_resources/mobile_network_operator.py +7 -0
  48. telnyx/api_resources/network.py +17 -0
  49. telnyx/api_resources/notification.py +17 -0
  50. telnyx/api_resources/{whatsapp_phone_number.py → number_configuration.py} +2 -2
  51. telnyx/api_resources/number_portout.py +11 -0
  52. telnyx/api_resources/numbers_feature.py +7 -0
  53. telnyx/api_resources/ota_update.py +7 -0
  54. telnyx/api_resources/phone_number.py +4 -2
  55. telnyx/api_resources/phone_number_block_order.py +7 -0
  56. telnyx/api_resources/phone_number_blocks_background_job.py +7 -0
  57. telnyx/api_resources/phone_number_campaign.py +0 -4
  58. telnyx/api_resources/phone_number_configuration.py +24 -0
  59. telnyx/api_resources/{whatsapp_message.py → phone_number_order.py} +2 -2
  60. telnyx/api_resources/phone_number_order_document.py +13 -0
  61. telnyx/api_resources/phone_number_porting.py +7 -0
  62. telnyx/api_resources/phone_number_reservation.py +15 -0
  63. telnyx/api_resources/phone_number_search.py +7 -0
  64. telnyx/api_resources/porting_order.py +1 -8
  65. telnyx/api_resources/presigned_object_url.py +7 -0
  66. telnyx/api_resources/private_wireless_gateway.py +13 -0
  67. telnyx/api_resources/public_internet_gateway.py +13 -0
  68. telnyx/api_resources/push_credential.py +11 -0
  69. telnyx/api_resources/queue_command.py +7 -0
  70. telnyx/api_resources/recordings_command.py +7 -0
  71. telnyx/api_resources/region.py +7 -0
  72. telnyx/api_resources/register_call.py +7 -0
  73. telnyx/api_resources/report.py +7 -0
  74. telnyx/api_resources/reporting.py +11 -0
  75. telnyx/api_resources/requirement.py +7 -0
  76. telnyx/api_resources/requirement_type.py +7 -0
  77. telnyx/api_resources/room_composition.py +11 -0
  78. telnyx/api_resources/room_recording.py +7 -0
  79. telnyx/api_resources/rooms_client_token.py +24 -0
  80. telnyx/api_resources/shared_campaign.py +7 -0
  81. telnyx/api_resources/sim_card.py +49 -19
  82. telnyx/api_resources/sim_card_group.py +17 -0
  83. telnyx/api_resources/ssl_certificate.py +11 -0
  84. telnyx/api_resources/texml_application.py +17 -0
  85. telnyx/api_resources/texml_rest_command.py +13 -0
  86. telnyx/api_resources/verified_calls_display_profile.py +17 -0
  87. telnyx/api_resources/verified_number.py +16 -0
  88. telnyx/api_resources/verify.py +22 -0
  89. telnyx/api_resources/virtual_cross_connect.py +24 -0
  90. telnyx/api_resources/wdr_detail_report.py +7 -0
  91. telnyx/api_resources/webhook.py +7 -0
  92. telnyx/api_resources/wireguard_interface.py +17 -0
  93. telnyx/error.py +1 -2
  94. telnyx/http_client.py +10 -9
  95. telnyx/multipart_data_generator.py +1 -1
  96. telnyx/telnyx_object.py +3 -1
  97. telnyx/util.py +86 -20
  98. telnyx/webhook.py +0 -2
  99. {telnyx-2.0.0.dist-info → telnyx-2.1.2.dist-info}/METADATA +24 -24
  100. telnyx-2.1.2.dist-info/RECORD +168 -0
  101. {telnyx-2.0.0.dist-info → telnyx-2.1.2.dist-info}/WHEEL +1 -1
  102. telnyx/six.py +0 -892
  103. telnyx-2.0.0.dist-info/RECORD +0 -102
  104. {telnyx-2.0.0.dist-info → telnyx-2.1.2.dist-info}/LICENSE +0 -0
  105. {telnyx-2.0.0.dist-info → telnyx-2.1.2.dist-info}/top_level.txt +0 -0
telnyx/__init__.py CHANGED
@@ -24,7 +24,7 @@ public_key = os.environ.get("TELNYX_PUBLIC_KEY")
24
24
  log = None
25
25
 
26
26
 
27
- __version__ = "2.0.0"
27
+ __version__ = "2.1.2"
28
28
 
29
29
 
30
30
  # Sets some basic information about the running application that's sent along
telnyx/api_requestor.py CHANGED
@@ -6,10 +6,12 @@ import json
6
6
  import platform
7
7
  import time
8
8
 
9
+ import six
10
+ from six.moves.urllib.parse import urlencode, urlsplit, urlunsplit
11
+
9
12
  import telnyx
10
- from telnyx import error, http_client, six, util
13
+ from telnyx import error, http_client, util
11
14
  from telnyx.multipart_data_generator import MultipartDataGenerator
12
- from telnyx.six.moves.urllib.parse import urlencode, urlsplit, urlunsplit
13
15
  from telnyx.telnyx_response import TelnyxResponse
14
16
 
15
17
 
@@ -123,37 +125,37 @@ class APIRequestor(object):
123
125
  )
124
126
 
125
127
  if rcode == 400:
126
- return error.InvalidRequestError(error_list, rbody, rcode, resp, rheaders)
128
+ return error.InvalidRequestError(error_list, rcode, rbody, resp, rheaders)
127
129
  elif rcode == 401:
128
- return error.AuthenticationError(error_list, rbody, rcode, resp, rheaders)
130
+ return error.AuthenticationError(error_list, rcode, rbody, resp, rheaders)
129
131
  elif rcode == 403:
130
- return error.PermissionError(error_list, rbody, rcode, resp, rheaders)
132
+ return error.PermissionError(error_list, rcode, rbody, resp, rheaders)
131
133
  elif rcode == 404:
132
- return error.ResourceNotFoundError(error_list, rbody, rcode, resp, rheaders)
134
+ return error.ResourceNotFoundError(error_list, rcode, rbody, resp, rheaders)
133
135
  elif rcode == 405:
134
136
  return error.MethodNotSupportedError(
135
- error_list, rbody, rcode, resp, rheaders
137
+ error_list, rcode, rbody, resp, rheaders
136
138
  )
137
139
  elif rcode == 408:
138
- return error.TimeoutError(error_list, rbody, rcode, resp, rheaders)
140
+ return error.TimeoutError(error_list, rcode, rbody, resp, rheaders)
139
141
  elif rcode == 415:
140
142
  return error.UnsupportedMediaTypeError(
141
- error_list, rbody, rcode, resp, rheaders
143
+ error_list, rcode, rbody, resp, rheaders
142
144
  )
143
145
  elif rcode == 422:
144
146
  return error.InvalidParametersError(
145
- error_list, rbody, rcode, resp, rheaders
147
+ error_list, rcode, rbody, resp, rheaders
146
148
  )
147
149
  elif rcode == 429:
148
- return error.RateLimitError(error_list, rbody, rcode, resp, rheaders)
150
+ return error.RateLimitError(error_list, rcode, rbody, resp, rheaders)
149
151
  elif rcode == 500:
150
- return error.APIError(error_list, rbody, rcode, resp, rheaders)
152
+ return error.APIError(error_list, rcode, rbody, resp, rheaders)
151
153
  elif rcode == 503:
152
154
  return error.ServiceUnavailableError(
153
- error_list, rbody, rcode, resp, rheaders
155
+ error_list, rcode, rbody, resp, rheaders
154
156
  )
155
157
  else:
156
- return error.APIError(error_list, rbody, rcode, resp, rheaders)
158
+ return error.APIError(error_list, rcode, rbody, resp, rheaders)
157
159
 
158
160
  def request_headers(self, api_key, method):
159
161
  user_agent = "Telnyx/v2 PythonBindings/%s" % (telnyx.__version__,)
@@ -237,9 +239,9 @@ class APIRequestor(object):
237
239
  generator.add_params(params or {})
238
240
  post_data = generator.get_post_data()
239
241
  encoded_params = params
240
- supplied_headers[
241
- "Content-Type"
242
- ] = "multipart/form-data; boundary=%s" % (generator.boundary,)
242
+ supplied_headers["Content-Type"] = (
243
+ "multipart/form-data; boundary=%s" % (generator.boundary,)
244
+ )
243
245
  else:
244
246
  raise error.APIConnectionError(
245
247
  "Unrecognized HTTP method %r. This may indicate a bug in the "
@@ -2,37 +2,68 @@ from __future__ import absolute_import, division, print_function
2
2
 
3
3
  from telnyx.api_resources.access_control_ip import AccessControlIP
4
4
  from telnyx.api_resources.access_ip_address import AccessIPAddress
5
+ from telnyx.api_resources.access_token import AccessToken
5
6
  from telnyx.api_resources.address import Address
7
+ from telnyx.api_resources.advanced_optinoptout import AdvancedOptinoptout
8
+ from telnyx.api_resources.ai import AI
6
9
  from telnyx.api_resources.api_key import APIKey
7
10
  from telnyx.api_resources.authentication_provider import AuthenticationProvider
11
+ from telnyx.api_resources.autorechargepreference import Autorechargepreference
8
12
  from telnyx.api_resources.available_phone_number import AvailablePhoneNumber
9
13
  from telnyx.api_resources.balance import Balance
14
+ from telnyx.api_resources.billing import Billing
10
15
  from telnyx.api_resources.billing_group import BillingGroup
11
16
  from telnyx.api_resources.brand import Brand
17
+ from telnyx.api_resources.bucket import Bucket
18
+ from telnyx.api_resources.bucket_usage import BucketUsage
12
19
  from telnyx.api_resources.bulk_creation import BulkCreation
20
+ from telnyx.api_resources.bulk_credential import BulkCredential
21
+ from telnyx.api_resources.bulk_phone_number_campaign import BulkPhoneNumberCampaign
22
+ from telnyx.api_resources.bulk_phone_number_operation import BulkPhoneNumberOperation
23
+ from telnyx.api_resources.bulk_sole_proprietor_creation import (
24
+ BulkSoleProprietorCreation,
25
+ )
26
+ from telnyx.api_resources.business_identity import BusinessIdentity
13
27
  from telnyx.api_resources.call import Call
14
28
  from telnyx.api_resources.call_control_application import CallControlApplication
29
+ from telnyx.api_resources.call_information import CallInformation
30
+ from telnyx.api_resources.call_recording import CallRecording
15
31
  from telnyx.api_resources.campaign import Campaign
32
+ from telnyx.api_resources.cdr_usage_report import CdrUsageReport
16
33
  from telnyx.api_resources.comment import Comment
17
34
  from telnyx.api_resources.conference import Conference
18
35
  from telnyx.api_resources.connection import Connection
19
36
  from telnyx.api_resources.credential_connection import CredentialConnection
37
+ from telnyx.api_resources.csv_download import CsvDownload
20
38
  from telnyx.api_resources.custom_storage_credential import CustomStorageCredential
39
+ from telnyx.api_resources.customer_service_record import CustomerServiceRecord
40
+ from telnyx.api_resources.debugging import Debugging
41
+ from telnyx.api_resources.detail_record import DetailRecord
21
42
  from telnyx.api_resources.detail_records_report import DetailRecordsReport
43
+ from telnyx.api_resources.dialogflow_integration import DialogflowIntegration
22
44
  from telnyx.api_resources.document import Document, DocumentLink
23
45
  from telnyx.api_resources.dynamic_emergency_address import DynamicEmergencyAddress
46
+ from telnyx.api_resources.dynamic_emergency_endpoint import DynamicEmergencyEndpoint
47
+ from telnyx.api_resources.enum import Enum
24
48
  from telnyx.api_resources.event import Event
49
+ from telnyx.api_resources.external_connection import ExternalConnection
25
50
  from telnyx.api_resources.fax import Fax
26
51
  from telnyx.api_resources.fax_application import FaxApplication
27
52
  from telnyx.api_resources.fqdn import FQDN
28
53
  from telnyx.api_resources.fqdn_connection import FQDNConnection
29
54
  from telnyx.api_resources.inbound_channel import InboundChannel
30
55
  from telnyx.api_resources.inventory_coverage import InventoryCoverage
56
+ from telnyx.api_resources.inventory_level import InventoryLevel
31
57
  from telnyx.api_resources.ip import IP
58
+ from telnyx.api_resources.ip_address import IPAddress
32
59
  from telnyx.api_resources.ip_connection import IPConnection
60
+ from telnyx.api_resources.ip_range import IPRange
33
61
  from telnyx.api_resources.list_object import ListObject
34
62
  from telnyx.api_resources.managed_account import ManagedAccount
63
+ from telnyx.api_resources.mdr_detail_report import MdrDetailReport
64
+ from telnyx.api_resources.mdr_usage_report import MdrUsageReport
35
65
  from telnyx.api_resources.media import Media
66
+ from telnyx.api_resources.media_storage_api import MediaStorageApi
36
67
  from telnyx.api_resources.message import Message
37
68
  from telnyx.api_resources.messaging_hosted_number import MessagingHostedNumber
38
69
  from telnyx.api_resources.messaging_hosted_number_order import (
@@ -40,15 +71,26 @@ from telnyx.api_resources.messaging_hosted_number_order import (
40
71
  )
41
72
  from telnyx.api_resources.messaging_phone_number import MessagingPhoneNumber
42
73
  from telnyx.api_resources.messaging_profile import MessagingProfile
74
+ from telnyx.api_resources.messaging_tollfree_verification import (
75
+ MessagingTollfreeVerification,
76
+ )
77
+ from telnyx.api_resources.messaging_url_domain import MessagingUrlDomain
78
+ from telnyx.api_resources.mobile_network_operator import MobileNetworkOperator
79
+ from telnyx.api_resources.network import Network
80
+ from telnyx.api_resources.notification import Notification
43
81
  from telnyx.api_resources.notification_channel import NotificationChannel
44
82
  from telnyx.api_resources.notification_event import NotificationEvent
45
83
  from telnyx.api_resources.notification_event_condition import NotificationEventCondition
46
84
  from telnyx.api_resources.notification_profiles import NotificationProfile
47
85
  from telnyx.api_resources.notification_setting import NotificationSetting
86
+ from telnyx.api_resources.number_configuration import NumberConfiguration
48
87
  from telnyx.api_resources.number_lookup import NumberLookup
49
88
  from telnyx.api_resources.number_order import NumberOrder
50
89
  from telnyx.api_resources.number_order_phone_number import NumberOrderPhoneNumber
90
+ from telnyx.api_resources.number_portout import NumberPortout
51
91
  from telnyx.api_resources.number_reservation import NumberReservation
92
+ from telnyx.api_resources.numbers_feature import NumbersFeature
93
+ from telnyx.api_resources.ota_update import OtaUpdate
52
94
  from telnyx.api_resources.outbound_voice_profile import OutboundVoiceProfile
53
95
  from telnyx.api_resources.phone_assignment_profile import PhoneNumberByProfile
54
96
  from telnyx.api_resources.phone_number import (
@@ -56,34 +98,66 @@ from telnyx.api_resources.phone_number import (
56
98
  PhoneNumber,
57
99
  VoiceSettings,
58
100
  )
101
+ from telnyx.api_resources.phone_number_block_order import PhoneNumberBlockOrder
102
+ from telnyx.api_resources.phone_number_blocks_background_job import (
103
+ PhoneNumberBlocksBackgroundJob,
104
+ )
59
105
  from telnyx.api_resources.phone_number_campaign import PhoneNumberCampaign
106
+ from telnyx.api_resources.phone_number_configuration import PhoneNumberConfiguration
60
107
  from telnyx.api_resources.phone_number_jobs import PhoneNumberJob
108
+ from telnyx.api_resources.phone_number_order import PhoneNumberOrder
109
+ from telnyx.api_resources.phone_number_order_document import PhoneNumberOrderDocument
110
+ from telnyx.api_resources.phone_number_porting import PhoneNumberPorting
61
111
  from telnyx.api_resources.phone_number_regulatory_requirement import (
62
112
  PhoneNumberRegulatoryRequirement,
63
113
  )
114
+ from telnyx.api_resources.phone_number_reservation import PhoneNumberReservation
115
+ from telnyx.api_resources.phone_number_search import PhoneNumberSearch
64
116
  from telnyx.api_resources.portability_check import PortabilityCheck
65
117
  from telnyx.api_resources.porting_order import PortingOrder, PortingPhoneNumber
66
118
  from telnyx.api_resources.portout import PortOut
67
- from telnyx.api_resources.public_key import PublicKey
119
+ from telnyx.api_resources.presigned_object_url import PresignedObjectUrl
120
+ from telnyx.api_resources.private_wireless_gateway import PrivateWirelessGateway
121
+ from telnyx.api_resources.public_internet_gateway import PublicInternetGateway
122
+ from telnyx.api_resources.push_credential import PushCredential
68
123
  from telnyx.api_resources.queue import Queue, QueueCall
124
+ from telnyx.api_resources.queue_command import QueueCommand
125
+ from telnyx.api_resources.recordings_command import RecordingsCommand
126
+ from telnyx.api_resources.region import Region
127
+ from telnyx.api_resources.register_call import RegisterCall
128
+ from telnyx.api_resources.report import Report
129
+ from telnyx.api_resources.reporting import Reporting
130
+ from telnyx.api_resources.requirement import Requirement
131
+ from telnyx.api_resources.requirement_type import RequirementType
69
132
  from telnyx.api_resources.room import Room
133
+ from telnyx.api_resources.room_composition import RoomComposition
70
134
  from telnyx.api_resources.room_participant import RoomParticipant
71
- from telnyx.api_resources.room_session import RoomSession, RoomSessionList
135
+ from telnyx.api_resources.room_recording import RoomRecording
136
+ from telnyx.api_resources.room_session import RoomSession
137
+ from telnyx.api_resources.rooms_client_token import RoomsClientToken
138
+ from telnyx.api_resources.shared_campaign import SharedCampaign
72
139
  from telnyx.api_resources.short_code import ShortCode
73
140
  from telnyx.api_resources.sim_card import SIMCard
74
141
  from telnyx.api_resources.sim_card_action import SIMCardAction
75
142
  from telnyx.api_resources.sim_card_group import SIMCardGroup
76
143
  from telnyx.api_resources.sim_card_order import SIMCardOrder, SIMCardOrderPreview
144
+ from telnyx.api_resources.ssl_certificate import SslCertificate
77
145
  from telnyx.api_resources.sub_number_order import SubNumberOrder
78
146
  from telnyx.api_resources.telephony_credential import TelephonyCredential
147
+ from telnyx.api_resources.texml_application import TexmlApplication
148
+ from telnyx.api_resources.texml_rest_command import TexmlRestCommand
79
149
  from telnyx.api_resources.verification import Verification
150
+ from telnyx.api_resources.verified_calls_display_profile import (
151
+ VerifiedCallsDisplayProfile,
152
+ )
153
+ from telnyx.api_resources.verified_number import VerifiedNumber
154
+ from telnyx.api_resources.verify import Verify
80
155
  from telnyx.api_resources.verify_profile import VerifyProfile
156
+ from telnyx.api_resources.virtual_cross_connect import VirtualCrossConnect
157
+ from telnyx.api_resources.wdr_detail_report import WdrDetailReport
158
+ from telnyx.api_resources.webhook import Webhook
81
159
  from telnyx.api_resources.webhook_deliveries import WebhookDeliveries
82
- from telnyx.api_resources.whatsapp_business_account import WhatsappBusinessAccount
83
- from telnyx.api_resources.whatsapp_contact import WhatsappContact
84
- from telnyx.api_resources.whatsapp_media import WhatsappMedia
85
- from telnyx.api_resources.whatsapp_message import WhatsappMessage
86
- from telnyx.api_resources.whatsapp_phone_number import WhatsappPhoneNumber
160
+ from telnyx.api_resources.wireguard_interface import WireguardInterface
87
161
  from telnyx.api_resources.wireless_detail_record_report import (
88
162
  WirelessDetailRecordsReports,
89
163
  )
@@ -92,87 +166,153 @@ from telnyx.api_resources.wireless_detail_record_report import (
92
166
 
93
167
 
94
168
  __all__ = [
169
+ "APIKey",
95
170
  "AccessControlIP",
96
171
  "AccessIPAddress",
97
- "AuthenticationProvider",
172
+ "AccessToken",
98
173
  "Address",
99
- "APIKey",
174
+ "AdvancedOptinoptout",
175
+ "AI",
176
+ "AuthenticationProvider",
177
+ "Autorechargepreference",
100
178
  "AvailablePhoneNumber",
101
179
  "Balance",
180
+ "Billing",
102
181
  "BillingGroup",
103
182
  "Brand",
183
+ "Bucket",
184
+ "BucketUsage",
104
185
  "BulkCreation",
186
+ "BulkCredential",
187
+ "BulkPhoneNumberCampaign",
188
+ "BulkPhoneNumberOperation",
189
+ "BulkSoleProprietorCreation",
190
+ "BusinessIdentity",
105
191
  "Call",
106
192
  "CallControlApplication",
193
+ "CallInformation",
194
+ "CallRecording",
107
195
  "Campaign",
196
+ "CdrUsageReport",
108
197
  "Comment",
109
198
  "Conference",
110
199
  "Connection",
111
200
  "CredentialConnection",
201
+ "CsvDownload",
112
202
  "CustomStorageCredential",
203
+ "CustomerServiceRecord",
204
+ "Debugging",
205
+ "DetailRecord",
113
206
  "DetailRecordsReport",
207
+ "DialogflowIntegration",
114
208
  "Document",
115
209
  "DocumentLink",
116
210
  "DynamicEmergencyAddress",
211
+ "DynamicEmergencyEndpoint",
212
+ "Enum",
117
213
  "Event",
214
+ "ExternalConnection",
118
215
  "Fax",
119
216
  "FaxApplication",
120
217
  "FQDN",
121
218
  "FQDNConnection",
122
- "InboundChannel",
123
- "InventoryCoverage",
124
219
  "IP",
220
+ "IPAddress",
125
221
  "IPConnection",
222
+ "IPRange",
223
+ "InboundChannel",
224
+ "InventoryCoverage",
225
+ "InventoryLevel",
126
226
  "ListObject",
127
227
  "ManagedAccount",
228
+ "MdrDetailReport",
229
+ "MdrUsageReport",
128
230
  "Media",
231
+ "MediaStorageApi",
129
232
  "Message",
130
233
  "MessagingHostedNumber",
131
234
  "MessagingHostedNumberOrder",
132
235
  "MessagingPhoneNumber",
133
236
  "MessagingProfile",
134
237
  "MessagingSettings",
238
+ "MessagingTollfreeVerification",
239
+ "MessagingUrlDomain",
240
+ "MobileNetworkOperator",
241
+ "Network",
242
+ "Notification",
135
243
  "NotificationChannel",
136
244
  "NotificationEvent",
137
245
  "NotificationEventCondition",
138
246
  "NotificationProfile",
139
247
  "NotificationSetting",
248
+ "NumberConfiguration",
140
249
  "NumberLookup",
141
250
  "NumberOrder",
142
251
  "NumberOrderPhoneNumber",
252
+ "NumberPortout",
143
253
  "NumberReservation",
254
+ "NumbersFeature",
255
+ "OtaUpdate",
144
256
  "OutboundVoiceProfile",
145
257
  "PhoneNumber",
258
+ "PhoneNumberBlockOrder",
259
+ "PhoneNumberBlocksBackgroundJob",
146
260
  "PhoneNumberByProfile",
147
261
  "PhoneNumberCampaign",
262
+ "PhoneNumberConfiguration",
148
263
  "PhoneNumberJob",
264
+ "PhoneNumberOrder",
265
+ "PhoneNumberOrderDocument",
266
+ "PhoneNumberPorting",
149
267
  "PhoneNumberRegulatoryRequirement",
268
+ "PhoneNumberReservation",
269
+ "PhoneNumberSearch",
270
+ "PortOut",
150
271
  "PortabilityCheck",
151
272
  "PortingOrder",
152
273
  "PortingPhoneNumber",
153
- "PortOut",
154
- "PublicKey",
274
+ "PresignedObjectUrl",
275
+ "PrivateWirelessGateway",
276
+ "PublicInternetGateway",
277
+ "PushCredential",
155
278
  "Queue",
156
279
  "QueueCall",
280
+ "QueueCommand",
281
+ "RecordingsCommand",
282
+ "Region",
283
+ "RegisterCall",
284
+ "Report",
285
+ "Reporting",
286
+ "Requirement",
287
+ "RequirementType",
157
288
  "Room",
289
+ "RoomComposition",
158
290
  "RoomParticipant",
291
+ "RoomRecording",
159
292
  "RoomSession",
160
- "ShortCode",
293
+ "RoomsClientToken",
161
294
  "SIMCard",
162
295
  "SIMCardAction",
163
296
  "SIMCardGroup",
164
297
  "SIMCardOrder",
165
298
  "SIMCardOrderPreview",
299
+ "SharedCampaign",
300
+ "ShortCode",
301
+ "SslCertificate",
166
302
  "SubNumberOrder",
167
303
  "TelephonyCredential",
304
+ "TexmlApplication",
305
+ "TexmlRestCommand",
168
306
  "Verification",
307
+ "VerifiedCallsDisplayProfile",
308
+ "VerifiedNumber",
309
+ "Verify",
169
310
  "VerifyProfile",
311
+ "VirtualCrossConnect",
170
312
  "VoiceSettings",
313
+ "WdrDetailReport",
314
+ "Webhook",
171
315
  "WebhookDeliveries",
172
- "WhatsappBusinessAccount",
173
- "WhatsappContact",
174
- "WhatsappMedia",
175
- "WhatsappMessage",
176
- "WhatsappPhoneNumber",
316
+ "WireguardInterface",
177
317
  "WirelessDetailRecordsReports",
178
318
  ]
@@ -1,7 +1,9 @@
1
1
  from __future__ import absolute_import, division, print_function
2
2
 
3
- from telnyx import error, six, util
4
- from telnyx.six.moves.urllib.parse import quote_plus
3
+ import six
4
+ from six.moves.urllib.parse import quote_plus
5
+
6
+ from telnyx import error, util
5
7
  from telnyx.telnyx_object import TelnyxObject
6
8
 
7
9
 
@@ -21,9 +23,8 @@ class APIResource(TelnyxObject):
21
23
  # Otherwise, we will have an object of type `TelnyxObject`, the
22
24
  # default type returned by `util.convert_to_telnyx_object`, and we
23
25
  # promote the object back to an `APIResource`.
24
- if type(response) == TelnyxObject:
26
+ if isinstance(response, TelnyxObject) and not isinstance(response, APIResource):
25
27
  instance.refresh_from(response)
26
-
27
28
  return instance
28
29
  else:
29
30
  return response
@@ -1,7 +1,8 @@
1
1
  from __future__ import absolute_import, division, print_function
2
2
 
3
+ from six.moves.urllib.parse import quote_plus
4
+
3
5
  from telnyx import api_requestor, util
4
- from telnyx.six.moves.urllib.parse import quote_plus
5
6
 
6
7
 
7
8
  def nested_resource_class_methods(
@@ -90,6 +91,15 @@ def nested_resource_class_methods(
90
91
  list_method = "list_%s" % make_path(resource)
91
92
  setattr(cls, list_method, classmethod(list_nested_resources))
92
93
 
94
+ elif operation == "put":
95
+
96
+ def update_nested_resource(cls, id, nested_id, **params):
97
+ url = getattr(cls, resource_url_method)(id, nested_id)
98
+ return getattr(cls, resource_request_method)("put", url, **params)
99
+
100
+ update_method = "update_%s" % resource
101
+ setattr(cls, update_method, classmethod(update_nested_resource))
102
+
93
103
  else:
94
104
  raise ValueError("Unknown operation: %s" % operation)
95
105
 
@@ -1,8 +1,9 @@
1
1
  from __future__ import absolute_import, division, print_function
2
2
 
3
+ from six.moves.urllib.parse import quote_plus
4
+
3
5
  from telnyx import api_requestor, util
4
6
  from telnyx.api_resources.abstract.api_resource import APIResource
5
- from telnyx.six.moves.urllib.parse import quote_plus
6
7
 
7
8
 
8
9
  class UpdateableAPIResource(APIResource):
@@ -3,5 +3,5 @@ from __future__ import absolute_import, division, print_function
3
3
  from telnyx.api_resources.abstract import CreateableAPIResource
4
4
 
5
5
 
6
- class WhatsappContact(CreateableAPIResource):
7
- OBJECT_NAME = "whatsapp_contact"
6
+ class AccessToken(CreateableAPIResource):
7
+ OBJECT_NAME = "access_token"
@@ -4,12 +4,25 @@ from telnyx.api_resources.abstract import (
4
4
  CreateableAPIResource,
5
5
  DeletableAPIResource,
6
6
  ListableAPIResource,
7
+ nested_resource_class_methods,
7
8
  )
8
9
 
9
10
 
11
+ @nested_resource_class_methods(
12
+ "validate", path="actions/validate", operations=["create"]
13
+ )
14
+ @nested_resource_class_methods(
15
+ "accept_suggestions", path="actions/accept_suggestions", operations=["create"]
16
+ )
10
17
  class Address(CreateableAPIResource, DeletableAPIResource, ListableAPIResource):
11
18
  OBJECT_NAME = "address"
12
19
 
13
20
  @classmethod
14
21
  def class_url(cls):
15
22
  return "/v2/addresses"
23
+
24
+ def validate(self, **params):
25
+ return self.create_validate(**params)
26
+
27
+ def accept_suggestions(self, **params):
28
+ return self.create_accept_suggestions(**params)
@@ -0,0 +1,17 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import (
4
+ CreateableAPIResource,
5
+ DeletableAPIResource,
6
+ ListableAPIResource,
7
+ UpdateableAPIResource,
8
+ )
9
+
10
+
11
+ class AdvancedOptinoptout(
12
+ CreateableAPIResource,
13
+ DeletableAPIResource,
14
+ ListableAPIResource,
15
+ UpdateableAPIResource,
16
+ ):
17
+ OBJECT_NAME = "advanced_optinoptout"
@@ -0,0 +1,36 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import (
4
+ CreateableAPIResource,
5
+ DeletableAPIResource,
6
+ ListableAPIResource,
7
+ nested_resource_class_methods,
8
+ )
9
+
10
+
11
+ @nested_resource_class_methods("generate", path="generate", operations=["create"])
12
+ @nested_resource_class_methods(
13
+ "generate_stream", path="generate_stream", operations=["create"]
14
+ )
15
+ @nested_resource_class_methods("summarize", path="summarize", operations=["create"])
16
+ @nested_resource_class_methods("embeddings", path="embeddings", operations=["create"])
17
+ @nested_resource_class_methods(
18
+ "similarity_search", path="embeddings/similarity-search", operations=["create"]
19
+ )
20
+ class AI(CreateableAPIResource, DeletableAPIResource, ListableAPIResource):
21
+ OBJECT_NAME = "ai"
22
+
23
+ def generate(self, **params):
24
+ return AI.create_generate(**params)
25
+
26
+ def generate_stream(self, **params):
27
+ return AI.create_generate_stream(**params)
28
+
29
+ def summarize(self, **params):
30
+ return AI.create_summarize(**params)
31
+
32
+ def embeddings(self, **params):
33
+ return AI.create_embeddings(**params)
34
+
35
+ def similarity_search(self, **params):
36
+ return AI.create_simalarity_search
@@ -0,0 +1,7 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import ListableAPIResource, UpdateableAPIResource
4
+
5
+
6
+ class Autorechargepreference(ListableAPIResource, UpdateableAPIResource):
7
+ OBJECT_NAME = "autorechargepreference"
@@ -3,5 +3,5 @@ from __future__ import absolute_import, division, print_function
3
3
  from telnyx.api_resources.abstract import ListableAPIResource
4
4
 
5
5
 
6
- class WhatsappBusinessAccount(ListableAPIResource):
7
- OBJECT_NAME = "whatsapp_business_account"
6
+ class Billing(ListableAPIResource):
7
+ OBJECT_NAME = "billing"
@@ -0,0 +1,17 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import (
4
+ CreateableAPIResource,
5
+ DeletableAPIResource,
6
+ ListableAPIResource,
7
+ UpdateableAPIResource,
8
+ )
9
+
10
+
11
+ class Bucket(
12
+ CreateableAPIResource,
13
+ DeletableAPIResource,
14
+ ListableAPIResource,
15
+ UpdateableAPIResource,
16
+ ):
17
+ OBJECT_NAME = "bucket"
@@ -0,0 +1,7 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import ListableAPIResource
4
+
5
+
6
+ class BucketUsage(ListableAPIResource):
7
+ OBJECT_NAME = "bucket_usage"
@@ -0,0 +1,13 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import (
4
+ CreateableAPIResource,
5
+ DeletableAPIResource,
6
+ UpdateableAPIResource,
7
+ )
8
+
9
+
10
+ class BulkCredential(
11
+ CreateableAPIResource, DeletableAPIResource, UpdateableAPIResource
12
+ ):
13
+ OBJECT_NAME = "bulk_credential"
@@ -0,0 +1,7 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import CreateableAPIResource, ListableAPIResource
4
+
5
+
6
+ class BulkPhoneNumberCampaign(CreateableAPIResource, ListableAPIResource):
7
+ OBJECT_NAME = "bulk_phone_number_campaign"
@@ -0,0 +1,7 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import CreateableAPIResource, ListableAPIResource
4
+
5
+
6
+ class BulkPhoneNumberOperation(CreateableAPIResource, ListableAPIResource):
7
+ OBJECT_NAME = "bulk_phone_number_operation"
@@ -0,0 +1,7 @@
1
+ from __future__ import absolute_import, division, print_function
2
+
3
+ from telnyx.api_resources.abstract import CreateableAPIResource, ListableAPIResource
4
+
5
+
6
+ class BulkSoleProprietorCreation(CreateableAPIResource, ListableAPIResource):
7
+ OBJECT_NAME = "bulk_sole_proprietor_creation"