Class: Twilio::REST::Verify::V2::ServiceContext::EntityContext::ChallengeContext::NotificationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, identity: nil, challenge_sid: nil) ⇒ NotificationInstance

Initialize the NotificationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Notification resource.

  • sid (String)

    The SID of the Call resource to fetch.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 107

def initialize(version, payload , service_sid: nil, identity: nil, challenge_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'entity_sid' => payload['entity_sid'],
        'identity' => payload['identity'],
        'challenge_sid' => payload['challenge_sid'],
        'priority' => payload['priority'],
        'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i,
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
    }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



133
134
135
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 133

def 
    @properties['account_sid']
end

#challenge_sidString

Returns The unique SID identifier of the Challenge.

Returns:

  • (String)

    The unique SID identifier of the Challenge.



157
158
159
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 157

def challenge_sid
    @properties['challenge_sid']
end

#date_createdTime

Returns The date that this Notification was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



175
176
177
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 175

def date_created
    @properties['date_created']
end

#entity_sidString

Returns The unique SID identifier of the Entity.

Returns:

  • (String)

    The unique SID identifier of the Entity.



145
146
147
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 145

def entity_sid
    @properties['entity_sid']
end

#identityString

Returns Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user’s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.

Returns:

  • (String)

    Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user’s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.



151
152
153
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 151

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



187
188
189
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 187

def inspect
    "<Twilio.Verify.V2.NotificationInstance>"
end

#priorityString

Returns The priority of the notification. For ‘push` Challenges it’s always ‘high` which sends the notification immediately, and can wake up a sleeping device.

Returns:

  • (String)

    The priority of the notification. For ‘push` Challenges it’s always ‘high` which sends the notification immediately, and can wake up a sleeping device.



163
164
165
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 163

def priority
    @properties['priority']
end

#service_sidString

Returns The unique SID identifier of the Service.

Returns:

  • (String)

    The unique SID identifier of the Service.



139
140
141
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 139

def service_sid
    @properties['service_sid']
end

#sidString

Returns A 34 character string that uniquely identifies this Notification.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Notification.



127
128
129
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 127

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



181
182
183
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 181

def to_s
    "<Twilio.Verify.V2.NotificationInstance>"
end

#ttlString

Returns How long, in seconds, the notification is valid. Max: 5 minutes.

Returns:

  • (String)

    How long, in seconds, the notification is valid. Max: 5 minutes



169
170
171
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb', line 169

def ttl
    @properties['ttl']
end