=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.15-SNAPSHOT =end require 'date' module UltracartClient class PaymentsConfigurationPayPal attr_accessor :accept_pay_pal attr_accessor :paypal_accounting_code attr_accessor :paypal_api_password attr_accessor :paypal_api_user_name attr_accessor :paypal_certificate_on_file attr_accessor :paypal_deposit_to_account attr_accessor :paypal_email attr_accessor :paypal_environment attr_accessor :paypal_header_image_url attr_accessor :paypal_hide_bill_me_later attr_accessor :paypal_hide_express_checkout_on_view_cart attr_accessor :paypal_hide_for_unshipped_orders attr_accessor :paypal_hold_in_ar attr_accessor :paypal_landing_page attr_accessor :paypal_mode attr_accessor :paypal_private_key_password attr_accessor :paypal_processing_fee attr_accessor :paypal_processing_perc attr_accessor :paypal_send_recurring attr_accessor :paypal_show_card_logos_not_directly_supported attr_accessor :paypal_show_signature attr_accessor :paypal_signature attr_accessor :paypal_solution_type attr_accessor :paypal_summary_email attr_accessor :paypal_summary_mode attr_accessor :paypal_zero_dollar_penny attr_accessor :push_pay_pal attr_accessor :restrictions attr_accessor :short_pay_pal_marketing_text # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'accept_pay_pal' => :'acceptPayPal', :'paypal_accounting_code' => :'paypalAccountingCode', :'paypal_api_password' => :'paypalApiPassword', :'paypal_api_user_name' => :'paypalApiUserName', :'paypal_certificate_on_file' => :'paypalCertificateOnFile', :'paypal_deposit_to_account' => :'paypalDepositToAccount', :'paypal_email' => :'paypalEmail', :'paypal_environment' => :'paypalEnvironment', :'paypal_header_image_url' => :'paypalHeaderImageUrl', :'paypal_hide_bill_me_later' => :'paypalHideBillMeLater', :'paypal_hide_express_checkout_on_view_cart' => :'paypalHideExpressCheckoutOnViewCart', :'paypal_hide_for_unshipped_orders' => :'paypalHideForUnshippedOrders', :'paypal_hold_in_ar' => :'paypalHoldInAR', :'paypal_landing_page' => :'paypalLandingPage', :'paypal_mode' => :'paypalMode', :'paypal_private_key_password' => :'paypalPrivateKeyPassword', :'paypal_processing_fee' => :'paypalProcessingFee', :'paypal_processing_perc' => :'paypalProcessingPerc', :'paypal_send_recurring' => :'paypalSendRecurring', :'paypal_show_card_logos_not_directly_supported' => :'paypalShowCardLogosNotDirectlySupported', :'paypal_show_signature' => :'paypalShowSignature', :'paypal_signature' => :'paypalSignature', :'paypal_solution_type' => :'paypalSolutionType', :'paypal_summary_email' => :'paypalSummaryEmail', :'paypal_summary_mode' => :'paypalSummaryMode', :'paypal_zero_dollar_penny' => :'paypalZeroDollarPenny', :'push_pay_pal' => :'pushPayPal', :'restrictions' => :'restrictions', :'short_pay_pal_marketing_text' => :'shortPayPalMarketingText' } end # Attribute type mapping. def self.swagger_types { :'accept_pay_pal' => :'BOOLEAN', :'paypal_accounting_code' => :'String', :'paypal_api_password' => :'String', :'paypal_api_user_name' => :'String', :'paypal_certificate_on_file' => :'BOOLEAN', :'paypal_deposit_to_account' => :'String', :'paypal_email' => :'String', :'paypal_environment' => :'String', :'paypal_header_image_url' => :'String', :'paypal_hide_bill_me_later' => :'BOOLEAN', :'paypal_hide_express_checkout_on_view_cart' => :'BOOLEAN', :'paypal_hide_for_unshipped_orders' => :'BOOLEAN', :'paypal_hold_in_ar' => :'BOOLEAN', :'paypal_landing_page' => :'String', :'paypal_mode' => :'String', :'paypal_private_key_password' => :'String', :'paypal_processing_fee' => :'String', :'paypal_processing_perc' => :'String', :'paypal_send_recurring' => :'String', :'paypal_show_card_logos_not_directly_supported' => :'BOOLEAN', :'paypal_show_signature' => :'BOOLEAN', :'paypal_signature' => :'String', :'paypal_solution_type' => :'String', :'paypal_summary_email' => :'String', :'paypal_summary_mode' => :'String', :'paypal_zero_dollar_penny' => :'BOOLEAN', :'push_pay_pal' => :'BOOLEAN', :'restrictions' => :'PaymentsConfigurationRestrictions', :'short_pay_pal_marketing_text' => :'BOOLEAN' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'acceptPayPal') self.accept_pay_pal = attributes[:'acceptPayPal'] end if attributes.has_key?(:'paypalAccountingCode') self.paypal_accounting_code = attributes[:'paypalAccountingCode'] end if attributes.has_key?(:'paypalApiPassword') self.paypal_api_password = attributes[:'paypalApiPassword'] end if attributes.has_key?(:'paypalApiUserName') self.paypal_api_user_name = attributes[:'paypalApiUserName'] end if attributes.has_key?(:'paypalCertificateOnFile') self.paypal_certificate_on_file = attributes[:'paypalCertificateOnFile'] end if attributes.has_key?(:'paypalDepositToAccount') self.paypal_deposit_to_account = attributes[:'paypalDepositToAccount'] end if attributes.has_key?(:'paypalEmail') self.paypal_email = attributes[:'paypalEmail'] end if attributes.has_key?(:'paypalEnvironment') self.paypal_environment = attributes[:'paypalEnvironment'] end if attributes.has_key?(:'paypalHeaderImageUrl') self.paypal_header_image_url = attributes[:'paypalHeaderImageUrl'] end if attributes.has_key?(:'paypalHideBillMeLater') self.paypal_hide_bill_me_later = attributes[:'paypalHideBillMeLater'] end if attributes.has_key?(:'paypalHideExpressCheckoutOnViewCart') self.paypal_hide_express_checkout_on_view_cart = attributes[:'paypalHideExpressCheckoutOnViewCart'] end if attributes.has_key?(:'paypalHideForUnshippedOrders') self.paypal_hide_for_unshipped_orders = attributes[:'paypalHideForUnshippedOrders'] end if attributes.has_key?(:'paypalHoldInAR') self.paypal_hold_in_ar = attributes[:'paypalHoldInAR'] end if attributes.has_key?(:'paypalLandingPage') self.paypal_landing_page = attributes[:'paypalLandingPage'] end if attributes.has_key?(:'paypalMode') self.paypal_mode = attributes[:'paypalMode'] end if attributes.has_key?(:'paypalPrivateKeyPassword') self.paypal_private_key_password = attributes[:'paypalPrivateKeyPassword'] end if attributes.has_key?(:'paypalProcessingFee') self.paypal_processing_fee = attributes[:'paypalProcessingFee'] end if attributes.has_key?(:'paypalProcessingPerc') self.paypal_processing_perc = attributes[:'paypalProcessingPerc'] end if attributes.has_key?(:'paypalSendRecurring') self.paypal_send_recurring = attributes[:'paypalSendRecurring'] end if attributes.has_key?(:'paypalShowCardLogosNotDirectlySupported') self.paypal_show_card_logos_not_directly_supported = attributes[:'paypalShowCardLogosNotDirectlySupported'] end if attributes.has_key?(:'paypalShowSignature') self.paypal_show_signature = attributes[:'paypalShowSignature'] end if attributes.has_key?(:'paypalSignature') self.paypal_signature = attributes[:'paypalSignature'] end if attributes.has_key?(:'paypalSolutionType') self.paypal_solution_type = attributes[:'paypalSolutionType'] end if attributes.has_key?(:'paypalSummaryEmail') self.paypal_summary_email = attributes[:'paypalSummaryEmail'] end if attributes.has_key?(:'paypalSummaryMode') self.paypal_summary_mode = attributes[:'paypalSummaryMode'] end if attributes.has_key?(:'paypalZeroDollarPenny') self.paypal_zero_dollar_penny = attributes[:'paypalZeroDollarPenny'] end if attributes.has_key?(:'pushPayPal') self.push_pay_pal = attributes[:'pushPayPal'] end if attributes.has_key?(:'restrictions') self.restrictions = attributes[:'restrictions'] end if attributes.has_key?(:'shortPayPalMarketingText') self.short_pay_pal_marketing_text = attributes[:'shortPayPalMarketingText'] 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 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? true 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 && accept_pay_pal == o.accept_pay_pal && paypal_accounting_code == o.paypal_accounting_code && paypal_api_password == o.paypal_api_password && paypal_api_user_name == o.paypal_api_user_name && paypal_certificate_on_file == o.paypal_certificate_on_file && paypal_deposit_to_account == o.paypal_deposit_to_account && paypal_email == o.paypal_email && paypal_environment == o.paypal_environment && paypal_header_image_url == o.paypal_header_image_url && paypal_hide_bill_me_later == o.paypal_hide_bill_me_later && paypal_hide_express_checkout_on_view_cart == o.paypal_hide_express_checkout_on_view_cart && paypal_hide_for_unshipped_orders == o.paypal_hide_for_unshipped_orders && paypal_hold_in_ar == o.paypal_hold_in_ar && paypal_landing_page == o.paypal_landing_page && paypal_mode == o.paypal_mode && paypal_private_key_password == o.paypal_private_key_password && paypal_processing_fee == o.paypal_processing_fee && paypal_processing_perc == o.paypal_processing_perc && paypal_send_recurring == o.paypal_send_recurring && paypal_show_card_logos_not_directly_supported == o.paypal_show_card_logos_not_directly_supported && paypal_show_signature == o.paypal_show_signature && paypal_signature == o.paypal_signature && paypal_solution_type == o.paypal_solution_type && paypal_summary_email == o.paypal_summary_email && paypal_summary_mode == o.paypal_summary_mode && paypal_zero_dollar_penny == o.paypal_zero_dollar_penny && push_pay_pal == o.push_pay_pal && restrictions == o.restrictions && short_pay_pal_marketing_text == o.short_pay_pal_marketing_text end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash [accept_pay_pal, paypal_accounting_code, paypal_api_password, paypal_api_user_name, paypal_certificate_on_file, paypal_deposit_to_account, paypal_email, paypal_environment, paypal_header_image_url, paypal_hide_bill_me_later, paypal_hide_express_checkout_on_view_cart, paypal_hide_for_unshipped_orders, paypal_hold_in_ar, paypal_landing_page, paypal_mode, paypal_private_key_password, paypal_processing_fee, paypal_processing_perc, paypal_send_recurring, paypal_show_card_logos_not_directly_supported, paypal_show_signature, paypal_signature, paypal_solution_type, paypal_summary_email, paypal_summary_mode, paypal_zero_dollar_penny, push_pay_pal, restrictions, short_pay_pal_marketing_text].hash 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) self.class.swagger_types.each_pair do |key, type| if 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 # or else data not found in attributes(hash), not an issue as the data can be optional 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 :DateTime DateTime.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<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+?), (?.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = UltracartClient.const_get(type).new temp_model.build_from_hash(value) end end # Returns the string representation of the object # @return [String] String presentation of the object def to_s to_hash.to_s end # to_body is an alias to to_hash (backward compatibility) # @return [Hash] Returns the object in the form of hash def to_body to_hash end # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end # Outputs non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value # @param [Object] value Any valid value # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end end end