Class: Twilio::REST::Messaging::V1::ServiceContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Messaging::V1::ServiceContext
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/service.rb,
lib/twilio-ruby/rest/messaging/v1/service/short_code.rb,
lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb,
lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb,
lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb,
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb,
lib/twilio-ruby/rest/messaging/v1/service/destination_alpha_sender.rb,
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb
Defined Under Namespace
Classes: AlphaSenderContext, AlphaSenderInstance, AlphaSenderList, AlphaSenderPage, ChannelSenderContext, ChannelSenderInstance, ChannelSenderList, ChannelSenderPage, DestinationAlphaSenderContext, DestinationAlphaSenderInstance, DestinationAlphaSenderList, DestinationAlphaSenderPage, PhoneNumberContext, PhoneNumberInstance, PhoneNumberList, PhoneNumberPage, ShortCodeContext, ShortCodeInstance, ShortCodeList, ShortCodePage, UsAppToPersonContext, UsAppToPersonInstance, UsAppToPersonList, UsAppToPersonPage, UsAppToPersonUsecaseInstance, UsAppToPersonUsecaseList, UsAppToPersonUsecasePage
Instance Method Summary collapse
-
#alpha_senders(sid = :unset) ⇒ AlphaSenderList, AlphaSenderContext
Access the alpha_senders.
-
#channel_senders(sid = :unset) ⇒ ChannelSenderList, ChannelSenderContext
Access the channel_senders.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#destination_alpha_senders(sid = :unset) ⇒ DestinationAlphaSenderList, DestinationAlphaSenderContext
Access the destination_alpha_senders.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#initialize(version, sid) ⇒ ServiceContext
constructor
Initialize the ServiceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#phone_numbers(sid = :unset) ⇒ PhoneNumberList, PhoneNumberContext
Access the phone_numbers.
-
#short_codes(sid = :unset) ⇒ ShortCodeList, ShortCodeContext
Access the short_codes.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, usecase: :unset, use_inbound_webhook_on_number: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#us_app_to_person(sid = :unset) ⇒ UsAppToPersonList, UsAppToPersonContext
Access the us_app_to_person.
-
#us_app_to_person_usecases ⇒ UsAppToPersonUsecaseList, UsAppToPersonUsecaseContext
Access the us_app_to_person_usecases.
Constructor Details
#initialize(version, sid) ⇒ ServiceContext
Initialize the ServiceContext
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 206 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Services/#{@solution[:sid]}" # Dependents @us_app_to_person_usecases = nil @short_codes = nil @us_app_to_person = nil @phone_numbers = nil @alpha_senders = nil @destination_alpha_senders = nil @channel_senders = nil end |
Instance Method Details
#alpha_senders(sid = :unset) ⇒ AlphaSenderList, AlphaSenderContext
Access the alpha_senders
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 396 def alpha_senders(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return AlphaSenderContext.new(@version, @solution[:sid],sid ) end unless @alpha_senders @alpha_senders = AlphaSenderList.new( @version, service_sid: @solution[:sid], ) end @alpha_senders end |
#channel_senders(sid = :unset) ⇒ ChannelSenderList, ChannelSenderContext
Access the channel_senders
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 434 def channel_senders(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ChannelSenderContext.new(@version, @solution[:sid],sid ) end unless @channel_senders @channel_senders = ChannelSenderList.new( @version, messaging_service_sid: @solution[:sid], ) end @channel_senders end |
#delete ⇒ Boolean
Delete the ServiceInstance
225 226 227 228 229 230 231 232 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 225 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#destination_alpha_senders(sid = :unset) ⇒ DestinationAlphaSenderList, DestinationAlphaSenderContext
Access the destination_alpha_senders
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 415 def destination_alpha_senders(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return DestinationAlphaSenderContext.new(@version, @solution[:sid],sid ) end unless @destination_alpha_senders @destination_alpha_senders = DestinationAlphaSenderList.new( @version, service_sid: @solution[:sid], ) end @destination_alpha_senders end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 237 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
459 460 461 462 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 459 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.ServiceContext #{context}>" end |
#phone_numbers(sid = :unset) ⇒ PhoneNumberList, PhoneNumberContext
Access the phone_numbers
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 377 def phone_numbers(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return PhoneNumberContext.new(@version, @solution[:sid],sid ) end unless @phone_numbers @phone_numbers = PhoneNumberList.new( @version, service_sid: @solution[:sid], ) end @phone_numbers end |
#short_codes(sid = :unset) ⇒ ShortCodeList, ShortCodeContext
Access the short_codes
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 339 def short_codes(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ShortCodeContext.new(@version, @solution[:sid],sid ) end unless @short_codes @short_codes = ShortCodeList.new( @version, service_sid: @solution[:sid], ) end @short_codes end |
#to_s ⇒ Object
Provide a user friendly representation
452 453 454 455 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 452 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.ServiceContext #{context}>" end |
#update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, usecase: :unset, use_inbound_webhook_on_number: :unset) ⇒ ServiceInstance
Update the ServiceInstance
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 272 def update( friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, usecase: :unset, use_inbound_webhook_on_number: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'InboundRequestUrl' => inbound_request_url, 'InboundMethod' => inbound_method, 'FallbackUrl' => fallback_url, 'FallbackMethod' => fallback_method, 'StatusCallback' => status_callback, 'StickySender' => sticky_sender, 'MmsConverter' => mms_converter, 'SmartEncoding' => smart_encoding, 'ScanMessageContent' => , 'FallbackToLongCode' => fallback_to_long_code, 'AreaCodeGeomatch' => area_code_geomatch, 'ValidityPeriod' => validity_period, 'SynchronousValidation' => synchronous_validation, 'Usecase' => usecase, 'UseInboundWebhookOnNumber' => use_inbound_webhook_on_number, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#us_app_to_person(sid = :unset) ⇒ UsAppToPersonList, UsAppToPersonContext
Access the us_app_to_person
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 358 def us_app_to_person(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return UsAppToPersonContext.new(@version, @solution[:sid],sid ) end unless @us_app_to_person @us_app_to_person = UsAppToPersonList.new( @version, messaging_service_sid: @solution[:sid], ) end @us_app_to_person end |
#us_app_to_person_usecases ⇒ UsAppToPersonUsecaseList, UsAppToPersonUsecaseContext
Access the us_app_to_person_usecases
328 329 330 331 332 333 334 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 328 def us_app_to_person_usecases unless @us_app_to_person_usecases @us_app_to_person_usecases = UsAppToPersonUsecaseList.new( @version, messaging_service_sid: @solution[:sid], ) end @us_app_to_person_usecases end |