## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Verify < Domain class V2 < Version ## # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. class FormList < ListResource ## # Initialize the FormList # @param [Version] version Version that contains the resource # @return [FormList] FormList def initialize(version) super(version) # Path Solution @solution = {} end ## # Provide a user friendly representation def to_s '#' end end ## # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. class FormPage < Page ## # Initialize the FormPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [FormPage] FormPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of FormInstance # @param [Hash] payload Payload response from the API # @return [FormInstance] FormInstance def get_instance(payload) FormInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '' end end ## # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. class FormContext < InstanceContext ## # Initialize the FormContext # @param [Version] version Version that contains the resource # @param [form.FormTypes] form_type The Type of this Form. One of `form-app-push`, # `form-sms` or `form-totp`. # @return [FormContext] FormContext def initialize(version, form_type) super(version) # Path Solution @solution = {form_type: form_type, } @uri = "/Forms/#{@solution[:form_type]}" end ## # Fetch a FormInstance # @return [FormInstance] Fetched FormInstance def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) FormInstance.new(@version, payload, form_type: @solution[:form_type], ) end ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end ## # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. class FormInstance < InstanceResource ## # Initialize the FormInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [form.FormTypes] form_type The Type of this Form. One of `form-app-push`, # `form-sms` or `form-totp`. # @return [FormInstance] FormInstance def initialize(version, payload, form_type: nil) super(version) # Marshaled Properties @properties = { 'form_type' => payload['form_type'], 'forms' => payload['forms'], 'form_meta' => payload['form_meta'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'form_type' => form_type || @properties['form_type'], } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [FormContext] FormContext for this FormInstance def context unless @instance_context @instance_context = FormContext.new(@version, @params['form_type'], ) end @instance_context end ## # @return [form.FormTypes] The Type of this Form def form_type @properties['form_type'] end ## # @return [Hash] Object that contains the available forms for this type. def forms @properties['forms'] end ## # @return [Hash] Additional information for the available forms for this type. def form_meta @properties['form_meta'] end ## # @return [String] The URL to access the forms for this type. def url @properties['url'] end ## # Fetch a FormInstance # @return [FormInstance] Fetched FormInstance def fetch context.fetch end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end