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

  • service_sid (String) (defaults to: nil) —

    The unique SID identifier of the Service.

  • identity (String) (defaults to: nil) —

    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.

  • challenge_sid (String) (defaults to: nil) —

    The unique SID identifier of the Challenge.



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

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_sid ⇒ String

Returns Account Sid.

Returns:

  • (String) —

    Account Sid.



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

def 
  @properties['account_sid']
end

#challenge_sid ⇒ String

Returns Challenge Sid.

Returns:

  • (String) —

    Challenge Sid.



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

def challenge_sid
  @properties['challenge_sid']
end

#date_created ⇒ Time

Returns The date this Notification was created.

Returns:

  • (Time) —

    The date this Notification was created



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

def date_created
  @properties['date_created']
end

#entity_sid ⇒ String

Returns Entity Sid.

Returns:

  • (String) —

    Entity Sid.



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

def entity_sid
  @properties['entity_sid']
end

#identity ⇒ String

Returns Unique external identifier of the Entity.

Returns:

  • (String) —

    Unique external identifier of the Entity



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

def identity
  @properties['identity']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



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

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

#priority ⇒ String

Returns The priority of the notification.

Returns:

  • (String) —

    The priority of the notification.



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

def priority
  @properties['priority']
end

#service_sid ⇒ String

Returns Service Sid.

Returns:

  • (String) —

    Service Sid.



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

def service_sid
  @properties['service_sid']
end

#sid ⇒ String

Returns A string that uniquely identifies this Notification.

Returns:

  • (String) —

    A string that uniquely identifies this Notification.



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

def sid
  @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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

#ttl ⇒ String

Returns How long, in seconds, the notification is valid.

Returns:

  • (String) —

    How long, in seconds, the notification is valid.



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

def ttl
  @properties['ttl']
end