twilio-ruby 7.4.5 → 7.5.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/.dockerignore +1 -1
- data/CHANGES.md +33 -0
- data/Dockerfile +2 -1
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +9 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -0
- data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +0 -39
- data/lib/twilio-ruby/rest/iam/v1/{key.rb → new_api_key.rb} +20 -20
- data/lib/twilio-ruby/rest/iam/v1/token.rb +186 -0
- data/lib/twilio-ruby/rest/iam/v1.rb +10 -4
- data/lib/twilio-ruby/rest/preview_base.rb +0 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +2 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +2 -2
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +4 -13
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -407
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -472
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -467
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -407
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -444
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -470
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -407
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -444
- data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -529
- data/lib/twilio-ruby/rest/preview/sync.rb +0 -49
@@ -22,7 +22,6 @@ module Twilio
|
|
22
22
|
@host = "preview.twilio.com"
|
23
23
|
@port = 443
|
24
24
|
@hosted_numbers = nil
|
25
|
-
@sync = nil
|
26
25
|
@marketplace = nil
|
27
26
|
@wireless = nil
|
28
27
|
end
|
@@ -31,10 +30,6 @@ module Twilio
|
|
31
30
|
@hosted_numbers ||= Preview::HostedNumbers.new self
|
32
31
|
end
|
33
32
|
|
34
|
-
def sync
|
35
|
-
@sync ||= Preview::Sync.new self
|
36
|
-
end
|
37
|
-
|
38
33
|
def marketplace
|
39
34
|
@marketplace ||= Preview::Marketplace.new self
|
40
35
|
end
|
@@ -226,7 +226,7 @@ module Twilio
|
|
226
226
|
# @param [String] recording_status_callback_method The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
227
227
|
# @param [String] conference_recording_status_callback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
|
228
228
|
# @param [String] conference_recording_status_callback_method The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
229
|
-
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
229
|
+
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
230
230
|
# @param [String] sip_auth_username The SIP username used for authentication.
|
231
231
|
# @param [String] sip_auth_password The SIP password for authentication.
|
232
232
|
# @param [Array[String]] dequeue_status_callback_event The Call progress events sent via webhooks as a result of a Dequeue instruction.
|
@@ -577,7 +577,7 @@ module Twilio
|
|
577
577
|
# @param [String] recording_status_callback_method The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
578
578
|
# @param [String] conference_recording_status_callback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
|
579
579
|
# @param [String] conference_recording_status_callback_method The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
580
|
-
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
580
|
+
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
581
581
|
# @param [String] sip_auth_username The SIP username used for authentication.
|
582
582
|
# @param [String] sip_auth_password The SIP password for authentication.
|
583
583
|
# @param [Array[String]] dequeue_status_callback_event The Call progress events sent via webhooks as a result of a Dequeue instruction.
|
@@ -220,7 +220,7 @@ module Twilio
|
|
220
220
|
# @param [String] recording_status_callback_method The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
221
221
|
# @param [String] conference_recording_status_callback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
|
222
222
|
# @param [String] conference_recording_status_callback_method The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
223
|
-
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
223
|
+
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
224
224
|
# @param [String] sip_auth_username The SIP username used for authentication.
|
225
225
|
# @param [String] sip_auth_password The SIP password for authentication.
|
226
226
|
# @param [Array[String]] dequeue_status_callback_event The call progress events sent via webhooks as a result of a Dequeue instruction.
|
@@ -565,7 +565,7 @@ module Twilio
|
|
565
565
|
# @param [String] recording_status_callback_method The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
566
566
|
# @param [String] conference_recording_status_callback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
|
567
567
|
# @param [String] conference_recording_status_callback_method The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
568
|
-
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
568
|
+
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
569
569
|
# @param [String] sip_auth_username The SIP username used for authentication.
|
570
570
|
# @param [String] sip_auth_password The SIP password for authentication.
|
571
571
|
# @param [Array[String]] dequeue_status_callback_event The call progress events sent via webhooks as a result of a Dequeue instruction.
|
@@ -43,6 +43,7 @@ module Twilio
|
|
43
43
|
# @param [Array[String]] international_roaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`.
|
44
44
|
# @param [String] national_roaming_data_limit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info.
|
45
45
|
# @param [String] international_roaming_data_limit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB.
|
46
|
+
# @param [DataLimitStrategy] data_limit_strategy
|
46
47
|
# @return [RatePlanInstance] Created RatePlanInstance
|
47
48
|
def create(
|
48
49
|
unique_name: :unset,
|
@@ -55,7 +56,8 @@ module Twilio
|
|
55
56
|
national_roaming_enabled: :unset,
|
56
57
|
international_roaming: :unset,
|
57
58
|
national_roaming_data_limit: :unset,
|
58
|
-
international_roaming_data_limit: :unset
|
59
|
+
international_roaming_data_limit: :unset,
|
60
|
+
data_limit_strategy: :unset
|
59
61
|
)
|
60
62
|
|
61
63
|
data = Twilio::Values.of({
|
@@ -70,6 +72,7 @@ module Twilio
|
|
70
72
|
'InternationalRoaming' => Twilio.serialize_list(international_roaming) { |e| e },
|
71
73
|
'NationalRoamingDataLimit' => national_roaming_data_limit,
|
72
74
|
'InternationalRoamingDataLimit' => international_roaming_data_limit,
|
75
|
+
'DataLimitStrategy' => data_limit_strategy,
|
73
76
|
})
|
74
77
|
|
75
78
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
data/lib/twilio-ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -525,7 +525,8 @@ files:
|
|
525
525
|
- lib/twilio-ruby/rest/iam/v1.rb
|
526
526
|
- lib/twilio-ruby/rest/iam/v1/api_key.rb
|
527
527
|
- lib/twilio-ruby/rest/iam/v1/get_api_keys.rb
|
528
|
-
- lib/twilio-ruby/rest/iam/v1/
|
528
|
+
- lib/twilio-ruby/rest/iam/v1/new_api_key.rb
|
529
|
+
- lib/twilio-ruby/rest/iam/v1/token.rb
|
529
530
|
- lib/twilio-ruby/rest/iam_base.rb
|
530
531
|
- lib/twilio-ruby/rest/insights.rb
|
531
532
|
- lib/twilio-ruby/rest/insights/v1.rb
|
@@ -687,16 +688,6 @@ files:
|
|
687
688
|
- lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb
|
688
689
|
- lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb
|
689
690
|
- lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
|
690
|
-
- lib/twilio-ruby/rest/preview/sync.rb
|
691
|
-
- lib/twilio-ruby/rest/preview/sync/service.rb
|
692
|
-
- lib/twilio-ruby/rest/preview/sync/service/document.rb
|
693
|
-
- lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb
|
694
|
-
- lib/twilio-ruby/rest/preview/sync/service/sync_list.rb
|
695
|
-
- lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
|
696
|
-
- lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb
|
697
|
-
- lib/twilio-ruby/rest/preview/sync/service/sync_map.rb
|
698
|
-
- lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb
|
699
|
-
- lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb
|
700
691
|
- lib/twilio-ruby/rest/preview/wireless.rb
|
701
692
|
- lib/twilio-ruby/rest/preview/wireless/command.rb
|
702
693
|
- lib/twilio-ruby/rest/preview/wireless/rate_plan.rb
|
@@ -1,407 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# This code was generated by
|
3
|
-
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
-
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
-
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
-
#
|
7
|
-
# Twilio - Preview
|
8
|
-
# This is the public Twilio REST API.
|
9
|
-
#
|
10
|
-
# NOTE: This class is auto generated by OpenAPI Generator.
|
11
|
-
# https://openapi-generator.tech
|
12
|
-
# Do not edit the class manually.
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
module Twilio
|
17
|
-
module REST
|
18
|
-
class Preview < PreviewBase
|
19
|
-
class Sync < Version
|
20
|
-
class ServiceContext < InstanceContext
|
21
|
-
class DocumentContext < InstanceContext
|
22
|
-
|
23
|
-
class DocumentPermissionList < ListResource
|
24
|
-
|
25
|
-
##
|
26
|
-
# Initialize the DocumentPermissionList
|
27
|
-
# @param [Version] version Version that contains the resource
|
28
|
-
# @return [DocumentPermissionList] DocumentPermissionList
|
29
|
-
def initialize(version, service_sid: nil, document_sid: nil)
|
30
|
-
super(version)
|
31
|
-
# Path Solution
|
32
|
-
@solution = { service_sid: service_sid, document_sid: document_sid }
|
33
|
-
@uri = "/Services/#{@solution[:service_sid]}/Documents/#{@solution[:document_sid]}/Permissions"
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
##
|
38
|
-
# Lists DocumentPermissionInstance records from the API as a list.
|
39
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
40
|
-
# memory before returning.
|
41
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
42
|
-
# guarantees to never return more than limit. Default is no limit
|
43
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
44
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
45
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
46
|
-
# efficient page size, i.e. min(limit, 1000)
|
47
|
-
# @return [Array] Array of up to limit results
|
48
|
-
def list(limit: nil, page_size: nil)
|
49
|
-
self.stream(
|
50
|
-
limit: limit,
|
51
|
-
page_size: page_size
|
52
|
-
).entries
|
53
|
-
end
|
54
|
-
|
55
|
-
##
|
56
|
-
# Streams Instance records from the API as an Enumerable.
|
57
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
58
|
-
# is reached.
|
59
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
60
|
-
# guarantees to never return more than limit. Default is no limit
|
61
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
62
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
63
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
64
|
-
# efficient page size, i.e. min(limit, 1000)
|
65
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
66
|
-
def stream(limit: nil, page_size: nil)
|
67
|
-
limits = @version.read_limits(limit, page_size)
|
68
|
-
|
69
|
-
page = self.page(
|
70
|
-
page_size: limits[:page_size], )
|
71
|
-
|
72
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
73
|
-
end
|
74
|
-
|
75
|
-
##
|
76
|
-
# When passed a block, yields DocumentPermissionInstance records from the API.
|
77
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
78
|
-
# is reached.
|
79
|
-
def each
|
80
|
-
limits = @version.read_limits
|
81
|
-
|
82
|
-
page = self.page(page_size: limits[:page_size], )
|
83
|
-
|
84
|
-
@version.stream(page,
|
85
|
-
limit: limits[:limit],
|
86
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
87
|
-
end
|
88
|
-
|
89
|
-
##
|
90
|
-
# Retrieve a single page of DocumentPermissionInstance records from the API.
|
91
|
-
# Request is executed immediately.
|
92
|
-
# @param [String] page_token PageToken provided by the API
|
93
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
94
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
95
|
-
# @return [Page] Page of DocumentPermissionInstance
|
96
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
97
|
-
params = Twilio::Values.of({
|
98
|
-
'PageToken' => page_token,
|
99
|
-
'Page' => page_number,
|
100
|
-
'PageSize' => page_size,
|
101
|
-
})
|
102
|
-
headers = Twilio::Values.of({})
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
response = @version.page('GET', @uri, params: params, headers: headers)
|
107
|
-
|
108
|
-
DocumentPermissionPage.new(@version, response, @solution)
|
109
|
-
end
|
110
|
-
|
111
|
-
##
|
112
|
-
# Retrieve a single page of DocumentPermissionInstance records from the API.
|
113
|
-
# Request is executed immediately.
|
114
|
-
# @param [String] target_url API-generated URL for the requested results page
|
115
|
-
# @return [Page] Page of DocumentPermissionInstance
|
116
|
-
def get_page(target_url)
|
117
|
-
response = @version.domain.request(
|
118
|
-
'GET',
|
119
|
-
target_url
|
120
|
-
)
|
121
|
-
DocumentPermissionPage.new(@version, response, @solution)
|
122
|
-
end
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
# Provide a user friendly representation
|
127
|
-
def to_s
|
128
|
-
'#<Twilio.Preview.Sync.DocumentPermissionList>'
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
|
133
|
-
class DocumentPermissionContext < InstanceContext
|
134
|
-
##
|
135
|
-
# Initialize the DocumentPermissionContext
|
136
|
-
# @param [Version] version Version that contains the resource
|
137
|
-
# @param [String] service_sid The unique SID identifier of the Sync Service Instance.
|
138
|
-
# @param [String] document_sid Identifier of the Sync Document. Either a SID or a unique name.
|
139
|
-
# @param [String] identity Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer.
|
140
|
-
# @return [DocumentPermissionContext] DocumentPermissionContext
|
141
|
-
def initialize(version, service_sid, document_sid, identity)
|
142
|
-
super(version)
|
143
|
-
|
144
|
-
# Path Solution
|
145
|
-
@solution = { service_sid: service_sid, document_sid: document_sid, identity: identity, }
|
146
|
-
@uri = "/Services/#{@solution[:service_sid]}/Documents/#{@solution[:document_sid]}/Permissions/#{@solution[:identity]}"
|
147
|
-
|
148
|
-
|
149
|
-
end
|
150
|
-
##
|
151
|
-
# Delete the DocumentPermissionInstance
|
152
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
153
|
-
def delete
|
154
|
-
|
155
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
@version.delete('DELETE', @uri, headers: headers)
|
160
|
-
end
|
161
|
-
|
162
|
-
##
|
163
|
-
# Fetch the DocumentPermissionInstance
|
164
|
-
# @return [DocumentPermissionInstance] Fetched DocumentPermissionInstance
|
165
|
-
def fetch
|
166
|
-
|
167
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
payload = @version.fetch('GET', @uri, headers: headers)
|
174
|
-
DocumentPermissionInstance.new(
|
175
|
-
@version,
|
176
|
-
payload,
|
177
|
-
service_sid: @solution[:service_sid],
|
178
|
-
document_sid: @solution[:document_sid],
|
179
|
-
identity: @solution[:identity],
|
180
|
-
)
|
181
|
-
end
|
182
|
-
|
183
|
-
##
|
184
|
-
# Update the DocumentPermissionInstance
|
185
|
-
# @param [Boolean] read Boolean flag specifying whether the identity can read the Sync Document.
|
186
|
-
# @param [Boolean] write Boolean flag specifying whether the identity can update the Sync Document.
|
187
|
-
# @param [Boolean] manage Boolean flag specifying whether the identity can delete the Sync Document.
|
188
|
-
# @return [DocumentPermissionInstance] Updated DocumentPermissionInstance
|
189
|
-
def update(
|
190
|
-
read: nil,
|
191
|
-
write: nil,
|
192
|
-
manage: nil
|
193
|
-
)
|
194
|
-
|
195
|
-
data = Twilio::Values.of({
|
196
|
-
'Read' => read,
|
197
|
-
'Write' => write,
|
198
|
-
'Manage' => manage,
|
199
|
-
})
|
200
|
-
|
201
|
-
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
payload = @version.update('POST', @uri, data: data, headers: headers)
|
208
|
-
DocumentPermissionInstance.new(
|
209
|
-
@version,
|
210
|
-
payload,
|
211
|
-
service_sid: @solution[:service_sid],
|
212
|
-
document_sid: @solution[:document_sid],
|
213
|
-
identity: @solution[:identity],
|
214
|
-
)
|
215
|
-
end
|
216
|
-
|
217
|
-
|
218
|
-
##
|
219
|
-
# Provide a user friendly representation
|
220
|
-
def to_s
|
221
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
222
|
-
"#<Twilio.Preview.Sync.DocumentPermissionContext #{context}>"
|
223
|
-
end
|
224
|
-
|
225
|
-
##
|
226
|
-
# Provide a detailed, user friendly representation
|
227
|
-
def inspect
|
228
|
-
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
229
|
-
"#<Twilio.Preview.Sync.DocumentPermissionContext #{context}>"
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
class DocumentPermissionPage < Page
|
234
|
-
##
|
235
|
-
# Initialize the DocumentPermissionPage
|
236
|
-
# @param [Version] version Version that contains the resource
|
237
|
-
# @param [Response] response Response from the API
|
238
|
-
# @param [Hash] solution Path solution for the resource
|
239
|
-
# @return [DocumentPermissionPage] DocumentPermissionPage
|
240
|
-
def initialize(version, response, solution)
|
241
|
-
super(version, response)
|
242
|
-
|
243
|
-
# Path Solution
|
244
|
-
@solution = solution
|
245
|
-
end
|
246
|
-
|
247
|
-
##
|
248
|
-
# Build an instance of DocumentPermissionInstance
|
249
|
-
# @param [Hash] payload Payload response from the API
|
250
|
-
# @return [DocumentPermissionInstance] DocumentPermissionInstance
|
251
|
-
def get_instance(payload)
|
252
|
-
DocumentPermissionInstance.new(@version, payload, service_sid: @solution[:service_sid], document_sid: @solution[:document_sid])
|
253
|
-
end
|
254
|
-
|
255
|
-
##
|
256
|
-
# Provide a user friendly representation
|
257
|
-
def to_s
|
258
|
-
'<Twilio.Preview.Sync.DocumentPermissionPage>'
|
259
|
-
end
|
260
|
-
end
|
261
|
-
class DocumentPermissionInstance < InstanceResource
|
262
|
-
##
|
263
|
-
# Initialize the DocumentPermissionInstance
|
264
|
-
# @param [Version] version Version that contains the resource
|
265
|
-
# @param [Hash] payload payload that contains response from Twilio
|
266
|
-
# @param [String] account_sid The SID of the
|
267
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this DocumentPermission
|
268
|
-
# resource.
|
269
|
-
# @param [String] sid The SID of the Call resource to fetch.
|
270
|
-
# @return [DocumentPermissionInstance] DocumentPermissionInstance
|
271
|
-
def initialize(version, payload , service_sid: nil, document_sid: nil, identity: nil)
|
272
|
-
super(version)
|
273
|
-
|
274
|
-
# Marshaled Properties
|
275
|
-
@properties = {
|
276
|
-
'account_sid' => payload['account_sid'],
|
277
|
-
'service_sid' => payload['service_sid'],
|
278
|
-
'document_sid' => payload['document_sid'],
|
279
|
-
'identity' => payload['identity'],
|
280
|
-
'read' => payload['read'],
|
281
|
-
'write' => payload['write'],
|
282
|
-
'manage' => payload['manage'],
|
283
|
-
'url' => payload['url'],
|
284
|
-
}
|
285
|
-
|
286
|
-
# Context
|
287
|
-
@instance_context = nil
|
288
|
-
@params = { 'service_sid' => service_sid || @properties['service_sid'] ,'document_sid' => document_sid || @properties['document_sid'] ,'identity' => identity || @properties['identity'] , }
|
289
|
-
end
|
290
|
-
|
291
|
-
##
|
292
|
-
# Generate an instance context for the instance, the context is capable of
|
293
|
-
# performing various actions. All instance actions are proxied to the context
|
294
|
-
# @return [DocumentPermissionContext] CallContext for this CallInstance
|
295
|
-
def context
|
296
|
-
unless @instance_context
|
297
|
-
@instance_context = DocumentPermissionContext.new(@version , @params['service_sid'], @params['document_sid'], @params['identity'])
|
298
|
-
end
|
299
|
-
@instance_context
|
300
|
-
end
|
301
|
-
|
302
|
-
##
|
303
|
-
# @return [String] The unique SID identifier of the Twilio Account.
|
304
|
-
def account_sid
|
305
|
-
@properties['account_sid']
|
306
|
-
end
|
307
|
-
|
308
|
-
##
|
309
|
-
# @return [String] The unique SID identifier of the Sync Service Instance.
|
310
|
-
def service_sid
|
311
|
-
@properties['service_sid']
|
312
|
-
end
|
313
|
-
|
314
|
-
##
|
315
|
-
# @return [String] The unique SID identifier of the Sync Document to which the Permission applies.
|
316
|
-
def document_sid
|
317
|
-
@properties['document_sid']
|
318
|
-
end
|
319
|
-
|
320
|
-
##
|
321
|
-
# @return [String] Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer.
|
322
|
-
def identity
|
323
|
-
@properties['identity']
|
324
|
-
end
|
325
|
-
|
326
|
-
##
|
327
|
-
# @return [Boolean] Boolean flag specifying whether the identity can read the Sync Document.
|
328
|
-
def read
|
329
|
-
@properties['read']
|
330
|
-
end
|
331
|
-
|
332
|
-
##
|
333
|
-
# @return [Boolean] Boolean flag specifying whether the identity can update the Sync Document.
|
334
|
-
def write
|
335
|
-
@properties['write']
|
336
|
-
end
|
337
|
-
|
338
|
-
##
|
339
|
-
# @return [Boolean] Boolean flag specifying whether the identity can delete the Sync Document.
|
340
|
-
def manage
|
341
|
-
@properties['manage']
|
342
|
-
end
|
343
|
-
|
344
|
-
##
|
345
|
-
# @return [String] Contains an absolute URL for this Sync Document Permission.
|
346
|
-
def url
|
347
|
-
@properties['url']
|
348
|
-
end
|
349
|
-
|
350
|
-
##
|
351
|
-
# Delete the DocumentPermissionInstance
|
352
|
-
# @return [Boolean] True if delete succeeds, false otherwise
|
353
|
-
def delete
|
354
|
-
|
355
|
-
context.delete
|
356
|
-
end
|
357
|
-
|
358
|
-
##
|
359
|
-
# Fetch the DocumentPermissionInstance
|
360
|
-
# @return [DocumentPermissionInstance] Fetched DocumentPermissionInstance
|
361
|
-
def fetch
|
362
|
-
|
363
|
-
context.fetch
|
364
|
-
end
|
365
|
-
|
366
|
-
##
|
367
|
-
# Update the DocumentPermissionInstance
|
368
|
-
# @param [Boolean] read Boolean flag specifying whether the identity can read the Sync Document.
|
369
|
-
# @param [Boolean] write Boolean flag specifying whether the identity can update the Sync Document.
|
370
|
-
# @param [Boolean] manage Boolean flag specifying whether the identity can delete the Sync Document.
|
371
|
-
# @return [DocumentPermissionInstance] Updated DocumentPermissionInstance
|
372
|
-
def update(
|
373
|
-
read: nil,
|
374
|
-
write: nil,
|
375
|
-
manage: nil
|
376
|
-
)
|
377
|
-
|
378
|
-
context.update(
|
379
|
-
read: read,
|
380
|
-
write: write,
|
381
|
-
manage: manage,
|
382
|
-
)
|
383
|
-
end
|
384
|
-
|
385
|
-
##
|
386
|
-
# Provide a user friendly representation
|
387
|
-
def to_s
|
388
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
389
|
-
"<Twilio.Preview.Sync.DocumentPermissionInstance #{values}>"
|
390
|
-
end
|
391
|
-
|
392
|
-
##
|
393
|
-
# Provide a detailed, user friendly representation
|
394
|
-
def inspect
|
395
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
396
|
-
"<Twilio.Preview.Sync.DocumentPermissionInstance #{values}>"
|
397
|
-
end
|
398
|
-
end
|
399
|
-
|
400
|
-
end
|
401
|
-
end
|
402
|
-
end
|
403
|
-
end
|
404
|
-
end
|
405
|
-
end
|
406
|
-
|
407
|
-
|