twilio-ruby 5.74.3 → 5.75.0

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +34 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
  6. data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +240 -0
  7. data/lib/twilio-ruby/rest/content/v1.rb +7 -0
  8. data/lib/twilio-ruby/rest/content.rb +6 -0
  9. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +258 -17
  10. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +216 -0
  11. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +10 -3
  12. data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +95 -1
  13. data/lib/twilio-ruby/rest/flex_api/v1.rb +19 -3
  14. data/lib/twilio-ruby/rest/flex_api.rb +11 -3
  15. data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +4 -4
  16. data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +226 -0
  17. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +218 -0
  18. data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
  19. data/lib/twilio-ruby/rest/messaging.rb +18 -0
  20. data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +21 -1
  21. data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +20 -0
  22. data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +192 -0
  23. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +25 -0
  24. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +25 -0
  25. data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +25 -0
  26. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
  27. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +0 -23
  28. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -2
  29. data/lib/twilio-ruby/version.rb +1 -1
  30. data/twilio-ruby.gemspec +1 -1
  31. metadata +11 -7
  32. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue_bulk_real_time_statistics.rb +0 -149
@@ -22,6 +22,100 @@ module Twilio
22
22
 
23
23
  # Path Solution
24
24
  @solution = {}
25
+ @uri = "/Insights/Segments"
26
+ end
27
+
28
+ ##
29
+ # Lists InsightsSegmentsInstance 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 [Array[String]] reservation_id The list of reservation Ids
33
+ # @param [String] token The Token HTTP request header
34
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
35
+ # guarantees to never return more than limit. Default is no limit
36
+ # @param [Integer] page_size Number of records to fetch per request, when
37
+ # not set will use the default value of 50 records. If no page_size is defined
38
+ # but a limit is defined, stream() will attempt to read the limit with the most
39
+ # efficient page size, i.e. min(limit, 1000)
40
+ # @return [Array] Array of up to limit results
41
+ def list(reservation_id: :unset, token: :unset, limit: nil, page_size: nil)
42
+ self.stream(
43
+ reservation_id: reservation_id,
44
+ token: token,
45
+ limit: limit,
46
+ page_size: page_size
47
+ ).entries
48
+ end
49
+
50
+ ##
51
+ # Streams InsightsSegmentsInstance records from the API as an Enumerable.
52
+ # This operation lazily loads records as efficiently as possible until the limit
53
+ # is reached.
54
+ # @param [Array[String]] reservation_id The list of reservation Ids
55
+ # @param [String] token The Token HTTP request header
56
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
57
+ # guarantees to never return more than limit. Default is no limit.
58
+ # @param [Integer] page_size Number of records to fetch per request, when
59
+ # not set will use the default value of 50 records. If no page_size is defined
60
+ # but a limit is defined, stream() will attempt to read the limit with the most
61
+ # efficient page size, i.e. min(limit, 1000)
62
+ # @return [Enumerable] Enumerable that will yield up to limit results
63
+ def stream(reservation_id: :unset, token: :unset, limit: nil, page_size: nil)
64
+ limits = @version.read_limits(limit, page_size)
65
+
66
+ page = self.page(reservation_id: reservation_id, token: token, page_size: limits[:page_size], )
67
+
68
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
69
+ end
70
+
71
+ ##
72
+ # When passed a block, yields InsightsSegmentsInstance records from the API.
73
+ # This operation lazily loads records as efficiently as possible until the limit
74
+ # is reached.
75
+ def each
76
+ limits = @version.read_limits
77
+
78
+ page = self.page(page_size: limits[:page_size], )
79
+
80
+ @version.stream(page,
81
+ limit: limits[:limit],
82
+ page_limit: limits[:page_limit]).each {|x| yield x}
83
+ end
84
+
85
+ ##
86
+ # Retrieve a single page of InsightsSegmentsInstance records from the API.
87
+ # Request is executed immediately.
88
+ # @param [Array[String]] reservation_id The list of reservation Ids
89
+ # @param [String] token The Token HTTP request header
90
+ # @param [String] page_token PageToken provided by the API
91
+ # @param [Integer] page_number Page Number, this value is simply for client state
92
+ # @param [Integer] page_size Number of records to return, defaults to 50
93
+ # @return [Page] Page of InsightsSegmentsInstance
94
+ def page(reservation_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
95
+ params = Twilio::Values.of({
96
+ 'ReservationId' => Twilio.serialize_list(reservation_id) { |e| e },
97
+ 'PageToken' => page_token,
98
+ 'Page' => page_number,
99
+ 'PageSize' => page_size,
100
+ })
101
+ headers = Twilio::Values.of({'Token' => token, })
102
+
103
+ response = @version.page('GET', @uri, params: params, headers: headers)
104
+
105
+ InsightsSegmentsPage.new(@version, response, @solution)
106
+ end
107
+
108
+ ##
109
+ # Retrieve a single page of InsightsSegmentsInstance records from the API.
110
+ # Request is executed immediately.
111
+ # @param [String] target_url API-generated URL for the requested results page
112
+ # @return [Page] Page of InsightsSegmentsInstance
113
+ def get_page(target_url)
114
+ response = @version.domain.request(
115
+ 'GET',
116
+ target_url
117
+ )
118
+ InsightsSegmentsPage.new(@version, response, @solution)
25
119
  end
26
120
 
27
121
  ##
@@ -268,7 +362,7 @@ module Twilio
268
362
  end
269
363
 
270
364
  ##
271
- # @return [String] The link for the conversation.
365
+ # @return [Hash] The media identifiers of the conversation.
272
366
  def media
273
367
  @properties['media']
274
368
  end
@@ -20,6 +20,7 @@ module Twilio
20
20
  @flex_flow = nil
21
21
  @assessments = nil
22
22
  @insights_assessments_comment = nil
23
+ @insights_conversations = nil
23
24
  @insights_questionnaires = nil
24
25
  @insights_questionnaires_category = nil
25
26
  @insights_questionnaires_question = nil
@@ -69,9 +70,18 @@ module Twilio
69
70
  end
70
71
 
71
72
  ##
72
- # @return [Twilio::REST::Flex_api::V1::AssessmentsContext]
73
- def assessments
74
- @assessments ||= AssessmentsContext.new self
73
+ # @param [String] assessment_id The id of the assessment to be modified
74
+ # @return [Twilio::REST::Flex_api::V1::AssessmentsContext] if assessment_id was passed.
75
+ # @return [Twilio::REST::Flex_api::V1::AssessmentsList]
76
+ def assessments(assessment_id=:unset)
77
+ if assessment_id.nil?
78
+ raise ArgumentError, 'assessment_id cannot be nil'
79
+ end
80
+ if assessment_id == :unset
81
+ @assessments ||= AssessmentsList.new self
82
+ else
83
+ AssessmentsContext.new(self, assessment_id)
84
+ end
75
85
  end
76
86
 
77
87
  ##
@@ -80,6 +90,12 @@ module Twilio
80
90
  @insights_assessments_comment ||= InsightsAssessmentsCommentList.new self
81
91
  end
82
92
 
93
+ ##
94
+ # @return [Twilio::REST::Flex_api::V1::InsightsConversationsContext]
95
+ def insights_conversations
96
+ @insights_conversations ||= InsightsConversationsList.new self
97
+ end
98
+
83
99
  ##
84
100
  # @param [String] id The unique ID of the questionnaire
85
101
  # @return [Twilio::REST::Flex_api::V1::InsightsQuestionnairesContext] if id was passed.
@@ -60,9 +60,11 @@ module Twilio
60
60
  end
61
61
 
62
62
  ##
63
- # @return [Twilio::REST::Flex_api::V1::AssessmentsInstance]
64
- def assessments
65
- self.v1.assessments()
63
+ # @param [String] assessment_id The unique id of the assessment
64
+ # @return [Twilio::REST::Flex_api::V1::AssessmentsInstance] if assessment_id was passed.
65
+ # @return [Twilio::REST::Flex_api::V1::AssessmentsList]
66
+ def assessments(assessment_id=:unset)
67
+ self.v1.assessments(assessment_id)
66
68
  end
67
69
 
68
70
  ##
@@ -71,6 +73,12 @@ module Twilio
71
73
  self.v1.insights_assessments_comment()
72
74
  end
73
75
 
76
+ ##
77
+ # @return [Twilio::REST::Flex_api::V1::InsightsConversationsInstance]
78
+ def insights_conversations
79
+ self.v1.insights_conversations()
80
+ end
81
+
74
82
  ##
75
83
  # @param [String] id The unique id of this questionnaire
76
84
  # @return [Twilio::REST::Flex_api::V1::InsightsQuestionnairesInstance] if id was passed.
@@ -146,7 +146,7 @@ module Twilio
146
146
  'domain_name' => payload['domain_name'],
147
147
  'certificate_sid' => payload['certificate_sid'],
148
148
  'url' => payload['url'],
149
- 'validated' => payload['validated'],
149
+ 'cert_in_validation' => payload['cert_in_validation'],
150
150
  }
151
151
 
152
152
  # Context
@@ -208,9 +208,9 @@ module Twilio
208
208
  end
209
209
 
210
210
  ##
211
- # @return [Boolean] Certificate validation field
212
- def validated
213
- @properties['validated']
211
+ # @return [Hash] New certificate in process of validation field
212
+ def cert_in_validation
213
+ @properties['cert_in_validation']
214
214
  end
215
215
 
216
216
  ##
@@ -0,0 +1,226 @@
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 Messaging < 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 DomainConfigMessagingServiceList < ListResource
16
+ ##
17
+ # Initialize the DomainConfigMessagingServiceList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [DomainConfigMessagingServiceList] DomainConfigMessagingServiceList
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.Messaging.V1.DomainConfigMessagingServiceList>'
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 DomainConfigMessagingServicePage < Page
37
+ ##
38
+ # Initialize the DomainConfigMessagingServicePage
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 [DomainConfigMessagingServicePage] DomainConfigMessagingServicePage
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 DomainConfigMessagingServiceInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [DomainConfigMessagingServiceInstance] DomainConfigMessagingServiceInstance
54
+ def get_instance(payload)
55
+ DomainConfigMessagingServiceInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Messaging.V1.DomainConfigMessagingServicePage>'
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 DomainConfigMessagingServiceContext < InstanceContext
68
+ ##
69
+ # Initialize the DomainConfigMessagingServiceContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] messaging_service_sid Unique string used to identify the
72
+ # Messaging service that this domain should be associated with.
73
+ # @return [DomainConfigMessagingServiceContext] DomainConfigMessagingServiceContext
74
+ def initialize(version, messaging_service_sid)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {messaging_service_sid: messaging_service_sid, }
79
+ @uri = "/LinkShortening/MessagingService/#{@solution[:messaging_service_sid]}/DomainConfig"
80
+ end
81
+
82
+ ##
83
+ # Fetch the DomainConfigMessagingServiceInstance
84
+ # @return [DomainConfigMessagingServiceInstance] Fetched DomainConfigMessagingServiceInstance
85
+ def fetch
86
+ payload = @version.fetch('GET', @uri)
87
+
88
+ DomainConfigMessagingServiceInstance.new(
89
+ @version,
90
+ payload,
91
+ messaging_service_sid: @solution[:messaging_service_sid],
92
+ )
93
+ end
94
+
95
+ ##
96
+ # Provide a user friendly representation
97
+ def to_s
98
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
99
+ "#<Twilio.Messaging.V1.DomainConfigMessagingServiceContext #{context}>"
100
+ end
101
+
102
+ ##
103
+ # Provide a detailed, user friendly representation
104
+ def inspect
105
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
106
+ "#<Twilio.Messaging.V1.DomainConfigMessagingServiceContext #{context}>"
107
+ end
108
+ end
109
+
110
+ ##
111
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
112
+ class DomainConfigMessagingServiceInstance < InstanceResource
113
+ ##
114
+ # Initialize the DomainConfigMessagingServiceInstance
115
+ # @param [Version] version Version that contains the resource
116
+ # @param [Hash] payload payload that contains response from Twilio
117
+ # @param [String] messaging_service_sid Unique string used to identify the
118
+ # Messaging service that this domain should be associated with.
119
+ # @return [DomainConfigMessagingServiceInstance] DomainConfigMessagingServiceInstance
120
+ def initialize(version, payload, messaging_service_sid: nil)
121
+ super(version)
122
+
123
+ # Marshaled Properties
124
+ @properties = {
125
+ 'domain_sid' => payload['domain_sid'],
126
+ 'config_sid' => payload['config_sid'],
127
+ 'messaging_service_sid' => payload['messaging_service_sid'],
128
+ 'fallback_url' => payload['fallback_url'],
129
+ 'callback_url' => payload['callback_url'],
130
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
131
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
132
+ 'url' => payload['url'],
133
+ }
134
+
135
+ # Context
136
+ @instance_context = nil
137
+ @params = {'messaging_service_sid' => messaging_service_sid || @properties['messaging_service_sid'], }
138
+ end
139
+
140
+ ##
141
+ # Generate an instance context for the instance, the context is capable of
142
+ # performing various actions. All instance actions are proxied to the context
143
+ # @return [DomainConfigMessagingServiceContext] DomainConfigMessagingServiceContext for this DomainConfigMessagingServiceInstance
144
+ def context
145
+ unless @instance_context
146
+ @instance_context = DomainConfigMessagingServiceContext.new(
147
+ @version,
148
+ @params['messaging_service_sid'],
149
+ )
150
+ end
151
+ @instance_context
152
+ end
153
+
154
+ ##
155
+ # @return [String] The unique string that we created to identify the Domain resource.
156
+ def domain_sid
157
+ @properties['domain_sid']
158
+ end
159
+
160
+ ##
161
+ # @return [String] The unique string that we created to identify the Domain config (prefix ZK).
162
+ def config_sid
163
+ @properties['config_sid']
164
+ end
165
+
166
+ ##
167
+ # @return [String] The unique string that identifies the messaging service
168
+ def messaging_service_sid
169
+ @properties['messaging_service_sid']
170
+ end
171
+
172
+ ##
173
+ # @return [String] We will redirect requests to urls we are unable to identify to this url.
174
+ def fallback_url
175
+ @properties['fallback_url']
176
+ end
177
+
178
+ ##
179
+ # @return [String] URL to receive click events to your webhook whenever the recipients click on the shortened links.
180
+ def callback_url
181
+ @properties['callback_url']
182
+ end
183
+
184
+ ##
185
+ # @return [Time] Date this Domain Config was created.
186
+ def date_created
187
+ @properties['date_created']
188
+ end
189
+
190
+ ##
191
+ # @return [Time] Date that this Domain Config was last updated.
192
+ def date_updated
193
+ @properties['date_updated']
194
+ end
195
+
196
+ ##
197
+ # @return [String] The url
198
+ def url
199
+ @properties['url']
200
+ end
201
+
202
+ ##
203
+ # Fetch the DomainConfigMessagingServiceInstance
204
+ # @return [DomainConfigMessagingServiceInstance] Fetched DomainConfigMessagingServiceInstance
205
+ def fetch
206
+ context.fetch
207
+ end
208
+
209
+ ##
210
+ # Provide a user friendly representation
211
+ def to_s
212
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
213
+ "<Twilio.Messaging.V1.DomainConfigMessagingServiceInstance #{values}>"
214
+ end
215
+
216
+ ##
217
+ # Provide a detailed, user friendly representation
218
+ def inspect
219
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
220
+ "<Twilio.Messaging.V1.DomainConfigMessagingServiceInstance #{values}>"
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,218 @@
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 Messaging < 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 LinkshorteningMessagingServiceList < ListResource
16
+ ##
17
+ # Initialize the LinkshorteningMessagingServiceList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [LinkshorteningMessagingServiceList] LinkshorteningMessagingServiceList
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.Messaging.V1.LinkshorteningMessagingServiceList>'
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 LinkshorteningMessagingServicePage < Page
37
+ ##
38
+ # Initialize the LinkshorteningMessagingServicePage
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 [LinkshorteningMessagingServicePage] LinkshorteningMessagingServicePage
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 LinkshorteningMessagingServiceInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [LinkshorteningMessagingServiceInstance] LinkshorteningMessagingServiceInstance
54
+ def get_instance(payload)
55
+ LinkshorteningMessagingServiceInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Messaging.V1.LinkshorteningMessagingServicePage>'
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 LinkshorteningMessagingServiceContext < InstanceContext
68
+ ##
69
+ # Initialize the LinkshorteningMessagingServiceContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] domain_sid The domain SID to dissociate from a messaging
72
+ # service. With URL shortening enabled, links in messages sent with the associated
73
+ # messaging service will be shortened to the provided domain
74
+ # @param [String] messaging_service_sid A messaging service SID to dissociate from
75
+ # a domain. With URL shortening enabled, links in messages sent with the provided
76
+ # messaging service will be shortened to the associated domain
77
+ # @return [LinkshorteningMessagingServiceContext] LinkshorteningMessagingServiceContext
78
+ def initialize(version, domain_sid, messaging_service_sid)
79
+ super(version)
80
+
81
+ # Path Solution
82
+ @solution = {domain_sid: domain_sid, messaging_service_sid: messaging_service_sid, }
83
+ @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/MessagingServices/#{@solution[:messaging_service_sid]}"
84
+ end
85
+
86
+ ##
87
+ # Create the LinkshorteningMessagingServiceInstance
88
+ # @return [LinkshorteningMessagingServiceInstance] Created LinkshorteningMessagingServiceInstance
89
+ def create
90
+ payload = @version.create('POST', @uri)
91
+
92
+ LinkshorteningMessagingServiceInstance.new(
93
+ @version,
94
+ payload,
95
+ domain_sid: @solution[:domain_sid],
96
+ messaging_service_sid: @solution[:messaging_service_sid],
97
+ )
98
+ end
99
+
100
+ ##
101
+ # Delete the LinkshorteningMessagingServiceInstance
102
+ # @return [Boolean] true if delete succeeds, false otherwise
103
+ def delete
104
+ @version.delete('DELETE', @uri)
105
+ end
106
+
107
+ ##
108
+ # Provide a user friendly representation
109
+ def to_s
110
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
111
+ "#<Twilio.Messaging.V1.LinkshorteningMessagingServiceContext #{context}>"
112
+ end
113
+
114
+ ##
115
+ # Provide a detailed, user friendly representation
116
+ def inspect
117
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
118
+ "#<Twilio.Messaging.V1.LinkshorteningMessagingServiceContext #{context}>"
119
+ end
120
+ end
121
+
122
+ ##
123
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
124
+ class LinkshorteningMessagingServiceInstance < InstanceResource
125
+ ##
126
+ # Initialize the LinkshorteningMessagingServiceInstance
127
+ # @param [Version] version Version that contains the resource
128
+ # @param [Hash] payload payload that contains response from Twilio
129
+ # @param [String] domain_sid The domain SID to dissociate from a messaging
130
+ # service. With URL shortening enabled, links in messages sent with the associated
131
+ # messaging service will be shortened to the provided domain
132
+ # @param [String] messaging_service_sid A messaging service SID to dissociate from
133
+ # a domain. With URL shortening enabled, links in messages sent with the provided
134
+ # messaging service will be shortened to the associated domain
135
+ # @return [LinkshorteningMessagingServiceInstance] LinkshorteningMessagingServiceInstance
136
+ def initialize(version, payload, domain_sid: nil, messaging_service_sid: nil)
137
+ super(version)
138
+
139
+ # Marshaled Properties
140
+ @properties = {
141
+ 'domain_sid' => payload['domain_sid'],
142
+ 'messaging_service_sid' => payload['messaging_service_sid'],
143
+ 'url' => payload['url'],
144
+ }
145
+
146
+ # Context
147
+ @instance_context = nil
148
+ @params = {
149
+ 'domain_sid' => domain_sid || @properties['domain_sid'],
150
+ 'messaging_service_sid' => messaging_service_sid || @properties['messaging_service_sid'],
151
+ }
152
+ end
153
+
154
+ ##
155
+ # Generate an instance context for the instance, the context is capable of
156
+ # performing various actions. All instance actions are proxied to the context
157
+ # @return [LinkshorteningMessagingServiceContext] LinkshorteningMessagingServiceContext for this LinkshorteningMessagingServiceInstance
158
+ def context
159
+ unless @instance_context
160
+ @instance_context = LinkshorteningMessagingServiceContext.new(
161
+ @version,
162
+ @params['domain_sid'],
163
+ @params['messaging_service_sid'],
164
+ )
165
+ end
166
+ @instance_context
167
+ end
168
+
169
+ ##
170
+ # @return [String] The unique string that identifies the domain resource
171
+ def domain_sid
172
+ @properties['domain_sid']
173
+ end
174
+
175
+ ##
176
+ # @return [String] The unique string that identifies the messaging service
177
+ def messaging_service_sid
178
+ @properties['messaging_service_sid']
179
+ end
180
+
181
+ ##
182
+ # @return [String] The url
183
+ def url
184
+ @properties['url']
185
+ end
186
+
187
+ ##
188
+ # Create the LinkshorteningMessagingServiceInstance
189
+ # @return [LinkshorteningMessagingServiceInstance] Created LinkshorteningMessagingServiceInstance
190
+ def create
191
+ context.create
192
+ end
193
+
194
+ ##
195
+ # Delete the LinkshorteningMessagingServiceInstance
196
+ # @return [Boolean] true if delete succeeds, false otherwise
197
+ def delete
198
+ context.delete
199
+ end
200
+
201
+ ##
202
+ # Provide a user friendly representation
203
+ def to_s
204
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
205
+ "<Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance #{values}>"
206
+ end
207
+
208
+ ##
209
+ # Provide a detailed, user friendly representation
210
+ def inspect
211
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
212
+ "<Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance #{values}>"
213
+ end
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end