twilio-ruby 5.40.1 → 5.40.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +27 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/version.rb +2 -7
- data/lib/twilio-ruby/rest/conversations.rb +52 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +88 -1
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +258 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +15 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +19 -10
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
- data/lib/twilio-ruby/rest/conversations/v1/notification.rb +310 -0
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +372 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +385 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +259 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +546 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +388 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +513 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +454 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +393 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
- data/lib/twilio-ruby/rest/events.rb +8 -0
- data/lib/twilio-ruby/rest/events/v1.rb +15 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +2 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +27 -24
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +12 -11
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +17 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +42 -0
- data/spec/holodeck/holodeck.rb +3 -3
- data/spec/integration/conversations/v1/configuration_spec.rb +85 -0
- data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +6 -6
- data/spec/integration/conversations/v1/conversation_spec.rb +5 -0
- data/spec/integration/conversations/v1/credential_spec.rb +219 -0
- data/spec/integration/conversations/v1/notification_spec.rb +107 -0
- data/spec/integration/conversations/v1/role_spec.rb +249 -0
- data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
- data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
- data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
- data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
- data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
- data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
- data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
- data/spec/integration/conversations/v1/service_spec.rb +174 -0
- data/spec/integration/conversations/v1/user_spec.rb +220 -0
- data/spec/integration/events/v1/event_type_spec.rb +133 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
- data/spec/integration/supersim/v1/sim_spec.rb +23 -0
- metadata +50 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88d33c49dd845714de79ae304f9481c5a154d64d9f384030cc39254283d5e5b0
|
4
|
+
data.tar.gz: 9ebfad3f85d6d17df150230d19ac036bc77c2329a1dcf8d32f917dad7f493174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcc344b8dbf6b62fb02b5f91df404131f6056da9a0e99eadb68949cd8fd1506fb566dd1eb67a7c63b44415808dc9395ba73bc16638443a3122a0242749899f11
|
7
|
+
data.tar.gz: 3f92a7d9204b0a9833f4e1b3d00c2598cca620da1cc66d616fa45991715ccf6e57ec71fb0bf3308f840e5f69cdd966b41784870e8a97a6496f2af780fdd8e7bf
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,33 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2020-09-16] Version 5.40.2
|
5
|
+
---------------------------
|
6
|
+
**Library - Fix**
|
7
|
+
- [PR #530](https://github.com/twilio/twilio-ruby/pull/530): drop the page limit calculation. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
8
|
+
|
9
|
+
**Conversations**
|
10
|
+
- Expose Configuration and Service Configuration resources
|
11
|
+
- Add Unique Name support for Conversations
|
12
|
+
- Add Services Push Notification resource
|
13
|
+
- Add Service scoped Conversation resources
|
14
|
+
- Support Identity in Users resource endpoint
|
15
|
+
|
16
|
+
**Messaging**
|
17
|
+
- GA Deactivation List API
|
18
|
+
- Add domain cert API's(fetch, update, create) for link tracker
|
19
|
+
|
20
|
+
**Numbers**
|
21
|
+
- Add API endpoint for Supporting Document deletion
|
22
|
+
|
23
|
+
**Proxy**
|
24
|
+
- Updated usage of FailOnParticipantConflict param to apply only to accounts with ProxyAllowParticipantConflict account flag
|
25
|
+
|
26
|
+
**Supersim**
|
27
|
+
- Add `AccountSid` parameter to Sim resource update request
|
28
|
+
- Add `ready` status as an available status for a Sim resource
|
29
|
+
|
30
|
+
|
4
31
|
[2020-09-02] Version 5.40.1
|
5
32
|
---------------------------
|
6
33
|
**Library - Chore**
|
data/README.md
CHANGED
@@ -34,13 +34,13 @@ This library supports the following Ruby implementations:
|
|
34
34
|
To install using [Bundler][bundler] grab the latest stable version:
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
gem 'twilio-ruby', '~> 5.40.
|
37
|
+
gem 'twilio-ruby', '~> 5.40.2'
|
38
38
|
```
|
39
39
|
|
40
40
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
41
41
|
|
42
42
|
```bash
|
43
|
-
gem install twilio-ruby -v 5.40.
|
43
|
+
gem install twilio-ruby -v 5.40.2
|
44
44
|
```
|
45
45
|
|
46
46
|
To build and install the development branch yourself from the latest source:
|
@@ -112,18 +112,13 @@ module Twilio
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def read_limits(limit = nil, page_size = nil)
|
115
|
-
|
116
|
-
|
117
|
-
unless limit.nil?
|
118
|
-
# If there is no user-specified page_size, pick the most network efficient size
|
115
|
+
unless limit.nil? || page_size
|
119
116
|
page_size = limit
|
120
|
-
page_limit = (limit / page_size.to_f).ceil
|
121
117
|
end
|
122
118
|
|
123
119
|
{
|
124
120
|
limit: limit || nil,
|
125
|
-
page_size: page_size || nil
|
126
|
-
page_limit: page_limit
|
121
|
+
page_size: page_size || nil
|
127
122
|
}
|
128
123
|
end
|
129
124
|
|
@@ -28,6 +28,12 @@ module Twilio
|
|
28
28
|
@v1 ||= V1.new self
|
29
29
|
end
|
30
30
|
|
31
|
+
##
|
32
|
+
# @return [Twilio::REST::Conversations::V1::ConfigurationInstance]
|
33
|
+
def configuration
|
34
|
+
self.v1.configuration()
|
35
|
+
end
|
36
|
+
|
31
37
|
##
|
32
38
|
# @param [String] sid A 34 character string that uniquely identifies this
|
33
39
|
# resource.
|
@@ -43,6 +49,52 @@ module Twilio
|
|
43
49
|
self.v1.webhooks()
|
44
50
|
end
|
45
51
|
|
52
|
+
##
|
53
|
+
# @param [String] sid A 34 character string that uniquely identifies this
|
54
|
+
# resource.
|
55
|
+
# @return [Twilio::REST::Conversations::V1::CredentialInstance] if sid was passed.
|
56
|
+
# @return [Twilio::REST::Conversations::V1::CredentialList]
|
57
|
+
def credentials(sid=:unset)
|
58
|
+
self.v1.credentials(sid)
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# @param [String] sid The unique string that we created to identify the Role
|
63
|
+
# resource.
|
64
|
+
# @return [Twilio::REST::Conversations::V1::RoleInstance] if sid was passed.
|
65
|
+
# @return [Twilio::REST::Conversations::V1::RoleList]
|
66
|
+
def roles(sid=:unset)
|
67
|
+
self.v1.roles(sid)
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# @param [String] sid A 34 character string that uniquely identifies this
|
72
|
+
# resource.
|
73
|
+
# @return [Twilio::REST::Conversations::V1::ServiceInstance] if sid was passed.
|
74
|
+
# @return [Twilio::REST::Conversations::V1::ServiceList]
|
75
|
+
def services(sid=:unset)
|
76
|
+
self.v1.services(sid)
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# @param [String] chat_service_sid The SID of the [Chat
|
81
|
+
# Service](https://www.twilio.com/docs/chat/rest/service-resource) the
|
82
|
+
# Configuration applies to.
|
83
|
+
# @return [Twilio::REST::Conversations::V1::NotificationInstance] if chat_service_sid was passed.
|
84
|
+
# @return [Twilio::REST::Conversations::V1::NotificationList]
|
85
|
+
def notifications(chat_service_sid=:unset)
|
86
|
+
self.v1.notifications(chat_service_sid)
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# @param [String] sid The unique string that we created to identify the User
|
91
|
+
# resource.
|
92
|
+
# @return [Twilio::REST::Conversations::V1::UserInstance] if sid was passed.
|
93
|
+
# @return [Twilio::REST::Conversations::V1::UserList]
|
94
|
+
def users(sid=:unset)
|
95
|
+
self.v1.users(sid)
|
96
|
+
end
|
97
|
+
|
46
98
|
##
|
47
99
|
# Provide a user friendly representation
|
48
100
|
def to_s
|
@@ -15,13 +15,25 @@ module Twilio
|
|
15
15
|
def initialize(domain)
|
16
16
|
super
|
17
17
|
@version = 'v1'
|
18
|
+
@configuration = nil
|
18
19
|
@conversations = nil
|
19
20
|
@webhooks = nil
|
21
|
+
@credentials = nil
|
22
|
+
@roles = nil
|
23
|
+
@services = nil
|
24
|
+
@notifications = nil
|
25
|
+
@users = nil
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# @return [Twilio::REST::Conversations::V1::ConfigurationContext]
|
30
|
+
def configuration
|
31
|
+
@configuration ||= ConfigurationContext.new self
|
20
32
|
end
|
21
33
|
|
22
34
|
##
|
23
35
|
# @param [String] sid A 34 character string that uniquely identifies this
|
24
|
-
# resource.
|
36
|
+
# resource. Can also be the `unique_name` of the Conversation.
|
25
37
|
# @return [Twilio::REST::Conversations::V1::ConversationContext] if sid was passed.
|
26
38
|
# @return [Twilio::REST::Conversations::V1::ConversationList]
|
27
39
|
def conversations(sid=:unset)
|
@@ -40,6 +52,81 @@ module Twilio
|
|
40
52
|
@webhooks ||= WebhookContext.new self
|
41
53
|
end
|
42
54
|
|
55
|
+
##
|
56
|
+
# @param [String] sid A 34 character string that uniquely identifies this
|
57
|
+
# resource.
|
58
|
+
# @return [Twilio::REST::Conversations::V1::CredentialContext] if sid was passed.
|
59
|
+
# @return [Twilio::REST::Conversations::V1::CredentialList]
|
60
|
+
def credentials(sid=:unset)
|
61
|
+
if sid.nil?
|
62
|
+
raise ArgumentError, 'sid cannot be nil'
|
63
|
+
elsif sid == :unset
|
64
|
+
@credentials ||= CredentialList.new self
|
65
|
+
else
|
66
|
+
CredentialContext.new(self, sid)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# @param [String] sid The SID of the Role resource to fetch.
|
72
|
+
# @return [Twilio::REST::Conversations::V1::RoleContext] if sid was passed.
|
73
|
+
# @return [Twilio::REST::Conversations::V1::RoleList]
|
74
|
+
def roles(sid=:unset)
|
75
|
+
if sid.nil?
|
76
|
+
raise ArgumentError, 'sid cannot be nil'
|
77
|
+
elsif sid == :unset
|
78
|
+
@roles ||= RoleList.new self
|
79
|
+
else
|
80
|
+
RoleContext.new(self, sid)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# @param [String] sid A 34 character string that uniquely identifies this
|
86
|
+
# resource.
|
87
|
+
# @return [Twilio::REST::Conversations::V1::ServiceContext] if sid was passed.
|
88
|
+
# @return [Twilio::REST::Conversations::V1::ServiceList]
|
89
|
+
def services(sid=:unset)
|
90
|
+
if sid.nil?
|
91
|
+
raise ArgumentError, 'sid cannot be nil'
|
92
|
+
elsif sid == :unset
|
93
|
+
@services ||= ServiceList.new self
|
94
|
+
else
|
95
|
+
ServiceContext.new(self, sid)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
# @param [String] chat_service_sid The SID of the [Chat
|
101
|
+
# Service](https://www.twilio.com/docs/chat/rest/service-resource) the
|
102
|
+
# Configuration applies to.
|
103
|
+
# @return [Twilio::REST::Conversations::V1::NotificationContext] if chat_service_sid was passed.
|
104
|
+
# @return [Twilio::REST::Conversations::V1::NotificationList]
|
105
|
+
def notifications(chat_service_sid=:unset)
|
106
|
+
if chat_service_sid.nil?
|
107
|
+
raise ArgumentError, 'chat_service_sid cannot be nil'
|
108
|
+
elsif chat_service_sid == :unset
|
109
|
+
@notifications ||= NotificationList.new self
|
110
|
+
else
|
111
|
+
NotificationContext.new(self, chat_service_sid)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# @param [String] sid The SID of the User resource to fetch. This value can be
|
117
|
+
# either the `sid` or the `identity` of the User resource to fetch.
|
118
|
+
# @return [Twilio::REST::Conversations::V1::UserContext] if sid was passed.
|
119
|
+
# @return [Twilio::REST::Conversations::V1::UserList]
|
120
|
+
def users(sid=:unset)
|
121
|
+
if sid.nil?
|
122
|
+
raise ArgumentError, 'sid cannot be nil'
|
123
|
+
elsif sid == :unset
|
124
|
+
@users ||= UserList.new self
|
125
|
+
else
|
126
|
+
UserContext.new(self, sid)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
43
130
|
##
|
44
131
|
# Provide a user friendly representation
|
45
132
|
def to_s
|
@@ -0,0 +1,258 @@
|
|
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 Conversations < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
15
|
+
class ConfigurationList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the ConfigurationList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [ConfigurationList] ConfigurationList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'#<Twilio.Conversations.V1.ConfigurationList>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
36
|
+
class ConfigurationPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the ConfigurationPage
|
39
|
+
# @param [Version] version Version that contains the resource
|
40
|
+
# @param [Response] response Response from the API
|
41
|
+
# @param [Hash] solution Path solution for the resource
|
42
|
+
# @return [ConfigurationPage] ConfigurationPage
|
43
|
+
def initialize(version, response, solution)
|
44
|
+
super(version, response)
|
45
|
+
|
46
|
+
# Path Solution
|
47
|
+
@solution = solution
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Build an instance of ConfigurationInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [ConfigurationInstance] ConfigurationInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
ConfigurationInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.Conversations.V1.ConfigurationPage>'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
67
|
+
class ConfigurationContext < InstanceContext
|
68
|
+
##
|
69
|
+
# Initialize the ConfigurationContext
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @return [ConfigurationContext] ConfigurationContext
|
72
|
+
def initialize(version)
|
73
|
+
super(version)
|
74
|
+
|
75
|
+
# Path Solution
|
76
|
+
@solution = {}
|
77
|
+
@uri = "/Configuration"
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Fetch the ConfigurationInstance
|
82
|
+
# @return [ConfigurationInstance] Fetched ConfigurationInstance
|
83
|
+
def fetch
|
84
|
+
payload = @version.fetch('GET', @uri)
|
85
|
+
|
86
|
+
ConfigurationInstance.new(@version, payload, )
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# Update the ConfigurationInstance
|
91
|
+
# @param [String] default_chat_service_sid The SID of the default [Chat
|
92
|
+
# Service](https://www.twilio.com/docs/chat/rest/service-resource) to use when
|
93
|
+
# creating a conversation.
|
94
|
+
# @param [String] default_messaging_service_sid The SID of the default [Messaging
|
95
|
+
# Service](https://www.twilio.com/docs/sms/services/api) to use when creating a
|
96
|
+
# conversation.
|
97
|
+
# @param [String] default_inactive_timer Default ISO8601 duration when
|
98
|
+
# conversation will be switched to `inactive` state. Minimum value for this timer
|
99
|
+
# is 1 minute.
|
100
|
+
# @param [String] default_closed_timer Default ISO8601 duration when conversation
|
101
|
+
# will be switched to `closed` state. Minimum value for this timer is 10 minutes.
|
102
|
+
# @return [ConfigurationInstance] Updated ConfigurationInstance
|
103
|
+
def update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset)
|
104
|
+
data = Twilio::Values.of({
|
105
|
+
'DefaultChatServiceSid' => default_chat_service_sid,
|
106
|
+
'DefaultMessagingServiceSid' => default_messaging_service_sid,
|
107
|
+
'DefaultInactiveTimer' => default_inactive_timer,
|
108
|
+
'DefaultClosedTimer' => default_closed_timer,
|
109
|
+
})
|
110
|
+
|
111
|
+
payload = @version.update('POST', @uri, data: data)
|
112
|
+
|
113
|
+
ConfigurationInstance.new(@version, payload, )
|
114
|
+
end
|
115
|
+
|
116
|
+
##
|
117
|
+
# Provide a user friendly representation
|
118
|
+
def to_s
|
119
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
120
|
+
"#<Twilio.Conversations.V1.ConfigurationContext #{context}>"
|
121
|
+
end
|
122
|
+
|
123
|
+
##
|
124
|
+
# Provide a detailed, user friendly representation
|
125
|
+
def inspect
|
126
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
127
|
+
"#<Twilio.Conversations.V1.ConfigurationContext #{context}>"
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
133
|
+
class ConfigurationInstance < InstanceResource
|
134
|
+
##
|
135
|
+
# Initialize the ConfigurationInstance
|
136
|
+
# @param [Version] version Version that contains the resource
|
137
|
+
# @param [Hash] payload payload that contains response from Twilio
|
138
|
+
# @return [ConfigurationInstance] ConfigurationInstance
|
139
|
+
def initialize(version, payload)
|
140
|
+
super(version)
|
141
|
+
|
142
|
+
# Marshaled Properties
|
143
|
+
@properties = {
|
144
|
+
'account_sid' => payload['account_sid'],
|
145
|
+
'default_chat_service_sid' => payload['default_chat_service_sid'],
|
146
|
+
'default_messaging_service_sid' => payload['default_messaging_service_sid'],
|
147
|
+
'default_inactive_timer' => payload['default_inactive_timer'],
|
148
|
+
'default_closed_timer' => payload['default_closed_timer'],
|
149
|
+
'url' => payload['url'],
|
150
|
+
'links' => payload['links'],
|
151
|
+
}
|
152
|
+
|
153
|
+
# Context
|
154
|
+
@instance_context = nil
|
155
|
+
@params = {}
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# Generate an instance context for the instance, the context is capable of
|
160
|
+
# performing various actions. All instance actions are proxied to the context
|
161
|
+
# @return [ConfigurationContext] ConfigurationContext for this ConfigurationInstance
|
162
|
+
def context
|
163
|
+
unless @instance_context
|
164
|
+
@instance_context = ConfigurationContext.new(@version, )
|
165
|
+
end
|
166
|
+
@instance_context
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# @return [String] The SID of the Account responsible for this configuration.
|
171
|
+
def account_sid
|
172
|
+
@properties['account_sid']
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# @return [String] The SID of the default Chat Service that every new conversation is associated with.
|
177
|
+
def default_chat_service_sid
|
178
|
+
@properties['default_chat_service_sid']
|
179
|
+
end
|
180
|
+
|
181
|
+
##
|
182
|
+
# @return [String] The SID of the default Messaging Service that every new conversation is associated with.
|
183
|
+
def default_messaging_service_sid
|
184
|
+
@properties['default_messaging_service_sid']
|
185
|
+
end
|
186
|
+
|
187
|
+
##
|
188
|
+
# @return [String] Default ISO8601 duration when conversation will be switched to `inactive` state.
|
189
|
+
def default_inactive_timer
|
190
|
+
@properties['default_inactive_timer']
|
191
|
+
end
|
192
|
+
|
193
|
+
##
|
194
|
+
# @return [String] Default ISO8601 duration when conversation will be switched to `closed` state.
|
195
|
+
def default_closed_timer
|
196
|
+
@properties['default_closed_timer']
|
197
|
+
end
|
198
|
+
|
199
|
+
##
|
200
|
+
# @return [String] The url
|
201
|
+
def url
|
202
|
+
@properties['url']
|
203
|
+
end
|
204
|
+
|
205
|
+
##
|
206
|
+
# @return [String] The links
|
207
|
+
def links
|
208
|
+
@properties['links']
|
209
|
+
end
|
210
|
+
|
211
|
+
##
|
212
|
+
# Fetch the ConfigurationInstance
|
213
|
+
# @return [ConfigurationInstance] Fetched ConfigurationInstance
|
214
|
+
def fetch
|
215
|
+
context.fetch
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# Update the ConfigurationInstance
|
220
|
+
# @param [String] default_chat_service_sid The SID of the default [Chat
|
221
|
+
# Service](https://www.twilio.com/docs/chat/rest/service-resource) to use when
|
222
|
+
# creating a conversation.
|
223
|
+
# @param [String] default_messaging_service_sid The SID of the default [Messaging
|
224
|
+
# Service](https://www.twilio.com/docs/sms/services/api) to use when creating a
|
225
|
+
# conversation.
|
226
|
+
# @param [String] default_inactive_timer Default ISO8601 duration when
|
227
|
+
# conversation will be switched to `inactive` state. Minimum value for this timer
|
228
|
+
# is 1 minute.
|
229
|
+
# @param [String] default_closed_timer Default ISO8601 duration when conversation
|
230
|
+
# will be switched to `closed` state. Minimum value for this timer is 10 minutes.
|
231
|
+
# @return [ConfigurationInstance] Updated ConfigurationInstance
|
232
|
+
def update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset)
|
233
|
+
context.update(
|
234
|
+
default_chat_service_sid: default_chat_service_sid,
|
235
|
+
default_messaging_service_sid: default_messaging_service_sid,
|
236
|
+
default_inactive_timer: default_inactive_timer,
|
237
|
+
default_closed_timer: default_closed_timer,
|
238
|
+
)
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# Provide a user friendly representation
|
243
|
+
def to_s
|
244
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
245
|
+
"<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# Provide a detailed, user friendly representation
|
250
|
+
def inspect
|
251
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
252
|
+
"<Twilio.Conversations.V1.ConfigurationInstance #{values}>"
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|