cloudmersive-security-api-client 2.0.1
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 +7 -0
 - data/Gemfile +7 -0
 - data/README.md +119 -0
 - data/Rakefile +8 -0
 - data/cloudmersive-security-api-client.gemspec +45 -0
 - data/docs/ContentThreatDetectionApi.md +283 -0
 - data/docs/IPThreatDetectionResponse.md +9 -0
 - data/docs/NetworkThreatDetectionApi.md +228 -0
 - data/docs/StringAutomaticThreatDetection.md +18 -0
 - data/docs/StringInsecureDeserializationJsonDetection.md +10 -0
 - data/docs/StringSqlInjectionDetectionResult.md +10 -0
 - data/docs/StringXssProtectionResult.md +11 -0
 - data/docs/StringXxeDetectionResult.md +9 -0
 - data/docs/ThreatDetectionBotCheckResponse.md +8 -0
 - data/docs/ThreatDetectionTorNodeResponse.md +8 -0
 - data/docs/UrlSsrfThreatDetectionRequestFull.md +9 -0
 - data/docs/UrlSsrfThreatDetectionResponseFull.md +9 -0
 - data/git_push.sh +55 -0
 - data/lib/cloudmersive-security-api-client.rb +51 -0
 - data/lib/cloudmersive-security-api-client/api/content_threat_detection_api.rb +293 -0
 - data/lib/cloudmersive-security-api-client/api/network_threat_detection_api.rb +239 -0
 - data/lib/cloudmersive-security-api-client/api_client.rb +391 -0
 - data/lib/cloudmersive-security-api-client/api_error.rb +38 -0
 - data/lib/cloudmersive-security-api-client/configuration.rb +209 -0
 - data/lib/cloudmersive-security-api-client/models/ip_threat_detection_response.rb +196 -0
 - data/lib/cloudmersive-security-api-client/models/string_automatic_threat_detection.rb +285 -0
 - data/lib/cloudmersive-security-api-client/models/string_insecure_deserialization_json_detection.rb +206 -0
 - data/lib/cloudmersive-security-api-client/models/string_sql_injection_detection_result.rb +206 -0
 - data/lib/cloudmersive-security-api-client/models/string_xss_protection_result.rb +216 -0
 - data/lib/cloudmersive-security-api-client/models/string_xxe_detection_result.rb +196 -0
 - data/lib/cloudmersive-security-api-client/models/threat_detection_bot_check_response.rb +186 -0
 - data/lib/cloudmersive-security-api-client/models/threat_detection_tor_node_response.rb +186 -0
 - data/lib/cloudmersive-security-api-client/models/url_ssrf_threat_detection_request_full.rb +198 -0
 - data/lib/cloudmersive-security-api-client/models/url_ssrf_threat_detection_response_full.rb +196 -0
 - data/lib/cloudmersive-security-api-client/version.rb +15 -0
 - data/spec/api/content_threat_detection_api_spec.rb +95 -0
 - data/spec/api/network_threat_detection_api_spec.rb +83 -0
 - data/spec/api_client_spec.rb +243 -0
 - data/spec/configuration_spec.rb +42 -0
 - data/spec/models/ip_threat_detection_response_spec.rb +47 -0
 - data/spec/models/string_automatic_threat_detection_spec.rb +101 -0
 - data/spec/models/string_insecure_deserialization_json_detection_spec.rb +53 -0
 - data/spec/models/string_sql_injection_detection_result_spec.rb +53 -0
 - data/spec/models/string_xss_protection_result_spec.rb +59 -0
 - data/spec/models/string_xxe_detection_result_spec.rb +47 -0
 - data/spec/models/threat_detection_bot_check_response_spec.rb +41 -0
 - data/spec/models/threat_detection_tor_node_response_spec.rb +41 -0
 - data/spec/models/url_ssrf_threat_detection_request_full_spec.rb +47 -0
 - data/spec/models/url_ssrf_threat_detection_response_full_spec.rb +47 -0
 - data/spec/spec_helper.rb +111 -0
 - metadata +273 -0
 
| 
         @@ -0,0 +1,196 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 2 
     | 
    
         
            +
            #securityapi
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #The security APIs help you detect and block security threats.
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            OpenAPI spec version: v1
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            Generated by: https://github.com/swagger-api/swagger-codegen.git
         
     | 
| 
      
 9 
     | 
    
         
            +
            Swagger Codegen version: 2.4.14
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            module CloudmersiveSecurityApiClient
         
     | 
| 
      
 16 
     | 
    
         
            +
              # Result of performing an XXE threat detection operation
         
     | 
| 
      
 17 
     | 
    
         
            +
              class StringXxeDetectionResult
         
     | 
| 
      
 18 
     | 
    
         
            +
                # True if the operation was successful, false otherwise
         
     | 
| 
      
 19 
     | 
    
         
            +
                attr_accessor :successful
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                # True if the input contained XXE threats, false otherwise
         
     | 
| 
      
 22 
     | 
    
         
            +
                attr_accessor :contained_xxe
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
      
 25 
     | 
    
         
            +
                def self.attribute_map
         
     | 
| 
      
 26 
     | 
    
         
            +
                  {
         
     | 
| 
      
 27 
     | 
    
         
            +
                    :'successful' => :'Successful',
         
     | 
| 
      
 28 
     | 
    
         
            +
                    :'contained_xxe' => :'ContainedXxe'
         
     | 
| 
      
 29 
     | 
    
         
            +
                  }
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                # Attribute type mapping.
         
     | 
| 
      
 33 
     | 
    
         
            +
                def self.swagger_types
         
     | 
| 
      
 34 
     | 
    
         
            +
                  {
         
     | 
| 
      
 35 
     | 
    
         
            +
                    :'successful' => :'BOOLEAN',
         
     | 
| 
      
 36 
     | 
    
         
            +
                    :'contained_xxe' => :'BOOLEAN'
         
     | 
| 
      
 37 
     | 
    
         
            +
                  }
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                # Initializes the object
         
     | 
| 
      
 41 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 42 
     | 
    
         
            +
                def initialize(attributes = {})
         
     | 
| 
      
 43 
     | 
    
         
            +
                  return unless attributes.is_a?(Hash)
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  # convert string to symbol for hash key
         
     | 
| 
      
 46 
     | 
    
         
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                  if attributes.has_key?(:'Successful')
         
     | 
| 
      
 49 
     | 
    
         
            +
                    self.successful = attributes[:'Successful']
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                  if attributes.has_key?(:'ContainedXxe')
         
     | 
| 
      
 53 
     | 
    
         
            +
                    self.contained_xxe = attributes[:'ContainedXxe']
         
     | 
| 
      
 54 
     | 
    
         
            +
                  end
         
     | 
| 
      
 55 
     | 
    
         
            +
                end
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
      
 58 
     | 
    
         
            +
                # @return Array for valid properties with the reasons
         
     | 
| 
      
 59 
     | 
    
         
            +
                def list_invalid_properties
         
     | 
| 
      
 60 
     | 
    
         
            +
                  invalid_properties = Array.new
         
     | 
| 
      
 61 
     | 
    
         
            +
                  invalid_properties
         
     | 
| 
      
 62 
     | 
    
         
            +
                end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                # Check to see if the all the properties in the model are valid
         
     | 
| 
      
 65 
     | 
    
         
            +
                # @return true if the model is valid
         
     | 
| 
      
 66 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 67 
     | 
    
         
            +
                  true
         
     | 
| 
      
 68 
     | 
    
         
            +
                end
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
                # Checks equality by comparing each attribute.
         
     | 
| 
      
 71 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 72 
     | 
    
         
            +
                def ==(o)
         
     | 
| 
      
 73 
     | 
    
         
            +
                  return true if self.equal?(o)
         
     | 
| 
      
 74 
     | 
    
         
            +
                  self.class == o.class &&
         
     | 
| 
      
 75 
     | 
    
         
            +
                      successful == o.successful &&
         
     | 
| 
      
 76 
     | 
    
         
            +
                      contained_xxe == o.contained_xxe
         
     | 
| 
      
 77 
     | 
    
         
            +
                end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                # @see the `==` method
         
     | 
| 
      
 80 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 81 
     | 
    
         
            +
                def eql?(o)
         
     | 
| 
      
 82 
     | 
    
         
            +
                  self == o
         
     | 
| 
      
 83 
     | 
    
         
            +
                end
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                # Calculates hash code according to all attributes.
         
     | 
| 
      
 86 
     | 
    
         
            +
                # @return [Fixnum] Hash code
         
     | 
| 
      
 87 
     | 
    
         
            +
                def hash
         
     | 
| 
      
 88 
     | 
    
         
            +
                  [successful, contained_xxe].hash
         
     | 
| 
      
 89 
     | 
    
         
            +
                end
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                # Builds the object from hash
         
     | 
| 
      
 92 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 93 
     | 
    
         
            +
                # @return [Object] Returns the model itself
         
     | 
| 
      
 94 
     | 
    
         
            +
                def build_from_hash(attributes)
         
     | 
| 
      
 95 
     | 
    
         
            +
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
      
 96 
     | 
    
         
            +
                  self.class.swagger_types.each_pair do |key, type|
         
     | 
| 
      
 97 
     | 
    
         
            +
                    if type =~ /\AArray<(.*)>/i
         
     | 
| 
      
 98 
     | 
    
         
            +
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
      
 99 
     | 
    
         
            +
                      # is documented as an array but the input is not
         
     | 
| 
      
 100 
     | 
    
         
            +
                      if attributes[self.class.attribute_map[key]].is_a?(Array)
         
     | 
| 
      
 101 
     | 
    
         
            +
                        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
         
     | 
| 
      
 102 
     | 
    
         
            +
                      end
         
     | 
| 
      
 103 
     | 
    
         
            +
                    elsif !attributes[self.class.attribute_map[key]].nil?
         
     | 
| 
      
 104 
     | 
    
         
            +
                      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
         
     | 
| 
      
 105 
     | 
    
         
            +
                    end # or else data not found in attributes(hash), not an issue as the data can be optional
         
     | 
| 
      
 106 
     | 
    
         
            +
                  end
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
                  self
         
     | 
| 
      
 109 
     | 
    
         
            +
                end
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
                # Deserializes the data based on type
         
     | 
| 
      
 112 
     | 
    
         
            +
                # @param string type Data type
         
     | 
| 
      
 113 
     | 
    
         
            +
                # @param string value Value to be deserialized
         
     | 
| 
      
 114 
     | 
    
         
            +
                # @return [Object] Deserialized data
         
     | 
| 
      
 115 
     | 
    
         
            +
                def _deserialize(type, value)
         
     | 
| 
      
 116 
     | 
    
         
            +
                  case type.to_sym
         
     | 
| 
      
 117 
     | 
    
         
            +
                  when :DateTime
         
     | 
| 
      
 118 
     | 
    
         
            +
                    DateTime.parse(value)
         
     | 
| 
      
 119 
     | 
    
         
            +
                  when :Date
         
     | 
| 
      
 120 
     | 
    
         
            +
                    Date.parse(value)
         
     | 
| 
      
 121 
     | 
    
         
            +
                  when :String
         
     | 
| 
      
 122 
     | 
    
         
            +
                    value.to_s
         
     | 
| 
      
 123 
     | 
    
         
            +
                  when :Integer
         
     | 
| 
      
 124 
     | 
    
         
            +
                    value.to_i
         
     | 
| 
      
 125 
     | 
    
         
            +
                  when :Float
         
     | 
| 
      
 126 
     | 
    
         
            +
                    value.to_f
         
     | 
| 
      
 127 
     | 
    
         
            +
                  when :BOOLEAN
         
     | 
| 
      
 128 
     | 
    
         
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
      
 129 
     | 
    
         
            +
                      true
         
     | 
| 
      
 130 
     | 
    
         
            +
                    else
         
     | 
| 
      
 131 
     | 
    
         
            +
                      false
         
     | 
| 
      
 132 
     | 
    
         
            +
                    end
         
     | 
| 
      
 133 
     | 
    
         
            +
                  when :Object
         
     | 
| 
      
 134 
     | 
    
         
            +
                    # generic object (usually a Hash), return directly
         
     | 
| 
      
 135 
     | 
    
         
            +
                    value
         
     | 
| 
      
 136 
     | 
    
         
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
      
 137 
     | 
    
         
            +
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
      
 138 
     | 
    
         
            +
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
      
 139 
     | 
    
         
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
      
 140 
     | 
    
         
            +
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
      
 141 
     | 
    
         
            +
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
      
 142 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 143 
     | 
    
         
            +
                      value.each do |k, v|
         
     | 
| 
      
 144 
     | 
    
         
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
      
 145 
     | 
    
         
            +
                      end
         
     | 
| 
      
 146 
     | 
    
         
            +
                    end
         
     | 
| 
      
 147 
     | 
    
         
            +
                  else # model
         
     | 
| 
      
 148 
     | 
    
         
            +
                    temp_model = CloudmersiveSecurityApiClient.const_get(type).new
         
     | 
| 
      
 149 
     | 
    
         
            +
                    temp_model.build_from_hash(value)
         
     | 
| 
      
 150 
     | 
    
         
            +
                  end
         
     | 
| 
      
 151 
     | 
    
         
            +
                end
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
                # Returns the string representation of the object
         
     | 
| 
      
 154 
     | 
    
         
            +
                # @return [String] String presentation of the object
         
     | 
| 
      
 155 
     | 
    
         
            +
                def to_s
         
     | 
| 
      
 156 
     | 
    
         
            +
                  to_hash.to_s
         
     | 
| 
      
 157 
     | 
    
         
            +
                end
         
     | 
| 
      
 158 
     | 
    
         
            +
             
     | 
| 
      
 159 
     | 
    
         
            +
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
      
 160 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 161 
     | 
    
         
            +
                def to_body
         
     | 
| 
      
 162 
     | 
    
         
            +
                  to_hash
         
     | 
| 
      
 163 
     | 
    
         
            +
                end
         
     | 
| 
      
 164 
     | 
    
         
            +
             
     | 
| 
      
 165 
     | 
    
         
            +
                # Returns the object in the form of hash
         
     | 
| 
      
 166 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 167 
     | 
    
         
            +
                def to_hash
         
     | 
| 
      
 168 
     | 
    
         
            +
                  hash = {}
         
     | 
| 
      
 169 
     | 
    
         
            +
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
      
 170 
     | 
    
         
            +
                    value = self.send(attr)
         
     | 
| 
      
 171 
     | 
    
         
            +
                    next if value.nil?
         
     | 
| 
      
 172 
     | 
    
         
            +
                    hash[param] = _to_hash(value)
         
     | 
| 
      
 173 
     | 
    
         
            +
                  end
         
     | 
| 
      
 174 
     | 
    
         
            +
                  hash
         
     | 
| 
      
 175 
     | 
    
         
            +
                end
         
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
                # Outputs non-array value in the form of hash
         
     | 
| 
      
 178 
     | 
    
         
            +
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
      
 179 
     | 
    
         
            +
                # @param [Object] value Any valid value
         
     | 
| 
      
 180 
     | 
    
         
            +
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
      
 181 
     | 
    
         
            +
                def _to_hash(value)
         
     | 
| 
      
 182 
     | 
    
         
            +
                  if value.is_a?(Array)
         
     | 
| 
      
 183 
     | 
    
         
            +
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
      
 184 
     | 
    
         
            +
                  elsif value.is_a?(Hash)
         
     | 
| 
      
 185 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 186 
     | 
    
         
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
      
 187 
     | 
    
         
            +
                    end
         
     | 
| 
      
 188 
     | 
    
         
            +
                  elsif value.respond_to? :to_hash
         
     | 
| 
      
 189 
     | 
    
         
            +
                    value.to_hash
         
     | 
| 
      
 190 
     | 
    
         
            +
                  else
         
     | 
| 
      
 191 
     | 
    
         
            +
                    value
         
     | 
| 
      
 192 
     | 
    
         
            +
                  end
         
     | 
| 
      
 193 
     | 
    
         
            +
                end
         
     | 
| 
      
 194 
     | 
    
         
            +
             
     | 
| 
      
 195 
     | 
    
         
            +
              end
         
     | 
| 
      
 196 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,186 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 2 
     | 
    
         
            +
            #securityapi
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #The security APIs help you detect and block security threats.
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            OpenAPI spec version: v1
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            Generated by: https://github.com/swagger-api/swagger-codegen.git
         
     | 
| 
      
 9 
     | 
    
         
            +
            Swagger Codegen version: 2.4.14
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            module CloudmersiveSecurityApiClient
         
     | 
| 
      
 16 
     | 
    
         
            +
              # Result of performing a Bot check on an IP address
         
     | 
| 
      
 17 
     | 
    
         
            +
              class ThreatDetectionBotCheckResponse
         
     | 
| 
      
 18 
     | 
    
         
            +
                # True if the input IP address is a Bot or Robot, false otherwise
         
     | 
| 
      
 19 
     | 
    
         
            +
                attr_accessor :is_bot
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
      
 22 
     | 
    
         
            +
                def self.attribute_map
         
     | 
| 
      
 23 
     | 
    
         
            +
                  {
         
     | 
| 
      
 24 
     | 
    
         
            +
                    :'is_bot' => :'IsBot'
         
     | 
| 
      
 25 
     | 
    
         
            +
                  }
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                # Attribute type mapping.
         
     | 
| 
      
 29 
     | 
    
         
            +
                def self.swagger_types
         
     | 
| 
      
 30 
     | 
    
         
            +
                  {
         
     | 
| 
      
 31 
     | 
    
         
            +
                    :'is_bot' => :'BOOLEAN'
         
     | 
| 
      
 32 
     | 
    
         
            +
                  }
         
     | 
| 
      
 33 
     | 
    
         
            +
                end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                # Initializes the object
         
     | 
| 
      
 36 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 37 
     | 
    
         
            +
                def initialize(attributes = {})
         
     | 
| 
      
 38 
     | 
    
         
            +
                  return unless attributes.is_a?(Hash)
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  # convert string to symbol for hash key
         
     | 
| 
      
 41 
     | 
    
         
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  if attributes.has_key?(:'IsBot')
         
     | 
| 
      
 44 
     | 
    
         
            +
                    self.is_bot = attributes[:'IsBot']
         
     | 
| 
      
 45 
     | 
    
         
            +
                  end
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
      
 49 
     | 
    
         
            +
                # @return Array for valid properties with the reasons
         
     | 
| 
      
 50 
     | 
    
         
            +
                def list_invalid_properties
         
     | 
| 
      
 51 
     | 
    
         
            +
                  invalid_properties = Array.new
         
     | 
| 
      
 52 
     | 
    
         
            +
                  invalid_properties
         
     | 
| 
      
 53 
     | 
    
         
            +
                end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                # Check to see if the all the properties in the model are valid
         
     | 
| 
      
 56 
     | 
    
         
            +
                # @return true if the model is valid
         
     | 
| 
      
 57 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 58 
     | 
    
         
            +
                  true
         
     | 
| 
      
 59 
     | 
    
         
            +
                end
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                # Checks equality by comparing each attribute.
         
     | 
| 
      
 62 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 63 
     | 
    
         
            +
                def ==(o)
         
     | 
| 
      
 64 
     | 
    
         
            +
                  return true if self.equal?(o)
         
     | 
| 
      
 65 
     | 
    
         
            +
                  self.class == o.class &&
         
     | 
| 
      
 66 
     | 
    
         
            +
                      is_bot == o.is_bot
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                # @see the `==` method
         
     | 
| 
      
 70 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 71 
     | 
    
         
            +
                def eql?(o)
         
     | 
| 
      
 72 
     | 
    
         
            +
                  self == o
         
     | 
| 
      
 73 
     | 
    
         
            +
                end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                # Calculates hash code according to all attributes.
         
     | 
| 
      
 76 
     | 
    
         
            +
                # @return [Fixnum] Hash code
         
     | 
| 
      
 77 
     | 
    
         
            +
                def hash
         
     | 
| 
      
 78 
     | 
    
         
            +
                  [is_bot].hash
         
     | 
| 
      
 79 
     | 
    
         
            +
                end
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                # Builds the object from hash
         
     | 
| 
      
 82 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 83 
     | 
    
         
            +
                # @return [Object] Returns the model itself
         
     | 
| 
      
 84 
     | 
    
         
            +
                def build_from_hash(attributes)
         
     | 
| 
      
 85 
     | 
    
         
            +
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
      
 86 
     | 
    
         
            +
                  self.class.swagger_types.each_pair do |key, type|
         
     | 
| 
      
 87 
     | 
    
         
            +
                    if type =~ /\AArray<(.*)>/i
         
     | 
| 
      
 88 
     | 
    
         
            +
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
      
 89 
     | 
    
         
            +
                      # is documented as an array but the input is not
         
     | 
| 
      
 90 
     | 
    
         
            +
                      if attributes[self.class.attribute_map[key]].is_a?(Array)
         
     | 
| 
      
 91 
     | 
    
         
            +
                        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
         
     | 
| 
      
 92 
     | 
    
         
            +
                      end
         
     | 
| 
      
 93 
     | 
    
         
            +
                    elsif !attributes[self.class.attribute_map[key]].nil?
         
     | 
| 
      
 94 
     | 
    
         
            +
                      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
         
     | 
| 
      
 95 
     | 
    
         
            +
                    end # or else data not found in attributes(hash), not an issue as the data can be optional
         
     | 
| 
      
 96 
     | 
    
         
            +
                  end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  self
         
     | 
| 
      
 99 
     | 
    
         
            +
                end
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
                # Deserializes the data based on type
         
     | 
| 
      
 102 
     | 
    
         
            +
                # @param string type Data type
         
     | 
| 
      
 103 
     | 
    
         
            +
                # @param string value Value to be deserialized
         
     | 
| 
      
 104 
     | 
    
         
            +
                # @return [Object] Deserialized data
         
     | 
| 
      
 105 
     | 
    
         
            +
                def _deserialize(type, value)
         
     | 
| 
      
 106 
     | 
    
         
            +
                  case type.to_sym
         
     | 
| 
      
 107 
     | 
    
         
            +
                  when :DateTime
         
     | 
| 
      
 108 
     | 
    
         
            +
                    DateTime.parse(value)
         
     | 
| 
      
 109 
     | 
    
         
            +
                  when :Date
         
     | 
| 
      
 110 
     | 
    
         
            +
                    Date.parse(value)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  when :String
         
     | 
| 
      
 112 
     | 
    
         
            +
                    value.to_s
         
     | 
| 
      
 113 
     | 
    
         
            +
                  when :Integer
         
     | 
| 
      
 114 
     | 
    
         
            +
                    value.to_i
         
     | 
| 
      
 115 
     | 
    
         
            +
                  when :Float
         
     | 
| 
      
 116 
     | 
    
         
            +
                    value.to_f
         
     | 
| 
      
 117 
     | 
    
         
            +
                  when :BOOLEAN
         
     | 
| 
      
 118 
     | 
    
         
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
      
 119 
     | 
    
         
            +
                      true
         
     | 
| 
      
 120 
     | 
    
         
            +
                    else
         
     | 
| 
      
 121 
     | 
    
         
            +
                      false
         
     | 
| 
      
 122 
     | 
    
         
            +
                    end
         
     | 
| 
      
 123 
     | 
    
         
            +
                  when :Object
         
     | 
| 
      
 124 
     | 
    
         
            +
                    # generic object (usually a Hash), return directly
         
     | 
| 
      
 125 
     | 
    
         
            +
                    value
         
     | 
| 
      
 126 
     | 
    
         
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
      
 127 
     | 
    
         
            +
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
      
 128 
     | 
    
         
            +
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
      
 129 
     | 
    
         
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
      
 130 
     | 
    
         
            +
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
      
 131 
     | 
    
         
            +
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
      
 132 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 133 
     | 
    
         
            +
                      value.each do |k, v|
         
     | 
| 
      
 134 
     | 
    
         
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
      
 135 
     | 
    
         
            +
                      end
         
     | 
| 
      
 136 
     | 
    
         
            +
                    end
         
     | 
| 
      
 137 
     | 
    
         
            +
                  else # model
         
     | 
| 
      
 138 
     | 
    
         
            +
                    temp_model = CloudmersiveSecurityApiClient.const_get(type).new
         
     | 
| 
      
 139 
     | 
    
         
            +
                    temp_model.build_from_hash(value)
         
     | 
| 
      
 140 
     | 
    
         
            +
                  end
         
     | 
| 
      
 141 
     | 
    
         
            +
                end
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
                # Returns the string representation of the object
         
     | 
| 
      
 144 
     | 
    
         
            +
                # @return [String] String presentation of the object
         
     | 
| 
      
 145 
     | 
    
         
            +
                def to_s
         
     | 
| 
      
 146 
     | 
    
         
            +
                  to_hash.to_s
         
     | 
| 
      
 147 
     | 
    
         
            +
                end
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
      
 150 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 151 
     | 
    
         
            +
                def to_body
         
     | 
| 
      
 152 
     | 
    
         
            +
                  to_hash
         
     | 
| 
      
 153 
     | 
    
         
            +
                end
         
     | 
| 
      
 154 
     | 
    
         
            +
             
     | 
| 
      
 155 
     | 
    
         
            +
                # Returns the object in the form of hash
         
     | 
| 
      
 156 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 157 
     | 
    
         
            +
                def to_hash
         
     | 
| 
      
 158 
     | 
    
         
            +
                  hash = {}
         
     | 
| 
      
 159 
     | 
    
         
            +
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
      
 160 
     | 
    
         
            +
                    value = self.send(attr)
         
     | 
| 
      
 161 
     | 
    
         
            +
                    next if value.nil?
         
     | 
| 
      
 162 
     | 
    
         
            +
                    hash[param] = _to_hash(value)
         
     | 
| 
      
 163 
     | 
    
         
            +
                  end
         
     | 
| 
      
 164 
     | 
    
         
            +
                  hash
         
     | 
| 
      
 165 
     | 
    
         
            +
                end
         
     | 
| 
      
 166 
     | 
    
         
            +
             
     | 
| 
      
 167 
     | 
    
         
            +
                # Outputs non-array value in the form of hash
         
     | 
| 
      
 168 
     | 
    
         
            +
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
      
 169 
     | 
    
         
            +
                # @param [Object] value Any valid value
         
     | 
| 
      
 170 
     | 
    
         
            +
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
      
 171 
     | 
    
         
            +
                def _to_hash(value)
         
     | 
| 
      
 172 
     | 
    
         
            +
                  if value.is_a?(Array)
         
     | 
| 
      
 173 
     | 
    
         
            +
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
      
 174 
     | 
    
         
            +
                  elsif value.is_a?(Hash)
         
     | 
| 
      
 175 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 176 
     | 
    
         
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
      
 177 
     | 
    
         
            +
                    end
         
     | 
| 
      
 178 
     | 
    
         
            +
                  elsif value.respond_to? :to_hash
         
     | 
| 
      
 179 
     | 
    
         
            +
                    value.to_hash
         
     | 
| 
      
 180 
     | 
    
         
            +
                  else
         
     | 
| 
      
 181 
     | 
    
         
            +
                    value
         
     | 
| 
      
 182 
     | 
    
         
            +
                  end
         
     | 
| 
      
 183 
     | 
    
         
            +
                end
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
              end
         
     | 
| 
      
 186 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,186 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 2 
     | 
    
         
            +
            #securityapi
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #The security APIs help you detect and block security threats.
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            OpenAPI spec version: v1
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            Generated by: https://github.com/swagger-api/swagger-codegen.git
         
     | 
| 
      
 9 
     | 
    
         
            +
            Swagger Codegen version: 2.4.14
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            module CloudmersiveSecurityApiClient
         
     | 
| 
      
 16 
     | 
    
         
            +
              # Result of performing a Tor node check on an IP address
         
     | 
| 
      
 17 
     | 
    
         
            +
              class ThreatDetectionTorNodeResponse
         
     | 
| 
      
 18 
     | 
    
         
            +
                # True if the input IP address is a Tor exit node, false otherwise
         
     | 
| 
      
 19 
     | 
    
         
            +
                attr_accessor :is_tor_node
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
      
 22 
     | 
    
         
            +
                def self.attribute_map
         
     | 
| 
      
 23 
     | 
    
         
            +
                  {
         
     | 
| 
      
 24 
     | 
    
         
            +
                    :'is_tor_node' => :'IsTorNode'
         
     | 
| 
      
 25 
     | 
    
         
            +
                  }
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                # Attribute type mapping.
         
     | 
| 
      
 29 
     | 
    
         
            +
                def self.swagger_types
         
     | 
| 
      
 30 
     | 
    
         
            +
                  {
         
     | 
| 
      
 31 
     | 
    
         
            +
                    :'is_tor_node' => :'BOOLEAN'
         
     | 
| 
      
 32 
     | 
    
         
            +
                  }
         
     | 
| 
      
 33 
     | 
    
         
            +
                end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                # Initializes the object
         
     | 
| 
      
 36 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 37 
     | 
    
         
            +
                def initialize(attributes = {})
         
     | 
| 
      
 38 
     | 
    
         
            +
                  return unless attributes.is_a?(Hash)
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  # convert string to symbol for hash key
         
     | 
| 
      
 41 
     | 
    
         
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  if attributes.has_key?(:'IsTorNode')
         
     | 
| 
      
 44 
     | 
    
         
            +
                    self.is_tor_node = attributes[:'IsTorNode']
         
     | 
| 
      
 45 
     | 
    
         
            +
                  end
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
      
 49 
     | 
    
         
            +
                # @return Array for valid properties with the reasons
         
     | 
| 
      
 50 
     | 
    
         
            +
                def list_invalid_properties
         
     | 
| 
      
 51 
     | 
    
         
            +
                  invalid_properties = Array.new
         
     | 
| 
      
 52 
     | 
    
         
            +
                  invalid_properties
         
     | 
| 
      
 53 
     | 
    
         
            +
                end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                # Check to see if the all the properties in the model are valid
         
     | 
| 
      
 56 
     | 
    
         
            +
                # @return true if the model is valid
         
     | 
| 
      
 57 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 58 
     | 
    
         
            +
                  true
         
     | 
| 
      
 59 
     | 
    
         
            +
                end
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                # Checks equality by comparing each attribute.
         
     | 
| 
      
 62 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 63 
     | 
    
         
            +
                def ==(o)
         
     | 
| 
      
 64 
     | 
    
         
            +
                  return true if self.equal?(o)
         
     | 
| 
      
 65 
     | 
    
         
            +
                  self.class == o.class &&
         
     | 
| 
      
 66 
     | 
    
         
            +
                      is_tor_node == o.is_tor_node
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                # @see the `==` method
         
     | 
| 
      
 70 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 71 
     | 
    
         
            +
                def eql?(o)
         
     | 
| 
      
 72 
     | 
    
         
            +
                  self == o
         
     | 
| 
      
 73 
     | 
    
         
            +
                end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                # Calculates hash code according to all attributes.
         
     | 
| 
      
 76 
     | 
    
         
            +
                # @return [Fixnum] Hash code
         
     | 
| 
      
 77 
     | 
    
         
            +
                def hash
         
     | 
| 
      
 78 
     | 
    
         
            +
                  [is_tor_node].hash
         
     | 
| 
      
 79 
     | 
    
         
            +
                end
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                # Builds the object from hash
         
     | 
| 
      
 82 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 83 
     | 
    
         
            +
                # @return [Object] Returns the model itself
         
     | 
| 
      
 84 
     | 
    
         
            +
                def build_from_hash(attributes)
         
     | 
| 
      
 85 
     | 
    
         
            +
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
      
 86 
     | 
    
         
            +
                  self.class.swagger_types.each_pair do |key, type|
         
     | 
| 
      
 87 
     | 
    
         
            +
                    if type =~ /\AArray<(.*)>/i
         
     | 
| 
      
 88 
     | 
    
         
            +
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
      
 89 
     | 
    
         
            +
                      # is documented as an array but the input is not
         
     | 
| 
      
 90 
     | 
    
         
            +
                      if attributes[self.class.attribute_map[key]].is_a?(Array)
         
     | 
| 
      
 91 
     | 
    
         
            +
                        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
         
     | 
| 
      
 92 
     | 
    
         
            +
                      end
         
     | 
| 
      
 93 
     | 
    
         
            +
                    elsif !attributes[self.class.attribute_map[key]].nil?
         
     | 
| 
      
 94 
     | 
    
         
            +
                      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
         
     | 
| 
      
 95 
     | 
    
         
            +
                    end # or else data not found in attributes(hash), not an issue as the data can be optional
         
     | 
| 
      
 96 
     | 
    
         
            +
                  end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  self
         
     | 
| 
      
 99 
     | 
    
         
            +
                end
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
                # Deserializes the data based on type
         
     | 
| 
      
 102 
     | 
    
         
            +
                # @param string type Data type
         
     | 
| 
      
 103 
     | 
    
         
            +
                # @param string value Value to be deserialized
         
     | 
| 
      
 104 
     | 
    
         
            +
                # @return [Object] Deserialized data
         
     | 
| 
      
 105 
     | 
    
         
            +
                def _deserialize(type, value)
         
     | 
| 
      
 106 
     | 
    
         
            +
                  case type.to_sym
         
     | 
| 
      
 107 
     | 
    
         
            +
                  when :DateTime
         
     | 
| 
      
 108 
     | 
    
         
            +
                    DateTime.parse(value)
         
     | 
| 
      
 109 
     | 
    
         
            +
                  when :Date
         
     | 
| 
      
 110 
     | 
    
         
            +
                    Date.parse(value)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  when :String
         
     | 
| 
      
 112 
     | 
    
         
            +
                    value.to_s
         
     | 
| 
      
 113 
     | 
    
         
            +
                  when :Integer
         
     | 
| 
      
 114 
     | 
    
         
            +
                    value.to_i
         
     | 
| 
      
 115 
     | 
    
         
            +
                  when :Float
         
     | 
| 
      
 116 
     | 
    
         
            +
                    value.to_f
         
     | 
| 
      
 117 
     | 
    
         
            +
                  when :BOOLEAN
         
     | 
| 
      
 118 
     | 
    
         
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
      
 119 
     | 
    
         
            +
                      true
         
     | 
| 
      
 120 
     | 
    
         
            +
                    else
         
     | 
| 
      
 121 
     | 
    
         
            +
                      false
         
     | 
| 
      
 122 
     | 
    
         
            +
                    end
         
     | 
| 
      
 123 
     | 
    
         
            +
                  when :Object
         
     | 
| 
      
 124 
     | 
    
         
            +
                    # generic object (usually a Hash), return directly
         
     | 
| 
      
 125 
     | 
    
         
            +
                    value
         
     | 
| 
      
 126 
     | 
    
         
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
      
 127 
     | 
    
         
            +
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
      
 128 
     | 
    
         
            +
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
      
 129 
     | 
    
         
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
      
 130 
     | 
    
         
            +
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
      
 131 
     | 
    
         
            +
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
      
 132 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 133 
     | 
    
         
            +
                      value.each do |k, v|
         
     | 
| 
      
 134 
     | 
    
         
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
      
 135 
     | 
    
         
            +
                      end
         
     | 
| 
      
 136 
     | 
    
         
            +
                    end
         
     | 
| 
      
 137 
     | 
    
         
            +
                  else # model
         
     | 
| 
      
 138 
     | 
    
         
            +
                    temp_model = CloudmersiveSecurityApiClient.const_get(type).new
         
     | 
| 
      
 139 
     | 
    
         
            +
                    temp_model.build_from_hash(value)
         
     | 
| 
      
 140 
     | 
    
         
            +
                  end
         
     | 
| 
      
 141 
     | 
    
         
            +
                end
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
                # Returns the string representation of the object
         
     | 
| 
      
 144 
     | 
    
         
            +
                # @return [String] String presentation of the object
         
     | 
| 
      
 145 
     | 
    
         
            +
                def to_s
         
     | 
| 
      
 146 
     | 
    
         
            +
                  to_hash.to_s
         
     | 
| 
      
 147 
     | 
    
         
            +
                end
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
      
 150 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 151 
     | 
    
         
            +
                def to_body
         
     | 
| 
      
 152 
     | 
    
         
            +
                  to_hash
         
     | 
| 
      
 153 
     | 
    
         
            +
                end
         
     | 
| 
      
 154 
     | 
    
         
            +
             
     | 
| 
      
 155 
     | 
    
         
            +
                # Returns the object in the form of hash
         
     | 
| 
      
 156 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 157 
     | 
    
         
            +
                def to_hash
         
     | 
| 
      
 158 
     | 
    
         
            +
                  hash = {}
         
     | 
| 
      
 159 
     | 
    
         
            +
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
      
 160 
     | 
    
         
            +
                    value = self.send(attr)
         
     | 
| 
      
 161 
     | 
    
         
            +
                    next if value.nil?
         
     | 
| 
      
 162 
     | 
    
         
            +
                    hash[param] = _to_hash(value)
         
     | 
| 
      
 163 
     | 
    
         
            +
                  end
         
     | 
| 
      
 164 
     | 
    
         
            +
                  hash
         
     | 
| 
      
 165 
     | 
    
         
            +
                end
         
     | 
| 
      
 166 
     | 
    
         
            +
             
     | 
| 
      
 167 
     | 
    
         
            +
                # Outputs non-array value in the form of hash
         
     | 
| 
      
 168 
     | 
    
         
            +
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
      
 169 
     | 
    
         
            +
                # @param [Object] value Any valid value
         
     | 
| 
      
 170 
     | 
    
         
            +
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
      
 171 
     | 
    
         
            +
                def _to_hash(value)
         
     | 
| 
      
 172 
     | 
    
         
            +
                  if value.is_a?(Array)
         
     | 
| 
      
 173 
     | 
    
         
            +
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
      
 174 
     | 
    
         
            +
                  elsif value.is_a?(Hash)
         
     | 
| 
      
 175 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 176 
     | 
    
         
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
      
 177 
     | 
    
         
            +
                    end
         
     | 
| 
      
 178 
     | 
    
         
            +
                  elsif value.respond_to? :to_hash
         
     | 
| 
      
 179 
     | 
    
         
            +
                    value.to_hash
         
     | 
| 
      
 180 
     | 
    
         
            +
                  else
         
     | 
| 
      
 181 
     | 
    
         
            +
                    value
         
     | 
| 
      
 182 
     | 
    
         
            +
                  end
         
     | 
| 
      
 183 
     | 
    
         
            +
                end
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
              end
         
     | 
| 
      
 186 
     | 
    
         
            +
            end
         
     |