## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Verify < Domain class V2 < Version class ServiceContext < InstanceContext class EntityContext < InstanceContext class ChallengeContext < InstanceContext ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class NotificationList < ListResource ## # Initialize the NotificationList # @param [Version] version Version that contains the resource # @param [String] service_sid The unique SID identifier of the Service. # @param [String] identity Customer unique identity for the Entity owner of the # Challenge. This value must be between 8 and 64 characters long. # @param [String] challenge_sid The unique SID identifier of the Challenge. # @return [NotificationList] NotificationList def initialize(version, service_sid: nil, identity: nil, challenge_sid: nil) super(version) # Path Solution @solution = {service_sid: service_sid, identity: identity, challenge_sid: challenge_sid} @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:challenge_sid]}/Notifications" end ## # Create the NotificationInstance # @param [String] ttl How long, in seconds, the Notification is valid. Delivery # will be attempted if the device is offline until the TTL elapses. 0 means that # the notification delivery is attempted immediately, only once, and is not stored # for future delivery. Must be an integer between 0 and 300 seconds, inclusive. # Defaults to 300 seconds. # @return [NotificationInstance] Created NotificationInstance def create(ttl: :unset) data = Twilio::Values.of({'Ttl' => ttl, }) payload = @version.create('POST', @uri, data: data) NotificationInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], challenge_sid: @solution[:challenge_sid], ) end ## # Provide a user friendly representation def to_s '#' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class NotificationPage < Page ## # Initialize the NotificationPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [NotificationPage] NotificationPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of NotificationInstance # @param [Hash] payload Payload response from the API # @return [NotificationInstance] NotificationInstance def get_instance(payload) NotificationInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], challenge_sid: @solution[:challenge_sid], ) end ## # Provide a user friendly representation def to_s '' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class NotificationInstance < InstanceResource ## # Initialize the NotificationInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] service_sid The unique SID identifier of the Service. # @param [String] identity Customer unique identity for the Entity owner of the # Challenge. This value must be between 8 and 64 characters long. # @param [String] challenge_sid The unique SID identifier of the Challenge. # @return [NotificationInstance] NotificationInstance 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'].to_i, 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), } end ## # @return [String] A string that uniquely identifies this Notification. def sid @properties['sid'] end ## # @return [String] Account Sid. def account_sid @properties['account_sid'] end ## # @return [String] Service Sid. def service_sid @properties['service_sid'] end ## # @return [String] Entity Sid. def entity_sid @properties['entity_sid'] end ## # @return [String] Unique external identifier of the Entity def identity @properties['identity'] end ## # @return [String] Challenge Sid. def challenge_sid @properties['challenge_sid'] end ## # @return [String] The priority of the Notification. def priority @properties['priority'] end ## # @return [String] How long, in seconds, the Notification is valid. def ttl @properties['ttl'] end ## # @return [Time] The date this Notification was created def date_created @properties['date_created'] end ## # Provide a user friendly representation def to_s "" end ## # Provide a detailed, user friendly representation def inspect "" end end end end end end end end end