=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 class CardProductResponse # PHYSICAL or VIRTUAL. attr_accessor :form # Indicates whether the Card Product is active attr_accessor :active # Card Program ID attr_accessor :card_program_id # Color code for dynamic card elements such as PAN and card holder name attr_accessor :color # The timestamp representing when the Card Product was created attr_accessor :creation_time attr_accessor :digital_wallet_tokenization # The time when the Card Product is decommissioned attr_accessor :end_date # Card Product ID attr_accessor :id # Indicates whether or not there is an overlay image of the card product available attr_accessor :image attr_accessor :image_mode # Allow issuing cards on this product without requiring KYC attr_accessor :issue_without_kyc # The timestamp representing when the Card Product was last modified attr_accessor :last_modified_time # The name of the Card Product attr_accessor :name # Card orientation attr_accessor :orientation # Card fulfillment provider’s package ID attr_accessor :package_id attr_accessor :physical_card_format attr_accessor :return_address # The time when the Card Product goes live attr_accessor :start_date attr_accessor :three_ds_policy attr_accessor :txn_enhancer class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values def initialize(datatype, allowable_values) @allowable_values = allowable_values.map do |value| case datatype.to_s when /Integer/i value.to_i when /Float/i value.to_f else value end end end def valid?(value) !value || allowable_values.include?(value) end end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'form' => :'form', :'active' => :'active', :'card_program_id' => :'card_program_id', :'color' => :'color', :'creation_time' => :'creation_time', :'digital_wallet_tokenization' => :'digital_wallet_tokenization', :'end_date' => :'end_date', :'id' => :'id', :'image' => :'image', :'image_mode' => :'image_mode', :'issue_without_kyc' => :'issue_without_kyc', :'last_modified_time' => :'last_modified_time', :'name' => :'name', :'orientation' => :'orientation', :'package_id' => :'package_id', :'physical_card_format' => :'physical_card_format', :'return_address' => :'return_address', :'start_date' => :'start_date', :'three_ds_policy' => :'three_ds_policy', :'txn_enhancer' => :'txn_enhancer' } 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 { :'form' => :'String', :'active' => :'Boolean', :'card_program_id' => :'String', :'color' => :'String', :'creation_time' => :'Time', :'digital_wallet_tokenization' => :'DigitalWalletTokenization', :'end_date' => :'Time', :'id' => :'String', :'image' => :'Boolean', :'image_mode' => :'CardImageMode', :'issue_without_kyc' => :'Boolean', :'last_modified_time' => :'Time', :'name' => :'String', :'orientation' => :'String', :'package_id' => :'String', :'physical_card_format' => :'PhysicalCardFormat', :'return_address' => :'Shipping', :'start_date' => :'Time', :'three_ds_policy' => :'ThreeDsPolicy', :'txn_enhancer' => :'TxnEnhancer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ ]) end # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ :'CardProduct' ] 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::CardProductResponse` 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::CardProductResponse`. 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?(:'form') self.form = attributes[:'form'] end if attributes.key?(:'active') self.active = attributes[:'active'] end if attributes.key?(:'card_program_id') self.card_program_id = attributes[:'card_program_id'] end if attributes.key?(:'color') self.color = attributes[:'color'] end if attributes.key?(:'creation_time') self.creation_time = attributes[:'creation_time'] end if attributes.key?(:'digital_wallet_tokenization') self.digital_wallet_tokenization = attributes[:'digital_wallet_tokenization'] end if attributes.key?(:'end_date') self.end_date = attributes[:'end_date'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'image') self.image = attributes[:'image'] end if attributes.key?(:'image_mode') self.image_mode = attributes[:'image_mode'] end if attributes.key?(:'issue_without_kyc') self.issue_without_kyc = attributes[:'issue_without_kyc'] end if attributes.key?(:'last_modified_time') self.last_modified_time = attributes[:'last_modified_time'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'orientation') self.orientation = attributes[:'orientation'] end if attributes.key?(:'package_id') self.package_id = attributes[:'package_id'] end if attributes.key?(:'physical_card_format') self.physical_card_format = attributes[:'physical_card_format'] end if attributes.key?(:'return_address') self.return_address = attributes[:'return_address'] end if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] end if attributes.key?(:'three_ds_policy') self.three_ds_policy = attributes[:'three_ds_policy'] end if attributes.key?(:'txn_enhancer') self.txn_enhancer = attributes[:'txn_enhancer'] else self.txn_enhancer = 'NONE' 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 @form.nil? invalid_properties.push('invalid value for "form", form cannot be nil.') end if @active.nil? invalid_properties.push('invalid value for "active", active cannot be nil.') end if @card_program_id.nil? invalid_properties.push('invalid value for "card_program_id", card_program_id cannot be nil.') end pattern = Regexp.new(/^[0-9A-F]{6}$/) if !@color.nil? && @color !~ pattern invalid_properties.push("invalid value for \"color\", must conform to the pattern #{pattern}.") end if @creation_time.nil? invalid_properties.push('invalid value for "creation_time", creation_time cannot be nil.') end if @digital_wallet_tokenization.nil? invalid_properties.push('invalid value for "digital_wallet_tokenization", digital_wallet_tokenization cannot be nil.') end if @end_date.nil? invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @last_modified_time.nil? invalid_properties.push('invalid value for "last_modified_time", last_modified_time cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @name.to_s.length > 40 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 40.') end if @name.to_s.length < 1 invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end if !@package_id.nil? && @package_id.to_s.length > 50 invalid_properties.push('invalid value for "package_id", the character length must be smaller than or equal to 50.') end if !@package_id.nil? && @package_id.to_s.length < 1 invalid_properties.push('invalid value for "package_id", the character length must be great than or equal to 1.') end if @start_date.nil? invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') end if @three_ds_policy.nil? invalid_properties.push('invalid value for "three_ds_policy", three_ds_policy 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 @form.nil? form_validator = EnumAttributeValidator.new('String', ["PHYSICAL", "VIRTUAL"]) return false unless form_validator.valid?(@form) return false if @active.nil? return false if @card_program_id.nil? return false if !@color.nil? && @color !~ Regexp.new(/^[0-9A-F]{6}$/) return false if @creation_time.nil? return false if @digital_wallet_tokenization.nil? return false if @end_date.nil? return false if @id.nil? return false if @last_modified_time.nil? return false if @name.nil? return false if @name.to_s.length > 40 return false if @name.to_s.length < 1 orientation_validator = EnumAttributeValidator.new('String', ["HORIZONTAL", "VERTICAL"]) return false unless orientation_validator.valid?(@orientation) return false if !@package_id.nil? && @package_id.to_s.length > 50 return false if !@package_id.nil? && @package_id.to_s.length < 1 return false if @start_date.nil? return false if @three_ds_policy.nil? true end # Custom attribute writer method checking allowed values (enum). # @param [Object] form Object to be assigned def form=(form) validator = EnumAttributeValidator.new('String', ["PHYSICAL", "VIRTUAL"]) unless validator.valid?(form) fail ArgumentError, "invalid value for \"form\", must be one of #{validator.allowable_values}." end @form = form end # Custom attribute writer method with validation # @param [Object] color Value to be assigned def color=(color) pattern = Regexp.new(/^[0-9A-F]{6}$/) if !color.nil? && color !~ pattern fail ArgumentError, "invalid value for \"color\", must conform to the pattern #{pattern}." end @color = color end # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) if name.nil? fail ArgumentError, 'name cannot be nil' end if name.to_s.length > 40 fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 40.' end if name.to_s.length < 1 fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end @name = name end # Custom attribute writer method checking allowed values (enum). # @param [Object] orientation Object to be assigned def orientation=(orientation) validator = EnumAttributeValidator.new('String', ["HORIZONTAL", "VERTICAL"]) unless validator.valid?(orientation) fail ArgumentError, "invalid value for \"orientation\", must be one of #{validator.allowable_values}." end @orientation = orientation end # Custom attribute writer method with validation # @param [Object] package_id Value to be assigned def package_id=(package_id) if !package_id.nil? && package_id.to_s.length > 50 fail ArgumentError, 'invalid value for "package_id", the character length must be smaller than or equal to 50.' end if !package_id.nil? && package_id.to_s.length < 1 fail ArgumentError, 'invalid value for "package_id", the character length must be great than or equal to 1.' end @package_id = package_id 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 && form == o.form && active == o.active && card_program_id == o.card_program_id && color == o.color && creation_time == o.creation_time && digital_wallet_tokenization == o.digital_wallet_tokenization && end_date == o.end_date && id == o.id && image == o.image && image_mode == o.image_mode && issue_without_kyc == o.issue_without_kyc && last_modified_time == o.last_modified_time && name == o.name && orientation == o.orientation && package_id == o.package_id && physical_card_format == o.physical_card_format && return_address == o.return_address && start_date == o.start_date && three_ds_policy == o.three_ds_policy && txn_enhancer == o.txn_enhancer 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 [form, active, card_program_id, color, creation_time, digital_wallet_tokenization, end_date, id, image, image_mode, issue_without_kyc, last_modified_time, name, orientation, package_id, physical_card_format, return_address, start_date, three_ds_policy, txn_enhancer].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<(?