=begin #Synctera API #
Welcome to the official reference documentation for Synctera APIs. Our APIs are the best way to automate your company's banking needs and are designed to be easy to understand and implement.
We're continuously growing this library and what you see here is just the start, but if you need something specific or have a question, contact us.
The version of the OpenAPI document: 0.60.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.5.0 =end require 'date' require 'time' module SyncteraRubySdk # Optionally provided browser device details, used as a fallback in case there is an issue with Device Data Collection. Note that minimal field validation is performed. class DeviceDetails # The device's color palette bit depth, in bits per pixel attr_accessor :color_depth # The exact contents of the browser's HTTP accept headers attr_accessor :header # The device's IP address (either IPv4 or IPv6 formats are acceptable) attr_accessor :ip_address # If the browser has the ability to execute Java (value returned from `navigator.javaEnabled` property) attr_accessor :java_enabled # If the browser has the ability to execute JavaScript (value returned from `navigator.javaScriptEnabled` property) attr_accessor :javascript_enabled # The browser's language as defined in IETF BCP47 attr_accessor :language # The total height of the device's screen, in pixels attr_accessor :screen_height # The total width of the device's screen, in pixels attr_accessor :screen_width # The offset from UTC of the device's local timezone, in minutes attr_accessor :timezone # The exact contents of the HTTP user agent header attr_accessor :user_agent # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'color_depth' => :'color_depth', :'header' => :'header', :'ip_address' => :'ip_address', :'java_enabled' => :'java_enabled', :'javascript_enabled' => :'javascript_enabled', :'language' => :'language', :'screen_height' => :'screen_height', :'screen_width' => :'screen_width', :'timezone' => :'timezone', :'user_agent' => :'user_agent' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes attribute_map.values end # Attribute type mapping. def self.openapi_types { :'color_depth' => :'Integer', :'header' => :'String', :'ip_address' => :'String', :'java_enabled' => :'Boolean', :'javascript_enabled' => :'Boolean', :'language' => :'String', :'screen_height' => :'Integer', :'screen_width' => :'Integer', :'timezone' => :'Integer', :'user_agent' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::DeviceDetails` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `SyncteraRubySdk::DeviceDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'color_depth') self.color_depth = attributes[:'color_depth'] end if attributes.key?(:'header') self.header = attributes[:'header'] end if attributes.key?(:'ip_address') self.ip_address = attributes[:'ip_address'] end if attributes.key?(:'java_enabled') self.java_enabled = attributes[:'java_enabled'] end if attributes.key?(:'javascript_enabled') self.javascript_enabled = attributes[:'javascript_enabled'] end if attributes.key?(:'language') self.language = attributes[:'language'] end if attributes.key?(:'screen_height') self.screen_height = attributes[:'screen_height'] end if attributes.key?(:'screen_width') self.screen_width = attributes[:'screen_width'] end if attributes.key?(:'timezone') self.timezone = attributes[:'timezone'] end if attributes.key?(:'user_agent') self.user_agent = attributes[:'user_agent'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new if @color_depth.nil? invalid_properties.push('invalid value for "color_depth", color_depth cannot be nil.') end if @color_depth > 99 invalid_properties.push('invalid value for "color_depth", must be smaller than or equal to 99.') end if @color_depth < 1 invalid_properties.push('invalid value for "color_depth", must be greater than or equal to 1.') end if @header.nil? invalid_properties.push('invalid value for "header", header cannot be nil.') end if @ip_address.nil? invalid_properties.push('invalid value for "ip_address", ip_address cannot be nil.') end if @java_enabled.nil? invalid_properties.push('invalid value for "java_enabled", java_enabled cannot be nil.') end if @javascript_enabled.nil? invalid_properties.push('invalid value for "javascript_enabled", javascript_enabled cannot be nil.') end if @language.nil? invalid_properties.push('invalid value for "language", language cannot be nil.') end if @screen_height.nil? invalid_properties.push('invalid value for "screen_height", screen_height cannot be nil.') end if @screen_height > 999999 invalid_properties.push('invalid value for "screen_height", must be smaller than or equal to 999999.') end if @screen_height < 1 invalid_properties.push('invalid value for "screen_height", must be greater than or equal to 1.') end if @screen_width.nil? invalid_properties.push('invalid value for "screen_width", screen_width cannot be nil.') end if @screen_width > 999999 invalid_properties.push('invalid value for "screen_width", must be smaller than or equal to 999999.') end if @screen_width < 1 invalid_properties.push('invalid value for "screen_width", must be greater than or equal to 1.') end if @timezone.nil? invalid_properties.push('invalid value for "timezone", timezone cannot be nil.') end if @timezone > 840 invalid_properties.push('invalid value for "timezone", must be smaller than or equal to 840.') end if @timezone < -840 invalid_properties.push('invalid value for "timezone", must be greater than or equal to -840.') end if @user_agent.nil? invalid_properties.push('invalid value for "user_agent", user_agent cannot be nil.') end invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if @color_depth.nil? return false if @color_depth > 99 return false if @color_depth < 1 return false if @header.nil? return false if @ip_address.nil? return false if @java_enabled.nil? return false if @javascript_enabled.nil? return false if @language.nil? return false if @screen_height.nil? return false if @screen_height > 999999 return false if @screen_height < 1 return false if @screen_width.nil? return false if @screen_width > 999999 return false if @screen_width < 1 return false if @timezone.nil? return false if @timezone > 840 return false if @timezone < -840 return false if @user_agent.nil? true end # Custom attribute writer method with validation # @param [Object] color_depth Value to be assigned def color_depth=(color_depth) if color_depth.nil? fail ArgumentError, 'color_depth cannot be nil' end if color_depth > 99 fail ArgumentError, 'invalid value for "color_depth", must be smaller than or equal to 99.' end if color_depth < 1 fail ArgumentError, 'invalid value for "color_depth", must be greater than or equal to 1.' end @color_depth = color_depth end # Custom attribute writer method with validation # @param [Object] screen_height Value to be assigned def screen_height=(screen_height) if screen_height.nil? fail ArgumentError, 'screen_height cannot be nil' end if screen_height > 999999 fail ArgumentError, 'invalid value for "screen_height", must be smaller than or equal to 999999.' end if screen_height < 1 fail ArgumentError, 'invalid value for "screen_height", must be greater than or equal to 1.' end @screen_height = screen_height end # Custom attribute writer method with validation # @param [Object] screen_width Value to be assigned def screen_width=(screen_width) if screen_width.nil? fail ArgumentError, 'screen_width cannot be nil' end if screen_width > 999999 fail ArgumentError, 'invalid value for "screen_width", must be smaller than or equal to 999999.' end if screen_width < 1 fail ArgumentError, 'invalid value for "screen_width", must be greater than or equal to 1.' end @screen_width = screen_width end # Custom attribute writer method with validation # @param [Object] timezone Value to be assigned def timezone=(timezone) if timezone.nil? fail ArgumentError, 'timezone cannot be nil' end if timezone > 840 fail ArgumentError, 'invalid value for "timezone", must be smaller than or equal to 840.' end if timezone < -840 fail ArgumentError, 'invalid value for "timezone", must be greater than or equal to -840.' end @timezone = timezone end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && color_depth == o.color_depth && header == o.header && ip_address == o.ip_address && java_enabled == o.java_enabled && javascript_enabled == o.javascript_enabled && language == o.language && screen_height == o.screen_height && screen_width == o.screen_width && timezone == o.timezone && user_agent == o.user_agent end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash [color_depth, header, ip_address, java_enabled, javascript_enabled, language, screen_height, screen_width, timezone, user_agent].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) new.build_from_hash(attributes) end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?