pnap_rancher_api 1.0.5 → 2.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/README.md +3 -4
 - data/VERSION +1 -1
 - data/docs/Cluster.md +3 -3
 - data/docs/ClustersApi.md +6 -8
 - data/docs/NodePool.md +2 -2
 - data/docs/RancherClusterConfig.md +1 -1
 - data/lib/pnap_rancher_api/api/clusters_api.rb +11 -7
 - data/lib/pnap_rancher_api/api_client.rb +24 -21
 - data/lib/pnap_rancher_api/api_error.rb +2 -1
 - data/lib/pnap_rancher_api/configuration.rb +28 -9
 - data/lib/pnap_rancher_api/models/cluster.rb +25 -24
 - data/lib/pnap_rancher_api/models/delete_result.rb +18 -19
 - data/lib/pnap_rancher_api/models/error.rb +16 -19
 - data/lib/pnap_rancher_api/models/node.rb +14 -19
 - data/lib/pnap_rancher_api/models/node_pool.rb +54 -20
 - data/lib/pnap_rancher_api/models/rancher_cluster_certificates.rb +14 -19
 - data/lib/pnap_rancher_api/models/rancher_cluster_config.rb +15 -20
 - data/lib/pnap_rancher_api/models/rancher_server_metadata.rb +14 -19
 - data/lib/pnap_rancher_api/models/ssh_config.rb +14 -19
 - data/lib/pnap_rancher_api/models/workload_cluster_config.rb +16 -19
 - data/lib/pnap_rancher_api/version.rb +1 -1
 - data/lib/pnap_rancher_api.rb +1 -5
 - data/pnap_rancher_api.gemspec +2 -2
 - data/spec/api/clusters_api_spec.rb +7 -7
 - data/spec/models/cluster_spec.rb +14 -12
 - data/spec/models/delete_result_spec.rb +6 -4
 - data/spec/models/error_spec.rb +6 -4
 - data/spec/models/node_pool_spec.rb +9 -7
 - data/spec/models/node_spec.rb +5 -3
 - data/spec/models/rancher_cluster_certificates_spec.rb +7 -5
 - data/spec/models/rancher_cluster_config_spec.rb +11 -9
 - data/spec/models/rancher_server_metadata_spec.rb +7 -5
 - data/spec/models/ssh_config_spec.rb +7 -5
 - data/spec/models/workload_cluster_config_spec.rb +8 -6
 - data/spec/spec_helper.rb +1 -1
 - metadata +9 -29
 - data/docs/ClusterConfiguration.md +0 -30
 - data/docs/ClusterWorkloadConfiguration.md +0 -24
 - data/docs/NodePoolSshConfig.md +0 -22
 - data/docs/RancherClusterConfigCertificates.md +0 -22
 - data/lib/pnap_rancher_api/models/cluster_configuration.rb +0 -290
 - data/lib/pnap_rancher_api/models/cluster_workload_configuration.rb +0 -271
 - data/lib/pnap_rancher_api/models/node_pool_ssh_config.rb +0 -253
 - data/lib/pnap_rancher_api/models/rancher_cluster_config_certificates.rb +0 -247
 - data/spec/api_client_spec.rb +0 -226
 - data/spec/configuration_spec.rb +0 -42
 - data/spec/models/cluster_configuration_spec.rb +0 -70
 - data/spec/models/cluster_workload_configuration_spec.rb +0 -52
 - data/spec/models/node_pool_ssh_config_spec.rb +0 -46
 - data/spec/models/rancher_cluster_config_certificates_spec.rb +0 -46
 
| 
         @@ -1,271 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            =begin
         
     | 
| 
       2 
     | 
    
         
            -
            #Rancher Solution API
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            #Simplify enterprise-grade Kubernetes cluster operations and management with Rancher on Bare Metal Cloud. Deploy Kubernetes clusters using a few API calls.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/rancher-bmc-integration-kubernetes' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/solutions/rancher/v1beta)</b> 
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            The version of the OpenAPI document: 0.1
         
     | 
| 
       7 
     | 
    
         
            -
            Contact: support@phoenixnap.com
         
     | 
| 
       8 
     | 
    
         
            -
            Generated by: https://openapi-generator.tech
         
     | 
| 
       9 
     | 
    
         
            -
            OpenAPI Generator version: 6.1.0
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            =end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            require 'date'
         
     | 
| 
       14 
     | 
    
         
            -
            require 'time'
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            module RancherApi
         
     | 
| 
       17 
     | 
    
         
            -
              class ClusterWorkloadConfiguration
         
     | 
| 
       18 
     | 
    
         
            -
                # The name of the workload cluster. This field is autogenerated if not provided.
         
     | 
| 
       19 
     | 
    
         
            -
                attr_accessor :name
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                # Number of configured servers. Currently only server counts of 1 and 3 are possible.
         
     | 
| 
       22 
     | 
    
         
            -
                attr_accessor :server_count
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                # Node server type. Cannot be changed once the cluster is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m2.medium`, `d2.m2.large` or `d2.m2.xlarge`.
         
     | 
| 
       25 
     | 
    
         
            -
                attr_accessor :server_type
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
                # Workload cluster location. Cannot be changed once cluster is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
         
     | 
| 
       28 
     | 
    
         
            -
                attr_accessor :location
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
       31 
     | 
    
         
            -
                def self.attribute_map
         
     | 
| 
       32 
     | 
    
         
            -
                  {
         
     | 
| 
       33 
     | 
    
         
            -
                    :'name' => :'name',
         
     | 
| 
       34 
     | 
    
         
            -
                    :'server_count' => :'serverCount',
         
     | 
| 
       35 
     | 
    
         
            -
                    :'server_type' => :'serverType',
         
     | 
| 
       36 
     | 
    
         
            -
                    :'location' => :'location'
         
     | 
| 
       37 
     | 
    
         
            -
                  }
         
     | 
| 
       38 
     | 
    
         
            -
                end
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                # Returns all the JSON keys this model knows about
         
     | 
| 
       41 
     | 
    
         
            -
                def self.acceptable_attributes
         
     | 
| 
       42 
     | 
    
         
            -
                  attribute_map.values
         
     | 
| 
       43 
     | 
    
         
            -
                end
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                # Attribute type mapping.
         
     | 
| 
       46 
     | 
    
         
            -
                def self.openapi_types
         
     | 
| 
       47 
     | 
    
         
            -
                  {
         
     | 
| 
       48 
     | 
    
         
            -
                    :'name' => :'String',
         
     | 
| 
       49 
     | 
    
         
            -
                    :'server_count' => :'Integer',
         
     | 
| 
       50 
     | 
    
         
            -
                    :'server_type' => :'String',
         
     | 
| 
       51 
     | 
    
         
            -
                    :'location' => :'String'
         
     | 
| 
       52 
     | 
    
         
            -
                  }
         
     | 
| 
       53 
     | 
    
         
            -
                end
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
                # List of attributes with nullable: true
         
     | 
| 
       56 
     | 
    
         
            -
                def self.openapi_nullable
         
     | 
| 
       57 
     | 
    
         
            -
                  Set.new([
         
     | 
| 
       58 
     | 
    
         
            -
                  ])
         
     | 
| 
       59 
     | 
    
         
            -
                end
         
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
                # List of class defined in allOf (OpenAPI v3)
         
     | 
| 
       62 
     | 
    
         
            -
                def self.openapi_all_of
         
     | 
| 
       63 
     | 
    
         
            -
                  [
         
     | 
| 
       64 
     | 
    
         
            -
                  :'WorkloadClusterConfig'
         
     | 
| 
       65 
     | 
    
         
            -
                  ]
         
     | 
| 
       66 
     | 
    
         
            -
                end
         
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
                # Initializes the object
         
     | 
| 
       69 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       70 
     | 
    
         
            -
                def initialize(attributes = {})
         
     | 
| 
       71 
     | 
    
         
            -
                  if (!attributes.is_a?(Hash))
         
     | 
| 
       72 
     | 
    
         
            -
                    fail ArgumentError, "The input argument (attributes) must be a hash in `RancherApi::ClusterWorkloadConfiguration` initialize method"
         
     | 
| 
       73 
     | 
    
         
            -
                  end
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
                  # check to see if the attribute exists and convert string to symbol for hash key
         
     | 
| 
       76 
     | 
    
         
            -
                  attributes = attributes.each_with_object({}) { |(k, v), h|
         
     | 
| 
       77 
     | 
    
         
            -
                    if (!self.class.attribute_map.key?(k.to_sym))
         
     | 
| 
       78 
     | 
    
         
            -
                      fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::ClusterWorkloadConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
         
     | 
| 
       79 
     | 
    
         
            -
                    end
         
     | 
| 
       80 
     | 
    
         
            -
                    h[k.to_sym] = v
         
     | 
| 
       81 
     | 
    
         
            -
                  }
         
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
                  if attributes.key?(:'name')
         
     | 
| 
       84 
     | 
    
         
            -
                    self.name = attributes[:'name']
         
     | 
| 
       85 
     | 
    
         
            -
                  end
         
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
                  if attributes.key?(:'server_count')
         
     | 
| 
       88 
     | 
    
         
            -
                    self.server_count = attributes[:'server_count']
         
     | 
| 
       89 
     | 
    
         
            -
                  else
         
     | 
| 
       90 
     | 
    
         
            -
                    self.server_count = 1
         
     | 
| 
       91 
     | 
    
         
            -
                  end
         
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
       93 
     | 
    
         
            -
                  if attributes.key?(:'server_type')
         
     | 
| 
       94 
     | 
    
         
            -
                    self.server_type = attributes[:'server_type']
         
     | 
| 
       95 
     | 
    
         
            -
                  else
         
     | 
| 
       96 
     | 
    
         
            -
                    self.server_type = 's0.d1.small'
         
     | 
| 
       97 
     | 
    
         
            -
                  end
         
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
                  if attributes.key?(:'location')
         
     | 
| 
       100 
     | 
    
         
            -
                    self.location = attributes[:'location']
         
     | 
| 
       101 
     | 
    
         
            -
                  end
         
     | 
| 
       102 
     | 
    
         
            -
                end
         
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
     | 
    
         
            -
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
       105 
     | 
    
         
            -
                # @return Array for valid properties with the reasons
         
     | 
| 
       106 
     | 
    
         
            -
                def list_invalid_properties
         
     | 
| 
       107 
     | 
    
         
            -
                  invalid_properties = Array.new
         
     | 
| 
       108 
     | 
    
         
            -
                  if @server_type.nil?
         
     | 
| 
       109 
     | 
    
         
            -
                    invalid_properties.push('invalid value for "server_type", server_type cannot be nil.')
         
     | 
| 
       110 
     | 
    
         
            -
                  end
         
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
       112 
     | 
    
         
            -
                  if @location.nil?
         
     | 
| 
       113 
     | 
    
         
            -
                    invalid_properties.push('invalid value for "location", location cannot be nil.')
         
     | 
| 
       114 
     | 
    
         
            -
                  end
         
     | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
                  invalid_properties
         
     | 
| 
       117 
     | 
    
         
            -
                end
         
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
                # Check to see if the all the properties in the model are valid
         
     | 
| 
       120 
     | 
    
         
            -
                # @return true if the model is valid
         
     | 
| 
       121 
     | 
    
         
            -
                def valid?
         
     | 
| 
       122 
     | 
    
         
            -
                  return false if @server_type.nil?
         
     | 
| 
       123 
     | 
    
         
            -
                  return false if @location.nil?
         
     | 
| 
       124 
     | 
    
         
            -
                  true
         
     | 
| 
       125 
     | 
    
         
            -
                end
         
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
     | 
    
         
            -
                # Checks equality by comparing each attribute.
         
     | 
| 
       128 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       129 
     | 
    
         
            -
                def ==(o)
         
     | 
| 
       130 
     | 
    
         
            -
                  return true if self.equal?(o)
         
     | 
| 
       131 
     | 
    
         
            -
                  self.class == o.class &&
         
     | 
| 
       132 
     | 
    
         
            -
                      name == o.name &&
         
     | 
| 
       133 
     | 
    
         
            -
                      server_count == o.server_count &&
         
     | 
| 
       134 
     | 
    
         
            -
                      server_type == o.server_type &&
         
     | 
| 
       135 
     | 
    
         
            -
                      location == o.location
         
     | 
| 
       136 
     | 
    
         
            -
                end
         
     | 
| 
       137 
     | 
    
         
            -
             
     | 
| 
       138 
     | 
    
         
            -
                # @see the `==` method
         
     | 
| 
       139 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       140 
     | 
    
         
            -
                def eql?(o)
         
     | 
| 
       141 
     | 
    
         
            -
                  self == o
         
     | 
| 
       142 
     | 
    
         
            -
                end
         
     | 
| 
       143 
     | 
    
         
            -
             
     | 
| 
       144 
     | 
    
         
            -
                # Calculates hash code according to all attributes.
         
     | 
| 
       145 
     | 
    
         
            -
                # @return [Integer] Hash code
         
     | 
| 
       146 
     | 
    
         
            -
                def hash
         
     | 
| 
       147 
     | 
    
         
            -
                  [name, server_count, server_type, location].hash
         
     | 
| 
       148 
     | 
    
         
            -
                end
         
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
                # Builds the object from hash
         
     | 
| 
       151 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       152 
     | 
    
         
            -
                # @return [Object] Returns the model itself
         
     | 
| 
       153 
     | 
    
         
            -
                def self.build_from_hash(attributes)
         
     | 
| 
       154 
     | 
    
         
            -
                  new.build_from_hash(attributes)
         
     | 
| 
       155 
     | 
    
         
            -
                end
         
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
       157 
     | 
    
         
            -
                # Builds the object from hash
         
     | 
| 
       158 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       159 
     | 
    
         
            -
                # @return [Object] Returns the model itself
         
     | 
| 
       160 
     | 
    
         
            -
                def build_from_hash(attributes)
         
     | 
| 
       161 
     | 
    
         
            -
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
       162 
     | 
    
         
            -
                  attributes = attributes.transform_keys(&:to_sym)
         
     | 
| 
       163 
     | 
    
         
            -
                  self.class.openapi_types.each_pair do |key, type|
         
     | 
| 
       164 
     | 
    
         
            -
                    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
         
     | 
| 
       165 
     | 
    
         
            -
                      self.send("#{key}=", nil)
         
     | 
| 
       166 
     | 
    
         
            -
                    elsif type =~ /\AArray<(.*)>/i
         
     | 
| 
       167 
     | 
    
         
            -
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
       168 
     | 
    
         
            -
                      # is documented as an array but the input is not
         
     | 
| 
       169 
     | 
    
         
            -
                      if attributes[self.class.attribute_map[key]].is_a?(Array)
         
     | 
| 
       170 
     | 
    
         
            -
                        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
         
     | 
| 
       171 
     | 
    
         
            -
                      end
         
     | 
| 
       172 
     | 
    
         
            -
                    elsif !attributes[self.class.attribute_map[key]].nil?
         
     | 
| 
       173 
     | 
    
         
            -
                      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
         
     | 
| 
       174 
     | 
    
         
            -
                    end
         
     | 
| 
       175 
     | 
    
         
            -
                  end
         
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
                  self
         
     | 
| 
       178 
     | 
    
         
            -
                end
         
     | 
| 
       179 
     | 
    
         
            -
             
     | 
| 
       180 
     | 
    
         
            -
                # Deserializes the data based on type
         
     | 
| 
       181 
     | 
    
         
            -
                # @param string type Data type
         
     | 
| 
       182 
     | 
    
         
            -
                # @param string value Value to be deserialized
         
     | 
| 
       183 
     | 
    
         
            -
                # @return [Object] Deserialized data
         
     | 
| 
       184 
     | 
    
         
            -
                def _deserialize(type, value)
         
     | 
| 
       185 
     | 
    
         
            -
                  case type.to_sym
         
     | 
| 
       186 
     | 
    
         
            -
                  when :Time
         
     | 
| 
       187 
     | 
    
         
            -
                    Time.parse(value)
         
     | 
| 
       188 
     | 
    
         
            -
                  when :Date
         
     | 
| 
       189 
     | 
    
         
            -
                    Date.parse(value)
         
     | 
| 
       190 
     | 
    
         
            -
                  when :String
         
     | 
| 
       191 
     | 
    
         
            -
                    value.to_s
         
     | 
| 
       192 
     | 
    
         
            -
                  when :Integer
         
     | 
| 
       193 
     | 
    
         
            -
                    value.to_i
         
     | 
| 
       194 
     | 
    
         
            -
                  when :Float
         
     | 
| 
       195 
     | 
    
         
            -
                    value.to_f
         
     | 
| 
       196 
     | 
    
         
            -
                  when :Boolean
         
     | 
| 
       197 
     | 
    
         
            -
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
       198 
     | 
    
         
            -
                      true
         
     | 
| 
       199 
     | 
    
         
            -
                    else
         
     | 
| 
       200 
     | 
    
         
            -
                      false
         
     | 
| 
       201 
     | 
    
         
            -
                    end
         
     | 
| 
       202 
     | 
    
         
            -
                  when :Object
         
     | 
| 
       203 
     | 
    
         
            -
                    # generic object (usually a Hash), return directly
         
     | 
| 
       204 
     | 
    
         
            -
                    value
         
     | 
| 
       205 
     | 
    
         
            -
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
       206 
     | 
    
         
            -
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
       207 
     | 
    
         
            -
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
       208 
     | 
    
         
            -
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
       209 
     | 
    
         
            -
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
       210 
     | 
    
         
            -
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
       211 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       212 
     | 
    
         
            -
                      value.each do |k, v|
         
     | 
| 
       213 
     | 
    
         
            -
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
       214 
     | 
    
         
            -
                      end
         
     | 
| 
       215 
     | 
    
         
            -
                    end
         
     | 
| 
       216 
     | 
    
         
            -
                  else # model
         
     | 
| 
       217 
     | 
    
         
            -
                    # models (e.g. Pet) or oneOf
         
     | 
| 
       218 
     | 
    
         
            -
                    klass = RancherApi.const_get(type)
         
     | 
| 
       219 
     | 
    
         
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         
     | 
| 
       220 
     | 
    
         
            -
                  end
         
     | 
| 
       221 
     | 
    
         
            -
                end
         
     | 
| 
       222 
     | 
    
         
            -
             
     | 
| 
       223 
     | 
    
         
            -
                # Returns the string representation of the object
         
     | 
| 
       224 
     | 
    
         
            -
                # @return [String] String presentation of the object
         
     | 
| 
       225 
     | 
    
         
            -
                def to_s
         
     | 
| 
       226 
     | 
    
         
            -
                  to_hash.to_s
         
     | 
| 
       227 
     | 
    
         
            -
                end
         
     | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
       229 
     | 
    
         
            -
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
       230 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       231 
     | 
    
         
            -
                def to_body
         
     | 
| 
       232 
     | 
    
         
            -
                  to_hash
         
     | 
| 
       233 
     | 
    
         
            -
                end
         
     | 
| 
       234 
     | 
    
         
            -
             
     | 
| 
       235 
     | 
    
         
            -
                # Returns the object in the form of hash
         
     | 
| 
       236 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       237 
     | 
    
         
            -
                def to_hash
         
     | 
| 
       238 
     | 
    
         
            -
                  hash = {}
         
     | 
| 
       239 
     | 
    
         
            -
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
       240 
     | 
    
         
            -
                    value = self.send(attr)
         
     | 
| 
       241 
     | 
    
         
            -
                    if value.nil?
         
     | 
| 
       242 
     | 
    
         
            -
                      is_nullable = self.class.openapi_nullable.include?(attr)
         
     | 
| 
       243 
     | 
    
         
            -
                      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
         
     | 
| 
       244 
     | 
    
         
            -
                    end
         
     | 
| 
       245 
     | 
    
         
            -
             
     | 
| 
       246 
     | 
    
         
            -
                    hash[param] = _to_hash(value)
         
     | 
| 
       247 
     | 
    
         
            -
                  end
         
     | 
| 
       248 
     | 
    
         
            -
                  hash
         
     | 
| 
       249 
     | 
    
         
            -
                end
         
     | 
| 
       250 
     | 
    
         
            -
             
     | 
| 
       251 
     | 
    
         
            -
                # Outputs non-array value in the form of hash
         
     | 
| 
       252 
     | 
    
         
            -
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
       253 
     | 
    
         
            -
                # @param [Object] value Any valid value
         
     | 
| 
       254 
     | 
    
         
            -
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
       255 
     | 
    
         
            -
                def _to_hash(value)
         
     | 
| 
       256 
     | 
    
         
            -
                  if value.is_a?(Array)
         
     | 
| 
       257 
     | 
    
         
            -
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
       258 
     | 
    
         
            -
                  elsif value.is_a?(Hash)
         
     | 
| 
       259 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       260 
     | 
    
         
            -
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
       261 
     | 
    
         
            -
                    end
         
     | 
| 
       262 
     | 
    
         
            -
                  elsif value.respond_to? :to_hash
         
     | 
| 
       263 
     | 
    
         
            -
                    value.to_hash
         
     | 
| 
       264 
     | 
    
         
            -
                  else
         
     | 
| 
       265 
     | 
    
         
            -
                    value
         
     | 
| 
       266 
     | 
    
         
            -
                  end
         
     | 
| 
       267 
     | 
    
         
            -
                end
         
     | 
| 
       268 
     | 
    
         
            -
             
     | 
| 
       269 
     | 
    
         
            -
              end
         
     | 
| 
       270 
     | 
    
         
            -
             
     | 
| 
       271 
     | 
    
         
            -
            end
         
     | 
| 
         @@ -1,253 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            =begin
         
     | 
| 
       2 
     | 
    
         
            -
            #Rancher Solution API
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            #Simplify enterprise-grade Kubernetes cluster operations and management with Rancher on Bare Metal Cloud. Deploy Kubernetes clusters using a few API calls.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/rancher-bmc-integration-kubernetes' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/solutions/rancher/v1beta)</b> 
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            The version of the OpenAPI document: 0.1
         
     | 
| 
       7 
     | 
    
         
            -
            Contact: support@phoenixnap.com
         
     | 
| 
       8 
     | 
    
         
            -
            Generated by: https://openapi-generator.tech
         
     | 
| 
       9 
     | 
    
         
            -
            OpenAPI Generator version: 6.1.0
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            =end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            require 'date'
         
     | 
| 
       14 
     | 
    
         
            -
            require 'time'
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            module RancherApi
         
     | 
| 
       17 
     | 
    
         
            -
              class NodePoolSshConfig
         
     | 
| 
       18 
     | 
    
         
            -
                # Define whether public keys marked as default should be installed on this node. These are public keys that were already recorded on this system. Use <a href='https://developers.phoenixnap.com/docs/bmc/1/routes/ssh-keys/get' target='_blank'>GET /ssh-keys</a> to retrieve a list of possible values.
         
     | 
| 
       19 
     | 
    
         
            -
                attr_accessor :install_default_keys
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                # List of public SSH keys.
         
     | 
| 
       22 
     | 
    
         
            -
                attr_accessor :keys
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                # List of public SSH key identifiers. These are public keys that were already recorded on this system. Use <a href='https://developers.phoenixnap.com/docs/bmc/1/routes/ssh-keys/get' target='_blank'>GET /ssh-keys</a> to retrieve a list of possible values.
         
     | 
| 
       25 
     | 
    
         
            -
                attr_accessor :key_ids
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
       28 
     | 
    
         
            -
                def self.attribute_map
         
     | 
| 
       29 
     | 
    
         
            -
                  {
         
     | 
| 
       30 
     | 
    
         
            -
                    :'install_default_keys' => :'installDefaultKeys',
         
     | 
| 
       31 
     | 
    
         
            -
                    :'keys' => :'keys',
         
     | 
| 
       32 
     | 
    
         
            -
                    :'key_ids' => :'keyIds'
         
     | 
| 
       33 
     | 
    
         
            -
                  }
         
     | 
| 
       34 
     | 
    
         
            -
                end
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                # Returns all the JSON keys this model knows about
         
     | 
| 
       37 
     | 
    
         
            -
                def self.acceptable_attributes
         
     | 
| 
       38 
     | 
    
         
            -
                  attribute_map.values
         
     | 
| 
       39 
     | 
    
         
            -
                end
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
                # Attribute type mapping.
         
     | 
| 
       42 
     | 
    
         
            -
                def self.openapi_types
         
     | 
| 
       43 
     | 
    
         
            -
                  {
         
     | 
| 
       44 
     | 
    
         
            -
                    :'install_default_keys' => :'Boolean',
         
     | 
| 
       45 
     | 
    
         
            -
                    :'keys' => :'Array<String>',
         
     | 
| 
       46 
     | 
    
         
            -
                    :'key_ids' => :'Array<String>'
         
     | 
| 
       47 
     | 
    
         
            -
                  }
         
     | 
| 
       48 
     | 
    
         
            -
                end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                # List of attributes with nullable: true
         
     | 
| 
       51 
     | 
    
         
            -
                def self.openapi_nullable
         
     | 
| 
       52 
     | 
    
         
            -
                  Set.new([
         
     | 
| 
       53 
     | 
    
         
            -
                  ])
         
     | 
| 
       54 
     | 
    
         
            -
                end
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
                # List of class defined in allOf (OpenAPI v3)
         
     | 
| 
       57 
     | 
    
         
            -
                def self.openapi_all_of
         
     | 
| 
       58 
     | 
    
         
            -
                  [
         
     | 
| 
       59 
     | 
    
         
            -
                  :'SshConfig'
         
     | 
| 
       60 
     | 
    
         
            -
                  ]
         
     | 
| 
       61 
     | 
    
         
            -
                end
         
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
                # Initializes the object
         
     | 
| 
       64 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       65 
     | 
    
         
            -
                def initialize(attributes = {})
         
     | 
| 
       66 
     | 
    
         
            -
                  if (!attributes.is_a?(Hash))
         
     | 
| 
       67 
     | 
    
         
            -
                    fail ArgumentError, "The input argument (attributes) must be a hash in `RancherApi::NodePoolSshConfig` initialize method"
         
     | 
| 
       68 
     | 
    
         
            -
                  end
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                  # check to see if the attribute exists and convert string to symbol for hash key
         
     | 
| 
       71 
     | 
    
         
            -
                  attributes = attributes.each_with_object({}) { |(k, v), h|
         
     | 
| 
       72 
     | 
    
         
            -
                    if (!self.class.attribute_map.key?(k.to_sym))
         
     | 
| 
       73 
     | 
    
         
            -
                      fail ArgumentError, "`#{k}` is not a valid attribute in `RancherApi::NodePoolSshConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
         
     | 
| 
       74 
     | 
    
         
            -
                    end
         
     | 
| 
       75 
     | 
    
         
            -
                    h[k.to_sym] = v
         
     | 
| 
       76 
     | 
    
         
            -
                  }
         
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
       78 
     | 
    
         
            -
                  if attributes.key?(:'install_default_keys')
         
     | 
| 
       79 
     | 
    
         
            -
                    self.install_default_keys = attributes[:'install_default_keys']
         
     | 
| 
       80 
     | 
    
         
            -
                  else
         
     | 
| 
       81 
     | 
    
         
            -
                    self.install_default_keys = true
         
     | 
| 
       82 
     | 
    
         
            -
                  end
         
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
                  if attributes.key?(:'keys')
         
     | 
| 
       85 
     | 
    
         
            -
                    if (value = attributes[:'keys']).is_a?(Array)
         
     | 
| 
       86 
     | 
    
         
            -
                      self.keys = value
         
     | 
| 
       87 
     | 
    
         
            -
                    end
         
     | 
| 
       88 
     | 
    
         
            -
                  end
         
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
                  if attributes.key?(:'key_ids')
         
     | 
| 
       91 
     | 
    
         
            -
                    if (value = attributes[:'key_ids']).is_a?(Array)
         
     | 
| 
       92 
     | 
    
         
            -
                      self.key_ids = value
         
     | 
| 
       93 
     | 
    
         
            -
                    end
         
     | 
| 
       94 
     | 
    
         
            -
                  end
         
     | 
| 
       95 
     | 
    
         
            -
                end
         
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
       97 
     | 
    
         
            -
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
       98 
     | 
    
         
            -
                # @return Array for valid properties with the reasons
         
     | 
| 
       99 
     | 
    
         
            -
                def list_invalid_properties
         
     | 
| 
       100 
     | 
    
         
            -
                  invalid_properties = Array.new
         
     | 
| 
       101 
     | 
    
         
            -
                  invalid_properties
         
     | 
| 
       102 
     | 
    
         
            -
                end
         
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
     | 
    
         
            -
                # Check to see if the all the properties in the model are valid
         
     | 
| 
       105 
     | 
    
         
            -
                # @return true if the model is valid
         
     | 
| 
       106 
     | 
    
         
            -
                def valid?
         
     | 
| 
       107 
     | 
    
         
            -
                  true
         
     | 
| 
       108 
     | 
    
         
            -
                end
         
     | 
| 
       109 
     | 
    
         
            -
             
     | 
| 
       110 
     | 
    
         
            -
                # Checks equality by comparing each attribute.
         
     | 
| 
       111 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       112 
     | 
    
         
            -
                def ==(o)
         
     | 
| 
       113 
     | 
    
         
            -
                  return true if self.equal?(o)
         
     | 
| 
       114 
     | 
    
         
            -
                  self.class == o.class &&
         
     | 
| 
       115 
     | 
    
         
            -
                      install_default_keys == o.install_default_keys &&
         
     | 
| 
       116 
     | 
    
         
            -
                      keys == o.keys &&
         
     | 
| 
       117 
     | 
    
         
            -
                      key_ids == o.key_ids
         
     | 
| 
       118 
     | 
    
         
            -
                end
         
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
                # @see the `==` method
         
     | 
| 
       121 
     | 
    
         
            -
                # @param [Object] Object to be compared
         
     | 
| 
       122 
     | 
    
         
            -
                def eql?(o)
         
     | 
| 
       123 
     | 
    
         
            -
                  self == o
         
     | 
| 
       124 
     | 
    
         
            -
                end
         
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
                # Calculates hash code according to all attributes.
         
     | 
| 
       127 
     | 
    
         
            -
                # @return [Integer] Hash code
         
     | 
| 
       128 
     | 
    
         
            -
                def hash
         
     | 
| 
       129 
     | 
    
         
            -
                  [install_default_keys, keys, key_ids].hash
         
     | 
| 
       130 
     | 
    
         
            -
                end
         
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
                # Builds the object from hash
         
     | 
| 
       133 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       134 
     | 
    
         
            -
                # @return [Object] Returns the model itself
         
     | 
| 
       135 
     | 
    
         
            -
                def self.build_from_hash(attributes)
         
     | 
| 
       136 
     | 
    
         
            -
                  new.build_from_hash(attributes)
         
     | 
| 
       137 
     | 
    
         
            -
                end
         
     | 
| 
       138 
     | 
    
         
            -
             
     | 
| 
       139 
     | 
    
         
            -
                # Builds the object from hash
         
     | 
| 
       140 
     | 
    
         
            -
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
       141 
     | 
    
         
            -
                # @return [Object] Returns the model itself
         
     | 
| 
       142 
     | 
    
         
            -
                def build_from_hash(attributes)
         
     | 
| 
       143 
     | 
    
         
            -
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
       144 
     | 
    
         
            -
                  attributes = attributes.transform_keys(&:to_sym)
         
     | 
| 
       145 
     | 
    
         
            -
                  self.class.openapi_types.each_pair do |key, type|
         
     | 
| 
       146 
     | 
    
         
            -
                    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
         
     | 
| 
       147 
     | 
    
         
            -
                      self.send("#{key}=", nil)
         
     | 
| 
       148 
     | 
    
         
            -
                    elsif type =~ /\AArray<(.*)>/i
         
     | 
| 
       149 
     | 
    
         
            -
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
       150 
     | 
    
         
            -
                      # is documented as an array but the input is not
         
     | 
| 
       151 
     | 
    
         
            -
                      if attributes[self.class.attribute_map[key]].is_a?(Array)
         
     | 
| 
       152 
     | 
    
         
            -
                        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
         
     | 
| 
       153 
     | 
    
         
            -
                      end
         
     | 
| 
       154 
     | 
    
         
            -
                    elsif !attributes[self.class.attribute_map[key]].nil?
         
     | 
| 
       155 
     | 
    
         
            -
                      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
         
     | 
| 
       156 
     | 
    
         
            -
                    end
         
     | 
| 
       157 
     | 
    
         
            -
                  end
         
     | 
| 
       158 
     | 
    
         
            -
             
     | 
| 
       159 
     | 
    
         
            -
                  self
         
     | 
| 
       160 
     | 
    
         
            -
                end
         
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
                # Deserializes the data based on type
         
     | 
| 
       163 
     | 
    
         
            -
                # @param string type Data type
         
     | 
| 
       164 
     | 
    
         
            -
                # @param string value Value to be deserialized
         
     | 
| 
       165 
     | 
    
         
            -
                # @return [Object] Deserialized data
         
     | 
| 
       166 
     | 
    
         
            -
                def _deserialize(type, value)
         
     | 
| 
       167 
     | 
    
         
            -
                  case type.to_sym
         
     | 
| 
       168 
     | 
    
         
            -
                  when :Time
         
     | 
| 
       169 
     | 
    
         
            -
                    Time.parse(value)
         
     | 
| 
       170 
     | 
    
         
            -
                  when :Date
         
     | 
| 
       171 
     | 
    
         
            -
                    Date.parse(value)
         
     | 
| 
       172 
     | 
    
         
            -
                  when :String
         
     | 
| 
       173 
     | 
    
         
            -
                    value.to_s
         
     | 
| 
       174 
     | 
    
         
            -
                  when :Integer
         
     | 
| 
       175 
     | 
    
         
            -
                    value.to_i
         
     | 
| 
       176 
     | 
    
         
            -
                  when :Float
         
     | 
| 
       177 
     | 
    
         
            -
                    value.to_f
         
     | 
| 
       178 
     | 
    
         
            -
                  when :Boolean
         
     | 
| 
       179 
     | 
    
         
            -
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
       180 
     | 
    
         
            -
                      true
         
     | 
| 
       181 
     | 
    
         
            -
                    else
         
     | 
| 
       182 
     | 
    
         
            -
                      false
         
     | 
| 
       183 
     | 
    
         
            -
                    end
         
     | 
| 
       184 
     | 
    
         
            -
                  when :Object
         
     | 
| 
       185 
     | 
    
         
            -
                    # generic object (usually a Hash), return directly
         
     | 
| 
       186 
     | 
    
         
            -
                    value
         
     | 
| 
       187 
     | 
    
         
            -
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
       188 
     | 
    
         
            -
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
       189 
     | 
    
         
            -
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
       190 
     | 
    
         
            -
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
       191 
     | 
    
         
            -
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
       192 
     | 
    
         
            -
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
       193 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       194 
     | 
    
         
            -
                      value.each do |k, v|
         
     | 
| 
       195 
     | 
    
         
            -
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
       196 
     | 
    
         
            -
                      end
         
     | 
| 
       197 
     | 
    
         
            -
                    end
         
     | 
| 
       198 
     | 
    
         
            -
                  else # model
         
     | 
| 
       199 
     | 
    
         
            -
                    # models (e.g. Pet) or oneOf
         
     | 
| 
       200 
     | 
    
         
            -
                    klass = RancherApi.const_get(type)
         
     | 
| 
       201 
     | 
    
         
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         
     | 
| 
       202 
     | 
    
         
            -
                  end
         
     | 
| 
       203 
     | 
    
         
            -
                end
         
     | 
| 
       204 
     | 
    
         
            -
             
     | 
| 
       205 
     | 
    
         
            -
                # Returns the string representation of the object
         
     | 
| 
       206 
     | 
    
         
            -
                # @return [String] String presentation of the object
         
     | 
| 
       207 
     | 
    
         
            -
                def to_s
         
     | 
| 
       208 
     | 
    
         
            -
                  to_hash.to_s
         
     | 
| 
       209 
     | 
    
         
            -
                end
         
     | 
| 
       210 
     | 
    
         
            -
             
     | 
| 
       211 
     | 
    
         
            -
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
       212 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       213 
     | 
    
         
            -
                def to_body
         
     | 
| 
       214 
     | 
    
         
            -
                  to_hash
         
     | 
| 
       215 
     | 
    
         
            -
                end
         
     | 
| 
       216 
     | 
    
         
            -
             
     | 
| 
       217 
     | 
    
         
            -
                # Returns the object in the form of hash
         
     | 
| 
       218 
     | 
    
         
            -
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
       219 
     | 
    
         
            -
                def to_hash
         
     | 
| 
       220 
     | 
    
         
            -
                  hash = {}
         
     | 
| 
       221 
     | 
    
         
            -
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
       222 
     | 
    
         
            -
                    value = self.send(attr)
         
     | 
| 
       223 
     | 
    
         
            -
                    if value.nil?
         
     | 
| 
       224 
     | 
    
         
            -
                      is_nullable = self.class.openapi_nullable.include?(attr)
         
     | 
| 
       225 
     | 
    
         
            -
                      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
         
     | 
| 
       226 
     | 
    
         
            -
                    end
         
     | 
| 
       227 
     | 
    
         
            -
             
     | 
| 
       228 
     | 
    
         
            -
                    hash[param] = _to_hash(value)
         
     | 
| 
       229 
     | 
    
         
            -
                  end
         
     | 
| 
       230 
     | 
    
         
            -
                  hash
         
     | 
| 
       231 
     | 
    
         
            -
                end
         
     | 
| 
       232 
     | 
    
         
            -
             
     | 
| 
       233 
     | 
    
         
            -
                # Outputs non-array value in the form of hash
         
     | 
| 
       234 
     | 
    
         
            -
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
       235 
     | 
    
         
            -
                # @param [Object] value Any valid value
         
     | 
| 
       236 
     | 
    
         
            -
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
       237 
     | 
    
         
            -
                def _to_hash(value)
         
     | 
| 
       238 
     | 
    
         
            -
                  if value.is_a?(Array)
         
     | 
| 
       239 
     | 
    
         
            -
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
       240 
     | 
    
         
            -
                  elsif value.is_a?(Hash)
         
     | 
| 
       241 
     | 
    
         
            -
                    {}.tap do |hash|
         
     | 
| 
       242 
     | 
    
         
            -
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
       243 
     | 
    
         
            -
                    end
         
     | 
| 
       244 
     | 
    
         
            -
                  elsif value.respond_to? :to_hash
         
     | 
| 
       245 
     | 
    
         
            -
                    value.to_hash
         
     | 
| 
       246 
     | 
    
         
            -
                  else
         
     | 
| 
       247 
     | 
    
         
            -
                    value
         
     | 
| 
       248 
     | 
    
         
            -
                  end
         
     | 
| 
       249 
     | 
    
         
            -
                end
         
     | 
| 
       250 
     | 
    
         
            -
             
     | 
| 
       251 
     | 
    
         
            -
              end
         
     | 
| 
       252 
     | 
    
         
            -
             
     | 
| 
       253 
     | 
    
         
            -
            end
         
     |