class Twilio::REST::IpMessaging::V2::ServiceInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the ServiceInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The sid @return [ServiceInstance] ServiceInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
372 def initialize(version, payload, sid: nil)
373   super(version)
374 
375   # Marshaled Properties
376   @properties = {
377       'sid' => payload['sid'],
378       'account_sid' => payload['account_sid'],
379       'friendly_name' => payload['friendly_name'],
380       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
381       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
382       'default_service_role_sid' => payload['default_service_role_sid'],
383       'default_channel_role_sid' => payload['default_channel_role_sid'],
384       'default_channel_creator_role_sid' => payload['default_channel_creator_role_sid'],
385       'read_status_enabled' => payload['read_status_enabled'],
386       'reachability_enabled' => payload['reachability_enabled'],
387       'typing_indicator_timeout' => payload['typing_indicator_timeout'].to_i,
388       'consumption_report_interval' => payload['consumption_report_interval'].to_i,
389       'limits' => payload['limits'],
390       'pre_webhook_url' => payload['pre_webhook_url'],
391       'post_webhook_url' => payload['post_webhook_url'],
392       'webhook_method' => payload['webhook_method'],
393       'webhook_filters' => payload['webhook_filters'],
394       'pre_webhook_retry_count' => payload['pre_webhook_retry_count'].to_i,
395       'post_webhook_retry_count' => payload['post_webhook_retry_count'].to_i,
396       'notifications' => payload['notifications'],
397       'media' => payload['media'],
398       'url' => payload['url'],
399       'links' => payload['links'],
400   }
401 
402   # Context
403   @instance_context = nil
404   @params = {'sid' => sid || @properties['sid'], }
405 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
426 def account_sid
427   @properties['account_sid']
428 end
bindings() click to toggle source

Access the bindings @return [bindings] bindings

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
678 def bindings
679   context.bindings
680 end
channels() click to toggle source

Access the channels @return [channels] channels

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
657 def channels
658   context.channels
659 end
consumption_report_interval() click to toggle source

@return [String] The consumption_report_interval

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
486 def consumption_report_interval
487   @properties['consumption_report_interval']
488 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ServiceContext] ServiceContext for this ServiceInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
411 def context
412   unless @instance_context
413     @instance_context = ServiceContext.new(@version, @params['sid'], )
414   end
415   @instance_context
416 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
438 def date_created
439   @properties['date_created']
440 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
444 def date_updated
445   @properties['date_updated']
446 end
default_channel_creator_role_sid() click to toggle source

@return [String] The default_channel_creator_role_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
462 def default_channel_creator_role_sid
463   @properties['default_channel_creator_role_sid']
464 end
default_channel_role_sid() click to toggle source

@return [String] The default_channel_role_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
456 def default_channel_role_sid
457   @properties['default_channel_role_sid']
458 end
default_service_role_sid() click to toggle source

@return [String] The default_service_role_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
450 def default_service_role_sid
451   @properties['default_service_role_sid']
452 end
delete() click to toggle source

Delete the ServiceInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
566 def delete
567   context.delete
568 end
fetch() click to toggle source

Fetch the ServiceInstance @return [ServiceInstance] Fetched ServiceInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
559 def fetch
560   context.fetch
561 end
friendly_name() click to toggle source

@return [String] The friendly_name

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
432 def friendly_name
433   @properties['friendly_name']
434 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
691 def inspect
692   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
693   "<Twilio.IpMessaging.V2.ServiceInstance #{values}>"
694 end
limits() click to toggle source

@return [Hash] The limits

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
492 def limits
493   @properties['limits']
494 end
media() click to toggle source

@return [Hash] The media

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
540 def media
541   @properties['media']
542 end
notifications() click to toggle source

@return [Hash] The notifications

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
534 def notifications
535   @properties['notifications']
536 end
post_webhook_retry_count() click to toggle source

@return [String] The post_webhook_retry_count

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
528 def post_webhook_retry_count
529   @properties['post_webhook_retry_count']
530 end
post_webhook_url() click to toggle source

@return [String] The post_webhook_url

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
504 def post_webhook_url
505   @properties['post_webhook_url']
506 end
pre_webhook_retry_count() click to toggle source

@return [String] The pre_webhook_retry_count

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
522 def pre_webhook_retry_count
523   @properties['pre_webhook_retry_count']
524 end
pre_webhook_url() click to toggle source

@return [String] The pre_webhook_url

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
498 def pre_webhook_url
499   @properties['pre_webhook_url']
500 end
reachability_enabled() click to toggle source

@return [Boolean] The reachability_enabled

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
474 def reachability_enabled
475   @properties['reachability_enabled']
476 end
read_status_enabled() click to toggle source

@return [Boolean] The read_status_enabled

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
468 def read_status_enabled
469   @properties['read_status_enabled']
470 end
roles() click to toggle source

Access the roles @return [roles] roles

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
664 def roles
665   context.roles
666 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
420 def sid
421   @properties['sid']
422 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
684 def to_s
685   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
686   "<Twilio.IpMessaging.V2.ServiceInstance #{values}>"
687 end
typing_indicator_timeout() click to toggle source

@return [String] The typing_indicator_timeout

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
480 def typing_indicator_timeout
481   @properties['typing_indicator_timeout']
482 end
update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset, media_compatibility_message: :unset, pre_webhook_retry_count: :unset, post_webhook_retry_count: :unset, notifications_log_enabled: :unset) click to toggle source

Update the ServiceInstance @param [String] friendly_name The friendly_name @param [String] default_service_role_sid The default_service_role_sid @param [String] default_channel_role_sid The default_channel_role_sid @param [String] default_channel_creator_role_sid The

default_channel_creator_role_sid

@param [Boolean] read_status_enabled The read_status_enabled @param [Boolean] reachability_enabled The reachability_enabled @param [String] typing_indicator_timeout The typing_indicator_timeout @param [String] consumption_report_interval The consumption_report_interval @param [Boolean] notifications_new_message_enabled The

notifications.new_message.enabled

@param [String] notifications_new_message_template The

notifications.new_message.template

@param [String] notifications_new_message_sound The

notifications.new_message.sound

@param [Boolean] notifications_new_message_badge_count_enabled The

notifications.new_message.badge_count_enabled

@param [Boolean] notifications_added_to_channel_enabled The

notifications.added_to_channel.enabled

@param [String] notifications_added_to_channel_template The

notifications.added_to_channel.template

@param [String] notifications_added_to_channel_sound The

notifications.added_to_channel.sound

@param [Boolean] notifications_removed_from_channel_enabled The

notifications.removed_from_channel.enabled

@param [String] notifications_removed_from_channel_template The

notifications.removed_from_channel.template

@param [String] notifications_removed_from_channel_sound The

notifications.removed_from_channel.sound

@param [Boolean] notifications_invited_to_channel_enabled The

notifications.invited_to_channel.enabled

@param [String] notifications_invited_to_channel_template The

notifications.invited_to_channel.template

@param [String] notifications_invited_to_channel_sound The

notifications.invited_to_channel.sound

@param [String] pre_webhook_url The pre_webhook_url @param [String] post_webhook_url The post_webhook_url @param [String] webhook_method The webhook_method @param [Array] webhook_filters The webhook_filters @param [String] limits_channel_members The limits.channel_members @param [String] limits_user_channels The limits.user_channels @param [String] media_compatibility_message The media.compatibility_message @param [String] pre_webhook_retry_count The pre_webhook_retry_count @param [String] post_webhook_retry_count The post_webhook_retry_count @param [Boolean] notifications_log_enabled The notifications.log_enabled @return [ServiceInstance] Updated ServiceInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
618 def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset, media_compatibility_message: :unset, pre_webhook_retry_count: :unset, post_webhook_retry_count: :unset, notifications_log_enabled: :unset)
619   context.update(
620       friendly_name: friendly_name,
621       default_service_role_sid: default_service_role_sid,
622       default_channel_role_sid: default_channel_role_sid,
623       default_channel_creator_role_sid: default_channel_creator_role_sid,
624       read_status_enabled: read_status_enabled,
625       reachability_enabled: reachability_enabled,
626       typing_indicator_timeout: typing_indicator_timeout,
627       consumption_report_interval: consumption_report_interval,
628       notifications_new_message_enabled: notifications_new_message_enabled,
629       notifications_new_message_template: notifications_new_message_template,
630       notifications_new_message_sound: notifications_new_message_sound,
631       notifications_new_message_badge_count_enabled: notifications_new_message_badge_count_enabled,
632       notifications_added_to_channel_enabled: notifications_added_to_channel_enabled,
633       notifications_added_to_channel_template: notifications_added_to_channel_template,
634       notifications_added_to_channel_sound: notifications_added_to_channel_sound,
635       notifications_removed_from_channel_enabled: notifications_removed_from_channel_enabled,
636       notifications_removed_from_channel_template: notifications_removed_from_channel_template,
637       notifications_removed_from_channel_sound: notifications_removed_from_channel_sound,
638       notifications_invited_to_channel_enabled: notifications_invited_to_channel_enabled,
639       notifications_invited_to_channel_template: notifications_invited_to_channel_template,
640       notifications_invited_to_channel_sound: notifications_invited_to_channel_sound,
641       pre_webhook_url: pre_webhook_url,
642       post_webhook_url: post_webhook_url,
643       webhook_method: webhook_method,
644       webhook_filters: webhook_filters,
645       limits_channel_members: limits_channel_members,
646       limits_user_channels: limits_user_channels,
647       media_compatibility_message: media_compatibility_message,
648       pre_webhook_retry_count: pre_webhook_retry_count,
649       post_webhook_retry_count: post_webhook_retry_count,
650       notifications_log_enabled: notifications_log_enabled,
651   )
652 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
546 def url
547   @properties['url']
548 end
users() click to toggle source

Access the users @return [users] users

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
671 def users
672   context.users
673 end
webhook_filters() click to toggle source

@return [Array] The webhook_filters

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
516 def webhook_filters
517   @properties['webhook_filters']
518 end
webhook_method() click to toggle source

@return [String] The webhook_method

    # File lib/twilio-ruby/rest/ip_messaging/v2/service.rb
510 def webhook_method
511   @properties['webhook_method']
512 end