passageidentity 0.7.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/openapi_client/api/users_api.rb +18 -18
 - data/lib/openapi_client/models/create_magic_link_request.rb +21 -2
 - data/lib/openapi_client/models/{create_user_request.rb → create_user_args.rb} +3 -3
 - data/lib/openapi_client/models/magic_link.rb +1 -0
 - data/lib/openapi_client/models/{theme_type.rb → magic_link_language.rb} +11 -7
 - data/lib/openapi_client/models/{user_info.rb → passage_user.rb} +3 -3
 - data/lib/openapi_client/models/{update_user_request.rb → update_user_args.rb} +3 -3
 - data/lib/openapi_client/models/user_response.rb +1 -1
 - data/lib/openapi_client.rb +4 -19
 - data/lib/passageidentity/auth.rb +43 -156
 - data/lib/passageidentity/client.rb +16 -96
 - data/lib/passageidentity/user.rb +246 -0
 - data/lib/passageidentity/version.rb +1 -1
 - metadata +38 -36
 - data/lib/models/update_magic_link_auth_method.rb +0 -276
 - data/lib/models/update_otp_auth_method.rb +0 -276
 - data/lib/models/update_passkeys_auth_method.rb +0 -216
 - data/lib/openapi_client/api/apps_api.rb +0 -85
 - data/lib/openapi_client/models/app_info.rb +0 -886
 - data/lib/openapi_client/models/app_response.rb +0 -221
 - data/lib/openapi_client/models/auth_methods.rb +0 -254
 - data/lib/openapi_client/models/element_customization.rb +0 -457
 - data/lib/openapi_client/models/font_family.rb +0 -58
 - data/lib/openapi_client/models/layout_config.rb +0 -285
 - data/lib/openapi_client/models/layouts.rb +0 -241
 - data/lib/openapi_client/models/magic_link_auth_method.rb +0 -295
 - data/lib/openapi_client/models/otp_auth_method.rb +0 -295
 - data/lib/openapi_client/models/passkeys_auth_method.rb +0 -221
 - data/lib/openapi_client/models/technologies.rb +0 -46
 - data/lib/openapi_client/models/ttl_display_unit.rb +0 -42
 - data/lib/openapi_client/models/user_metadata_field.rb +0 -323
 - data/lib/openapi_client/models/user_metadata_field_type.rb +0 -44
 - data/lib/passageidentity/user_api.rb +0 -218
 
| 
         @@ -1,276 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            =begin
         
     | 
| 
       2 
     | 
    
         
            -
            #Passage Management API
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            #Passage's management API to manage your Passage apps and users.
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            The version of the OpenAPI document: 1
         
     | 
| 
       7 
     | 
    
         
            -
            Contact: support@passage.id
         
     | 
| 
       8 
     | 
    
         
            -
            Generated by: https://openapi-generator.tech
         
     | 
| 
       9 
     | 
    
         
            -
            OpenAPI Generator version: 7.1.0
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            =end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            require 'date'
         
     | 
| 
       14 
     | 
    
         
            -
            require 'time'
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            module OpenapiClient
         
     | 
| 
       17 
     | 
    
         
            -
              class UpdateMagicLinkAuthMethod
         
     | 
| 
       18 
     | 
    
         
            -
                attr_accessor :enabled
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                # Maximum time (IN SECONDS) for the auth to expire.
         
     | 
| 
       21 
     | 
    
         
            -
                attr_accessor :ttl
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
                attr_accessor :ttl_display_unit
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
                class EnumAttributeValidator
         
     | 
| 
       26 
     | 
    
         
            -
                  attr_reader :datatype
         
     | 
| 
       27 
     | 
    
         
            -
                  attr_reader :allowable_values
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
                  def initialize(datatype, allowable_values)
         
     | 
| 
       30 
     | 
    
         
            -
                    @allowable_values = allowable_values.map do |value|
         
     | 
| 
       31 
     | 
    
         
            -
                      case datatype.to_s
         
     | 
| 
       32 
     | 
    
         
            -
                      when /Integer/i
         
     | 
| 
       33 
     | 
    
         
            -
                        value.to_i
         
     | 
| 
       34 
     | 
    
         
            -
                      when /Float/i
         
     | 
| 
       35 
     | 
    
         
            -
                        value.to_f
         
     | 
| 
       36 
     | 
    
         
            -
                      else
         
     | 
| 
       37 
     | 
    
         
            -
                        value
         
     | 
| 
       38 
     | 
    
         
            -
                      end
         
     | 
| 
       39 
     | 
    
         
            -
                    end
         
     | 
| 
       40 
     | 
    
         
            -
                  end
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
                  def valid?(value)
         
     | 
| 
       43 
     | 
    
         
            -
                    !value || allowable_values.include?(value)
         
     | 
| 
       44 
     | 
    
         
            -
                  end
         
     | 
| 
       45 
     | 
    
         
            -
                end
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
       48 
     | 
    
         
            -
                def self.attribute_map
         
     | 
| 
       49 
     | 
    
         
            -
                  {
         
     | 
| 
       50 
     | 
    
         
            -
                    :'enabled' => :'enabled',
         
     | 
| 
       51 
     | 
    
         
            -
                    :'ttl' => :'ttl',
         
     | 
| 
       52 
     | 
    
         
            -
                    :'ttl_display_unit' => :'ttl_display_unit'
         
     | 
| 
       53 
     | 
    
         
            -
                  }
         
     | 
| 
       54 
     | 
    
         
            -
                end
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
                # Returns all the JSON keys this model knows about
         
     | 
| 
       57 
     | 
    
         
            -
                def self.acceptable_attributes
         
     | 
| 
       58 
     | 
    
         
            -
                  attribute_map.values
         
     | 
| 
       59 
     | 
    
         
            -
                end
         
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
                # Attribute type mapping.
         
     | 
| 
       62 
     | 
    
         
            -
                def self.openapi_types
         
     | 
| 
       63 
     | 
    
         
            -
                  {
         
     | 
| 
       64 
     | 
    
         
            -
                    :'enabled' => :'Boolean',
         
     | 
| 
       65 
     | 
    
         
            -
                    :'ttl' => :'Integer',
         
     | 
| 
       66 
     | 
    
         
            -
                    :'ttl_display_unit' => :'TtlDisplayUnit'
         
     | 
| 
       67 
     | 
    
         
            -
                  }
         
     | 
| 
       68 
     | 
    
         
            -
                end
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                # List of attributes with nullable: true
         
     | 
| 
       71 
     | 
    
         
            -
                def self.openapi_nullable
         
     | 
| 
       72 
     | 
    
         
            -
                  Set.new([
         
     | 
| 
       73 
     | 
    
         
            -
                  ])
         
     | 
| 
       74 
     | 
    
         
            -
                end
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
                # Initializes the object
         
     | 
| 
       77 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       78 
     | 
    
         
            -
                def initialize(attributes = {})
         
     | 
| 
       79 
     | 
    
         
            -
                  if (!attributes.is_a?(Hash))
         
     | 
| 
       80 
     | 
    
         
            -
                    fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UpdateMagicLinkAuthMethod` initialize method"
         
     | 
| 
       81 
     | 
    
         
            -
                  end
         
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
                  # check to see if the attribute exists and convert string to symbol for hash key
         
     | 
| 
       84 
     | 
    
         
            -
                  attributes = attributes.each_with_object({}) { |(k, v), h|
         
     | 
| 
       85 
     | 
    
         
            -
                    if (!self.class.attribute_map.key?(k.to_sym))
         
     | 
| 
       86 
     | 
    
         
            -
                      fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UpdateMagicLinkAuthMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
         
     | 
| 
       87 
     | 
    
         
            -
                    end
         
     | 
| 
       88 
     | 
    
         
            -
                    h[k.to_sym] = v
         
     | 
| 
       89 
     | 
    
         
            -
                  }
         
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
                  if attributes.key?(:'enabled')
         
     | 
| 
       92 
     | 
    
         
            -
                    self.enabled = attributes[:'enabled']
         
     | 
| 
       93 
     | 
    
         
            -
                  end
         
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
                  if attributes.key?(:'ttl')
         
     | 
| 
       96 
     | 
    
         
            -
                    self.ttl = attributes[:'ttl']
         
     | 
| 
       97 
     | 
    
         
            -
                  else
         
     | 
| 
       98 
     | 
    
         
            -
                    self.ttl = 300
         
     | 
| 
       99 
     | 
    
         
            -
                  end
         
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
                  if attributes.key?(:'ttl_display_unit')
         
     | 
| 
       102 
     | 
    
         
            -
                    self.ttl_display_unit = attributes[:'ttl_display_unit']
         
     | 
| 
       103 
     | 
    
         
            -
                  end
         
     | 
| 
       104 
     | 
    
         
            -
                end
         
     | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
       106 
     | 
    
         
            -
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
       107 
     | 
    
         
            -
                # @return Array for valid properties with the reasons
         
     | 
| 
       108 
     | 
    
         
            -
                def list_invalid_properties
         
     | 
| 
       109 
     | 
    
         
            -
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         
     | 
| 
       110 
     | 
    
         
            -
                  invalid_properties = Array.new
         
     | 
| 
       111 
     | 
    
         
            -
                  if !@ttl.nil? && @ttl < 60
         
     | 
| 
       112 
     | 
    
         
            -
                    invalid_properties.push('invalid value for "ttl", must be greater than or equal to 60.')
         
     | 
| 
       113 
     | 
    
         
            -
                  end
         
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
     | 
    
         
            -
                  invalid_properties
         
     | 
| 
       116 
     | 
    
         
            -
                end
         
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
                # Check to see if the all the properties in the model are valid
         
     | 
| 
       119 
     | 
    
         
            -
                # @return true if the model is valid
         
     | 
| 
       120 
     | 
    
         
            -
                def valid?
         
     | 
| 
       121 
     | 
    
         
            -
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         
     | 
| 
       122 
     | 
    
         
            -
                  return false if !@ttl.nil? && @ttl < 60
         
     | 
| 
       123 
     | 
    
         
            -
                  true
         
     | 
| 
       124 
     | 
    
         
            -
                end
         
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
                # Custom attribute writer method with validation
         
     | 
| 
       127 
     | 
    
         
            -
                # @param [Object] ttl Value to be assigned
         
     | 
| 
       128 
     | 
    
         
            -
                def ttl=(ttl)
         
     | 
| 
       129 
     | 
    
         
            -
                  if ttl.nil?
         
     | 
| 
       130 
     | 
    
         
            -
                    fail ArgumentError, 'ttl cannot be nil'
         
     | 
| 
       131 
     | 
    
         
            -
                  end
         
     | 
| 
       132 
     | 
    
         
            -
             
     | 
| 
       133 
     | 
    
         
            -
                  if ttl < 60
         
     | 
| 
       134 
     | 
    
         
            -
                    fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.'
         
     | 
| 
       135 
     | 
    
         
            -
                  end
         
     | 
| 
       136 
     | 
    
         
            -
             
     | 
| 
       137 
     | 
    
         
            -
                  @ttl = ttl
         
     | 
| 
       138 
     | 
    
         
            -
                end
         
     | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
                # Checks equality by comparing each attribute.
         
     | 
| 
       141 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       142 
     | 
    
         
            -
                def ==(o)
         
     | 
| 
       143 
     | 
    
         
            -
                  return true if self.equal?(o)
         
     | 
| 
       144 
     | 
    
         
            -
                  self.class == o.class &&
         
     | 
| 
       145 
     | 
    
         
            -
                      enabled == o.enabled &&
         
     | 
| 
       146 
     | 
    
         
            -
                      ttl == o.ttl &&
         
     | 
| 
       147 
     | 
    
         
            -
                      ttl_display_unit == o.ttl_display_unit
         
     | 
| 
       148 
     | 
    
         
            -
                end
         
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
                # @see the `==` method
         
     | 
| 
       151 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       152 
     | 
    
         
            -
                def eql?(o)
         
     | 
| 
       153 
     | 
    
         
            -
                  self == o
         
     | 
| 
       154 
     | 
    
         
            -
                end
         
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
                # Calculates hash code according to all attributes.
         
     | 
| 
       157 
     | 
    
         
            -
                # @return [Integer] Hash code
         
     | 
| 
       158 
     | 
    
         
            -
                def hash
         
     | 
| 
       159 
     | 
    
         
            -
                  [enabled, ttl, ttl_display_unit].hash
         
     | 
| 
       160 
     | 
    
         
            -
                end
         
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
                # Builds the object from hash
         
     | 
| 
       163 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       164 
     | 
    
         
            -
                # @return [Object] Returns the model itself
         
     | 
| 
       165 
     | 
    
         
            -
                def self.build_from_hash(attributes)
         
     | 
| 
       166 
     | 
    
         
            -
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
       167 
     | 
    
         
            -
                  attributes = attributes.transform_keys(&:to_sym)
         
     | 
| 
       168 
     | 
    
         
            -
                  transformed_hash = {}
         
     | 
| 
       169 
     | 
    
         
            -
                  openapi_types.each_pair do |key, type|
         
     | 
| 
       170 
     | 
    
         
            -
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         
     | 
| 
       171 
     | 
    
         
            -
                      transformed_hash["#{key}"] = nil
         
     | 
| 
       172 
     | 
    
         
            -
                    elsif type =~ /\AArray<(.*)>/i
         
     | 
| 
       173 
     | 
    
         
            -
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
       174 
     | 
    
         
            -
                      # is documented as an array but the input is not
         
     | 
| 
       175 
     | 
    
         
            -
                      if attributes[attribute_map[key]].is_a?(Array)
         
     | 
| 
       176 
     | 
    
         
            -
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         
     | 
| 
       177 
     | 
    
         
            -
                      end
         
     | 
| 
       178 
     | 
    
         
            -
                    elsif !attributes[attribute_map[key]].nil?
         
     | 
| 
       179 
     | 
    
         
            -
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         
     | 
| 
       180 
     | 
    
         
            -
                    end
         
     | 
| 
       181 
     | 
    
         
            -
                  end
         
     | 
| 
       182 
     | 
    
         
            -
                  new(transformed_hash)
         
     | 
| 
       183 
     | 
    
         
            -
                end
         
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
       185 
     | 
    
         
            -
                # Deserializes the data based on type
         
     | 
| 
       186 
     | 
    
         
            -
                # @param string type Data type
         
     | 
| 
       187 
     | 
    
         
            -
                # @param string value Value to be deserialized
         
     | 
| 
       188 
     | 
    
         
            -
                # @return [Object] Deserialized data
         
     | 
| 
       189 
     | 
    
         
            -
                def self._deserialize(type, value)
         
     | 
| 
       190 
     | 
    
         
            -
                  case type.to_sym
         
     | 
| 
       191 
     | 
    
         
            -
                  when :Time
         
     | 
| 
       192 
     | 
    
         
            -
                    Time.parse(value)
         
     | 
| 
       193 
     | 
    
         
            -
                  when :Date
         
     | 
| 
       194 
     | 
    
         
            -
                    Date.parse(value)
         
     | 
| 
       195 
     | 
    
         
            -
                  when :String
         
     | 
| 
       196 
     | 
    
         
            -
                    value.to_s
         
     | 
| 
       197 
     | 
    
         
            -
                  when :Integer
         
     | 
| 
       198 
     | 
    
         
            -
                    value.to_i
         
     | 
| 
       199 
     | 
    
         
            -
                  when :Float
         
     | 
| 
       200 
     | 
    
         
            -
                    value.to_f
         
     | 
| 
       201 
     | 
    
         
            -
                  when :Boolean
         
     | 
| 
       202 
     | 
    
         
            -
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
       203 
     | 
    
         
            -
                      true
         
     | 
| 
       204 
     | 
    
         
            -
                    else
         
     | 
| 
       205 
     | 
    
         
            -
                      false
         
     | 
| 
       206 
     | 
    
         
            -
                    end
         
     | 
| 
       207 
     | 
    
         
            -
                  when :Object
         
     | 
| 
       208 
     | 
    
         
            -
                    # generic object (usually a Hash), return directly
         
     | 
| 
       209 
     | 
    
         
            -
                    value
         
     | 
| 
       210 
     | 
    
         
            -
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
       211 
     | 
    
         
            -
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
       212 
     | 
    
         
            -
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
       213 
     | 
    
         
            -
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
       214 
     | 
    
         
            -
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
       215 
     | 
    
         
            -
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
       216 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       217 
     | 
    
         
            -
                      value.each do |k, v|
         
     | 
| 
       218 
     | 
    
         
            -
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
       219 
     | 
    
         
            -
                      end
         
     | 
| 
       220 
     | 
    
         
            -
                    end
         
     | 
| 
       221 
     | 
    
         
            -
                  else # model
         
     | 
| 
       222 
     | 
    
         
            -
                    # models (e.g. Pet) or oneOf
         
     | 
| 
       223 
     | 
    
         
            -
                    klass = OpenapiClient.const_get(type)
         
     | 
| 
       224 
     | 
    
         
            -
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         
     | 
| 
       225 
     | 
    
         
            -
                  end
         
     | 
| 
       226 
     | 
    
         
            -
                end
         
     | 
| 
       227 
     | 
    
         
            -
             
     | 
| 
       228 
     | 
    
         
            -
                # Returns the string representation of the object
         
     | 
| 
       229 
     | 
    
         
            -
                # @return [String] String presentation of the object
         
     | 
| 
       230 
     | 
    
         
            -
                def to_s
         
     | 
| 
       231 
     | 
    
         
            -
                  to_hash.to_s
         
     | 
| 
       232 
     | 
    
         
            -
                end
         
     | 
| 
       233 
     | 
    
         
            -
             
     | 
| 
       234 
     | 
    
         
            -
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
       235 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       236 
     | 
    
         
            -
                def to_body
         
     | 
| 
       237 
     | 
    
         
            -
                  to_hash
         
     | 
| 
       238 
     | 
    
         
            -
                end
         
     | 
| 
       239 
     | 
    
         
            -
             
     | 
| 
       240 
     | 
    
         
            -
                # Returns the object in the form of hash
         
     | 
| 
       241 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       242 
     | 
    
         
            -
                def to_hash
         
     | 
| 
       243 
     | 
    
         
            -
                  hash = {}
         
     | 
| 
       244 
     | 
    
         
            -
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
       245 
     | 
    
         
            -
                    value = self.send(attr)
         
     | 
| 
       246 
     | 
    
         
            -
                    if value.nil?
         
     | 
| 
       247 
     | 
    
         
            -
                      is_nullable = self.class.openapi_nullable.include?(attr)
         
     | 
| 
       248 
     | 
    
         
            -
                      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
         
     | 
| 
       249 
     | 
    
         
            -
                    end
         
     | 
| 
       250 
     | 
    
         
            -
             
     | 
| 
       251 
     | 
    
         
            -
                    hash[param] = _to_hash(value)
         
     | 
| 
       252 
     | 
    
         
            -
                  end
         
     | 
| 
       253 
     | 
    
         
            -
                  hash
         
     | 
| 
       254 
     | 
    
         
            -
                end
         
     | 
| 
       255 
     | 
    
         
            -
             
     | 
| 
       256 
     | 
    
         
            -
                # Outputs non-array value in the form of hash
         
     | 
| 
       257 
     | 
    
         
            -
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
       258 
     | 
    
         
            -
                # @param [Object] value Any valid value
         
     | 
| 
       259 
     | 
    
         
            -
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
       260 
     | 
    
         
            -
                def _to_hash(value)
         
     | 
| 
       261 
     | 
    
         
            -
                  if value.is_a?(Array)
         
     | 
| 
       262 
     | 
    
         
            -
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
       263 
     | 
    
         
            -
                  elsif value.is_a?(Hash)
         
     | 
| 
       264 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       265 
     | 
    
         
            -
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
       266 
     | 
    
         
            -
                    end
         
     | 
| 
       267 
     | 
    
         
            -
                  elsif value.respond_to? :to_hash
         
     | 
| 
       268 
     | 
    
         
            -
                    value.to_hash
         
     | 
| 
       269 
     | 
    
         
            -
                  else
         
     | 
| 
       270 
     | 
    
         
            -
                    value
         
     | 
| 
       271 
     | 
    
         
            -
                  end
         
     | 
| 
       272 
     | 
    
         
            -
                end
         
     | 
| 
       273 
     | 
    
         
            -
             
     | 
| 
       274 
     | 
    
         
            -
              end
         
     | 
| 
       275 
     | 
    
         
            -
             
     | 
| 
       276 
     | 
    
         
            -
            end
         
     | 
| 
         @@ -1,276 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            =begin
         
     | 
| 
       2 
     | 
    
         
            -
            #Passage Management API
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            #Passage's management API to manage your Passage apps and users.
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            The version of the OpenAPI document: 1
         
     | 
| 
       7 
     | 
    
         
            -
            Contact: support@passage.id
         
     | 
| 
       8 
     | 
    
         
            -
            Generated by: https://openapi-generator.tech
         
     | 
| 
       9 
     | 
    
         
            -
            OpenAPI Generator version: 7.1.0
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            =end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            require 'date'
         
     | 
| 
       14 
     | 
    
         
            -
            require 'time'
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            module OpenapiClient
         
     | 
| 
       17 
     | 
    
         
            -
              class UpdateOtpAuthMethod
         
     | 
| 
       18 
     | 
    
         
            -
                attr_accessor :enabled
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                # Maximum time (IN SECONDS) for the auth to expire.
         
     | 
| 
       21 
     | 
    
         
            -
                attr_accessor :ttl
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
                attr_accessor :ttl_display_unit
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
                class EnumAttributeValidator
         
     | 
| 
       26 
     | 
    
         
            -
                  attr_reader :datatype
         
     | 
| 
       27 
     | 
    
         
            -
                  attr_reader :allowable_values
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
                  def initialize(datatype, allowable_values)
         
     | 
| 
       30 
     | 
    
         
            -
                    @allowable_values = allowable_values.map do |value|
         
     | 
| 
       31 
     | 
    
         
            -
                      case datatype.to_s
         
     | 
| 
       32 
     | 
    
         
            -
                      when /Integer/i
         
     | 
| 
       33 
     | 
    
         
            -
                        value.to_i
         
     | 
| 
       34 
     | 
    
         
            -
                      when /Float/i
         
     | 
| 
       35 
     | 
    
         
            -
                        value.to_f
         
     | 
| 
       36 
     | 
    
         
            -
                      else
         
     | 
| 
       37 
     | 
    
         
            -
                        value
         
     | 
| 
       38 
     | 
    
         
            -
                      end
         
     | 
| 
       39 
     | 
    
         
            -
                    end
         
     | 
| 
       40 
     | 
    
         
            -
                  end
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
                  def valid?(value)
         
     | 
| 
       43 
     | 
    
         
            -
                    !value || allowable_values.include?(value)
         
     | 
| 
       44 
     | 
    
         
            -
                  end
         
     | 
| 
       45 
     | 
    
         
            -
                end
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
       48 
     | 
    
         
            -
                def self.attribute_map
         
     | 
| 
       49 
     | 
    
         
            -
                  {
         
     | 
| 
       50 
     | 
    
         
            -
                    :'enabled' => :'enabled',
         
     | 
| 
       51 
     | 
    
         
            -
                    :'ttl' => :'ttl',
         
     | 
| 
       52 
     | 
    
         
            -
                    :'ttl_display_unit' => :'ttl_display_unit'
         
     | 
| 
       53 
     | 
    
         
            -
                  }
         
     | 
| 
       54 
     | 
    
         
            -
                end
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
                # Returns all the JSON keys this model knows about
         
     | 
| 
       57 
     | 
    
         
            -
                def self.acceptable_attributes
         
     | 
| 
       58 
     | 
    
         
            -
                  attribute_map.values
         
     | 
| 
       59 
     | 
    
         
            -
                end
         
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
                # Attribute type mapping.
         
     | 
| 
       62 
     | 
    
         
            -
                def self.openapi_types
         
     | 
| 
       63 
     | 
    
         
            -
                  {
         
     | 
| 
       64 
     | 
    
         
            -
                    :'enabled' => :'Boolean',
         
     | 
| 
       65 
     | 
    
         
            -
                    :'ttl' => :'Integer',
         
     | 
| 
       66 
     | 
    
         
            -
                    :'ttl_display_unit' => :'TtlDisplayUnit'
         
     | 
| 
       67 
     | 
    
         
            -
                  }
         
     | 
| 
       68 
     | 
    
         
            -
                end
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                # List of attributes with nullable: true
         
     | 
| 
       71 
     | 
    
         
            -
                def self.openapi_nullable
         
     | 
| 
       72 
     | 
    
         
            -
                  Set.new([
         
     | 
| 
       73 
     | 
    
         
            -
                  ])
         
     | 
| 
       74 
     | 
    
         
            -
                end
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
                # Initializes the object
         
     | 
| 
       77 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       78 
     | 
    
         
            -
                def initialize(attributes = {})
         
     | 
| 
       79 
     | 
    
         
            -
                  if (!attributes.is_a?(Hash))
         
     | 
| 
       80 
     | 
    
         
            -
                    fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UpdateOtpAuthMethod` initialize method"
         
     | 
| 
       81 
     | 
    
         
            -
                  end
         
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
                  # check to see if the attribute exists and convert string to symbol for hash key
         
     | 
| 
       84 
     | 
    
         
            -
                  attributes = attributes.each_with_object({}) { |(k, v), h|
         
     | 
| 
       85 
     | 
    
         
            -
                    if (!self.class.attribute_map.key?(k.to_sym))
         
     | 
| 
       86 
     | 
    
         
            -
                      fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UpdateOtpAuthMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
         
     | 
| 
       87 
     | 
    
         
            -
                    end
         
     | 
| 
       88 
     | 
    
         
            -
                    h[k.to_sym] = v
         
     | 
| 
       89 
     | 
    
         
            -
                  }
         
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
                  if attributes.key?(:'enabled')
         
     | 
| 
       92 
     | 
    
         
            -
                    self.enabled = attributes[:'enabled']
         
     | 
| 
       93 
     | 
    
         
            -
                  end
         
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
                  if attributes.key?(:'ttl')
         
     | 
| 
       96 
     | 
    
         
            -
                    self.ttl = attributes[:'ttl']
         
     | 
| 
       97 
     | 
    
         
            -
                  else
         
     | 
| 
       98 
     | 
    
         
            -
                    self.ttl = 300
         
     | 
| 
       99 
     | 
    
         
            -
                  end
         
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
                  if attributes.key?(:'ttl_display_unit')
         
     | 
| 
       102 
     | 
    
         
            -
                    self.ttl_display_unit = attributes[:'ttl_display_unit']
         
     | 
| 
       103 
     | 
    
         
            -
                  end
         
     | 
| 
       104 
     | 
    
         
            -
                end
         
     | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
       106 
     | 
    
         
            -
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
       107 
     | 
    
         
            -
                # @return Array for valid properties with the reasons
         
     | 
| 
       108 
     | 
    
         
            -
                def list_invalid_properties
         
     | 
| 
       109 
     | 
    
         
            -
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         
     | 
| 
       110 
     | 
    
         
            -
                  invalid_properties = Array.new
         
     | 
| 
       111 
     | 
    
         
            -
                  if !@ttl.nil? && @ttl < 60
         
     | 
| 
       112 
     | 
    
         
            -
                    invalid_properties.push('invalid value for "ttl", must be greater than or equal to 60.')
         
     | 
| 
       113 
     | 
    
         
            -
                  end
         
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
     | 
    
         
            -
                  invalid_properties
         
     | 
| 
       116 
     | 
    
         
            -
                end
         
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
                # Check to see if the all the properties in the model are valid
         
     | 
| 
       119 
     | 
    
         
            -
                # @return true if the model is valid
         
     | 
| 
       120 
     | 
    
         
            -
                def valid?
         
     | 
| 
       121 
     | 
    
         
            -
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         
     | 
| 
       122 
     | 
    
         
            -
                  return false if !@ttl.nil? && @ttl < 60
         
     | 
| 
       123 
     | 
    
         
            -
                  true
         
     | 
| 
       124 
     | 
    
         
            -
                end
         
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
                # Custom attribute writer method with validation
         
     | 
| 
       127 
     | 
    
         
            -
                # @param [Object] ttl Value to be assigned
         
     | 
| 
       128 
     | 
    
         
            -
                def ttl=(ttl)
         
     | 
| 
       129 
     | 
    
         
            -
                  if ttl.nil?
         
     | 
| 
       130 
     | 
    
         
            -
                    fail ArgumentError, 'ttl cannot be nil'
         
     | 
| 
       131 
     | 
    
         
            -
                  end
         
     | 
| 
       132 
     | 
    
         
            -
             
     | 
| 
       133 
     | 
    
         
            -
                  if ttl < 60
         
     | 
| 
       134 
     | 
    
         
            -
                    fail ArgumentError, 'invalid value for "ttl", must be greater than or equal to 60.'
         
     | 
| 
       135 
     | 
    
         
            -
                  end
         
     | 
| 
       136 
     | 
    
         
            -
             
     | 
| 
       137 
     | 
    
         
            -
                  @ttl = ttl
         
     | 
| 
       138 
     | 
    
         
            -
                end
         
     | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
                # Checks equality by comparing each attribute.
         
     | 
| 
       141 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       142 
     | 
    
         
            -
                def ==(o)
         
     | 
| 
       143 
     | 
    
         
            -
                  return true if self.equal?(o)
         
     | 
| 
       144 
     | 
    
         
            -
                  self.class == o.class &&
         
     | 
| 
       145 
     | 
    
         
            -
                      enabled == o.enabled &&
         
     | 
| 
       146 
     | 
    
         
            -
                      ttl == o.ttl &&
         
     | 
| 
       147 
     | 
    
         
            -
                      ttl_display_unit == o.ttl_display_unit
         
     | 
| 
       148 
     | 
    
         
            -
                end
         
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
                # @see the `==` method
         
     | 
| 
       151 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       152 
     | 
    
         
            -
                def eql?(o)
         
     | 
| 
       153 
     | 
    
         
            -
                  self == o
         
     | 
| 
       154 
     | 
    
         
            -
                end
         
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
                # Calculates hash code according to all attributes.
         
     | 
| 
       157 
     | 
    
         
            -
                # @return [Integer] Hash code
         
     | 
| 
       158 
     | 
    
         
            -
                def hash
         
     | 
| 
       159 
     | 
    
         
            -
                  [enabled, ttl, ttl_display_unit].hash
         
     | 
| 
       160 
     | 
    
         
            -
                end
         
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
                # Builds the object from hash
         
     | 
| 
       163 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       164 
     | 
    
         
            -
                # @return [Object] Returns the model itself
         
     | 
| 
       165 
     | 
    
         
            -
                def self.build_from_hash(attributes)
         
     | 
| 
       166 
     | 
    
         
            -
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
       167 
     | 
    
         
            -
                  attributes = attributes.transform_keys(&:to_sym)
         
     | 
| 
       168 
     | 
    
         
            -
                  transformed_hash = {}
         
     | 
| 
       169 
     | 
    
         
            -
                  openapi_types.each_pair do |key, type|
         
     | 
| 
       170 
     | 
    
         
            -
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         
     | 
| 
       171 
     | 
    
         
            -
                      transformed_hash["#{key}"] = nil
         
     | 
| 
       172 
     | 
    
         
            -
                    elsif type =~ /\AArray<(.*)>/i
         
     | 
| 
       173 
     | 
    
         
            -
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
       174 
     | 
    
         
            -
                      # is documented as an array but the input is not
         
     | 
| 
       175 
     | 
    
         
            -
                      if attributes[attribute_map[key]].is_a?(Array)
         
     | 
| 
       176 
     | 
    
         
            -
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         
     | 
| 
       177 
     | 
    
         
            -
                      end
         
     | 
| 
       178 
     | 
    
         
            -
                    elsif !attributes[attribute_map[key]].nil?
         
     | 
| 
       179 
     | 
    
         
            -
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         
     | 
| 
       180 
     | 
    
         
            -
                    end
         
     | 
| 
       181 
     | 
    
         
            -
                  end
         
     | 
| 
       182 
     | 
    
         
            -
                  new(transformed_hash)
         
     | 
| 
       183 
     | 
    
         
            -
                end
         
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
       185 
     | 
    
         
            -
                # Deserializes the data based on type
         
     | 
| 
       186 
     | 
    
         
            -
                # @param string type Data type
         
     | 
| 
       187 
     | 
    
         
            -
                # @param string value Value to be deserialized
         
     | 
| 
       188 
     | 
    
         
            -
                # @return [Object] Deserialized data
         
     | 
| 
       189 
     | 
    
         
            -
                def self._deserialize(type, value)
         
     | 
| 
       190 
     | 
    
         
            -
                  case type.to_sym
         
     | 
| 
       191 
     | 
    
         
            -
                  when :Time
         
     | 
| 
       192 
     | 
    
         
            -
                    Time.parse(value)
         
     | 
| 
       193 
     | 
    
         
            -
                  when :Date
         
     | 
| 
       194 
     | 
    
         
            -
                    Date.parse(value)
         
     | 
| 
       195 
     | 
    
         
            -
                  when :String
         
     | 
| 
       196 
     | 
    
         
            -
                    value.to_s
         
     | 
| 
       197 
     | 
    
         
            -
                  when :Integer
         
     | 
| 
       198 
     | 
    
         
            -
                    value.to_i
         
     | 
| 
       199 
     | 
    
         
            -
                  when :Float
         
     | 
| 
       200 
     | 
    
         
            -
                    value.to_f
         
     | 
| 
       201 
     | 
    
         
            -
                  when :Boolean
         
     | 
| 
       202 
     | 
    
         
            -
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
       203 
     | 
    
         
            -
                      true
         
     | 
| 
       204 
     | 
    
         
            -
                    else
         
     | 
| 
       205 
     | 
    
         
            -
                      false
         
     | 
| 
       206 
     | 
    
         
            -
                    end
         
     | 
| 
       207 
     | 
    
         
            -
                  when :Object
         
     | 
| 
       208 
     | 
    
         
            -
                    # generic object (usually a Hash), return directly
         
     | 
| 
       209 
     | 
    
         
            -
                    value
         
     | 
| 
       210 
     | 
    
         
            -
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
       211 
     | 
    
         
            -
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
       212 
     | 
    
         
            -
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
       213 
     | 
    
         
            -
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
       214 
     | 
    
         
            -
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
       215 
     | 
    
         
            -
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
       216 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       217 
     | 
    
         
            -
                      value.each do |k, v|
         
     | 
| 
       218 
     | 
    
         
            -
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
       219 
     | 
    
         
            -
                      end
         
     | 
| 
       220 
     | 
    
         
            -
                    end
         
     | 
| 
       221 
     | 
    
         
            -
                  else # model
         
     | 
| 
       222 
     | 
    
         
            -
                    # models (e.g. Pet) or oneOf
         
     | 
| 
       223 
     | 
    
         
            -
                    klass = OpenapiClient.const_get(type)
         
     | 
| 
       224 
     | 
    
         
            -
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         
     | 
| 
       225 
     | 
    
         
            -
                  end
         
     | 
| 
       226 
     | 
    
         
            -
                end
         
     | 
| 
       227 
     | 
    
         
            -
             
     | 
| 
       228 
     | 
    
         
            -
                # Returns the string representation of the object
         
     | 
| 
       229 
     | 
    
         
            -
                # @return [String] String presentation of the object
         
     | 
| 
       230 
     | 
    
         
            -
                def to_s
         
     | 
| 
       231 
     | 
    
         
            -
                  to_hash.to_s
         
     | 
| 
       232 
     | 
    
         
            -
                end
         
     | 
| 
       233 
     | 
    
         
            -
             
     | 
| 
       234 
     | 
    
         
            -
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
       235 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       236 
     | 
    
         
            -
                def to_body
         
     | 
| 
       237 
     | 
    
         
            -
                  to_hash
         
     | 
| 
       238 
     | 
    
         
            -
                end
         
     | 
| 
       239 
     | 
    
         
            -
             
     | 
| 
       240 
     | 
    
         
            -
                # Returns the object in the form of hash
         
     | 
| 
       241 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       242 
     | 
    
         
            -
                def to_hash
         
     | 
| 
       243 
     | 
    
         
            -
                  hash = {}
         
     | 
| 
       244 
     | 
    
         
            -
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
       245 
     | 
    
         
            -
                    value = self.send(attr)
         
     | 
| 
       246 
     | 
    
         
            -
                    if value.nil?
         
     | 
| 
       247 
     | 
    
         
            -
                      is_nullable = self.class.openapi_nullable.include?(attr)
         
     | 
| 
       248 
     | 
    
         
            -
                      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
         
     | 
| 
       249 
     | 
    
         
            -
                    end
         
     | 
| 
       250 
     | 
    
         
            -
             
     | 
| 
       251 
     | 
    
         
            -
                    hash[param] = _to_hash(value)
         
     | 
| 
       252 
     | 
    
         
            -
                  end
         
     | 
| 
       253 
     | 
    
         
            -
                  hash
         
     | 
| 
       254 
     | 
    
         
            -
                end
         
     | 
| 
       255 
     | 
    
         
            -
             
     | 
| 
       256 
     | 
    
         
            -
                # Outputs non-array value in the form of hash
         
     | 
| 
       257 
     | 
    
         
            -
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
       258 
     | 
    
         
            -
                # @param [Object] value Any valid value
         
     | 
| 
       259 
     | 
    
         
            -
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
       260 
     | 
    
         
            -
                def _to_hash(value)
         
     | 
| 
       261 
     | 
    
         
            -
                  if value.is_a?(Array)
         
     | 
| 
       262 
     | 
    
         
            -
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
       263 
     | 
    
         
            -
                  elsif value.is_a?(Hash)
         
     | 
| 
       264 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       265 
     | 
    
         
            -
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
       266 
     | 
    
         
            -
                    end
         
     | 
| 
       267 
     | 
    
         
            -
                  elsif value.respond_to? :to_hash
         
     | 
| 
       268 
     | 
    
         
            -
                    value.to_hash
         
     | 
| 
       269 
     | 
    
         
            -
                  else
         
     | 
| 
       270 
     | 
    
         
            -
                    value
         
     | 
| 
       271 
     | 
    
         
            -
                  end
         
     | 
| 
       272 
     | 
    
         
            -
                end
         
     | 
| 
       273 
     | 
    
         
            -
             
     | 
| 
       274 
     | 
    
         
            -
              end
         
     | 
| 
       275 
     | 
    
         
            -
             
     | 
| 
       276 
     | 
    
         
            -
            end
         
     |