twilio-ruby 7.0.2 → 7.1.1
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.
- checksums.yaml +4 -4
- data/CHANGES.md +58 -0
- data/Gemfile +1 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -3
- data/lib/twilio-ruby/rest/client.rb +3 -3
- data/lib/twilio-ruby/rest/content/v2/content.rb +316 -0
- data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +309 -0
- data/lib/twilio-ruby/rest/content/v2.rb +46 -0
- data/lib/twilio-ruby/rest/content_base.rb +6 -1
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
- data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
- data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
- data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
- data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
- data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
- data/lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb +308 -0
- data/lib/twilio-ruby/rest/marketplace/v1/available_add_on.rb +335 -0
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_extension.rb +350 -0
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +169 -0
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb +461 -0
- data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +282 -0
- data/lib/twilio-ruby/rest/marketplace/v1.rb +79 -0
- data/lib/twilio-ruby/rest/marketplace.rb +6 -0
- data/lib/twilio-ruby/rest/{preview_messaging_base.rb → marketplace_base.rb} +6 -6
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
- data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +15 -3
- data/lib/twilio-ruby/rest/messaging/v1.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +86 -1
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +126 -2
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
- data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +176 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +35 -32
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +24 -9
- data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
- data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
- data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
- data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
- data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3df3c763e91edb94440e0a32dec6bc3200b06945
|
4
|
+
data.tar.gz: 8c5c80ed0520f2fdbc2dc73fbf5958f4f71eb261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87dee824b6e9c61c9469e8f6ab18cab181c6a734943041dc94fcf03991fe165f77d71eae5c6080240420644564dcc4ed807dc37d4a944a33cd5677f3f6655964
|
7
|
+
data.tar.gz: 66d6eca434fc78e086c70bb5861d71344858f9a9307cf35cccde69baa3af65591c80f50d54dd7948e830facf10172773d27d4aa39a246362c4337b3733bdad4e
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,64 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2024-06-06] Version 7.1.1
|
5
|
+
--------------------------
|
6
|
+
**Library - Chore**
|
7
|
+
- [PR #721](https://github.com/twilio/twilio-ruby/pull/721): adding rexml to Gemfile. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
|
8
|
+
|
9
|
+
**Api**
|
10
|
+
- Mark MaxPrice as obsolete
|
11
|
+
|
12
|
+
**Lookups**
|
13
|
+
- Update examples for `phone_number_quality_score`
|
14
|
+
|
15
|
+
**Messaging**
|
16
|
+
- List tollfree verifications on parent account and all sub-accounts
|
17
|
+
|
18
|
+
|
19
|
+
[2024-05-24] Version 7.1.0
|
20
|
+
--------------------------
|
21
|
+
**Library - Chore**
|
22
|
+
- [PR #720](https://github.com/twilio/twilio-ruby/pull/720): removing preview_messaging reference. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
|
23
|
+
|
24
|
+
**Api**
|
25
|
+
- Add ie1 as supported region for UserDefinedMessage and UserDefinedMessageSubscription.
|
26
|
+
|
27
|
+
**Flex**
|
28
|
+
- Adding validated field to `plugin_versions`
|
29
|
+
- Corrected the data type for `runtime_domain`, `call_recording_webhook_url`, `crm_callback_url`, `crm_fallback_url`, `flex_url` in Flex Configuration
|
30
|
+
- Making `routing` optional in Create Interactions endpoint
|
31
|
+
|
32
|
+
**Intelligence**
|
33
|
+
- Expose operator authoring apis to public visibility
|
34
|
+
- Deleted `language_code` parameter from updating service in v2 **(breaking change)**
|
35
|
+
- Add read_only_attached_operator_sids to v2 services
|
36
|
+
|
37
|
+
**Numbers**
|
38
|
+
- Add API endpoint for GET Porting Webhook Configurations By Account SID
|
39
|
+
- Remove bulk portability api under version `/v1`. **(breaking change)**
|
40
|
+
- Removed porting_port_in_fetch.json files and move the content into porting_port_in.json files
|
41
|
+
- Add API endpoint to deleting Webhook Configurations
|
42
|
+
- Add Get Phone Number by Port in request SID and Phone Number SID api
|
43
|
+
- Add Create Porting webhook configuration API
|
44
|
+
- Added bundle_sid and losing_carrier_information fields to Create PortInRequest api to support Japan porting
|
45
|
+
|
46
|
+
**Taskrouter**
|
47
|
+
- Add back `routing_target` property to tasks
|
48
|
+
- Add back `ignore_capacity` property to tasks
|
49
|
+
- Removing `routing_target` property to tasks due to revert
|
50
|
+
- Removing `ignore_capacity` property to tasks due to revert
|
51
|
+
- Add `routing_target` property to tasks
|
52
|
+
- Add `ignore_capacity` property to tasks
|
53
|
+
|
54
|
+
**Trusthub**
|
55
|
+
- Add new field errors to bundle as part of public API response in customer_profile.json and trust_product.json **(breaking change)**
|
56
|
+
- Add themeSetId field in compliance_tollfree_inquiry.
|
57
|
+
|
58
|
+
**Verify**
|
59
|
+
- Update `friendly_name` description on service docs
|
60
|
+
|
61
|
+
|
4
62
|
[2024-04-18] Version 7.0.2
|
5
63
|
--------------------------
|
6
64
|
**Flex**
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -39,13 +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', '~> 7.
|
42
|
+
gem 'twilio-ruby', '~> 7.1.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 7.
|
48
|
+
gem install twilio-ruby -v 7.1.1
|
49
49
|
```
|
50
50
|
|
51
51
|
To build and install the development branch yourself from the latest source:
|
@@ -37,10 +37,10 @@ module Twilio
|
|
37
37
|
# @param [String] to The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`.
|
38
38
|
# @param [String] status_callback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource).
|
39
39
|
# @param [String] application_sid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored.
|
40
|
-
# @param [Float] max_price [
|
40
|
+
# @param [Float] max_price [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03.
|
41
41
|
# @param [Boolean] provide_feedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`.
|
42
42
|
# @param [String] attempt Total number of attempts made (including this request) to send the message regardless of the provider used
|
43
|
-
# @param [String] validity_period The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `
|
43
|
+
# @param [String] validity_period The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)
|
44
44
|
# @param [Boolean] force_delivery Reserved
|
45
45
|
# @param [ContentRetention] content_retention
|
46
46
|
# @param [AddressRetention] address_retention
|
@@ -510,7 +510,7 @@ module Twilio
|
|
510
510
|
end
|
511
511
|
|
512
512
|
##
|
513
|
-
# @return [String] The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource.
|
513
|
+
# @return [String] The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. A unique default value is assigned if a Messaging Service is not used.
|
514
514
|
def messaging_service_sid
|
515
515
|
@properties['messaging_service_sid']
|
516
516
|
end
|
@@ -82,9 +82,9 @@ module Twilio
|
|
82
82
|
@lookups ||= Lookups.new self
|
83
83
|
end
|
84
84
|
##
|
85
|
-
# Access the
|
86
|
-
def
|
87
|
-
@
|
85
|
+
# Access the Marketplace Twilio Domain
|
86
|
+
def marketplace
|
87
|
+
@marketplace ||= Marketplace.new self
|
88
88
|
end
|
89
89
|
##
|
90
90
|
# Access the Messaging Twilio Domain
|
@@ -0,0 +1,316 @@
|
|
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
|
+
|
16
|
+
module Twilio
|
17
|
+
module REST
|
18
|
+
class Content < ContentBase
|
19
|
+
class V2 < Version
|
20
|
+
class ContentList < ListResource
|
21
|
+
|
22
|
+
##
|
23
|
+
# Initialize the ContentList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [ContentList] ContentList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
@uri = "/Content"
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# Lists ContentInstance records from the API as a list.
|
36
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
37
|
+
# memory before returning.
|
38
|
+
# @param [String] sort_by_date Whether to sort by ascending or descending date updated
|
39
|
+
# @param [String] sort_by_content_name Whether to sort by ascending or descending content name
|
40
|
+
# @param [Time] date_created_after Filter by >=[date-time]
|
41
|
+
# @param [Time] date_created_before Filter by <=[date-time]
|
42
|
+
# @param [String] content_name Filter by Regex Pattern in content name
|
43
|
+
# @param [String] content Filter by Regex Pattern in template content
|
44
|
+
# @param [Array[String]] language Filter by array of valid language(s)
|
45
|
+
# @param [Array[String]] content_type Filter by array of contentType(s)
|
46
|
+
# @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
|
47
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
48
|
+
# guarantees to never return more than limit. Default is no limit
|
49
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
50
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
51
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
52
|
+
# efficient page size, i.e. min(limit, 1000)
|
53
|
+
# @return [Array] Array of up to limit results
|
54
|
+
def list(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, limit: nil, page_size: nil)
|
55
|
+
self.stream(
|
56
|
+
sort_by_date: sort_by_date,
|
57
|
+
sort_by_content_name: sort_by_content_name,
|
58
|
+
date_created_after: date_created_after,
|
59
|
+
date_created_before: date_created_before,
|
60
|
+
content_name: content_name,
|
61
|
+
content: content,
|
62
|
+
language: language,
|
63
|
+
content_type: content_type,
|
64
|
+
channel_eligibility: channel_eligibility,
|
65
|
+
limit: limit,
|
66
|
+
page_size: page_size
|
67
|
+
).entries
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# Streams Instance records from the API as an Enumerable.
|
72
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
73
|
+
# is reached.
|
74
|
+
# @param [String] sort_by_date Whether to sort by ascending or descending date updated
|
75
|
+
# @param [String] sort_by_content_name Whether to sort by ascending or descending content name
|
76
|
+
# @param [Time] date_created_after Filter by >=[date-time]
|
77
|
+
# @param [Time] date_created_before Filter by <=[date-time]
|
78
|
+
# @param [String] content_name Filter by Regex Pattern in content name
|
79
|
+
# @param [String] content Filter by Regex Pattern in template content
|
80
|
+
# @param [Array[String]] language Filter by array of valid language(s)
|
81
|
+
# @param [Array[String]] content_type Filter by array of contentType(s)
|
82
|
+
# @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
|
83
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
84
|
+
# guarantees to never return more than limit. Default is no limit
|
85
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
86
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
87
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
88
|
+
# efficient page size, i.e. min(limit, 1000)
|
89
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
90
|
+
def stream(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, limit: nil, page_size: nil)
|
91
|
+
limits = @version.read_limits(limit, page_size)
|
92
|
+
|
93
|
+
page = self.page(
|
94
|
+
sort_by_date: sort_by_date,
|
95
|
+
sort_by_content_name: sort_by_content_name,
|
96
|
+
date_created_after: date_created_after,
|
97
|
+
date_created_before: date_created_before,
|
98
|
+
content_name: content_name,
|
99
|
+
content: content,
|
100
|
+
language: language,
|
101
|
+
content_type: content_type,
|
102
|
+
channel_eligibility: channel_eligibility,
|
103
|
+
page_size: limits[:page_size], )
|
104
|
+
|
105
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# When passed a block, yields ContentInstance records from the API.
|
110
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
111
|
+
# is reached.
|
112
|
+
def each
|
113
|
+
limits = @version.read_limits
|
114
|
+
|
115
|
+
page = self.page(page_size: limits[:page_size], )
|
116
|
+
|
117
|
+
@version.stream(page,
|
118
|
+
limit: limits[:limit],
|
119
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Retrieve a single page of ContentInstance records from the API.
|
124
|
+
# Request is executed immediately.
|
125
|
+
# @param [String] sort_by_date Whether to sort by ascending or descending date updated
|
126
|
+
# @param [String] sort_by_content_name Whether to sort by ascending or descending content name
|
127
|
+
# @param [Time] date_created_after Filter by >=[date-time]
|
128
|
+
# @param [Time] date_created_before Filter by <=[date-time]
|
129
|
+
# @param [String] content_name Filter by Regex Pattern in content name
|
130
|
+
# @param [String] content Filter by Regex Pattern in template content
|
131
|
+
# @param [Array[String]] language Filter by array of valid language(s)
|
132
|
+
# @param [Array[String]] content_type Filter by array of contentType(s)
|
133
|
+
# @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
|
134
|
+
# @param [String] page_token PageToken provided by the API
|
135
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
136
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
137
|
+
# @return [Page] Page of ContentInstance
|
138
|
+
def page(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
139
|
+
params = Twilio::Values.of({
|
140
|
+
'SortByDate' => sort_by_date,
|
141
|
+
'SortByContentName' => sort_by_content_name,
|
142
|
+
'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after),
|
143
|
+
'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before),
|
144
|
+
'ContentName' => content_name,
|
145
|
+
'Content' => content,
|
146
|
+
|
147
|
+
'Language' => Twilio.serialize_list(language) { |e| e },
|
148
|
+
|
149
|
+
'ContentType' => Twilio.serialize_list(content_type) { |e| e },
|
150
|
+
|
151
|
+
'ChannelEligibility' => Twilio.serialize_list(channel_eligibility) { |e| e },
|
152
|
+
'PageToken' => page_token,
|
153
|
+
'Page' => page_number,
|
154
|
+
'PageSize' => page_size,
|
155
|
+
})
|
156
|
+
|
157
|
+
response = @version.page('GET', @uri, params: params)
|
158
|
+
|
159
|
+
ContentPage.new(@version, response, @solution)
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# Retrieve a single page of ContentInstance records from the API.
|
164
|
+
# Request is executed immediately.
|
165
|
+
# @param [String] target_url API-generated URL for the requested results page
|
166
|
+
# @return [Page] Page of ContentInstance
|
167
|
+
def get_page(target_url)
|
168
|
+
response = @version.domain.request(
|
169
|
+
'GET',
|
170
|
+
target_url
|
171
|
+
)
|
172
|
+
ContentPage.new(@version, response, @solution)
|
173
|
+
end
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
# Provide a user friendly representation
|
178
|
+
def to_s
|
179
|
+
'#<Twilio.Content.V2.ContentList>'
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
class ContentPage < Page
|
184
|
+
##
|
185
|
+
# Initialize the ContentPage
|
186
|
+
# @param [Version] version Version that contains the resource
|
187
|
+
# @param [Response] response Response from the API
|
188
|
+
# @param [Hash] solution Path solution for the resource
|
189
|
+
# @return [ContentPage] ContentPage
|
190
|
+
def initialize(version, response, solution)
|
191
|
+
super(version, response)
|
192
|
+
|
193
|
+
# Path Solution
|
194
|
+
@solution = solution
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# Build an instance of ContentInstance
|
199
|
+
# @param [Hash] payload Payload response from the API
|
200
|
+
# @return [ContentInstance] ContentInstance
|
201
|
+
def get_instance(payload)
|
202
|
+
ContentInstance.new(@version, payload)
|
203
|
+
end
|
204
|
+
|
205
|
+
##
|
206
|
+
# Provide a user friendly representation
|
207
|
+
def to_s
|
208
|
+
'<Twilio.Content.V2.ContentPage>'
|
209
|
+
end
|
210
|
+
end
|
211
|
+
class ContentInstance < InstanceResource
|
212
|
+
##
|
213
|
+
# Initialize the ContentInstance
|
214
|
+
# @param [Version] version Version that contains the resource
|
215
|
+
# @param [Hash] payload payload that contains response from Twilio
|
216
|
+
# @param [String] account_sid The SID of the
|
217
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Content
|
218
|
+
# resource.
|
219
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
220
|
+
# @return [ContentInstance] ContentInstance
|
221
|
+
def initialize(version, payload )
|
222
|
+
super(version)
|
223
|
+
|
224
|
+
# Marshaled Properties
|
225
|
+
@properties = {
|
226
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
227
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
228
|
+
'sid' => payload['sid'],
|
229
|
+
'account_sid' => payload['account_sid'],
|
230
|
+
'friendly_name' => payload['friendly_name'],
|
231
|
+
'language' => payload['language'],
|
232
|
+
'variables' => payload['variables'],
|
233
|
+
'types' => payload['types'],
|
234
|
+
'url' => payload['url'],
|
235
|
+
'links' => payload['links'],
|
236
|
+
}
|
237
|
+
end
|
238
|
+
|
239
|
+
|
240
|
+
##
|
241
|
+
# @return [Time] The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
242
|
+
def date_created
|
243
|
+
@properties['date_created']
|
244
|
+
end
|
245
|
+
|
246
|
+
##
|
247
|
+
# @return [Time] The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
248
|
+
def date_updated
|
249
|
+
@properties['date_updated']
|
250
|
+
end
|
251
|
+
|
252
|
+
##
|
253
|
+
# @return [String] The unique string that that we created to identify the Content resource.
|
254
|
+
def sid
|
255
|
+
@properties['sid']
|
256
|
+
end
|
257
|
+
|
258
|
+
##
|
259
|
+
# @return [String] The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource.
|
260
|
+
def account_sid
|
261
|
+
@properties['account_sid']
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# @return [String] A string name used to describe the Content resource. Not visible to the end recipient.
|
266
|
+
def friendly_name
|
267
|
+
@properties['friendly_name']
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# @return [String] Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
|
272
|
+
def language
|
273
|
+
@properties['language']
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# @return [Hash] Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
|
278
|
+
def variables
|
279
|
+
@properties['variables']
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# @return [Hash] The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
|
284
|
+
def types
|
285
|
+
@properties['types']
|
286
|
+
end
|
287
|
+
|
288
|
+
##
|
289
|
+
# @return [String] The URL of the resource, relative to `https://content.twilio.com`.
|
290
|
+
def url
|
291
|
+
@properties['url']
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# @return [Hash] A list of links related to the Content resource, such as approval_fetch and approval_create
|
296
|
+
def links
|
297
|
+
@properties['links']
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# Provide a user friendly representation
|
302
|
+
def to_s
|
303
|
+
"<Twilio.Content.V2.ContentInstance>"
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Provide a detailed, user friendly representation
|
308
|
+
def inspect
|
309
|
+
"<Twilio.Content.V2.ContentInstance>"
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|