class Twilio::REST::IpMessaging::V1::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/v1/service.rb
418 def initialize(version, payload, sid: nil)
419   super(version)
420 
421   # Marshaled Properties
422   @properties = {
423       'sid' => payload['sid'],
424       'account_sid' => payload['account_sid'],
425       'friendly_name' => payload['friendly_name'],
426       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
427       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
428       'default_service_role_sid' => payload['default_service_role_sid'],
429       'default_channel_role_sid' => payload['default_channel_role_sid'],
430       'default_channel_creator_role_sid' => payload['default_channel_creator_role_sid'],
431       'read_status_enabled' => payload['read_status_enabled'],
432       'reachability_enabled' => payload['reachability_enabled'],
433       'typing_indicator_timeout' => payload['typing_indicator_timeout'].to_i,
434       'consumption_report_interval' => payload['consumption_report_interval'].to_i,
435       'limits' => payload['limits'],
436       'webhooks' => payload['webhooks'],
437       'pre_webhook_url' => payload['pre_webhook_url'],
438       'post_webhook_url' => payload['post_webhook_url'],
439       'webhook_method' => payload['webhook_method'],
440       'webhook_filters' => payload['webhook_filters'],
441       'notifications' => payload['notifications'],
442       'url' => payload['url'],
443       'links' => payload['links'],
444   }
445 
446   # Context
447   @instance_context = nil
448   @params = {'sid' => sid || @properties['sid'], }
449 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
470 def account_sid
471   @properties['account_sid']
472 end
channels() click to toggle source

Access the channels @return [channels] channels

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
754 def channels
755   context.channels
756 end
consumption_report_interval() click to toggle source

@return [String] The consumption_report_interval

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
530 def consumption_report_interval
531   @properties['consumption_report_interval']
532 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/v1/service.rb
455 def context
456   unless @instance_context
457     @instance_context = ServiceContext.new(@version, @params['sid'], )
458   end
459   @instance_context
460 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
482 def date_created
483   @properties['date_created']
484 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
488 def date_updated
489   @properties['date_updated']
490 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/v1/service.rb
506 def default_channel_creator_role_sid
507   @properties['default_channel_creator_role_sid']
508 end
default_channel_role_sid() click to toggle source

@return [String] The default_channel_role_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
500 def default_channel_role_sid
501   @properties['default_channel_role_sid']
502 end
default_service_role_sid() click to toggle source

@return [String] The default_service_role_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
494 def default_service_role_sid
495   @properties['default_service_role_sid']
496 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
598 def delete
599   context.delete
600 end
fetch() click to toggle source

Fetch the ServiceInstance @return [ServiceInstance] Fetched ServiceInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
591 def fetch
592   context.fetch
593 end
friendly_name() click to toggle source

@return [String] The friendly_name

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
476 def friendly_name
477   @properties['friendly_name']
478 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
781 def inspect
782   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
783   "<Twilio.IpMessaging.V1.ServiceInstance #{values}>"
784 end
limits() click to toggle source

@return [Hash] The limits

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
536 def limits
537   @properties['limits']
538 end
notifications() click to toggle source

@return [Hash] The notifications

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
572 def notifications
573   @properties['notifications']
574 end
post_webhook_url() click to toggle source

@return [String] The post_webhook_url

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
554 def post_webhook_url
555   @properties['post_webhook_url']
556 end
pre_webhook_url() click to toggle source

@return [String] The pre_webhook_url

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
548 def pre_webhook_url
549   @properties['pre_webhook_url']
550 end
reachability_enabled() click to toggle source

@return [Boolean] The reachability_enabled

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
518 def reachability_enabled
519   @properties['reachability_enabled']
520 end
read_status_enabled() click to toggle source

@return [Boolean] The read_status_enabled

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
512 def read_status_enabled
513   @properties['read_status_enabled']
514 end
roles() click to toggle source

Access the roles @return [roles] roles

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
761 def roles
762   context.roles
763 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
464 def sid
465   @properties['sid']
466 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
774 def to_s
775   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
776   "<Twilio.IpMessaging.V1.ServiceInstance #{values}>"
777 end
typing_indicator_timeout() click to toggle source

@return [String] The typing_indicator_timeout

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
524 def typing_indicator_timeout
525   @properties['typing_indicator_timeout']
526 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_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, webhooks_on_message_send_url: :unset, webhooks_on_message_send_method: :unset, webhooks_on_message_update_url: :unset, webhooks_on_message_update_method: :unset, webhooks_on_message_remove_url: :unset, webhooks_on_message_remove_method: :unset, webhooks_on_channel_add_url: :unset, webhooks_on_channel_add_method: :unset, webhooks_on_channel_destroy_url: :unset, webhooks_on_channel_destroy_method: :unset, webhooks_on_channel_update_url: :unset, webhooks_on_channel_update_method: :unset, webhooks_on_member_add_url: :unset, webhooks_on_member_add_method: :unset, webhooks_on_member_remove_url: :unset, webhooks_on_member_remove_method: :unset, webhooks_on_message_sent_url: :unset, webhooks_on_message_sent_method: :unset, webhooks_on_message_updated_url: :unset, webhooks_on_message_updated_method: :unset, webhooks_on_message_removed_url: :unset, webhooks_on_message_removed_method: :unset, webhooks_on_channel_added_url: :unset, webhooks_on_channel_added_method: :unset, webhooks_on_channel_destroyed_url: :unset, webhooks_on_channel_destroyed_method: :unset, webhooks_on_channel_updated_url: :unset, webhooks_on_channel_updated_method: :unset, webhooks_on_member_added_url: :unset, webhooks_on_member_added_method: :unset, webhooks_on_member_removed_url: :unset, webhooks_on_member_removed_method: :unset, limits_channel_members: :unset, limits_user_channels: :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 [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 [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 [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] 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] webhooks_on_message_send_url The webhooks.on_message_send.url @param [String] webhooks_on_message_send_method The

webhooks.on_message_send.method

@param [String] webhooks_on_message_update_url The

webhooks.on_message_update.url

@param [String] webhooks_on_message_update_method The

webhooks.on_message_update.method

@param [String] webhooks_on_message_remove_url The

webhooks.on_message_remove.url

@param [String] webhooks_on_message_remove_method The

webhooks.on_message_remove.method

@param [String] webhooks_on_channel_add_url The webhooks.on_channel_add.url @param [String] webhooks_on_channel_add_method The

webhooks.on_channel_add.method

@param [String] webhooks_on_channel_destroy_url The

webhooks.on_channel_destroy.url

@param [String] webhooks_on_channel_destroy_method The

webhooks.on_channel_destroy.method

@param [String] webhooks_on_channel_update_url The

webhooks.on_channel_update.url

@param [String] webhooks_on_channel_update_method The

webhooks.on_channel_update.method

@param [String] webhooks_on_member_add_url The webhooks.on_member_add.url @param [String] webhooks_on_member_add_method The webhooks.on_member_add.method @param [String] webhooks_on_member_remove_url The webhooks.on_member_remove.url @param [String] webhooks_on_member_remove_method The

webhooks.on_member_remove.method

@param [String] webhooks_on_message_sent_url The webhooks.on_message_sent.url @param [String] webhooks_on_message_sent_method The

webhooks.on_message_sent.method

@param [String] webhooks_on_message_updated_url The

webhooks.on_message_updated.url

@param [String] webhooks_on_message_updated_method The

webhooks.on_message_updated.method

@param [String] webhooks_on_message_removed_url The

webhooks.on_message_removed.url

@param [String] webhooks_on_message_removed_method The

webhooks.on_message_removed.method

@param [String] webhooks_on_channel_added_url The webhooks.on_channel_added.url @param [String] webhooks_on_channel_added_method The

webhooks.on_channel_added.method

@param [String] webhooks_on_channel_destroyed_url The

webhooks.on_channel_destroyed.url

@param [String] webhooks_on_channel_destroyed_method The

webhooks.on_channel_destroyed.method

@param [String] webhooks_on_channel_updated_url The

webhooks.on_channel_updated.url

@param [String] webhooks_on_channel_updated_method The

webhooks.on_channel_updated.method

@param [String] webhooks_on_member_added_url The webhooks.on_member_added.url @param [String] webhooks_on_member_added_method The

webhooks.on_member_added.method

@param [String] webhooks_on_member_removed_url The

webhooks.on_member_removed.url

@param [String] webhooks_on_member_removed_method The

webhooks.on_member_removed.method

@param [String] limits_channel_members The limits.channel_members @param [String] limits_user_channels The limits.user_channels @return [ServiceInstance] Updated ServiceInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
692 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_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, webhooks_on_message_send_url: :unset, webhooks_on_message_send_method: :unset, webhooks_on_message_update_url: :unset, webhooks_on_message_update_method: :unset, webhooks_on_message_remove_url: :unset, webhooks_on_message_remove_method: :unset, webhooks_on_channel_add_url: :unset, webhooks_on_channel_add_method: :unset, webhooks_on_channel_destroy_url: :unset, webhooks_on_channel_destroy_method: :unset, webhooks_on_channel_update_url: :unset, webhooks_on_channel_update_method: :unset, webhooks_on_member_add_url: :unset, webhooks_on_member_add_method: :unset, webhooks_on_member_remove_url: :unset, webhooks_on_member_remove_method: :unset, webhooks_on_message_sent_url: :unset, webhooks_on_message_sent_method: :unset, webhooks_on_message_updated_url: :unset, webhooks_on_message_updated_method: :unset, webhooks_on_message_removed_url: :unset, webhooks_on_message_removed_method: :unset, webhooks_on_channel_added_url: :unset, webhooks_on_channel_added_method: :unset, webhooks_on_channel_destroyed_url: :unset, webhooks_on_channel_destroyed_method: :unset, webhooks_on_channel_updated_url: :unset, webhooks_on_channel_updated_method: :unset, webhooks_on_member_added_url: :unset, webhooks_on_member_added_method: :unset, webhooks_on_member_removed_url: :unset, webhooks_on_member_removed_method: :unset, limits_channel_members: :unset, limits_user_channels: :unset)
693   context.update(
694       friendly_name: friendly_name,
695       default_service_role_sid: default_service_role_sid,
696       default_channel_role_sid: default_channel_role_sid,
697       default_channel_creator_role_sid: default_channel_creator_role_sid,
698       read_status_enabled: read_status_enabled,
699       reachability_enabled: reachability_enabled,
700       typing_indicator_timeout: typing_indicator_timeout,
701       consumption_report_interval: consumption_report_interval,
702       notifications_new_message_enabled: notifications_new_message_enabled,
703       notifications_new_message_template: notifications_new_message_template,
704       notifications_added_to_channel_enabled: notifications_added_to_channel_enabled,
705       notifications_added_to_channel_template: notifications_added_to_channel_template,
706       notifications_removed_from_channel_enabled: notifications_removed_from_channel_enabled,
707       notifications_removed_from_channel_template: notifications_removed_from_channel_template,
708       notifications_invited_to_channel_enabled: notifications_invited_to_channel_enabled,
709       notifications_invited_to_channel_template: notifications_invited_to_channel_template,
710       pre_webhook_url: pre_webhook_url,
711       post_webhook_url: post_webhook_url,
712       webhook_method: webhook_method,
713       webhook_filters: webhook_filters,
714       webhooks_on_message_send_url: webhooks_on_message_send_url,
715       webhooks_on_message_send_method: webhooks_on_message_send_method,
716       webhooks_on_message_update_url: webhooks_on_message_update_url,
717       webhooks_on_message_update_method: webhooks_on_message_update_method,
718       webhooks_on_message_remove_url: webhooks_on_message_remove_url,
719       webhooks_on_message_remove_method: webhooks_on_message_remove_method,
720       webhooks_on_channel_add_url: webhooks_on_channel_add_url,
721       webhooks_on_channel_add_method: webhooks_on_channel_add_method,
722       webhooks_on_channel_destroy_url: webhooks_on_channel_destroy_url,
723       webhooks_on_channel_destroy_method: webhooks_on_channel_destroy_method,
724       webhooks_on_channel_update_url: webhooks_on_channel_update_url,
725       webhooks_on_channel_update_method: webhooks_on_channel_update_method,
726       webhooks_on_member_add_url: webhooks_on_member_add_url,
727       webhooks_on_member_add_method: webhooks_on_member_add_method,
728       webhooks_on_member_remove_url: webhooks_on_member_remove_url,
729       webhooks_on_member_remove_method: webhooks_on_member_remove_method,
730       webhooks_on_message_sent_url: webhooks_on_message_sent_url,
731       webhooks_on_message_sent_method: webhooks_on_message_sent_method,
732       webhooks_on_message_updated_url: webhooks_on_message_updated_url,
733       webhooks_on_message_updated_method: webhooks_on_message_updated_method,
734       webhooks_on_message_removed_url: webhooks_on_message_removed_url,
735       webhooks_on_message_removed_method: webhooks_on_message_removed_method,
736       webhooks_on_channel_added_url: webhooks_on_channel_added_url,
737       webhooks_on_channel_added_method: webhooks_on_channel_added_method,
738       webhooks_on_channel_destroyed_url: webhooks_on_channel_destroyed_url,
739       webhooks_on_channel_destroyed_method: webhooks_on_channel_destroyed_method,
740       webhooks_on_channel_updated_url: webhooks_on_channel_updated_url,
741       webhooks_on_channel_updated_method: webhooks_on_channel_updated_method,
742       webhooks_on_member_added_url: webhooks_on_member_added_url,
743       webhooks_on_member_added_method: webhooks_on_member_added_method,
744       webhooks_on_member_removed_url: webhooks_on_member_removed_url,
745       webhooks_on_member_removed_method: webhooks_on_member_removed_method,
746       limits_channel_members: limits_channel_members,
747       limits_user_channels: limits_user_channels,
748   )
749 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
578 def url
579   @properties['url']
580 end
users() click to toggle source

Access the users @return [users] users

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
768 def users
769   context.users
770 end
webhook_filters() click to toggle source

@return [Array] The webhook_filters

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
566 def webhook_filters
567   @properties['webhook_filters']
568 end
webhook_method() click to toggle source

@return [String] The webhook_method

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
560 def webhook_method
561   @properties['webhook_method']
562 end
webhooks() click to toggle source

@return [Hash] The webhooks

    # File lib/twilio-ruby/rest/ip_messaging/v1/service.rb
542 def webhooks
543   @properties['webhooks']
544 end