## # 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 beta products that are subject to change. Use them with caution. 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 beta products that are subject to change. Use them with caution. 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 beta products that are subject to change. Use them with caution. class FormContext < InstanceContext ## # Initialize the FormContext # @param [Version] version Version that contains the resource # @param [form.FormTypes] form_type The Type of this Form. Currently only # `form-push` is supported. # @return [FormContext] FormContext def initialize(version, form_type) super(version) # Path Solution @solution = {form_type: form_type, } @uri = "/Forms/#{@solution[:form_type]}" end ## # Fetch the FormInstance # @return [FormInstance] Fetched FormInstance def fetch payload = @version.fetch('GET', @uri) 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 beta products that are subject to change. Use them with caution. 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. Currently only # `form-push` is supported. # @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 the 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