Class: Twilio::REST::Notify::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Notify::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/notify/v1/service.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
-
#alexa_skill_id ⇒ String
Deprecated.
-
#apn_credential_sid ⇒ String
The SID of the [Credential](www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings.
-
#bindings ⇒ bindings
Access the bindings.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#default_alexa_notification_protocol_version ⇒ String
Deprecated.
-
#default_apn_notification_protocol_version ⇒ String
The protocol version to use for sending APNS notifications.
-
#default_fcm_notification_protocol_version ⇒ String
The protocol version to use for sending FCM notifications.
-
#default_gcm_notification_protocol_version ⇒ String
The protocol version to use for sending GCM notifications.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#delivery_callback_enabled ⇒ Boolean
Callback configuration that enables delivery callbacks, default false.
-
#delivery_callback_url ⇒ String
URL to send delivery status callback.
-
#facebook_messenger_page_id ⇒ String
Deprecated.
-
#fcm_credential_sid ⇒ String
The SID of the [Credential](www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#gcm_credential_sid ⇒ String
The SID of the [Credential](www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of the Binding, Notification, Segment, and User resources related to the service.
-
#log_enabled ⇒ Boolean
Whether to log notifications.
-
#messaging_service_sid ⇒ String
The SID of the [Messaging Service](www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings.
-
#notifications ⇒ notifications
Access the notifications.
-
#sid ⇒ String
The unique string that we created to identify the Service resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the Service resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 725 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'apn_credential_sid' => payload['apn_credential_sid'], 'gcm_credential_sid' => payload['gcm_credential_sid'], 'fcm_credential_sid' => payload['fcm_credential_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'facebook_messenger_page_id' => payload['facebook_messenger_page_id'], 'default_apn_notification_protocol_version' => payload['default_apn_notification_protocol_version'], 'default_gcm_notification_protocol_version' => payload['default_gcm_notification_protocol_version'], 'default_fcm_notification_protocol_version' => payload['default_fcm_notification_protocol_version'], 'log_enabled' => payload['log_enabled'], 'url' => payload['url'], 'links' => payload['links'], 'alexa_skill_id' => payload['alexa_skill_id'], 'default_alexa_notification_protocol_version' => payload['default_alexa_notification_protocol_version'], 'delivery_callback_url' => payload['delivery_callback_url'], 'delivery_callback_enabled' => payload['delivery_callback_enabled'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
777 778 779 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 777 def account_sid @properties['account_sid'] end |
#alexa_skill_id ⇒ String
Returns Deprecated.
867 868 869 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 867 def alexa_skill_id @properties['alexa_skill_id'] end |
#apn_credential_sid ⇒ String
Returns The SID of the [Credential](www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings.
801 802 803 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 801 def apn_credential_sid @properties['apn_credential_sid'] end |
#bindings ⇒ bindings
Access the bindings
967 968 969 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 967 def bindings context.bindings end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
762 763 764 765 766 767 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 762 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
789 790 791 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 789 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
795 796 797 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 795 def date_updated @properties['date_updated'] end |
#default_alexa_notification_protocol_version ⇒ String
Returns Deprecated.
873 874 875 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 873 def default_alexa_notification_protocol_version @properties['default_alexa_notification_protocol_version'] end |
#default_apn_notification_protocol_version ⇒ String
Returns The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](www.twilio.com/docs/notify/api/binding-resource) resource.
831 832 833 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 831 def default_apn_notification_protocol_version @properties['default_apn_notification_protocol_version'] end |
#default_fcm_notification_protocol_version ⇒ String
Returns The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](www.twilio.com/docs/notify/api/binding-resource) resource.
843 844 845 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 843 def default_fcm_notification_protocol_version @properties['default_fcm_notification_protocol_version'] end |
#default_gcm_notification_protocol_version ⇒ String
Returns The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](www.twilio.com/docs/notify/api/binding-resource) resource.
837 838 839 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 837 def default_gcm_notification_protocol_version @properties['default_gcm_notification_protocol_version'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
892 893 894 895 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 892 def delete context.delete end |
#delivery_callback_enabled ⇒ Boolean
Returns Callback configuration that enables delivery callbacks, default false.
885 886 887 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 885 def delivery_callback_enabled @properties['delivery_callback_enabled'] end |
#delivery_callback_url ⇒ String
Returns URL to send delivery status callback.
879 880 881 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 879 def delivery_callback_url @properties['delivery_callback_url'] end |
#facebook_messenger_page_id ⇒ String
Returns Deprecated.
825 826 827 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 825 def facebook_messenger_page_id @properties['facebook_messenger_page_id'] end |
#fcm_credential_sid ⇒ String
Returns The SID of the [Credential](www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings.
813 814 815 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 813 def fcm_credential_sid @properties['fcm_credential_sid'] end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
900 901 902 903 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 900 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
783 784 785 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 783 def friendly_name @properties['friendly_name'] end |
#gcm_credential_sid ⇒ String
Returns The SID of the [Credential](www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings.
807 808 809 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 807 def gcm_credential_sid @properties['gcm_credential_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
980 981 982 983 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 980 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.ServiceInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of the Binding, Notification, Segment, and User resources related to the service.
861 862 863 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 861 def links @properties['links'] end |
#log_enabled ⇒ Boolean
Returns Whether to log notifications. Can be: ‘true` or `false` and the default is `true`.
849 850 851 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 849 def log_enabled @properties['log_enabled'] end |
#messaging_service_sid ⇒ String
Returns The SID of the [Messaging Service](www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set.
819 820 821 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 819 def messaging_service_sid @properties['messaging_service_sid'] end |
#notifications ⇒ notifications
Access the notifications
960 961 962 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 960 def notifications context.notifications end |
#sid ⇒ String
Returns The unique string that we created to identify the Service resource.
771 772 773 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 771 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
973 974 975 976 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 973 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.ServiceInstance #{values}>" end |
#update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 922 def update( friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset ) context.update( friendly_name: friendly_name, apn_credential_sid: apn_credential_sid, gcm_credential_sid: gcm_credential_sid, messaging_service_sid: messaging_service_sid, facebook_messenger_page_id: facebook_messenger_page_id, default_apn_notification_protocol_version: default_apn_notification_protocol_version, default_gcm_notification_protocol_version: default_gcm_notification_protocol_version, fcm_credential_sid: fcm_credential_sid, default_fcm_notification_protocol_version: default_fcm_notification_protocol_version, log_enabled: log_enabled, alexa_skill_id: alexa_skill_id, default_alexa_notification_protocol_version: default_alexa_notification_protocol_version, delivery_callback_url: delivery_callback_url, delivery_callback_enabled: delivery_callback_enabled, ) end |
#url ⇒ String
Returns The absolute URL of the Service resource.
855 856 857 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 855 def url @properties['url'] end |