pnap_ip_api 1.1.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 -0
- data/VERSION +1 -1
- data/docs/IPBlocksApi.md +18 -24
- data/docs/IpBlock.md +1 -1
- data/lib/pnap_ip_api/api/ip_blocks_api.rb +31 -19
- data/lib/pnap_ip_api/api_client.rb +24 -21
- data/lib/pnap_ip_api/api_error.rb +2 -1
- data/lib/pnap_ip_api/configuration.rb +28 -9
- data/lib/pnap_ip_api/models/delete_ip_block_result.rb +18 -19
- data/lib/pnap_ip_api/models/error.rb +16 -19
- data/lib/pnap_ip_api/models/ip_block.rb +34 -21
- data/lib/pnap_ip_api/models/ip_block_create.rb +23 -20
- data/lib/pnap_ip_api/models/ip_block_patch.rb +19 -20
- data/lib/pnap_ip_api/models/tag_assignment.rb +20 -19
- data/lib/pnap_ip_api/models/tag_assignment_request.rb +16 -19
- data/lib/pnap_ip_api/version.rb +1 -1
- data/lib/pnap_ip_api.rb +1 -1
- data/pnap_ip_api.gemspec +2 -2
- data/spec/api/ip_blocks_api_spec.rb +22 -8
- data/spec/models/delete_ip_block_result_spec.rb +6 -4
- data/spec/models/error_spec.rb +6 -4
- data/spec/models/ip_block_create_spec.rb +13 -5
- data/spec/models/ip_block_patch_spec.rb +5 -3
- data/spec/models/ip_block_spec.rb +30 -10
- data/spec/models/tag_assignment_request_spec.rb +6 -4
- data/spec/models/tag_assignment_spec.rb +9 -7
- data/spec/spec_helper.rb +1 -1
- metadata +7 -11
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
| @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 7 7 | 
             
            Contact: support@phoenixnap.com
         | 
| 8 8 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            -
            OpenAPI Generator version:  | 
| 9 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 10 10 |  | 
| 11 11 | 
             
            =end
         | 
| 12 12 |  | 
| @@ -65,6 +65,8 @@ module IpApi | |
| 65 65 |  | 
| 66 66 | 
             
                  if attributes.key?(:'message')
         | 
| 67 67 | 
             
                    self.message = attributes[:'message']
         | 
| 68 | 
            +
                  else
         | 
| 69 | 
            +
                    self.message = nil
         | 
| 68 70 | 
             
                  end
         | 
| 69 71 |  | 
| 70 72 | 
             
                  if attributes.key?(:'validation_errors')
         | 
| @@ -77,6 +79,7 @@ module IpApi | |
| 77 79 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 78 80 | 
             
                # @return Array for valid properties with the reasons
         | 
| 79 81 | 
             
                def list_invalid_properties
         | 
| 82 | 
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         | 
| 80 83 | 
             
                  invalid_properties = Array.new
         | 
| 81 84 | 
             
                  if @message.nil?
         | 
| 82 85 | 
             
                    invalid_properties.push('invalid value for "message", message cannot be nil.')
         | 
| @@ -88,6 +91,7 @@ module IpApi | |
| 88 91 | 
             
                # Check to see if the all the properties in the model are valid
         | 
| 89 92 | 
             
                # @return true if the model is valid
         | 
| 90 93 | 
             
                def valid?
         | 
| 94 | 
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         | 
| 91 95 | 
             
                  return false if @message.nil?
         | 
| 92 96 | 
             
                  true
         | 
| 93 97 | 
             
                end
         | 
| @@ -117,37 +121,30 @@ module IpApi | |
| 117 121 | 
             
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 118 122 | 
             
                # @return [Object] Returns the model itself
         | 
| 119 123 | 
             
                def self.build_from_hash(attributes)
         | 
| 120 | 
            -
                  new.build_from_hash(attributes)
         | 
| 121 | 
            -
                end
         | 
| 122 | 
            -
             | 
| 123 | 
            -
                # Builds the object from hash
         | 
| 124 | 
            -
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 125 | 
            -
                # @return [Object] Returns the model itself
         | 
| 126 | 
            -
                def build_from_hash(attributes)
         | 
| 127 124 | 
             
                  return nil unless attributes.is_a?(Hash)
         | 
| 128 125 | 
             
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 129 | 
            -
                   | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 126 | 
            +
                  transformed_hash = {}
         | 
| 127 | 
            +
                  openapi_types.each_pair do |key, type|
         | 
| 128 | 
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         | 
| 129 | 
            +
                      transformed_hash["#{key}"] = nil
         | 
| 132 130 | 
             
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 133 131 | 
             
                      # check to ensure the input is an array given that the attribute
         | 
| 134 132 | 
             
                      # is documented as an array but the input is not
         | 
| 135 | 
            -
                      if attributes[ | 
| 136 | 
            -
                         | 
| 133 | 
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         | 
| 134 | 
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         | 
| 137 135 | 
             
                      end
         | 
| 138 | 
            -
                    elsif !attributes[ | 
| 139 | 
            -
                       | 
| 136 | 
            +
                    elsif !attributes[attribute_map[key]].nil?
         | 
| 137 | 
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         | 
| 140 138 | 
             
                    end
         | 
| 141 139 | 
             
                  end
         | 
| 142 | 
            -
             | 
| 143 | 
            -
                  self
         | 
| 140 | 
            +
                  new(transformed_hash)
         | 
| 144 141 | 
             
                end
         | 
| 145 142 |  | 
| 146 143 | 
             
                # Deserializes the data based on type
         | 
| 147 144 | 
             
                # @param string type Data type
         | 
| 148 145 | 
             
                # @param string value Value to be deserialized
         | 
| 149 146 | 
             
                # @return [Object] Deserialized data
         | 
| 150 | 
            -
                def _deserialize(type, value)
         | 
| 147 | 
            +
                def self._deserialize(type, value)
         | 
| 151 148 | 
             
                  case type.to_sym
         | 
| 152 149 | 
             
                  when :Time
         | 
| 153 150 | 
             
                    Time.parse(value)
         | 
| @@ -182,7 +179,7 @@ module IpApi | |
| 182 179 | 
             
                  else # model
         | 
| 183 180 | 
             
                    # models (e.g. Pet) or oneOf
         | 
| 184 181 | 
             
                    klass = IpApi.const_get(type)
         | 
| 185 | 
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 182 | 
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 186 183 | 
             
                  end
         | 
| 187 184 | 
             
                end
         | 
| 188 185 |  | 
| @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 7 7 | 
             
            Contact: support@phoenixnap.com
         | 
| 8 8 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            -
            OpenAPI Generator version:  | 
| 9 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 10 10 |  | 
| 11 11 | 
             
            =end
         | 
| 12 12 |  | 
| @@ -28,7 +28,7 @@ module IpApi | |
| 28 28 | 
             
                # The IP Block in CIDR notation.
         | 
| 29 29 | 
             
                attr_accessor :cidr
         | 
| 30 30 |  | 
| 31 | 
            -
                # The status of the IP Block.
         | 
| 31 | 
            +
                # The status of the IP Block. Can have one of the following values: `creating` , `assigning` , `error assigning` , `assigned` , `unassigning` , `error unassigning` or `unassigned`.
         | 
| 32 32 | 
             
                attr_accessor :status
         | 
| 33 33 |  | 
| 34 34 | 
             
                # ID of the resource assigned to the IP Block.
         | 
| @@ -111,22 +111,32 @@ module IpApi | |
| 111 111 |  | 
| 112 112 | 
             
                  if attributes.key?(:'id')
         | 
| 113 113 | 
             
                    self.id = attributes[:'id']
         | 
| 114 | 
            +
                  else
         | 
| 115 | 
            +
                    self.id = nil
         | 
| 114 116 | 
             
                  end
         | 
| 115 117 |  | 
| 116 118 | 
             
                  if attributes.key?(:'location')
         | 
| 117 119 | 
             
                    self.location = attributes[:'location']
         | 
| 120 | 
            +
                  else
         | 
| 121 | 
            +
                    self.location = nil
         | 
| 118 122 | 
             
                  end
         | 
| 119 123 |  | 
| 120 124 | 
             
                  if attributes.key?(:'cidr_block_size')
         | 
| 121 125 | 
             
                    self.cidr_block_size = attributes[:'cidr_block_size']
         | 
| 126 | 
            +
                  else
         | 
| 127 | 
            +
                    self.cidr_block_size = nil
         | 
| 122 128 | 
             
                  end
         | 
| 123 129 |  | 
| 124 130 | 
             
                  if attributes.key?(:'cidr')
         | 
| 125 131 | 
             
                    self.cidr = attributes[:'cidr']
         | 
| 132 | 
            +
                  else
         | 
| 133 | 
            +
                    self.cidr = nil
         | 
| 126 134 | 
             
                  end
         | 
| 127 135 |  | 
| 128 136 | 
             
                  if attributes.key?(:'status')
         | 
| 129 137 | 
             
                    self.status = attributes[:'status']
         | 
| 138 | 
            +
                  else
         | 
| 139 | 
            +
                    self.status = nil
         | 
| 130 140 | 
             
                  end
         | 
| 131 141 |  | 
| 132 142 | 
             
                  if attributes.key?(:'assigned_resource_id')
         | 
| @@ -149,16 +159,21 @@ module IpApi | |
| 149 159 |  | 
| 150 160 | 
             
                  if attributes.key?(:'is_bring_your_own')
         | 
| 151 161 | 
             
                    self.is_bring_your_own = attributes[:'is_bring_your_own']
         | 
| 162 | 
            +
                  else
         | 
| 163 | 
            +
                    self.is_bring_your_own = nil
         | 
| 152 164 | 
             
                  end
         | 
| 153 165 |  | 
| 154 166 | 
             
                  if attributes.key?(:'created_on')
         | 
| 155 167 | 
             
                    self.created_on = attributes[:'created_on']
         | 
| 168 | 
            +
                  else
         | 
| 169 | 
            +
                    self.created_on = nil
         | 
| 156 170 | 
             
                  end
         | 
| 157 171 | 
             
                end
         | 
| 158 172 |  | 
| 159 173 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 160 174 | 
             
                # @return Array for valid properties with the reasons
         | 
| 161 175 | 
             
                def list_invalid_properties
         | 
| 176 | 
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         | 
| 162 177 | 
             
                  invalid_properties = Array.new
         | 
| 163 178 | 
             
                  if @id.nil?
         | 
| 164 179 | 
             
                    invalid_properties.push('invalid value for "id", id cannot be nil.')
         | 
| @@ -198,6 +213,7 @@ module IpApi | |
| 198 213 | 
             
                # Check to see if the all the properties in the model are valid
         | 
| 199 214 | 
             
                # @return true if the model is valid
         | 
| 200 215 | 
             
                def valid?
         | 
| 216 | 
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         | 
| 201 217 | 
             
                  return false if @id.nil?
         | 
| 202 218 | 
             
                  return false if @location.nil?
         | 
| 203 219 | 
             
                  return false if @cidr_block_size.nil?
         | 
| @@ -212,7 +228,11 @@ module IpApi | |
| 212 228 | 
             
                # Custom attribute writer method with validation
         | 
| 213 229 | 
             
                # @param [Object] description Value to be assigned
         | 
| 214 230 | 
             
                def description=(description)
         | 
| 215 | 
            -
                  if  | 
| 231 | 
            +
                  if description.nil?
         | 
| 232 | 
            +
                    fail ArgumentError, 'description cannot be nil'
         | 
| 233 | 
            +
                  end
         | 
| 234 | 
            +
             | 
| 235 | 
            +
                  if description.to_s.length > 250
         | 
| 216 236 | 
             
                    fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
         | 
| 217 237 | 
             
                  end
         | 
| 218 238 |  | 
| @@ -253,37 +273,30 @@ module IpApi | |
| 253 273 | 
             
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 254 274 | 
             
                # @return [Object] Returns the model itself
         | 
| 255 275 | 
             
                def self.build_from_hash(attributes)
         | 
| 256 | 
            -
                  new.build_from_hash(attributes)
         | 
| 257 | 
            -
                end
         | 
| 258 | 
            -
             | 
| 259 | 
            -
                # Builds the object from hash
         | 
| 260 | 
            -
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 261 | 
            -
                # @return [Object] Returns the model itself
         | 
| 262 | 
            -
                def build_from_hash(attributes)
         | 
| 263 276 | 
             
                  return nil unless attributes.is_a?(Hash)
         | 
| 264 277 | 
             
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 265 | 
            -
                   | 
| 266 | 
            -
             | 
| 267 | 
            -
             | 
| 278 | 
            +
                  transformed_hash = {}
         | 
| 279 | 
            +
                  openapi_types.each_pair do |key, type|
         | 
| 280 | 
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         | 
| 281 | 
            +
                      transformed_hash["#{key}"] = nil
         | 
| 268 282 | 
             
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 269 283 | 
             
                      # check to ensure the input is an array given that the attribute
         | 
| 270 284 | 
             
                      # is documented as an array but the input is not
         | 
| 271 | 
            -
                      if attributes[ | 
| 272 | 
            -
                         | 
| 285 | 
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         | 
| 286 | 
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         | 
| 273 287 | 
             
                      end
         | 
| 274 | 
            -
                    elsif !attributes[ | 
| 275 | 
            -
                       | 
| 288 | 
            +
                    elsif !attributes[attribute_map[key]].nil?
         | 
| 289 | 
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         | 
| 276 290 | 
             
                    end
         | 
| 277 291 | 
             
                  end
         | 
| 278 | 
            -
             | 
| 279 | 
            -
                  self
         | 
| 292 | 
            +
                  new(transformed_hash)
         | 
| 280 293 | 
             
                end
         | 
| 281 294 |  | 
| 282 295 | 
             
                # Deserializes the data based on type
         | 
| 283 296 | 
             
                # @param string type Data type
         | 
| 284 297 | 
             
                # @param string value Value to be deserialized
         | 
| 285 298 | 
             
                # @return [Object] Deserialized data
         | 
| 286 | 
            -
                def _deserialize(type, value)
         | 
| 299 | 
            +
                def self._deserialize(type, value)
         | 
| 287 300 | 
             
                  case type.to_sym
         | 
| 288 301 | 
             
                  when :Time
         | 
| 289 302 | 
             
                    Time.parse(value)
         | 
| @@ -318,7 +331,7 @@ module IpApi | |
| 318 331 | 
             
                  else # model
         | 
| 319 332 | 
             
                    # models (e.g. Pet) or oneOf
         | 
| 320 333 | 
             
                    klass = IpApi.const_get(type)
         | 
| 321 | 
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 334 | 
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 322 335 | 
             
                  end
         | 
| 323 336 | 
             
                end
         | 
| 324 337 |  | 
| @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 7 7 | 
             
            Contact: support@phoenixnap.com
         | 
| 8 8 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            -
            OpenAPI Generator version:  | 
| 9 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 10 10 |  | 
| 11 11 | 
             
            =end
         | 
| 12 12 |  | 
| @@ -76,10 +76,14 @@ module IpApi | |
| 76 76 |  | 
| 77 77 | 
             
                  if attributes.key?(:'location')
         | 
| 78 78 | 
             
                    self.location = attributes[:'location']
         | 
| 79 | 
            +
                  else
         | 
| 80 | 
            +
                    self.location = nil
         | 
| 79 81 | 
             
                  end
         | 
| 80 82 |  | 
| 81 83 | 
             
                  if attributes.key?(:'cidr_block_size')
         | 
| 82 84 | 
             
                    self.cidr_block_size = attributes[:'cidr_block_size']
         | 
| 85 | 
            +
                  else
         | 
| 86 | 
            +
                    self.cidr_block_size = nil
         | 
| 83 87 | 
             
                  end
         | 
| 84 88 |  | 
| 85 89 | 
             
                  if attributes.key?(:'description')
         | 
| @@ -96,6 +100,7 @@ module IpApi | |
| 96 100 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 97 101 | 
             
                # @return Array for valid properties with the reasons
         | 
| 98 102 | 
             
                def list_invalid_properties
         | 
| 103 | 
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         | 
| 99 104 | 
             
                  invalid_properties = Array.new
         | 
| 100 105 | 
             
                  if @location.nil?
         | 
| 101 106 | 
             
                    invalid_properties.push('invalid value for "location", location cannot be nil.')
         | 
| @@ -115,6 +120,7 @@ module IpApi | |
| 115 120 | 
             
                # Check to see if the all the properties in the model are valid
         | 
| 116 121 | 
             
                # @return true if the model is valid
         | 
| 117 122 | 
             
                def valid?
         | 
| 123 | 
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         | 
| 118 124 | 
             
                  return false if @location.nil?
         | 
| 119 125 | 
             
                  return false if @cidr_block_size.nil?
         | 
| 120 126 | 
             
                  return false if !@description.nil? && @description.to_s.length > 250
         | 
| @@ -124,7 +130,11 @@ module IpApi | |
| 124 130 | 
             
                # Custom attribute writer method with validation
         | 
| 125 131 | 
             
                # @param [Object] description Value to be assigned
         | 
| 126 132 | 
             
                def description=(description)
         | 
| 127 | 
            -
                  if  | 
| 133 | 
            +
                  if description.nil?
         | 
| 134 | 
            +
                    fail ArgumentError, 'description cannot be nil'
         | 
| 135 | 
            +
                  end
         | 
| 136 | 
            +
             | 
| 137 | 
            +
                  if description.to_s.length > 250
         | 
| 128 138 | 
             
                    fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
         | 
| 129 139 | 
             
                  end
         | 
| 130 140 |  | 
| @@ -158,37 +168,30 @@ module IpApi | |
| 158 168 | 
             
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 159 169 | 
             
                # @return [Object] Returns the model itself
         | 
| 160 170 | 
             
                def self.build_from_hash(attributes)
         | 
| 161 | 
            -
                  new.build_from_hash(attributes)
         | 
| 162 | 
            -
                end
         | 
| 163 | 
            -
             | 
| 164 | 
            -
                # Builds the object from hash
         | 
| 165 | 
            -
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 166 | 
            -
                # @return [Object] Returns the model itself
         | 
| 167 | 
            -
                def build_from_hash(attributes)
         | 
| 168 171 | 
             
                  return nil unless attributes.is_a?(Hash)
         | 
| 169 172 | 
             
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 170 | 
            -
                   | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            +
                  transformed_hash = {}
         | 
| 174 | 
            +
                  openapi_types.each_pair do |key, type|
         | 
| 175 | 
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         | 
| 176 | 
            +
                      transformed_hash["#{key}"] = nil
         | 
| 173 177 | 
             
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 174 178 | 
             
                      # check to ensure the input is an array given that the attribute
         | 
| 175 179 | 
             
                      # is documented as an array but the input is not
         | 
| 176 | 
            -
                      if attributes[ | 
| 177 | 
            -
                         | 
| 180 | 
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         | 
| 181 | 
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         | 
| 178 182 | 
             
                      end
         | 
| 179 | 
            -
                    elsif !attributes[ | 
| 180 | 
            -
                       | 
| 183 | 
            +
                    elsif !attributes[attribute_map[key]].nil?
         | 
| 184 | 
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         | 
| 181 185 | 
             
                    end
         | 
| 182 186 | 
             
                  end
         | 
| 183 | 
            -
             | 
| 184 | 
            -
                  self
         | 
| 187 | 
            +
                  new(transformed_hash)
         | 
| 185 188 | 
             
                end
         | 
| 186 189 |  | 
| 187 190 | 
             
                # Deserializes the data based on type
         | 
| 188 191 | 
             
                # @param string type Data type
         | 
| 189 192 | 
             
                # @param string value Value to be deserialized
         | 
| 190 193 | 
             
                # @return [Object] Deserialized data
         | 
| 191 | 
            -
                def _deserialize(type, value)
         | 
| 194 | 
            +
                def self._deserialize(type, value)
         | 
| 192 195 | 
             
                  case type.to_sym
         | 
| 193 196 | 
             
                  when :Time
         | 
| 194 197 | 
             
                    Time.parse(value)
         | 
| @@ -223,7 +226,7 @@ module IpApi | |
| 223 226 | 
             
                  else # model
         | 
| 224 227 | 
             
                    # models (e.g. Pet) or oneOf
         | 
| 225 228 | 
             
                    klass = IpApi.const_get(type)
         | 
| 226 | 
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 229 | 
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 227 230 | 
             
                  end
         | 
| 228 231 | 
             
                end
         | 
| 229 232 |  | 
| @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 7 7 | 
             
            Contact: support@phoenixnap.com
         | 
| 8 8 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            -
            OpenAPI Generator version:  | 
| 9 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 10 10 |  | 
| 11 11 | 
             
            =end
         | 
| 12 12 |  | 
| @@ -67,6 +67,7 @@ module IpApi | |
| 67 67 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 68 68 | 
             
                # @return Array for valid properties with the reasons
         | 
| 69 69 | 
             
                def list_invalid_properties
         | 
| 70 | 
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         | 
| 70 71 | 
             
                  invalid_properties = Array.new
         | 
| 71 72 | 
             
                  if !@description.nil? && @description.to_s.length > 250
         | 
| 72 73 | 
             
                    invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
         | 
| @@ -78,6 +79,7 @@ module IpApi | |
| 78 79 | 
             
                # Check to see if the all the properties in the model are valid
         | 
| 79 80 | 
             
                # @return true if the model is valid
         | 
| 80 81 | 
             
                def valid?
         | 
| 82 | 
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         | 
| 81 83 | 
             
                  return false if !@description.nil? && @description.to_s.length > 250
         | 
| 82 84 | 
             
                  true
         | 
| 83 85 | 
             
                end
         | 
| @@ -85,7 +87,11 @@ module IpApi | |
| 85 87 | 
             
                # Custom attribute writer method with validation
         | 
| 86 88 | 
             
                # @param [Object] description Value to be assigned
         | 
| 87 89 | 
             
                def description=(description)
         | 
| 88 | 
            -
                  if  | 
| 90 | 
            +
                  if description.nil?
         | 
| 91 | 
            +
                    fail ArgumentError, 'description cannot be nil'
         | 
| 92 | 
            +
                  end
         | 
| 93 | 
            +
             | 
| 94 | 
            +
                  if description.to_s.length > 250
         | 
| 89 95 | 
             
                    fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
         | 
| 90 96 | 
             
                  end
         | 
| 91 97 |  | 
| @@ -116,37 +122,30 @@ module IpApi | |
| 116 122 | 
             
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 117 123 | 
             
                # @return [Object] Returns the model itself
         | 
| 118 124 | 
             
                def self.build_from_hash(attributes)
         | 
| 119 | 
            -
                  new.build_from_hash(attributes)
         | 
| 120 | 
            -
                end
         | 
| 121 | 
            -
             | 
| 122 | 
            -
                # Builds the object from hash
         | 
| 123 | 
            -
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 124 | 
            -
                # @return [Object] Returns the model itself
         | 
| 125 | 
            -
                def build_from_hash(attributes)
         | 
| 126 125 | 
             
                  return nil unless attributes.is_a?(Hash)
         | 
| 127 126 | 
             
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 128 | 
            -
                   | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 127 | 
            +
                  transformed_hash = {}
         | 
| 128 | 
            +
                  openapi_types.each_pair do |key, type|
         | 
| 129 | 
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         | 
| 130 | 
            +
                      transformed_hash["#{key}"] = nil
         | 
| 131 131 | 
             
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 132 132 | 
             
                      # check to ensure the input is an array given that the attribute
         | 
| 133 133 | 
             
                      # is documented as an array but the input is not
         | 
| 134 | 
            -
                      if attributes[ | 
| 135 | 
            -
                         | 
| 134 | 
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         | 
| 135 | 
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         | 
| 136 136 | 
             
                      end
         | 
| 137 | 
            -
                    elsif !attributes[ | 
| 138 | 
            -
                       | 
| 137 | 
            +
                    elsif !attributes[attribute_map[key]].nil?
         | 
| 138 | 
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         | 
| 139 139 | 
             
                    end
         | 
| 140 140 | 
             
                  end
         | 
| 141 | 
            -
             | 
| 142 | 
            -
                  self
         | 
| 141 | 
            +
                  new(transformed_hash)
         | 
| 143 142 | 
             
                end
         | 
| 144 143 |  | 
| 145 144 | 
             
                # Deserializes the data based on type
         | 
| 146 145 | 
             
                # @param string type Data type
         | 
| 147 146 | 
             
                # @param string value Value to be deserialized
         | 
| 148 147 | 
             
                # @return [Object] Deserialized data
         | 
| 149 | 
            -
                def _deserialize(type, value)
         | 
| 148 | 
            +
                def self._deserialize(type, value)
         | 
| 150 149 | 
             
                  case type.to_sym
         | 
| 151 150 | 
             
                  when :Time
         | 
| 152 151 | 
             
                    Time.parse(value)
         | 
| @@ -181,7 +180,7 @@ module IpApi | |
| 181 180 | 
             
                  else # model
         | 
| 182 181 | 
             
                    # models (e.g. Pet) or oneOf
         | 
| 183 182 | 
             
                    klass = IpApi.const_get(type)
         | 
| 184 | 
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 183 | 
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 185 184 | 
             
                  end
         | 
| 186 185 | 
             
                end
         | 
| 187 186 |  | 
| @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 7 7 | 
             
            Contact: support@phoenixnap.com
         | 
| 8 8 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            -
            OpenAPI Generator version:  | 
| 9 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 10 10 |  | 
| 11 11 | 
             
            =end
         | 
| 12 12 |  | 
| @@ -103,10 +103,14 @@ module IpApi | |
| 103 103 |  | 
| 104 104 | 
             
                  if attributes.key?(:'id')
         | 
| 105 105 | 
             
                    self.id = attributes[:'id']
         | 
| 106 | 
            +
                  else
         | 
| 107 | 
            +
                    self.id = nil
         | 
| 106 108 | 
             
                  end
         | 
| 107 109 |  | 
| 108 110 | 
             
                  if attributes.key?(:'name')
         | 
| 109 111 | 
             
                    self.name = attributes[:'name']
         | 
| 112 | 
            +
                  else
         | 
| 113 | 
            +
                    self.name = nil
         | 
| 110 114 | 
             
                  end
         | 
| 111 115 |  | 
| 112 116 | 
             
                  if attributes.key?(:'value')
         | 
| @@ -115,6 +119,8 @@ module IpApi | |
| 115 119 |  | 
| 116 120 | 
             
                  if attributes.key?(:'is_billing_tag')
         | 
| 117 121 | 
             
                    self.is_billing_tag = attributes[:'is_billing_tag']
         | 
| 122 | 
            +
                  else
         | 
| 123 | 
            +
                    self.is_billing_tag = nil
         | 
| 118 124 | 
             
                  end
         | 
| 119 125 |  | 
| 120 126 | 
             
                  if attributes.key?(:'created_by')
         | 
| @@ -125,6 +131,7 @@ module IpApi | |
| 125 131 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 126 132 | 
             
                # @return Array for valid properties with the reasons
         | 
| 127 133 | 
             
                def list_invalid_properties
         | 
| 134 | 
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         | 
| 128 135 | 
             
                  invalid_properties = Array.new
         | 
| 129 136 | 
             
                  if @id.nil?
         | 
| 130 137 | 
             
                    invalid_properties.push('invalid value for "id", id cannot be nil.')
         | 
| @@ -144,6 +151,7 @@ module IpApi | |
| 144 151 | 
             
                # Check to see if the all the properties in the model are valid
         | 
| 145 152 | 
             
                # @return true if the model is valid
         | 
| 146 153 | 
             
                def valid?
         | 
| 154 | 
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         | 
| 147 155 | 
             
                  return false if @id.nil?
         | 
| 148 156 | 
             
                  return false if @name.nil?
         | 
| 149 157 | 
             
                  return false if @is_billing_tag.nil?
         | 
| @@ -190,37 +198,30 @@ module IpApi | |
| 190 198 | 
             
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 191 199 | 
             
                # @return [Object] Returns the model itself
         | 
| 192 200 | 
             
                def self.build_from_hash(attributes)
         | 
| 193 | 
            -
                  new.build_from_hash(attributes)
         | 
| 194 | 
            -
                end
         | 
| 195 | 
            -
             | 
| 196 | 
            -
                # Builds the object from hash
         | 
| 197 | 
            -
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 198 | 
            -
                # @return [Object] Returns the model itself
         | 
| 199 | 
            -
                def build_from_hash(attributes)
         | 
| 200 201 | 
             
                  return nil unless attributes.is_a?(Hash)
         | 
| 201 202 | 
             
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 202 | 
            -
                   | 
| 203 | 
            -
             | 
| 204 | 
            -
             | 
| 203 | 
            +
                  transformed_hash = {}
         | 
| 204 | 
            +
                  openapi_types.each_pair do |key, type|
         | 
| 205 | 
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         | 
| 206 | 
            +
                      transformed_hash["#{key}"] = nil
         | 
| 205 207 | 
             
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 206 208 | 
             
                      # check to ensure the input is an array given that the attribute
         | 
| 207 209 | 
             
                      # is documented as an array but the input is not
         | 
| 208 | 
            -
                      if attributes[ | 
| 209 | 
            -
                         | 
| 210 | 
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         | 
| 211 | 
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         | 
| 210 212 | 
             
                      end
         | 
| 211 | 
            -
                    elsif !attributes[ | 
| 212 | 
            -
                       | 
| 213 | 
            +
                    elsif !attributes[attribute_map[key]].nil?
         | 
| 214 | 
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         | 
| 213 215 | 
             
                    end
         | 
| 214 216 | 
             
                  end
         | 
| 215 | 
            -
             | 
| 216 | 
            -
                  self
         | 
| 217 | 
            +
                  new(transformed_hash)
         | 
| 217 218 | 
             
                end
         | 
| 218 219 |  | 
| 219 220 | 
             
                # Deserializes the data based on type
         | 
| 220 221 | 
             
                # @param string type Data type
         | 
| 221 222 | 
             
                # @param string value Value to be deserialized
         | 
| 222 223 | 
             
                # @return [Object] Deserialized data
         | 
| 223 | 
            -
                def _deserialize(type, value)
         | 
| 224 | 
            +
                def self._deserialize(type, value)
         | 
| 224 225 | 
             
                  case type.to_sym
         | 
| 225 226 | 
             
                  when :Time
         | 
| 226 227 | 
             
                    Time.parse(value)
         | 
| @@ -255,7 +256,7 @@ module IpApi | |
| 255 256 | 
             
                  else # model
         | 
| 256 257 | 
             
                    # models (e.g. Pet) or oneOf
         | 
| 257 258 | 
             
                    klass = IpApi.const_get(type)
         | 
| 258 | 
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 259 | 
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 259 260 | 
             
                  end
         | 
| 260 261 | 
             
                end
         | 
| 261 262 |  | 
| @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 7 7 | 
             
            Contact: support@phoenixnap.com
         | 
| 8 8 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 9 | 
            -
            OpenAPI Generator version:  | 
| 9 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 10 10 |  | 
| 11 11 | 
             
            =end
         | 
| 12 12 |  | 
| @@ -66,6 +66,8 @@ module IpApi | |
| 66 66 |  | 
| 67 67 | 
             
                  if attributes.key?(:'name')
         | 
| 68 68 | 
             
                    self.name = attributes[:'name']
         | 
| 69 | 
            +
                  else
         | 
| 70 | 
            +
                    self.name = nil
         | 
| 69 71 | 
             
                  end
         | 
| 70 72 |  | 
| 71 73 | 
             
                  if attributes.key?(:'value')
         | 
| @@ -76,6 +78,7 @@ module IpApi | |
| 76 78 | 
             
                # Show invalid properties with the reasons. Usually used together with valid?
         | 
| 77 79 | 
             
                # @return Array for valid properties with the reasons
         | 
| 78 80 | 
             
                def list_invalid_properties
         | 
| 81 | 
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         | 
| 79 82 | 
             
                  invalid_properties = Array.new
         | 
| 80 83 | 
             
                  if @name.nil?
         | 
| 81 84 | 
             
                    invalid_properties.push('invalid value for "name", name cannot be nil.')
         | 
| @@ -87,6 +90,7 @@ module IpApi | |
| 87 90 | 
             
                # Check to see if the all the properties in the model are valid
         | 
| 88 91 | 
             
                # @return true if the model is valid
         | 
| 89 92 | 
             
                def valid?
         | 
| 93 | 
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         | 
| 90 94 | 
             
                  return false if @name.nil?
         | 
| 91 95 | 
             
                  true
         | 
| 92 96 | 
             
                end
         | 
| @@ -116,37 +120,30 @@ module IpApi | |
| 116 120 | 
             
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 117 121 | 
             
                # @return [Object] Returns the model itself
         | 
| 118 122 | 
             
                def self.build_from_hash(attributes)
         | 
| 119 | 
            -
                  new.build_from_hash(attributes)
         | 
| 120 | 
            -
                end
         | 
| 121 | 
            -
             | 
| 122 | 
            -
                # Builds the object from hash
         | 
| 123 | 
            -
                # @param [Hash] attributes Model attributes in the form of hash
         | 
| 124 | 
            -
                # @return [Object] Returns the model itself
         | 
| 125 | 
            -
                def build_from_hash(attributes)
         | 
| 126 123 | 
             
                  return nil unless attributes.is_a?(Hash)
         | 
| 127 124 | 
             
                  attributes = attributes.transform_keys(&:to_sym)
         | 
| 128 | 
            -
                   | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 125 | 
            +
                  transformed_hash = {}
         | 
| 126 | 
            +
                  openapi_types.each_pair do |key, type|
         | 
| 127 | 
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         | 
| 128 | 
            +
                      transformed_hash["#{key}"] = nil
         | 
| 131 129 | 
             
                    elsif type =~ /\AArray<(.*)>/i
         | 
| 132 130 | 
             
                      # check to ensure the input is an array given that the attribute
         | 
| 133 131 | 
             
                      # is documented as an array but the input is not
         | 
| 134 | 
            -
                      if attributes[ | 
| 135 | 
            -
                         | 
| 132 | 
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         | 
| 133 | 
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         | 
| 136 134 | 
             
                      end
         | 
| 137 | 
            -
                    elsif !attributes[ | 
| 138 | 
            -
                       | 
| 135 | 
            +
                    elsif !attributes[attribute_map[key]].nil?
         | 
| 136 | 
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         | 
| 139 137 | 
             
                    end
         | 
| 140 138 | 
             
                  end
         | 
| 141 | 
            -
             | 
| 142 | 
            -
                  self
         | 
| 139 | 
            +
                  new(transformed_hash)
         | 
| 143 140 | 
             
                end
         | 
| 144 141 |  | 
| 145 142 | 
             
                # Deserializes the data based on type
         | 
| 146 143 | 
             
                # @param string type Data type
         | 
| 147 144 | 
             
                # @param string value Value to be deserialized
         | 
| 148 145 | 
             
                # @return [Object] Deserialized data
         | 
| 149 | 
            -
                def _deserialize(type, value)
         | 
| 146 | 
            +
                def self._deserialize(type, value)
         | 
| 150 147 | 
             
                  case type.to_sym
         | 
| 151 148 | 
             
                  when :Time
         | 
| 152 149 | 
             
                    Time.parse(value)
         | 
| @@ -181,7 +178,7 @@ module IpApi | |
| 181 178 | 
             
                  else # model
         | 
| 182 179 | 
             
                    # models (e.g. Pet) or oneOf
         | 
| 183 180 | 
             
                    klass = IpApi.const_get(type)
         | 
| 184 | 
            -
                    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 181 | 
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         | 
| 185 182 | 
             
                  end
         | 
| 186 183 | 
             
                end
         | 
| 187 184 |  | 
    
        data/lib/pnap_ip_api/version.rb
    CHANGED
    
    
    
        data/lib/pnap_ip_api.rb
    CHANGED
    
    
    
        data/pnap_ip_api.gemspec
    CHANGED
    
    | @@ -8,7 +8,7 @@ | |
| 8 8 | 
             
            The version of the OpenAPI document: 1.0
         | 
| 9 9 | 
             
            Contact: support@phoenixnap.com
         | 
| 10 10 | 
             
            Generated by: https://openapi-generator.tech
         | 
| 11 | 
            -
            OpenAPI Generator version:  | 
| 11 | 
            +
            OpenAPI Generator version: 7.2.0
         | 
| 12 12 |  | 
| 13 13 | 
             
            =end
         | 
| 14 14 |  | 
| @@ -25,7 +25,7 @@ Gem::Specification.new do |s| | |
| 25 25 | 
             
              s.summary     = "IP Addresses API Ruby Gem"
         | 
| 26 26 | 
             
              s.description = "IP Addresses API Ruby Gem"
         | 
| 27 27 | 
             
              s.license     = "MPL-2.0"
         | 
| 28 | 
            -
              s.required_ruby_version = ">= 2. | 
| 28 | 
            +
              s.required_ruby_version = ">= 2.7"
         | 
| 29 29 | 
             
              s.metadata    = { "source_code_uri" => "https://github.com/phoenixnap/ruby-sdk-bmc" }
         | 
| 30 30 |  | 
| 31 31 | 
             
              s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
         |