twilio-ruby 5.72.1 → 5.73.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pr-lint.yml +8 -2
- data/.github/workflows/test-and-deploy.yml +3 -3
- data/CHANGES.md +89 -0
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +160 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +251 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +59 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +22 -16
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -1
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
- data/lib/twilio-ruby/rest/client.rb +14 -0
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
- data/lib/twilio-ruby/rest/content/v1/content.rb +346 -0
- data/lib/twilio-ruby/rest/content/v1.rb +45 -0
- data/lib/twilio-ruby/rest/content.rb +47 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +156 -0
- data/lib/twilio-ruby/rest/flex_api/v1/good_data.rb +190 -0
- data/lib/twilio-ruby/rest/flex_api/v1/user_roles.rb +166 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +21 -0
- data/lib/twilio-ruby/rest/flex_api.rb +18 -0
- data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +81 -6
- data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
- data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -2
- data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +267 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +71 -1
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1.rb +34 -0
- data/lib/twilio-ruby/rest/messaging.rb +18 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device.rb +7 -0
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
- data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
- data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
- data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
- data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
- data/lib/twilio-ruby/rest/oauth/v1.rb +56 -0
- data/lib/twilio-ruby/rest/oauth.rb +62 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
- data/lib/twilio-ruby/rest/preview.rb +0 -33
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -14
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -46
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +240 -0
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
- data/lib/twilio-ruby/rest/supersim.rb +6 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +18 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +9 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +2 -2
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/template.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
- data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
- data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
- data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
- data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
- data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
- data/lib/twilio-ruby/twiml/voice_response.rb +10 -6
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +20 -8
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
- data/lib/twilio-ruby/rest/preview/trusted_comms/brands_information.rb +0 -195
- data/lib/twilio-ruby/rest/preview/trusted_comms/cps.rb +0 -186
- data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -0,0 +1,346 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Content < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
+
class ContentList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the ContentList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [ContentList] ContentList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/Content"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists ContentInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
33
|
+
# guarantees to never return more than limit. Default is no limit
|
34
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
35
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
36
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
37
|
+
# efficient page size, i.e. min(limit, 1000)
|
38
|
+
# @return [Array] Array of up to limit results
|
39
|
+
def list(limit: nil, page_size: nil)
|
40
|
+
self.stream(limit: limit, page_size: page_size).entries
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Streams ContentInstance records from the API as an Enumerable.
|
45
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
46
|
+
# is reached.
|
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 [Enumerable] Enumerable that will yield up to limit results
|
54
|
+
def stream(limit: nil, page_size: nil)
|
55
|
+
limits = @version.read_limits(limit, page_size)
|
56
|
+
|
57
|
+
page = self.page(page_size: limits[:page_size], )
|
58
|
+
|
59
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# When passed a block, yields ContentInstance records from the API.
|
64
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
+
# is reached.
|
66
|
+
def each
|
67
|
+
limits = @version.read_limits
|
68
|
+
|
69
|
+
page = self.page(page_size: limits[:page_size], )
|
70
|
+
|
71
|
+
@version.stream(page,
|
72
|
+
limit: limits[:limit],
|
73
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Retrieve a single page of ContentInstance records from the API.
|
78
|
+
# Request is executed immediately.
|
79
|
+
# @param [String] page_token PageToken provided by the API
|
80
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
81
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
82
|
+
# @return [Page] Page of ContentInstance
|
83
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
84
|
+
params = Twilio::Values.of({
|
85
|
+
'PageToken' => page_token,
|
86
|
+
'Page' => page_number,
|
87
|
+
'PageSize' => page_size,
|
88
|
+
})
|
89
|
+
|
90
|
+
response = @version.page('GET', @uri, params: params)
|
91
|
+
|
92
|
+
ContentPage.new(@version, response, @solution)
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Retrieve a single page of ContentInstance records from the API.
|
97
|
+
# Request is executed immediately.
|
98
|
+
# @param [String] target_url API-generated URL for the requested results page
|
99
|
+
# @return [Page] Page of ContentInstance
|
100
|
+
def get_page(target_url)
|
101
|
+
response = @version.domain.request(
|
102
|
+
'GET',
|
103
|
+
target_url
|
104
|
+
)
|
105
|
+
ContentPage.new(@version, response, @solution)
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Provide a user friendly representation
|
110
|
+
def to_s
|
111
|
+
'#<Twilio.Content.V1.ContentList>'
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
117
|
+
class ContentPage < Page
|
118
|
+
##
|
119
|
+
# Initialize the ContentPage
|
120
|
+
# @param [Version] version Version that contains the resource
|
121
|
+
# @param [Response] response Response from the API
|
122
|
+
# @param [Hash] solution Path solution for the resource
|
123
|
+
# @return [ContentPage] ContentPage
|
124
|
+
def initialize(version, response, solution)
|
125
|
+
super(version, response)
|
126
|
+
|
127
|
+
# Path Solution
|
128
|
+
@solution = solution
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Build an instance of ContentInstance
|
133
|
+
# @param [Hash] payload Payload response from the API
|
134
|
+
# @return [ContentInstance] ContentInstance
|
135
|
+
def get_instance(payload)
|
136
|
+
ContentInstance.new(@version, payload, )
|
137
|
+
end
|
138
|
+
|
139
|
+
##
|
140
|
+
# Provide a user friendly representation
|
141
|
+
def to_s
|
142
|
+
'<Twilio.Content.V1.ContentPage>'
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
148
|
+
class ContentContext < InstanceContext
|
149
|
+
##
|
150
|
+
# Initialize the ContentContext
|
151
|
+
# @param [Version] version Version that contains the resource
|
152
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
153
|
+
# Content resource to fetch.
|
154
|
+
# @return [ContentContext] ContentContext
|
155
|
+
def initialize(version, sid)
|
156
|
+
super(version)
|
157
|
+
|
158
|
+
# Path Solution
|
159
|
+
@solution = {sid: sid, }
|
160
|
+
@uri = "/Content/#{@solution[:sid]}"
|
161
|
+
|
162
|
+
# Dependents
|
163
|
+
@approval_fetch = nil
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# Fetch the ContentInstance
|
168
|
+
# @return [ContentInstance] Fetched ContentInstance
|
169
|
+
def fetch
|
170
|
+
payload = @version.fetch('GET', @uri)
|
171
|
+
|
172
|
+
ContentInstance.new(@version, payload, sid: @solution[:sid], )
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# Delete the ContentInstance
|
177
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
178
|
+
def delete
|
179
|
+
@version.delete('DELETE', @uri)
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# Access the approval_fetch
|
184
|
+
# @return [ApprovalFetchList]
|
185
|
+
# @return [ApprovalFetchContext]
|
186
|
+
def approval_fetch
|
187
|
+
ApprovalFetchContext.new(@version, @solution[:sid], )
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# Provide a user friendly representation
|
192
|
+
def to_s
|
193
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
194
|
+
"#<Twilio.Content.V1.ContentContext #{context}>"
|
195
|
+
end
|
196
|
+
|
197
|
+
##
|
198
|
+
# Provide a detailed, user friendly representation
|
199
|
+
def inspect
|
200
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
201
|
+
"#<Twilio.Content.V1.ContentContext #{context}>"
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
##
|
206
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
207
|
+
class ContentInstance < InstanceResource
|
208
|
+
##
|
209
|
+
# Initialize the ContentInstance
|
210
|
+
# @param [Version] version Version that contains the resource
|
211
|
+
# @param [Hash] payload payload that contains response from Twilio
|
212
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
213
|
+
# Content resource to fetch.
|
214
|
+
# @return [ContentInstance] ContentInstance
|
215
|
+
def initialize(version, payload, sid: nil)
|
216
|
+
super(version)
|
217
|
+
|
218
|
+
# Marshaled Properties
|
219
|
+
@properties = {
|
220
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
221
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
222
|
+
'sid' => payload['sid'],
|
223
|
+
'account_sid' => payload['account_sid'],
|
224
|
+
'friendly_name' => payload['friendly_name'],
|
225
|
+
'language' => payload['language'],
|
226
|
+
'variables' => payload['variables'],
|
227
|
+
'types' => payload['types'],
|
228
|
+
'url' => payload['url'],
|
229
|
+
'links' => payload['links'],
|
230
|
+
}
|
231
|
+
|
232
|
+
# Context
|
233
|
+
@instance_context = nil
|
234
|
+
@params = {'sid' => sid || @properties['sid'], }
|
235
|
+
end
|
236
|
+
|
237
|
+
##
|
238
|
+
# Generate an instance context for the instance, the context is capable of
|
239
|
+
# performing various actions. All instance actions are proxied to the context
|
240
|
+
# @return [ContentContext] ContentContext for this ContentInstance
|
241
|
+
def context
|
242
|
+
unless @instance_context
|
243
|
+
@instance_context = ContentContext.new(@version, @params['sid'], )
|
244
|
+
end
|
245
|
+
@instance_context
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
|
250
|
+
def date_created
|
251
|
+
@properties['date_created']
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
|
256
|
+
def date_updated
|
257
|
+
@properties['date_updated']
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# @return [String] The unique string that identifies the resource
|
262
|
+
def sid
|
263
|
+
@properties['sid']
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# @return [String] The SID of the Account that created the resource
|
268
|
+
def account_sid
|
269
|
+
@properties['account_sid']
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [String] A string name used to describe the Content resource
|
274
|
+
def friendly_name
|
275
|
+
@properties['friendly_name']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# @return [String] Two-letter language code identifying the language the Content resource is in.
|
280
|
+
def language
|
281
|
+
@properties['language']
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# @return [Hash] Defines the default placeholder values for variables included in the Content resource
|
286
|
+
def variables
|
287
|
+
@properties['variables']
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [Hash] The Content types (e.g. twilio/text) for this Content resource
|
292
|
+
def types
|
293
|
+
@properties['types']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [String] The URL of the resource, relative to `https://content.twilio.com`
|
298
|
+
def url
|
299
|
+
@properties['url']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# @return [String] A list of links related to the Content resource
|
304
|
+
def links
|
305
|
+
@properties['links']
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# Fetch the ContentInstance
|
310
|
+
# @return [ContentInstance] Fetched ContentInstance
|
311
|
+
def fetch
|
312
|
+
context.fetch
|
313
|
+
end
|
314
|
+
|
315
|
+
##
|
316
|
+
# Delete the ContentInstance
|
317
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
318
|
+
def delete
|
319
|
+
context.delete
|
320
|
+
end
|
321
|
+
|
322
|
+
##
|
323
|
+
# Access the approval_fetch
|
324
|
+
# @return [approval_fetch] approval_fetch
|
325
|
+
def approval_fetch
|
326
|
+
context.approval_fetch
|
327
|
+
end
|
328
|
+
|
329
|
+
##
|
330
|
+
# Provide a user friendly representation
|
331
|
+
def to_s
|
332
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
333
|
+
"<Twilio.Content.V1.ContentInstance #{values}>"
|
334
|
+
end
|
335
|
+
|
336
|
+
##
|
337
|
+
# Provide a detailed, user friendly representation
|
338
|
+
def inspect
|
339
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
340
|
+
"<Twilio.Content.V1.ContentInstance #{values}>"
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Content
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# Initialize the V1 version of Content
|
15
|
+
def initialize(domain)
|
16
|
+
super
|
17
|
+
@version = 'v1'
|
18
|
+
@contents = nil
|
19
|
+
end
|
20
|
+
|
21
|
+
##
|
22
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
23
|
+
# Content resource to fetch.
|
24
|
+
# @return [Twilio::REST::Content::V1::ContentContext] if sid was passed.
|
25
|
+
# @return [Twilio::REST::Content::V1::ContentList]
|
26
|
+
def contents(sid=:unset)
|
27
|
+
if sid.nil?
|
28
|
+
raise ArgumentError, 'sid cannot be nil'
|
29
|
+
end
|
30
|
+
if sid == :unset
|
31
|
+
@contents ||= ContentList.new self
|
32
|
+
else
|
33
|
+
ContentContext.new(self, sid)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Provide a user friendly representation
|
39
|
+
def to_s
|
40
|
+
'<Twilio::REST::Content::V1>'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Content < Domain
|
12
|
+
##
|
13
|
+
# Initialize the Content Domain
|
14
|
+
def initialize(twilio)
|
15
|
+
super
|
16
|
+
|
17
|
+
@base_url = 'https://content.twilio.com'
|
18
|
+
@host = 'content.twilio.com'
|
19
|
+
@port = 443
|
20
|
+
|
21
|
+
# Versions
|
22
|
+
@v1 = nil
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Version v1 of content
|
27
|
+
def v1
|
28
|
+
@v1 ||= V1.new self
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# @param [String] sid The unique string that that we created to identify the
|
33
|
+
# Content resource.
|
34
|
+
# @return [Twilio::REST::Content::V1::ContentInstance] if sid was passed.
|
35
|
+
# @return [Twilio::REST::Content::V1::ContentList]
|
36
|
+
def contents(sid=:unset)
|
37
|
+
self.v1.contents(sid)
|
38
|
+
end
|
39
|
+
|
40
|
+
##
|
41
|
+
# Provide a user friendly representation
|
42
|
+
def to_s
|
43
|
+
'#<Twilio::REST::Content>'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -229,7 +229,7 @@ module Twilio
|
|
229
229
|
'channel_message_sid' => payload['channel_message_sid'],
|
230
230
|
'participant_sid' => payload['participant_sid'],
|
231
231
|
'status' => payload['status'],
|
232
|
-
'error_code' => payload['error_code'].to_i,
|
232
|
+
'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
|
233
233
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
234
234
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
235
235
|
'url' => payload['url'],
|
@@ -319,7 +319,7 @@ module Twilio
|
|
319
319
|
'account_sid' => payload['account_sid'],
|
320
320
|
'conversation_sid' => payload['conversation_sid'],
|
321
321
|
'sid' => payload['sid'],
|
322
|
-
'index' => payload['index'].to_i,
|
322
|
+
'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
|
323
323
|
'author' => payload['author'],
|
324
324
|
'body' => payload['body'],
|
325
325
|
'media' => payload['media'],
|
@@ -251,7 +251,7 @@ module Twilio
|
|
251
251
|
'channel_message_sid' => payload['channel_message_sid'],
|
252
252
|
'participant_sid' => payload['participant_sid'],
|
253
253
|
'status' => payload['status'],
|
254
|
-
'error_code' => payload['error_code'].to_i,
|
254
|
+
'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
|
255
255
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
256
256
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
257
257
|
'url' => payload['url'],
|
@@ -349,7 +349,7 @@ module Twilio
|
|
349
349
|
'chat_service_sid' => payload['chat_service_sid'],
|
350
350
|
'conversation_sid' => payload['conversation_sid'],
|
351
351
|
'sid' => payload['sid'],
|
352
|
-
'index' => payload['index'].to_i,
|
352
|
+
'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i,
|
353
353
|
'author' => payload['author'],
|
354
354
|
'body' => payload['body'],
|
355
355
|
'media' => payload['media'],
|
@@ -210,7 +210,7 @@ module Twilio
|
|
210
210
|
# Marshaled Properties
|
211
211
|
@properties = {
|
212
212
|
'id' => payload['id'],
|
213
|
-
'schema_version' => payload['schema_version'].to_i,
|
213
|
+
'schema_version' => payload['schema_version'] == nil ? payload['schema_version'] : payload['schema_version'].to_i,
|
214
214
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
215
215
|
'url' => payload['url'],
|
216
216
|
'raw' => payload['raw'],
|
@@ -143,7 +143,7 @@ module Twilio
|
|
143
143
|
'url' => payload['url'],
|
144
144
|
'links' => payload['links'],
|
145
145
|
'latest_version_date_created' => Twilio.deserialize_iso8601_datetime(payload['latest_version_date_created']),
|
146
|
-
'latest_version' => payload['latest_version'].to_i,
|
146
|
+
'latest_version' => payload['latest_version'] == nil ? payload['latest_version'] : payload['latest_version'].to_i,
|
147
147
|
}
|
148
148
|
|
149
149
|
# Context
|
@@ -247,7 +247,7 @@ module Twilio
|
|
247
247
|
@properties = {
|
248
248
|
'account_sid' => payload['account_sid'],
|
249
249
|
'type' => payload['type'],
|
250
|
-
'schema_version' => payload['schema_version'].to_i,
|
250
|
+
'schema_version' => payload['schema_version'] == nil ? payload['schema_version'] : payload['schema_version'].to_i,
|
251
251
|
'subscription_sid' => payload['subscription_sid'],
|
252
252
|
'url' => payload['url'],
|
253
253
|
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class FlexApi < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class AssessmentsList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the AssessmentsList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [AssessmentsList] AssessmentsList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Provide a user friendly representation
|
27
|
+
def to_s
|
28
|
+
'#<Twilio.FlexApi.V1.AssessmentsList>'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class AssessmentsPage < Page
|
33
|
+
##
|
34
|
+
# Initialize the AssessmentsPage
|
35
|
+
# @param [Version] version Version that contains the resource
|
36
|
+
# @param [Response] response Response from the API
|
37
|
+
# @param [Hash] solution Path solution for the resource
|
38
|
+
# @return [AssessmentsPage] AssessmentsPage
|
39
|
+
def initialize(version, response, solution)
|
40
|
+
super(version, response)
|
41
|
+
|
42
|
+
# Path Solution
|
43
|
+
@solution = solution
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Build an instance of AssessmentsInstance
|
48
|
+
# @param [Hash] payload Payload response from the API
|
49
|
+
# @return [AssessmentsInstance] AssessmentsInstance
|
50
|
+
def get_instance(payload)
|
51
|
+
AssessmentsInstance.new(@version, payload, )
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Provide a user friendly representation
|
56
|
+
def to_s
|
57
|
+
'<Twilio.FlexApi.V1.AssessmentsPage>'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class AssessmentsContext < InstanceContext
|
62
|
+
##
|
63
|
+
# Initialize the AssessmentsContext
|
64
|
+
# @param [Version] version Version that contains the resource
|
65
|
+
# @return [AssessmentsContext] AssessmentsContext
|
66
|
+
def initialize(version)
|
67
|
+
super(version)
|
68
|
+
|
69
|
+
# Path Solution
|
70
|
+
@solution = {}
|
71
|
+
@uri = "/Accounts/Assessments"
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Create the AssessmentsInstance
|
76
|
+
# @return [AssessmentsInstance] Created AssessmentsInstance
|
77
|
+
def create
|
78
|
+
payload = @version.create('POST', @uri)
|
79
|
+
|
80
|
+
AssessmentsInstance.new(@version, payload, )
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Provide a user friendly representation
|
85
|
+
def to_s
|
86
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
87
|
+
"#<Twilio.FlexApi.V1.AssessmentsContext #{context}>"
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Provide a detailed, user friendly representation
|
92
|
+
def inspect
|
93
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
94
|
+
"#<Twilio.FlexApi.V1.AssessmentsContext #{context}>"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
class AssessmentsInstance < InstanceResource
|
99
|
+
##
|
100
|
+
# Initialize the AssessmentsInstance
|
101
|
+
# @param [Version] version Version that contains the resource
|
102
|
+
# @param [Hash] payload payload that contains response from Twilio
|
103
|
+
# @return [AssessmentsInstance] AssessmentsInstance
|
104
|
+
def initialize(version, payload)
|
105
|
+
super(version)
|
106
|
+
|
107
|
+
# Marshaled Properties
|
108
|
+
@properties = {'url' => payload['url'], }
|
109
|
+
|
110
|
+
# Context
|
111
|
+
@instance_context = nil
|
112
|
+
@params = {}
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# Generate an instance context for the instance, the context is capable of
|
117
|
+
# performing various actions. All instance actions are proxied to the context
|
118
|
+
# @return [AssessmentsContext] AssessmentsContext for this AssessmentsInstance
|
119
|
+
def context
|
120
|
+
unless @instance_context
|
121
|
+
@instance_context = AssessmentsContext.new(@version, )
|
122
|
+
end
|
123
|
+
@instance_context
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# @return [String] The URL of this resource.
|
128
|
+
def url
|
129
|
+
@properties['url']
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Create the AssessmentsInstance
|
134
|
+
# @return [AssessmentsInstance] Created AssessmentsInstance
|
135
|
+
def create
|
136
|
+
context.create
|
137
|
+
end
|
138
|
+
|
139
|
+
##
|
140
|
+
# Provide a user friendly representation
|
141
|
+
def to_s
|
142
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
143
|
+
"<Twilio.FlexApi.V1.AssessmentsInstance #{values}>"
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# Provide a detailed, user friendly representation
|
148
|
+
def inspect
|
149
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
150
|
+
"<Twilio.FlexApi.V1.AssessmentsInstance #{values}>"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|