twilio-ruby 6.0.0.pre.rc.3 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +103 -47
- data/CONTRIBUTING.md +10 -8
- data/README.md +128 -46
- data/UPGRADE.md +7 -4
- data/advanced-examples/custom-http-client.md +170 -0
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb +7 -42
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +8 -42
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +2 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +3 -16
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account.rb +24 -103
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +1 -5
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +2 -10
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +6 -24
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +2 -9
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +3 -15
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -6
- data/lib/twilio-ruby/rest/chat/v1/service.rb +3 -12
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +4 -20
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +2 -10
- data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -16
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +11 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -5
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +3 -12
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -6
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +3 -15
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +1 -5
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +5 -21
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +1 -4
- data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -4
- data/lib/twilio-ruby/rest/events/v1/sink.rb +2 -10
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +1 -4
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +38 -44
- data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +17 -23
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +9 -9
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +53 -53
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +37 -37
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +52 -52
- data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +19 -92
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answer_sets.rb +4 -4
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +4 -4
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +2 -11
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -4
- data/lib/twilio-ruby/rest/flex_api/v1.rb +30 -39
- data/lib/twilio-ruby/rest/insights/v1/call.rb +2 -10
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +31 -3
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +1 -4
- data/lib/twilio-ruby/rest/insights/v1/room.rb +1 -4
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -15
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -6
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -12
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +4 -20
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +2 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -16
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +2 -9
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +28 -2
- data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +196 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +31 -47
- data/lib/twilio-ruby/rest/messaging/v1.rb +15 -15
- data/lib/twilio-ruby/rest/messaging.rb +1 -1
- data/lib/twilio-ruby/rest/microvisor/v1/device.rb +2 -8
- data/lib/twilio-ruby/rest/microvisor.rb +2 -1
- data/lib/twilio-ruby/rest/notify/v1/service.rb +2 -9
- data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +224 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +49 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +4 -18
- data/lib/twilio-ruby/rest/oauth.rb +1 -1
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +4 -16
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +1 -5
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +1 -4
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +1 -4
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -5
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -10
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -10
- data/lib/twilio-ruby/rest/preview/sync/service.rb +3 -12
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +1 -5
- data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +2 -10
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +5 -20
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -6
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +2 -10
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +3 -12
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +1 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +3 -15
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +1 -5
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +4 -16
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement.rb +1 -5
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -5
- data/lib/twilio-ruby/rest/studio/v1/flow.rb +2 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -5
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +2 -8
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +1 -4
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +2 -10
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -10
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -10
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -6
- data/lib/twilio-ruby/rest/sync/v1/service.rb +4 -16
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +1 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +2 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +7 -28
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +4 -16
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +3 -12
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +3 -12
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +1 -7
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +3 -16
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb +1 -5
- data/lib/twilio-ruby/rest/verify/v2/service.rb +7 -29
- data/lib/twilio-ruby/rest/video/v1/room/participant.rb +3 -16
- data/lib/twilio-ruby/rest/video/v1/room.rb +3 -13
- data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +1 -4
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -5
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +2 -10
- data/lib/twilio-ruby/rest.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +12 -9
- data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +0 -744
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 879e6c988389b279694568764e67cc0f6da872ec
|
4
|
+
data.tar.gz: b2f437359378e1c21eeaca94f1fdfa3b976e4b7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ff88c428018101c5e78adea45e38b01e357714b397a86a587870253ed870225ced732f934ac2c4d5e70ad7f569aa7f4312a56b4c9019aac00ea520c5b091ada
|
7
|
+
data.tar.gz: 5bf17165b9f5c77b2a92d14c596193cb7b6b4caa0c8594bd6050714d84814c087b176b141e573c12b2a70611b26e5e2d14cb94ed6893fa6210a8324884cbc2b1
|
data/CHANGES.md
CHANGED
@@ -1,13 +1,44 @@
|
|
1
1
|
twilio-ruby changelog
|
2
|
-
=====================
|
2
|
+
=====================
|
3
3
|
|
4
|
-
[2023-
|
5
|
-
|
4
|
+
[2023-05-18] Version 6.0.1
|
5
|
+
--------------------------
|
6
6
|
**Library - Fix**
|
7
|
-
- [PR #
|
7
|
+
- [PR #654](https://github.com/twilio/twilio-ruby/pull/654): match only against the end of a file path. Thanks to [@pat](https://github.com/pat)!
|
8
8
|
|
9
|
-
**
|
10
|
-
-
|
9
|
+
**Conversations**
|
10
|
+
- Added `AddressCountry` parameter to Address Configuration endpoint, to support regional short code addresses
|
11
|
+
- Added query parameters `start_date`, `end_date` and `state` in list Conversations resource for filtering
|
12
|
+
|
13
|
+
**Insights**
|
14
|
+
- Added annotations parameters to list summary api
|
15
|
+
|
16
|
+
**Messaging**
|
17
|
+
- Add GET domainByMessagingService endpoint to linkShortening service
|
18
|
+
- Add `disable_https` to link shortening domain_config properties
|
19
|
+
|
20
|
+
**Numbers**
|
21
|
+
- Add bulk_eligibility api under version `/v1`.
|
22
|
+
|
23
|
+
|
24
|
+
[2023-05-04] Version 6.0.0
|
25
|
+
--------------------------
|
26
|
+
**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md#2023-05-03-5xx-to-6xx) for detailed migration notes.
|
27
|
+
|
28
|
+
**Library - Feature**
|
29
|
+
- [PR #651](https://github.com/twilio/twilio-ruby/pull/651): Merge branch '6.x.x-rc' to main. Thanks to [@shrutiburman](https://github.com/shrutiburman)! **(breaking change)**
|
30
|
+
|
31
|
+
**Conversations**
|
32
|
+
- Remove `start_date`, `end_date` and `state` query parameters from list operation on Conversations resource **(breaking change)**
|
33
|
+
|
34
|
+
**Twiml**
|
35
|
+
- Add support for new Amazon Polly voices (Q1 2023) for `Say` verb
|
36
|
+
|
37
|
+
|
38
|
+
[2023-04-19] Version 5.77.0
|
39
|
+
---------------------------
|
40
|
+
**Library - Docs**
|
41
|
+
- [PR #645](https://github.com/twilio/twilio-ruby/pull/645): consolidate. Thanks to [@stern-shawn](https://github.com/stern-shawn)!
|
11
42
|
|
12
43
|
**Messaging**
|
13
44
|
- Remove `messaging_service_sids` and `messaging_service_sid_action` from domain config endpoint **(breaking change)**
|
@@ -17,15 +48,8 @@ twilio-ruby changelog
|
|
17
48
|
- Added the new Eligibility API under version `/v1`.
|
18
49
|
|
19
50
|
|
20
|
-
[2023-04-05] Version
|
21
|
-
|
22
|
-
**Library - Fix**
|
23
|
-
- [PR #642](https://github.com/twilio/twilio-ruby/pull/642): remove deprecated Twilio::REST::TwilioError#body. Thanks to [@kridai](https://github.com/kridai)!
|
24
|
-
- [PR #641](https://github.com/twilio/twilio-ruby/pull/641): remove deprecated TwilioResponse class. Thanks to [@kridai](https://github.com/kridai)!
|
25
|
-
|
26
|
-
**Library - Chore**
|
27
|
-
- [PR #643](https://github.com/twilio/twilio-ruby/pull/643): extend ruby & jruby support. Thanks to [@shrutiburman](https://github.com/shrutiburman)!
|
28
|
-
|
51
|
+
[2023-04-05] Version 5.76.0
|
52
|
+
---------------------------
|
29
53
|
**Conversations**
|
30
54
|
- Expose query parameters `start_date`, `end_date` and `state` in list operation on Conversations resource for sorting and filtering
|
31
55
|
|
@@ -42,52 +66,93 @@ twilio-ruby changelog
|
|
42
66
|
- Add Brand Registrations OTP API
|
43
67
|
|
44
68
|
|
45
|
-
[2023-03-
|
46
|
-
|
47
|
-
**Library - Fix**
|
48
|
-
- [PR #639](https://github.com/twilio/twilio-ruby/pull/639): add all handcrafted domain files. Thanks to [@charan678](https://github.com/charan678)!
|
49
|
-
|
69
|
+
[2023-03-22] Version 5.75.0
|
70
|
+
---------------------------
|
50
71
|
**Library - Chore**
|
51
|
-
- [PR #
|
52
|
-
- [PR #627](https://github.com/twilio/twilio-ruby/pull/627): bump jwt max version to 2.6. Thanks to [@claudiachua](https://github.com/claudiachua)!
|
53
|
-
|
54
|
-
**Library - Feature**
|
55
|
-
- [PR #622](https://github.com/twilio/twilio-ruby/pull/622): Add client base file. Thanks to [@shrutiburman](https://github.com/shrutiburman)!
|
72
|
+
- [PR #630](https://github.com/twilio/twilio-ruby/pull/630): Accommodate jwt's minor and patch updates. Thanks to [@sato11](https://github.com/sato11)!
|
56
73
|
|
57
74
|
**Api**
|
58
75
|
- Revert Corrected the data type for `friendly_name` in Available Phone Number Local, Mobile and TollFree resources
|
59
76
|
- Corrected the data type for `friendly_name` in Available Phone Number Local, Mobile and TollFree resources **(breaking change)**
|
77
|
+
|
78
|
+
**Messaging**
|
79
|
+
- Add `linkshortening_messaging_service` resource
|
80
|
+
- Add new endpoint for GetDomainConfigByMessagingServiceSid
|
81
|
+
- Remove `validated` parameter and add `cert_in_validation` parameter to Link Shortening API **(breaking change)**
|
82
|
+
|
83
|
+
|
84
|
+
[2023-03-09] Version 5.74.5
|
85
|
+
---------------------------
|
86
|
+
**Api**
|
60
87
|
- Add new categories for whatsapp template
|
88
|
+
|
89
|
+
**Lookups**
|
90
|
+
- Remove `validation_results` from the `default_output_properties`
|
91
|
+
|
92
|
+
**Supersim**
|
93
|
+
- Add ESimProfile's `matching_id` and `activation_code` parameters to libraries
|
94
|
+
|
95
|
+
|
96
|
+
[2023-02-22] Version 5.74.4
|
97
|
+
---------------------------
|
98
|
+
**Api**
|
61
99
|
- Remove `scheduled_for` property from message resource
|
62
100
|
- Add `scheduled_for` property to message resource
|
101
|
+
|
102
|
+
|
103
|
+
[2023-02-08] Version 5.74.3
|
104
|
+
---------------------------
|
105
|
+
**Lookups**
|
106
|
+
- Add `disposable_phone_number_risk` package to the lookup response
|
107
|
+
- Add `sms_pumping_risk` package to the lookup response
|
108
|
+
|
109
|
+
|
110
|
+
[2023-01-25] Version 5.74.2
|
111
|
+
---------------------------
|
112
|
+
**Api**
|
63
113
|
- Add `public_application_connect_enabled` param to Application resource
|
64
|
-
|
65
|
-
|
114
|
+
|
115
|
+
**Messaging**
|
116
|
+
- Add new tollfree verification API property (ExternalReferenceId)]
|
117
|
+
|
118
|
+
**Verify**
|
119
|
+
- Add `device_ip` parameter and channel `auto` for sna/sms orchestration
|
120
|
+
|
121
|
+
**Twiml**
|
122
|
+
- Add support for `<Application>` noun and `<ApplicationSid>` noun, nested `<Parameter>` to `<Hangup>` and `<Leave>` verb
|
123
|
+
|
124
|
+
|
125
|
+
[2023-01-11] Version 5.74.1
|
126
|
+
---------------------------
|
127
|
+
**Library - Chore**
|
128
|
+
- [PR #626](https://github.com/twilio/twilio-ruby/pull/626): Bump jwt version max version to 2.6. Thanks to [@MarcPer](https://github.com/MarcPer)!
|
66
129
|
|
67
130
|
**Conversations**
|
68
131
|
- Add support for creating Multi-Channel Rich Content Messages
|
69
132
|
|
133
|
+
**Lookups**
|
134
|
+
- Changed the no data message for match postal code from `no_data` to `data_not_available` in identity match package
|
135
|
+
|
136
|
+
**Messaging**
|
137
|
+
- Add update/edit tollfree verification API
|
138
|
+
|
139
|
+
|
140
|
+
[2022-12-14] Version 5.74.0
|
141
|
+
---------------------------
|
142
|
+
**Api**
|
143
|
+
- Add `street_secondary` param to address create and update
|
144
|
+
- Make `method` optional for user defined message subscription **(breaking change)**
|
145
|
+
|
70
146
|
**Flex**
|
71
147
|
- Flex Conversations is now Generally Available
|
72
148
|
- Adding the ie1 mapping for authorization api, updating service base uri and base url response attribute **(breaking change)**
|
73
149
|
- Change web channels to GA and library visibility to public
|
74
150
|
- Changing the uri for authorization api from using Accounts to Insights **(breaking change)**
|
75
151
|
|
76
|
-
**Lookups**
|
77
|
-
- Remove `validation_results` from the `default_output_properties`
|
78
|
-
- Add `disposable_phone_number_risk` package to the lookup response
|
79
|
-
- Add `sms_pumping_risk` package to the lookup response
|
80
|
-
- Changed the no data message for match postal code from `no_data` to `data_not_available` in identity match package
|
81
|
-
|
82
152
|
**Media**
|
83
153
|
- Gate Twilio Live endpoints behind beta_feature for EOS
|
84
154
|
|
85
155
|
**Messaging**
|
86
|
-
- Add `linkshortening_messaging_service` resource
|
87
|
-
- Add new endpoint for GetDomainConfigByMessagingServiceSid
|
88
|
-
- Remove `validated` parameter and add `cert_in_validation` parameter to Link Shortening API **(breaking change)**
|
89
|
-
- Add new tollfree verification API property (ExternalReferenceId)]
|
90
|
-
- Add update/edit tollfree verification API
|
91
156
|
- Mark `MessageFlow` as a required field for Campaign Creation **(breaking change)**
|
92
157
|
|
93
158
|
**Oauth**
|
@@ -95,14 +160,9 @@ twilio-ruby changelog
|
|
95
160
|
- Added device code authorization endpoint
|
96
161
|
|
97
162
|
**Supersim**
|
98
|
-
- Add ESimProfile's `matching_id` and `activation_code` parameters to libraries
|
99
163
|
- Allow filtering the SettingsUpdates resource by `status`
|
100
164
|
|
101
|
-
**Verify**
|
102
|
-
- Add `device_ip` parameter and channel `auto` for sna/sms orchestration
|
103
|
-
|
104
165
|
**Twiml**
|
105
|
-
- Add support for `<Application>` noun and `<ApplicationSid>` noun, nested `<Parameter>` to `<Hangup>` and `<Leave>` verb
|
106
166
|
- Add new Polly Neural voices
|
107
167
|
- Add tr-TR, ar-AE, yue-CN, fi-FI languages to SSML `<lang>` element.
|
108
168
|
- Add x-amazon-jyutping, x-amazon-pinyin, x-amazon-pron-kana, x-amazon-yomigana alphabets to SSML `<phoneme>` element.
|
@@ -110,10 +170,6 @@ twilio-ruby changelog
|
|
110
170
|
- Rename `role` attribute to `format` in SSML `<say-as>` element. **(breaking change)**
|
111
171
|
|
112
172
|
|
113
|
-
[2023-03-23] Version 6.0.0-rc.0
|
114
|
-
---------------------------
|
115
|
-
- Release Candidate prep
|
116
|
-
|
117
173
|
[2022-11-30] Version 5.73.4
|
118
174
|
---------------------------
|
119
175
|
**Flex**
|
data/CONTRIBUTING.md
CHANGED
@@ -21,7 +21,7 @@ it can be.
|
|
21
21
|
## <a name="question"></a> Got an API/Product Question or Problem?
|
22
22
|
|
23
23
|
If you have questions about how to use `twilio-ruby`, please see our
|
24
|
-
[docs]
|
24
|
+
[docs](./README.md), and if you don't find the answer there, please contact
|
25
25
|
[help@twilio.com](mailto:help@twilio.com) with any issues you have.
|
26
26
|
|
27
27
|
## <a name="issue"></a> Found an Issue?
|
@@ -37,6 +37,14 @@ This code was generated by
|
|
37
37
|
/ /
|
38
38
|
"""
|
39
39
|
```
|
40
|
+
or
|
41
|
+
```
|
42
|
+
* This code was generated by
|
43
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
44
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
45
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
46
|
+
*
|
47
|
+
```
|
40
48
|
then it is a generated file and the change will need to be made by us, but
|
41
49
|
submitting an issue will help us track it and keep you up-to-date. If the file
|
42
50
|
isn't generated, you can help us out even more by submitting a Pull Request with
|
@@ -68,10 +76,6 @@ you're working on.
|
|
68
76
|
For large fixes, please build and test the documentation before submitting the
|
69
77
|
PR to be sure you haven't accidentally introduced layout or formatting issues.
|
70
78
|
|
71
|
-
If you want to help improve the docs at
|
72
|
-
[https://www.twilio.com/docs/libraries/ruby][docs-link], please contact
|
73
|
-
[help@twilio.com](mailto:help@twilio.com).
|
74
|
-
|
75
79
|
## <a name="submit"></a> Submission Guidelines
|
76
80
|
|
77
81
|
### Submitting an Issue
|
@@ -155,7 +159,5 @@ you are working:
|
|
155
159
|
* All features or bug fixes **must be tested** by one or more tests.
|
156
160
|
* All classes and methods **must be documented**.
|
157
161
|
|
158
|
-
|
159
|
-
[docs-link]: https://www.twilio.com/docs/libraries/ruby
|
160
162
|
[issue-link]: https://github.com/twilio/twilio-ruby/issues/new
|
161
|
-
[github]: https://github.com/twilio/twilio-ruby
|
163
|
+
[github]: https://github.com/twilio/twilio-ruby
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
The documentation for the Twilio API can be found [here][apidocs].
|
10
10
|
|
11
|
-
The
|
11
|
+
The individual releases [here][refdocs].
|
12
12
|
|
13
13
|
## Versions
|
14
14
|
|
@@ -30,7 +30,7 @@ This library supports the following Ruby implementations:
|
|
30
30
|
* JRuby 9.3
|
31
31
|
* JRuby 9.4
|
32
32
|
|
33
|
-
### Migrating from
|
33
|
+
### Migrating from 5.x
|
34
34
|
|
35
35
|
[Upgrade Guide][upgrade]
|
36
36
|
|
@@ -39,19 +39,13 @@ This library supports the following Ruby implementations:
|
|
39
39
|
To install using [Bundler][bundler] grab the latest stable version:
|
40
40
|
|
41
41
|
```ruby
|
42
|
-
gem 'twilio-ruby', '~> 6.0.
|
42
|
+
gem 'twilio-ruby', '~> 6.0.1'
|
43
43
|
```
|
44
44
|
|
45
45
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
46
46
|
|
47
47
|
```bash
|
48
|
-
gem install twilio-ruby -v 6.0.
|
49
|
-
```
|
50
|
-
|
51
|
-
To install `twilio-ruby` release candidate via [Rubygems][rubygems] simply gem install:
|
52
|
-
|
53
|
-
```bash
|
54
|
-
gem install twilio-ruby -v 6.0.0-rc.3
|
48
|
+
gem install twilio-ruby -v 6.0.1
|
55
49
|
```
|
56
50
|
|
57
51
|
To build and install the development branch yourself from the latest source:
|
@@ -62,18 +56,47 @@ cd twilio-ruby
|
|
62
56
|
make install
|
63
57
|
```
|
64
58
|
|
65
|
-
|
59
|
+
> **Info**
|
60
|
+
> If the command line gives you an error message that says Permission Denied, try running the above commands with sudo.
|
61
|
+
>
|
62
|
+
> For example: `sudo gem install twilio-ruby`
|
63
|
+
|
64
|
+
### Test your installation
|
65
|
+
|
66
|
+
To make sure the installation was successful, try sending yourself an SMS message, like this:
|
66
67
|
|
67
|
-
|
68
|
+
```rb
|
69
|
+
require "twilio-ruby"
|
70
|
+
|
71
|
+
# Your Account SID and Auth Token from console.twilio.com
|
72
|
+
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
73
|
+
auth_token = "your_auth_token"
|
74
|
+
|
75
|
+
@client = Twilio::REST::Client.new account_sid, auth_token
|
76
|
+
message = @client.messages.create(
|
77
|
+
body: "Hello from Ruby",
|
78
|
+
to: "+12345678901", # Text this number
|
79
|
+
from: "+15005550006", # From a valid Twilio number
|
80
|
+
)
|
81
|
+
|
82
|
+
puts message.sid
|
83
|
+
```
|
84
|
+
|
85
|
+
> **Warning**
|
86
|
+
> It's okay to hardcode your credentials when testing locally, but you should use environment variables to keep them secret before committing any code or deploying to production. Check out [How to Set Environment Variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html) for more information.
|
87
|
+
|
88
|
+
## Usage
|
89
|
+
|
90
|
+
### Authenticate the Client
|
68
91
|
|
69
92
|
```ruby
|
70
93
|
require 'twilio-ruby'
|
71
94
|
|
72
|
-
#
|
95
|
+
# Your Account SID and Auth Token from console.twilio.com
|
73
96
|
account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
74
97
|
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
75
98
|
|
76
|
-
#
|
99
|
+
# Initialize the Twilio Client with your credentials
|
77
100
|
@client = Twilio::REST::Client.new account_sid, auth_token
|
78
101
|
```
|
79
102
|
|
@@ -82,8 +105,9 @@ auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
|
82
105
|
```ruby
|
83
106
|
require 'twilio-ruby'
|
84
107
|
|
85
|
-
#
|
108
|
+
# Your Account SID from console.twilio.com
|
86
109
|
account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
110
|
+
# API Key from twilio.com/console/project/api-keys
|
87
111
|
api_key_sid = 'zzzzzzzzzzzzzzzzzzzzzz'
|
88
112
|
api_key_secret = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
89
113
|
|
@@ -108,22 +132,6 @@ To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/doc
|
|
108
132
|
|
109
133
|
This will result in the `hostname` transforming from `api.twilio.com` to `api.sydney.au1.twilio.com`.
|
110
134
|
|
111
|
-
### Enable Debug logging
|
112
|
-
|
113
|
-
In order to enable debug logging, pass in a 'logger' instance to the client with the level set to at least 'DEBUG'
|
114
|
-
|
115
|
-
```ruby
|
116
|
-
@client = Twilio::REST::Client.new account_sid, auth_token
|
117
|
-
myLogger = Logger.new(STDOUT)
|
118
|
-
myLogger.level = Logger::DEBUG
|
119
|
-
@client.logger = myLogger
|
120
|
-
|
121
|
-
@client = Twilio::REST::Client.new account_sid, auth_token
|
122
|
-
myLogger = Logger.new('my_log.log')
|
123
|
-
myLogger.level = Logger::DEBUG
|
124
|
-
@client.logger = myLogger
|
125
|
-
```
|
126
|
-
|
127
135
|
### Make a Call
|
128
136
|
|
129
137
|
```ruby
|
@@ -158,27 +166,59 @@ message_sid = 'SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
158
166
|
@client.messages(message_sid).fetch
|
159
167
|
```
|
160
168
|
|
161
|
-
###
|
169
|
+
### Iterate through records
|
162
170
|
|
163
|
-
`
|
171
|
+
The library automatically handles paging for you. Collections, such as `calls` and `messages`, have `list` and stream methods that page under the hood. With both `list` and `stream`, you can specify the number of records you want to receive (`limit`) and the maximum size you want each page fetch to be (`page_size`). The library will then handle the task for you.
|
164
172
|
|
165
|
-
|
166
|
-
|
173
|
+
`list` eagerly fetches all records and returns them as a list, whereas `stream` returns an enumerator and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the `page` method.
|
174
|
+
|
175
|
+
For more information about these methods, view the [auto-generated library docs](https://www.twilio.com/docs/libraries/reference/twilio-ruby).
|
176
|
+
|
177
|
+
```rb
|
178
|
+
require 'twilio-ruby'
|
179
|
+
|
180
|
+
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
|
181
|
+
auth_token = 'your_auth_token'
|
182
|
+
|
183
|
+
@client = Twilio::REST::Client.new(account_sid, auth_token)
|
184
|
+
|
185
|
+
@client.calls.list
|
186
|
+
.each do |call|
|
187
|
+
puts call.direction
|
188
|
+
end
|
167
189
|
```
|
168
190
|
|
169
|
-
|
191
|
+
### Enable Debug logging
|
170
192
|
|
171
|
-
|
193
|
+
In order to enable debug logging, pass in a 'logger' instance to the client with the level set to at least 'DEBUG'
|
172
194
|
|
173
195
|
```ruby
|
174
|
-
@client.
|
175
|
-
|
176
|
-
|
196
|
+
@client = Twilio::REST::Client.new account_sid, auth_token
|
197
|
+
myLogger = Logger.new(STDOUT)
|
198
|
+
myLogger.level = Logger::DEBUG
|
199
|
+
@client.logger = myLogger
|
200
|
+
|
201
|
+
@client = Twilio::REST::Client.new account_sid, auth_token
|
202
|
+
myLogger = Logger.new('my_log.log')
|
203
|
+
myLogger.level = Logger::DEBUG
|
204
|
+
@client.logger = myLogger
|
177
205
|
```
|
178
206
|
|
179
|
-
###
|
207
|
+
### Handle Exceptions {#exceptions}
|
208
|
+
|
209
|
+
If the Twilio API returns a 400 or a 500 level HTTP response, the `twilio-ruby`
|
210
|
+
library will throw a `Twilio::REST::RestError`. 400-level errors are normal
|
211
|
+
during API operation (`“Invalid number”`, `“Cannot deliver SMS to that number”`,
|
212
|
+
for example) and should be handled appropriately.
|
213
|
+
|
214
|
+
```rb
|
215
|
+
require 'twilio-ruby'
|
216
|
+
|
217
|
+
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
|
218
|
+
auth_token = 'your_auth_token'
|
219
|
+
|
220
|
+
@client = Twilio::REST::Client.new account_sid, auth_token
|
180
221
|
|
181
|
-
```ruby
|
182
222
|
begin
|
183
223
|
messages = @client.messages.list(limit: 20)
|
184
224
|
rescue Twilio::REST::RestError => e
|
@@ -186,9 +226,51 @@ rescue Twilio::REST::RestError => e
|
|
186
226
|
end
|
187
227
|
```
|
188
228
|
|
189
|
-
|
229
|
+
### Debug API requests
|
230
|
+
|
231
|
+
To assist with debugging, the library allows you to access the underlying request and response objects. This capability is built into the default HTTP client that ships with the library.
|
232
|
+
|
233
|
+
For example, you can retrieve the status code of the last response like so:
|
234
|
+
|
235
|
+
```ruby
|
236
|
+
require 'rubygems' # Not necessary with ruby 1.9 but included for completeness
|
237
|
+
require 'twilio-ruby'
|
238
|
+
|
239
|
+
# Your Account SID and Auth Token from console.twilio.com
|
240
|
+
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
|
241
|
+
auth_token = 'your_auth_token'
|
242
|
+
|
243
|
+
@client = Twilio::REST::Client.new(account_sid, auth_token)
|
244
|
+
|
245
|
+
@message = @client.messages.create(
|
246
|
+
to: '+14158675309',
|
247
|
+
from: '+14258675310',
|
248
|
+
body: 'Ahoy!'
|
249
|
+
)
|
250
|
+
|
251
|
+
# Retrieve the status code of the last response from the HTTP client
|
252
|
+
puts @client.http_client.last_response.status_code
|
253
|
+
```
|
254
|
+
|
255
|
+
### Customize your HTTP Client
|
256
|
+
|
257
|
+
`twilio-ruby` uses [Faraday][faraday] to make HTTP requests. You can tell `Twilio::REST::Client` to use any of the Faraday adapters like so:
|
258
|
+
|
259
|
+
```ruby
|
260
|
+
@client.http_client.adapter = :typhoeus
|
261
|
+
```
|
262
|
+
|
263
|
+
To use a custom HTTP client with this helper library, please see the [advanced example of how to do so](./advanced-examples/custom-http-client.md).
|
264
|
+
|
265
|
+
To apply customizations such as middleware, you can use the `configure_connection` method like so:
|
266
|
+
|
267
|
+
```ruby
|
268
|
+
@client.http_client.configure_connection do |faraday|
|
269
|
+
faraday.use SomeMiddleware
|
270
|
+
end
|
271
|
+
```
|
190
272
|
|
191
|
-
###
|
273
|
+
### Get started With Client Capability Tokens
|
192
274
|
|
193
275
|
If you just need to generate a Capability Token for use with Twilio Client, you can do this:
|
194
276
|
|
@@ -216,7 +298,7 @@ capability.add_scope(incoming_scope)
|
|
216
298
|
|
217
299
|
There is a slightly more detailed document in the [Capability][capability] section of the wiki.
|
218
300
|
|
219
|
-
###
|
301
|
+
### Generate TwiML
|
220
302
|
|
221
303
|
To control phone calls, your application needs to output [TwiML][twiml].
|
222
304
|
|
@@ -260,7 +342,7 @@ If you've instead found a bug in the library or would like new features added, g
|
|
260
342
|
|
261
343
|
[apidocs]: https://www.twilio.com/docs/api
|
262
344
|
[twiml]: https://www.twilio.com/docs/api/twiml
|
263
|
-
[libdocs]: https://www.twilio.com/docs/libraries/ruby
|
345
|
+
[libdocs]: https://www.twilio.com/docs/libraries/reference/twilio-ruby/
|
264
346
|
[refdocs]: https://twilio.github.io/twilio-ruby
|
265
347
|
[capability]: https://github.com/twilio/twilio-ruby/wiki/JWT-Tokens
|
266
348
|
[wiki]: https://github.com/twilio/twilio-ruby/wiki
|
data/UPGRADE.md
CHANGED
@@ -3,10 +3,13 @@
|
|
3
3
|
_After `5.0.0` all `MINOR` and `MAJOR` version bumps will have upgrade notes
|
4
4
|
posted here._
|
5
5
|
|
6
|
-
[2023-03
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
[2023-05-03] 5.x.x to 6.x.x
|
7
|
+
-----------------------------
|
8
|
+
### Overview
|
9
|
+
|
10
|
+
##### Twilio Ruby Helper Library’s major version 6.0.0 is now available. We ensured that you can upgrade to Ruby helper Library 6.0.0 version without any breaking changes
|
11
|
+
|
12
|
+
Behind the scenes Ruby Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages.
|
10
13
|
|
11
14
|
To learn more about the Ruby Helper Library, check out [our docs](https://www.twilio.com/docs/libraries/ruby).
|
12
15
|
|