mundi_api 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/LICENSE +28 -0
 - data/README.md +2186 -0
 - data/lib/mundi_api.rb +137 -0
 - data/lib/mundi_api/api_helper.rb +209 -0
 - data/lib/mundi_api/configuration.rb +25 -0
 - data/lib/mundi_api/controllers/base_controller.rb +61 -0
 - data/lib/mundi_api/controllers/charges_controller.rb +359 -0
 - data/lib/mundi_api/controllers/customers_controller.rb +758 -0
 - data/lib/mundi_api/controllers/invoices_controller.rb +184 -0
 - data/lib/mundi_api/controllers/orders_controller.rb +171 -0
 - data/lib/mundi_api/controllers/plans_controller.rb +387 -0
 - data/lib/mundi_api/controllers/subscriptions_controller.rb +648 -0
 - data/lib/mundi_api/controllers/tokens_controller.rb +87 -0
 - data/lib/mundi_api/exceptions/api_exception.rb +18 -0
 - data/lib/mundi_api/exceptions/error_exception.rb +37 -0
 - data/lib/mundi_api/http/auth/basic_auth.rb +20 -0
 - data/lib/mundi_api/http/faraday_client.rb +55 -0
 - data/lib/mundi_api/http/http_call_back.rb +22 -0
 - data/lib/mundi_api/http/http_client.rb +92 -0
 - data/lib/mundi_api/http/http_context.rb +18 -0
 - data/lib/mundi_api/http/http_method_enum.rb +11 -0
 - data/lib/mundi_api/http/http_request.rb +48 -0
 - data/lib/mundi_api/http/http_response.rb +21 -0
 - data/lib/mundi_api/models/base_model.rb +34 -0
 - data/lib/mundi_api/models/create_access_token_request.rb +35 -0
 - data/lib/mundi_api/models/create_address_request.rb +108 -0
 - data/lib/mundi_api/models/create_bank_transfer_payment_request.rb +44 -0
 - data/lib/mundi_api/models/create_boleto_payment_request.rb +83 -0
 - data/lib/mundi_api/models/create_cancel_charge_request.rb +35 -0
 - data/lib/mundi_api/models/create_cancel_subscription_request.rb +35 -0
 - data/lib/mundi_api/models/create_capture_charge_request.rb +45 -0
 - data/lib/mundi_api/models/create_card_options_request.rb +36 -0
 - data/lib/mundi_api/models/create_card_request.rb +136 -0
 - data/lib/mundi_api/models/create_card_token_request.rb +80 -0
 - data/lib/mundi_api/models/create_charge_request.rb +92 -0
 - data/lib/mundi_api/models/create_checkout_boleto_payment_request.rb +54 -0
 - data/lib/mundi_api/models/create_checkout_card_installment_option_request.rb +44 -0
 - data/lib/mundi_api/models/create_checkout_card_payment_request.rb +51 -0
 - data/lib/mundi_api/models/create_checkout_payment_request.rb +82 -0
 - data/lib/mundi_api/models/create_credit_card_payment_request.rb +108 -0
 - data/lib/mundi_api/models/create_customer_request.rb +108 -0
 - data/lib/mundi_api/models/create_discount_request.rb +62 -0
 - data/lib/mundi_api/models/create_order_item_request.rb +71 -0
 - data/lib/mundi_api/models/create_order_request.rb +114 -0
 - data/lib/mundi_api/models/create_payment_request.rb +121 -0
 - data/lib/mundi_api/models/create_phone_request.rb +53 -0
 - data/lib/mundi_api/models/create_phones_request.rb +46 -0
 - data/lib/mundi_api/models/create_plan_item_request.rb +81 -0
 - data/lib/mundi_api/models/create_plan_request.rb +199 -0
 - data/lib/mundi_api/models/create_price_bracket_request.rb +62 -0
 - data/lib/mundi_api/models/create_pricing_scheme_request.rb +69 -0
 - data/lib/mundi_api/models/create_seller_request.rb +90 -0
 - data/lib/mundi_api/models/create_setup_request.rb +55 -0
 - data/lib/mundi_api/models/create_shipping_request.rb +81 -0
 - data/lib/mundi_api/models/create_subscription_item_request.rb +106 -0
 - data/lib/mundi_api/models/create_subscription_request.rb +269 -0
 - data/lib/mundi_api/models/create_token_request.rb +44 -0
 - data/lib/mundi_api/models/create_usage_request.rb +54 -0
 - data/lib/mundi_api/models/create_voucher_payment_request.rb +72 -0
 - data/lib/mundi_api/models/get_access_token_response.rb +73 -0
 - data/lib/mundi_api/models/get_address_response.rb +163 -0
 - data/lib/mundi_api/models/get_bank_transfer_transaction_response.rb +118 -0
 - data/lib/mundi_api/models/get_billing_address_response.rb +98 -0
 - data/lib/mundi_api/models/get_boleto_transaction_response.rb +137 -0
 - data/lib/mundi_api/models/get_card_response.rb +164 -0
 - data/lib/mundi_api/models/get_card_token_response.rb +89 -0
 - data/lib/mundi_api/models/get_charge_response.rb +184 -0
 - data/lib/mundi_api/models/get_checkout_payment_settings_response.rb +99 -0
 - data/lib/mundi_api/models/get_credit_card_transaction_response.rb +163 -0
 - data/lib/mundi_api/models/get_customer_response.rb +145 -0
 - data/lib/mundi_api/models/get_discount_response.rb +100 -0
 - data/lib/mundi_api/models/get_invoice_item_response.rb +73 -0
 - data/lib/mundi_api/models/get_invoice_response.rb +210 -0
 - data/lib/mundi_api/models/get_order_item_response.rb +63 -0
 - data/lib/mundi_api/models/get_order_response.rb +167 -0
 - data/lib/mundi_api/models/get_period_response.rb +73 -0
 - data/lib/mundi_api/models/get_phone_response.rb +53 -0
 - data/lib/mundi_api/models/get_phones_response.rb +46 -0
 - data/lib/mundi_api/models/get_plan_item_response.rb +127 -0
 - data/lib/mundi_api/models/get_plan_response.rb +223 -0
 - data/lib/mundi_api/models/get_price_bracket_response.rb +62 -0
 - data/lib/mundi_api/models/get_pricing_scheme_response.rb +69 -0
 - data/lib/mundi_api/models/get_safety_pay_transaction_response.rb +109 -0
 - data/lib/mundi_api/models/get_seller_response.rb +126 -0
 - data/lib/mundi_api/models/get_setup_response.rb +62 -0
 - data/lib/mundi_api/models/get_shipping_response.rb +72 -0
 - data/lib/mundi_api/models/get_subscription_item_response.rb +135 -0
 - data/lib/mundi_api/models/get_subscription_response.rb +261 -0
 - data/lib/mundi_api/models/get_token_response.rb +72 -0
 - data/lib/mundi_api/models/get_transaction_response.rb +136 -0
 - data/lib/mundi_api/models/get_usage_response.rb +82 -0
 - data/lib/mundi_api/models/get_voucher_transaction_response.rb +163 -0
 - data/lib/mundi_api/models/list_access_tokens_response.rb +51 -0
 - data/lib/mundi_api/models/list_addresses_response.rb +51 -0
 - data/lib/mundi_api/models/list_cards_response.rb +51 -0
 - data/lib/mundi_api/models/list_charges_response.rb +51 -0
 - data/lib/mundi_api/models/list_customers_response.rb +51 -0
 - data/lib/mundi_api/models/list_invoices_response.rb +51 -0
 - data/lib/mundi_api/models/list_order_response.rb +51 -0
 - data/lib/mundi_api/models/list_plans_response.rb +51 -0
 - data/lib/mundi_api/models/list_subscription_items_response.rb +51 -0
 - data/lib/mundi_api/models/list_subscriptions_response.rb +51 -0
 - data/lib/mundi_api/models/list_transactions_response.rb +51 -0
 - data/lib/mundi_api/models/list_usages_response.rb +51 -0
 - data/lib/mundi_api/models/paging_response.rb +53 -0
 - data/lib/mundi_api/models/update_address_request.rb +53 -0
 - data/lib/mundi_api/models/update_card_request.rb +81 -0
 - data/lib/mundi_api/models/update_charge_card_request.rb +62 -0
 - data/lib/mundi_api/models/update_charge_due_date_request.rb +36 -0
 - data/lib/mundi_api/models/update_charge_payment_method_request.rb +74 -0
 - data/lib/mundi_api/models/update_customer_request.rb +90 -0
 - data/lib/mundi_api/models/update_metadata_request.rb +35 -0
 - data/lib/mundi_api/models/update_plan_item_request.rb +81 -0
 - data/lib/mundi_api/models/update_plan_request.rb +161 -0
 - data/lib/mundi_api/models/update_price_bracket_request.rb +62 -0
 - data/lib/mundi_api/models/update_pricing_scheme_request.rb +69 -0
 - data/lib/mundi_api/models/update_subscription_billing_date_request.rb +37 -0
 - data/lib/mundi_api/models/update_subscription_card_request.rb +44 -0
 - data/lib/mundi_api/models/update_subscription_item_request.rb +81 -0
 - data/lib/mundi_api/models/update_subscription_payment_method_request.rb +53 -0
 - data/lib/mundi_api/mundi_api_client.rb +63 -0
 - metadata +246 -0
 
| 
         @@ -0,0 +1,163 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # This file was automatically generated by APIMATIC v2.0
         
     | 
| 
      
 2 
     | 
    
         
            +
            # ( https://apimatic.io ).
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require_relative 'get_transaction_response'
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            module MundiApi
         
     | 
| 
      
 8 
     | 
    
         
            +
              # Response object for getting a credit card transaction
         
     | 
| 
      
 9 
     | 
    
         
            +
              class GetCreditCardTransactionResponse < GetTransactionResponse
         
     | 
| 
      
 10 
     | 
    
         
            +
                # Text that will appear on the credit card's statement
         
     | 
| 
      
 11 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 12 
     | 
    
         
            +
                attr_accessor :statement_descriptor
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                # Acquirer name
         
     | 
| 
      
 15 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 16 
     | 
    
         
            +
                attr_accessor :acquirer_name
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                # Aquirer affiliation code
         
     | 
| 
      
 19 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 20 
     | 
    
         
            +
                attr_accessor :acquirer_affiliation_code
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                # Acquirer TID
         
     | 
| 
      
 23 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 24 
     | 
    
         
            +
                attr_accessor :acquirer_tid
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                # Acquirer NSU
         
     | 
| 
      
 27 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 28 
     | 
    
         
            +
                attr_accessor :acquirer_nsu
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                # Acquirer authorization code
         
     | 
| 
      
 31 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 32 
     | 
    
         
            +
                attr_accessor :acquirer_auth_code
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                # Operation type
         
     | 
| 
      
 35 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 36 
     | 
    
         
            +
                attr_accessor :operation_type
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                # Card data
         
     | 
| 
      
 39 
     | 
    
         
            +
                # @return [GetCardResponse]
         
     | 
| 
      
 40 
     | 
    
         
            +
                attr_accessor :card
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                # Acquirer message
         
     | 
| 
      
 43 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 44 
     | 
    
         
            +
                attr_accessor :acquirer_message
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                # Number of installments
         
     | 
| 
      
 47 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 48 
     | 
    
         
            +
                attr_accessor :installments
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                # A mapping from model property names to API property names.
         
     | 
| 
      
 51 
     | 
    
         
            +
                def self.names
         
     | 
| 
      
 52 
     | 
    
         
            +
                  if @_hash.nil?
         
     | 
| 
      
 53 
     | 
    
         
            +
                    @_hash = {}
         
     | 
| 
      
 54 
     | 
    
         
            +
                    @_hash['statement_descriptor'] = 'statement_descriptor'
         
     | 
| 
      
 55 
     | 
    
         
            +
                    @_hash['acquirer_name'] = 'acquirer_name'
         
     | 
| 
      
 56 
     | 
    
         
            +
                    @_hash['acquirer_affiliation_code'] = 'acquirer_affiliation_code'
         
     | 
| 
      
 57 
     | 
    
         
            +
                    @_hash['acquirer_tid'] = 'acquirer_tid'
         
     | 
| 
      
 58 
     | 
    
         
            +
                    @_hash['acquirer_nsu'] = 'acquirer_nsu'
         
     | 
| 
      
 59 
     | 
    
         
            +
                    @_hash['acquirer_auth_code'] = 'acquirer_auth_code'
         
     | 
| 
      
 60 
     | 
    
         
            +
                    @_hash['operation_type'] = 'operation_type'
         
     | 
| 
      
 61 
     | 
    
         
            +
                    @_hash['card'] = 'card'
         
     | 
| 
      
 62 
     | 
    
         
            +
                    @_hash['acquirer_message'] = 'acquirer_message'
         
     | 
| 
      
 63 
     | 
    
         
            +
                    @_hash['installments'] = 'installments'
         
     | 
| 
      
 64 
     | 
    
         
            +
                    @_hash = super().merge(@_hash)
         
     | 
| 
      
 65 
     | 
    
         
            +
                  end
         
     | 
| 
      
 66 
     | 
    
         
            +
                  @_hash
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                def initialize(statement_descriptor = nil,
         
     | 
| 
      
 70 
     | 
    
         
            +
                               acquirer_name = nil,
         
     | 
| 
      
 71 
     | 
    
         
            +
                               acquirer_affiliation_code = nil,
         
     | 
| 
      
 72 
     | 
    
         
            +
                               acquirer_tid = nil,
         
     | 
| 
      
 73 
     | 
    
         
            +
                               acquirer_nsu = nil,
         
     | 
| 
      
 74 
     | 
    
         
            +
                               acquirer_auth_code = nil,
         
     | 
| 
      
 75 
     | 
    
         
            +
                               operation_type = nil,
         
     | 
| 
      
 76 
     | 
    
         
            +
                               card = nil,
         
     | 
| 
      
 77 
     | 
    
         
            +
                               acquirer_message = nil,
         
     | 
| 
      
 78 
     | 
    
         
            +
                               gateway_id = nil,
         
     | 
| 
      
 79 
     | 
    
         
            +
                               amount = nil,
         
     | 
| 
      
 80 
     | 
    
         
            +
                               status = nil,
         
     | 
| 
      
 81 
     | 
    
         
            +
                               success = nil,
         
     | 
| 
      
 82 
     | 
    
         
            +
                               created_at = nil,
         
     | 
| 
      
 83 
     | 
    
         
            +
                               updated_at = nil,
         
     | 
| 
      
 84 
     | 
    
         
            +
                               attempt_count = nil,
         
     | 
| 
      
 85 
     | 
    
         
            +
                               max_attempts = nil,
         
     | 
| 
      
 86 
     | 
    
         
            +
                               installments = nil,
         
     | 
| 
      
 87 
     | 
    
         
            +
                               next_attempt = nil,
         
     | 
| 
      
 88 
     | 
    
         
            +
                               transaction_type = nil)
         
     | 
| 
      
 89 
     | 
    
         
            +
                  @statement_descriptor = statement_descriptor
         
     | 
| 
      
 90 
     | 
    
         
            +
                  @acquirer_name = acquirer_name
         
     | 
| 
      
 91 
     | 
    
         
            +
                  @acquirer_affiliation_code = acquirer_affiliation_code
         
     | 
| 
      
 92 
     | 
    
         
            +
                  @acquirer_tid = acquirer_tid
         
     | 
| 
      
 93 
     | 
    
         
            +
                  @acquirer_nsu = acquirer_nsu
         
     | 
| 
      
 94 
     | 
    
         
            +
                  @acquirer_auth_code = acquirer_auth_code
         
     | 
| 
      
 95 
     | 
    
         
            +
                  @operation_type = operation_type
         
     | 
| 
      
 96 
     | 
    
         
            +
                  @card = card
         
     | 
| 
      
 97 
     | 
    
         
            +
                  @acquirer_message = acquirer_message
         
     | 
| 
      
 98 
     | 
    
         
            +
                  @installments = installments
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
                  # Call the constructor of the base class
         
     | 
| 
      
 101 
     | 
    
         
            +
                  super(gateway_id,
         
     | 
| 
      
 102 
     | 
    
         
            +
                        amount,
         
     | 
| 
      
 103 
     | 
    
         
            +
                        status,
         
     | 
| 
      
 104 
     | 
    
         
            +
                        success,
         
     | 
| 
      
 105 
     | 
    
         
            +
                        created_at,
         
     | 
| 
      
 106 
     | 
    
         
            +
                        updated_at,
         
     | 
| 
      
 107 
     | 
    
         
            +
                        attempt_count,
         
     | 
| 
      
 108 
     | 
    
         
            +
                        max_attempts,
         
     | 
| 
      
 109 
     | 
    
         
            +
                        next_attempt,
         
     | 
| 
      
 110 
     | 
    
         
            +
                        transaction_type)
         
     | 
| 
      
 111 
     | 
    
         
            +
                end
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
                # Creates an instance of the object from a hash.
         
     | 
| 
      
 114 
     | 
    
         
            +
                def self.from_hash(hash)
         
     | 
| 
      
 115 
     | 
    
         
            +
                  return nil unless hash
         
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
      
 117 
     | 
    
         
            +
                  # Extract variables from the hash.
         
     | 
| 
      
 118 
     | 
    
         
            +
                  statement_descriptor = hash['statement_descriptor']
         
     | 
| 
      
 119 
     | 
    
         
            +
                  acquirer_name = hash['acquirer_name']
         
     | 
| 
      
 120 
     | 
    
         
            +
                  acquirer_affiliation_code = hash['acquirer_affiliation_code']
         
     | 
| 
      
 121 
     | 
    
         
            +
                  acquirer_tid = hash['acquirer_tid']
         
     | 
| 
      
 122 
     | 
    
         
            +
                  acquirer_nsu = hash['acquirer_nsu']
         
     | 
| 
      
 123 
     | 
    
         
            +
                  acquirer_auth_code = hash['acquirer_auth_code']
         
     | 
| 
      
 124 
     | 
    
         
            +
                  operation_type = hash['operation_type']
         
     | 
| 
      
 125 
     | 
    
         
            +
                  card = GetCardResponse.from_hash(hash['card']) if hash['card']
         
     | 
| 
      
 126 
     | 
    
         
            +
                  acquirer_message = hash['acquirer_message']
         
     | 
| 
      
 127 
     | 
    
         
            +
                  gateway_id = hash['gateway_id']
         
     | 
| 
      
 128 
     | 
    
         
            +
                  amount = hash['amount']
         
     | 
| 
      
 129 
     | 
    
         
            +
                  status = hash['status']
         
     | 
| 
      
 130 
     | 
    
         
            +
                  success = hash['success']
         
     | 
| 
      
 131 
     | 
    
         
            +
                  created_at = DateTime.rfc3339(hash['created_at']) if hash['created_at']
         
     | 
| 
      
 132 
     | 
    
         
            +
                  updated_at = DateTime.rfc3339(hash['updated_at']) if hash['updated_at']
         
     | 
| 
      
 133 
     | 
    
         
            +
                  attempt_count = hash['attempt_count']
         
     | 
| 
      
 134 
     | 
    
         
            +
                  max_attempts = hash['max_attempts']
         
     | 
| 
      
 135 
     | 
    
         
            +
                  installments = hash['installments']
         
     | 
| 
      
 136 
     | 
    
         
            +
                  next_attempt = DateTime.rfc3339(hash['next_attempt']) if
         
     | 
| 
      
 137 
     | 
    
         
            +
                    hash['next_attempt']
         
     | 
| 
      
 138 
     | 
    
         
            +
                  transaction_type = hash['transaction_type']
         
     | 
| 
      
 139 
     | 
    
         
            +
             
     | 
| 
      
 140 
     | 
    
         
            +
                  # Create object from extracted values.
         
     | 
| 
      
 141 
     | 
    
         
            +
                  GetCreditCardTransactionResponse.new(statement_descriptor,
         
     | 
| 
      
 142 
     | 
    
         
            +
                                                       acquirer_name,
         
     | 
| 
      
 143 
     | 
    
         
            +
                                                       acquirer_affiliation_code,
         
     | 
| 
      
 144 
     | 
    
         
            +
                                                       acquirer_tid,
         
     | 
| 
      
 145 
     | 
    
         
            +
                                                       acquirer_nsu,
         
     | 
| 
      
 146 
     | 
    
         
            +
                                                       acquirer_auth_code,
         
     | 
| 
      
 147 
     | 
    
         
            +
                                                       operation_type,
         
     | 
| 
      
 148 
     | 
    
         
            +
                                                       card,
         
     | 
| 
      
 149 
     | 
    
         
            +
                                                       acquirer_message,
         
     | 
| 
      
 150 
     | 
    
         
            +
                                                       gateway_id,
         
     | 
| 
      
 151 
     | 
    
         
            +
                                                       amount,
         
     | 
| 
      
 152 
     | 
    
         
            +
                                                       status,
         
     | 
| 
      
 153 
     | 
    
         
            +
                                                       success,
         
     | 
| 
      
 154 
     | 
    
         
            +
                                                       created_at,
         
     | 
| 
      
 155 
     | 
    
         
            +
                                                       updated_at,
         
     | 
| 
      
 156 
     | 
    
         
            +
                                                       attempt_count,
         
     | 
| 
      
 157 
     | 
    
         
            +
                                                       max_attempts,
         
     | 
| 
      
 158 
     | 
    
         
            +
                                                       installments,
         
     | 
| 
      
 159 
     | 
    
         
            +
                                                       next_attempt,
         
     | 
| 
      
 160 
     | 
    
         
            +
                                                       transaction_type)
         
     | 
| 
      
 161 
     | 
    
         
            +
                end
         
     | 
| 
      
 162 
     | 
    
         
            +
              end
         
     | 
| 
      
 163 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,145 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # This file was automatically generated by APIMATIC v2.0
         
     | 
| 
      
 2 
     | 
    
         
            +
            # ( https://apimatic.io ).
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 5 
     | 
    
         
            +
            module MundiApi
         
     | 
| 
      
 6 
     | 
    
         
            +
              # Response object for getting a customer
         
     | 
| 
      
 7 
     | 
    
         
            +
              class GetCustomerResponse < BaseModel
         
     | 
| 
      
 8 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 9 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 10 
     | 
    
         
            +
                attr_accessor :id
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 13 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 14 
     | 
    
         
            +
                attr_accessor :name
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 17 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 18 
     | 
    
         
            +
                attr_accessor :email
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 21 
     | 
    
         
            +
                # @return [Boolean]
         
     | 
| 
      
 22 
     | 
    
         
            +
                attr_accessor :delinquent
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 25 
     | 
    
         
            +
                # @return [DateTime]
         
     | 
| 
      
 26 
     | 
    
         
            +
                attr_accessor :created_at
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 29 
     | 
    
         
            +
                # @return [DateTime]
         
     | 
| 
      
 30 
     | 
    
         
            +
                attr_accessor :updated_at
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 33 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 34 
     | 
    
         
            +
                attr_accessor :document
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 37 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 38 
     | 
    
         
            +
                attr_accessor :type
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 41 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 42 
     | 
    
         
            +
                attr_accessor :fb_access_token
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 45 
     | 
    
         
            +
                # @return [GetAddressResponse]
         
     | 
| 
      
 46 
     | 
    
         
            +
                attr_accessor :address
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 49 
     | 
    
         
            +
                # @return [Array<String, String>]
         
     | 
| 
      
 50 
     | 
    
         
            +
                attr_accessor :metadata
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 53 
     | 
    
         
            +
                # @return [GetPhonesResponse]
         
     | 
| 
      
 54 
     | 
    
         
            +
                attr_accessor :phones
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 57 
     | 
    
         
            +
                # @return [Long]
         
     | 
| 
      
 58 
     | 
    
         
            +
                attr_accessor :fb_id
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                # A mapping from model property names to API property names.
         
     | 
| 
      
 61 
     | 
    
         
            +
                def self.names
         
     | 
| 
      
 62 
     | 
    
         
            +
                  if @_hash.nil?
         
     | 
| 
      
 63 
     | 
    
         
            +
                    @_hash = {}
         
     | 
| 
      
 64 
     | 
    
         
            +
                    @_hash['id'] = 'id'
         
     | 
| 
      
 65 
     | 
    
         
            +
                    @_hash['name'] = 'name'
         
     | 
| 
      
 66 
     | 
    
         
            +
                    @_hash['email'] = 'email'
         
     | 
| 
      
 67 
     | 
    
         
            +
                    @_hash['delinquent'] = 'delinquent'
         
     | 
| 
      
 68 
     | 
    
         
            +
                    @_hash['created_at'] = 'created_at'
         
     | 
| 
      
 69 
     | 
    
         
            +
                    @_hash['updated_at'] = 'updated_at'
         
     | 
| 
      
 70 
     | 
    
         
            +
                    @_hash['document'] = 'document'
         
     | 
| 
      
 71 
     | 
    
         
            +
                    @_hash['type'] = 'type'
         
     | 
| 
      
 72 
     | 
    
         
            +
                    @_hash['fb_access_token'] = 'fb_access_token'
         
     | 
| 
      
 73 
     | 
    
         
            +
                    @_hash['address'] = 'address'
         
     | 
| 
      
 74 
     | 
    
         
            +
                    @_hash['metadata'] = 'metadata'
         
     | 
| 
      
 75 
     | 
    
         
            +
                    @_hash['phones'] = 'phones'
         
     | 
| 
      
 76 
     | 
    
         
            +
                    @_hash['fb_id'] = 'fb_id'
         
     | 
| 
      
 77 
     | 
    
         
            +
                  end
         
     | 
| 
      
 78 
     | 
    
         
            +
                  @_hash
         
     | 
| 
      
 79 
     | 
    
         
            +
                end
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                def initialize(id = nil,
         
     | 
| 
      
 82 
     | 
    
         
            +
                               name = nil,
         
     | 
| 
      
 83 
     | 
    
         
            +
                               email = nil,
         
     | 
| 
      
 84 
     | 
    
         
            +
                               delinquent = nil,
         
     | 
| 
      
 85 
     | 
    
         
            +
                               created_at = nil,
         
     | 
| 
      
 86 
     | 
    
         
            +
                               updated_at = nil,
         
     | 
| 
      
 87 
     | 
    
         
            +
                               document = nil,
         
     | 
| 
      
 88 
     | 
    
         
            +
                               type = nil,
         
     | 
| 
      
 89 
     | 
    
         
            +
                               fb_access_token = nil,
         
     | 
| 
      
 90 
     | 
    
         
            +
                               address = nil,
         
     | 
| 
      
 91 
     | 
    
         
            +
                               metadata = nil,
         
     | 
| 
      
 92 
     | 
    
         
            +
                               phones = nil,
         
     | 
| 
      
 93 
     | 
    
         
            +
                               fb_id = nil)
         
     | 
| 
      
 94 
     | 
    
         
            +
                  @id = id
         
     | 
| 
      
 95 
     | 
    
         
            +
                  @name = name
         
     | 
| 
      
 96 
     | 
    
         
            +
                  @email = email
         
     | 
| 
      
 97 
     | 
    
         
            +
                  @delinquent = delinquent
         
     | 
| 
      
 98 
     | 
    
         
            +
                  @created_at = created_at
         
     | 
| 
      
 99 
     | 
    
         
            +
                  @updated_at = updated_at
         
     | 
| 
      
 100 
     | 
    
         
            +
                  @document = document
         
     | 
| 
      
 101 
     | 
    
         
            +
                  @type = type
         
     | 
| 
      
 102 
     | 
    
         
            +
                  @fb_access_token = fb_access_token
         
     | 
| 
      
 103 
     | 
    
         
            +
                  @address = address
         
     | 
| 
      
 104 
     | 
    
         
            +
                  @metadata = metadata
         
     | 
| 
      
 105 
     | 
    
         
            +
                  @phones = phones
         
     | 
| 
      
 106 
     | 
    
         
            +
                  @fb_id = fb_id
         
     | 
| 
      
 107 
     | 
    
         
            +
                end
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
                # Creates an instance of the object from a hash.
         
     | 
| 
      
 110 
     | 
    
         
            +
                def self.from_hash(hash)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  return nil unless hash
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
                  # Extract variables from the hash.
         
     | 
| 
      
 114 
     | 
    
         
            +
                  id = hash['id']
         
     | 
| 
      
 115 
     | 
    
         
            +
                  name = hash['name']
         
     | 
| 
      
 116 
     | 
    
         
            +
                  email = hash['email']
         
     | 
| 
      
 117 
     | 
    
         
            +
                  delinquent = hash['delinquent']
         
     | 
| 
      
 118 
     | 
    
         
            +
                  created_at = DateTime.rfc3339(hash['created_at']) if hash['created_at']
         
     | 
| 
      
 119 
     | 
    
         
            +
                  updated_at = DateTime.rfc3339(hash['updated_at']) if hash['updated_at']
         
     | 
| 
      
 120 
     | 
    
         
            +
                  document = hash['document']
         
     | 
| 
      
 121 
     | 
    
         
            +
                  type = hash['type']
         
     | 
| 
      
 122 
     | 
    
         
            +
                  fb_access_token = hash['fb_access_token']
         
     | 
| 
      
 123 
     | 
    
         
            +
                  address = GetAddressResponse.from_hash(hash['address']) if
         
     | 
| 
      
 124 
     | 
    
         
            +
                    hash['address']
         
     | 
| 
      
 125 
     | 
    
         
            +
                  metadata = hash['metadata']
         
     | 
| 
      
 126 
     | 
    
         
            +
                  phones = GetPhonesResponse.from_hash(hash['phones']) if hash['phones']
         
     | 
| 
      
 127 
     | 
    
         
            +
                  fb_id = hash['fb_id']
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
                  # Create object from extracted values.
         
     | 
| 
      
 130 
     | 
    
         
            +
                  GetCustomerResponse.new(id,
         
     | 
| 
      
 131 
     | 
    
         
            +
                                          name,
         
     | 
| 
      
 132 
     | 
    
         
            +
                                          email,
         
     | 
| 
      
 133 
     | 
    
         
            +
                                          delinquent,
         
     | 
| 
      
 134 
     | 
    
         
            +
                                          created_at,
         
     | 
| 
      
 135 
     | 
    
         
            +
                                          updated_at,
         
     | 
| 
      
 136 
     | 
    
         
            +
                                          document,
         
     | 
| 
      
 137 
     | 
    
         
            +
                                          type,
         
     | 
| 
      
 138 
     | 
    
         
            +
                                          fb_access_token,
         
     | 
| 
      
 139 
     | 
    
         
            +
                                          address,
         
     | 
| 
      
 140 
     | 
    
         
            +
                                          metadata,
         
     | 
| 
      
 141 
     | 
    
         
            +
                                          phones,
         
     | 
| 
      
 142 
     | 
    
         
            +
                                          fb_id)
         
     | 
| 
      
 143 
     | 
    
         
            +
                end
         
     | 
| 
      
 144 
     | 
    
         
            +
              end
         
     | 
| 
      
 145 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,100 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # This file was automatically generated by APIMATIC v2.0
         
     | 
| 
      
 2 
     | 
    
         
            +
            # ( https://apimatic.io ).
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 5 
     | 
    
         
            +
            module MundiApi
         
     | 
| 
      
 6 
     | 
    
         
            +
              # Response object for getting a discount
         
     | 
| 
      
 7 
     | 
    
         
            +
              class GetDiscountResponse < BaseModel
         
     | 
| 
      
 8 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 9 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 10 
     | 
    
         
            +
                attr_accessor :id
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 13 
     | 
    
         
            +
                # @return [Float]
         
     | 
| 
      
 14 
     | 
    
         
            +
                attr_accessor :value
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 17 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 18 
     | 
    
         
            +
                attr_accessor :discount_type
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 21 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 22 
     | 
    
         
            +
                attr_accessor :status
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 25 
     | 
    
         
            +
                # @return [DateTime]
         
     | 
| 
      
 26 
     | 
    
         
            +
                attr_accessor :created_at
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 29 
     | 
    
         
            +
                # @return [GetSubscriptionResponse]
         
     | 
| 
      
 30 
     | 
    
         
            +
                attr_accessor :subscription
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 33 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 34 
     | 
    
         
            +
                attr_accessor :cycles
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 37 
     | 
    
         
            +
                # @return [DateTime]
         
     | 
| 
      
 38 
     | 
    
         
            +
                attr_accessor :deleted_at
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                # A mapping from model property names to API property names.
         
     | 
| 
      
 41 
     | 
    
         
            +
                def self.names
         
     | 
| 
      
 42 
     | 
    
         
            +
                  if @_hash.nil?
         
     | 
| 
      
 43 
     | 
    
         
            +
                    @_hash = {}
         
     | 
| 
      
 44 
     | 
    
         
            +
                    @_hash['id'] = 'id'
         
     | 
| 
      
 45 
     | 
    
         
            +
                    @_hash['value'] = 'value'
         
     | 
| 
      
 46 
     | 
    
         
            +
                    @_hash['discount_type'] = 'discount_type'
         
     | 
| 
      
 47 
     | 
    
         
            +
                    @_hash['status'] = 'status'
         
     | 
| 
      
 48 
     | 
    
         
            +
                    @_hash['created_at'] = 'created_at'
         
     | 
| 
      
 49 
     | 
    
         
            +
                    @_hash['subscription'] = 'subscription'
         
     | 
| 
      
 50 
     | 
    
         
            +
                    @_hash['cycles'] = 'cycles'
         
     | 
| 
      
 51 
     | 
    
         
            +
                    @_hash['deleted_at'] = 'deleted_at'
         
     | 
| 
      
 52 
     | 
    
         
            +
                  end
         
     | 
| 
      
 53 
     | 
    
         
            +
                  @_hash
         
     | 
| 
      
 54 
     | 
    
         
            +
                end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                def initialize(id = nil,
         
     | 
| 
      
 57 
     | 
    
         
            +
                               value = nil,
         
     | 
| 
      
 58 
     | 
    
         
            +
                               discount_type = nil,
         
     | 
| 
      
 59 
     | 
    
         
            +
                               status = nil,
         
     | 
| 
      
 60 
     | 
    
         
            +
                               created_at = nil,
         
     | 
| 
      
 61 
     | 
    
         
            +
                               subscription = nil,
         
     | 
| 
      
 62 
     | 
    
         
            +
                               cycles = nil,
         
     | 
| 
      
 63 
     | 
    
         
            +
                               deleted_at = nil)
         
     | 
| 
      
 64 
     | 
    
         
            +
                  @id = id
         
     | 
| 
      
 65 
     | 
    
         
            +
                  @value = value
         
     | 
| 
      
 66 
     | 
    
         
            +
                  @discount_type = discount_type
         
     | 
| 
      
 67 
     | 
    
         
            +
                  @status = status
         
     | 
| 
      
 68 
     | 
    
         
            +
                  @created_at = created_at
         
     | 
| 
      
 69 
     | 
    
         
            +
                  @subscription = subscription
         
     | 
| 
      
 70 
     | 
    
         
            +
                  @cycles = cycles
         
     | 
| 
      
 71 
     | 
    
         
            +
                  @deleted_at = deleted_at
         
     | 
| 
      
 72 
     | 
    
         
            +
                end
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
                # Creates an instance of the object from a hash.
         
     | 
| 
      
 75 
     | 
    
         
            +
                def self.from_hash(hash)
         
     | 
| 
      
 76 
     | 
    
         
            +
                  return nil unless hash
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
                  # Extract variables from the hash.
         
     | 
| 
      
 79 
     | 
    
         
            +
                  id = hash['id']
         
     | 
| 
      
 80 
     | 
    
         
            +
                  value = hash['value']
         
     | 
| 
      
 81 
     | 
    
         
            +
                  discount_type = hash['discount_type']
         
     | 
| 
      
 82 
     | 
    
         
            +
                  status = hash['status']
         
     | 
| 
      
 83 
     | 
    
         
            +
                  created_at = DateTime.rfc3339(hash['created_at']) if hash['created_at']
         
     | 
| 
      
 84 
     | 
    
         
            +
                  subscription = GetSubscriptionResponse.from_hash(hash['subscription']) if
         
     | 
| 
      
 85 
     | 
    
         
            +
                    hash['subscription']
         
     | 
| 
      
 86 
     | 
    
         
            +
                  cycles = hash['cycles']
         
     | 
| 
      
 87 
     | 
    
         
            +
                  deleted_at = DateTime.rfc3339(hash['deleted_at']) if hash['deleted_at']
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                  # Create object from extracted values.
         
     | 
| 
      
 90 
     | 
    
         
            +
                  GetDiscountResponse.new(id,
         
     | 
| 
      
 91 
     | 
    
         
            +
                                          value,
         
     | 
| 
      
 92 
     | 
    
         
            +
                                          discount_type,
         
     | 
| 
      
 93 
     | 
    
         
            +
                                          status,
         
     | 
| 
      
 94 
     | 
    
         
            +
                                          created_at,
         
     | 
| 
      
 95 
     | 
    
         
            +
                                          subscription,
         
     | 
| 
      
 96 
     | 
    
         
            +
                                          cycles,
         
     | 
| 
      
 97 
     | 
    
         
            +
                                          deleted_at)
         
     | 
| 
      
 98 
     | 
    
         
            +
                end
         
     | 
| 
      
 99 
     | 
    
         
            +
              end
         
     | 
| 
      
 100 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,73 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # This file was automatically generated by APIMATIC v2.0
         
     | 
| 
      
 2 
     | 
    
         
            +
            # ( https://apimatic.io ).
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module MundiApi
         
     | 
| 
      
 5 
     | 
    
         
            +
              # Response object for getting an invoice item
         
     | 
| 
      
 6 
     | 
    
         
            +
              class GetInvoiceItemResponse < BaseModel
         
     | 
| 
      
 7 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 8 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 9 
     | 
    
         
            +
                attr_accessor :amount
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 12 
     | 
    
         
            +
                # @return [String]
         
     | 
| 
      
 13 
     | 
    
         
            +
                attr_accessor :description
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 16 
     | 
    
         
            +
                # @return [GetPricingSchemeResponse]
         
     | 
| 
      
 17 
     | 
    
         
            +
                attr_accessor :pricing_scheme
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 20 
     | 
    
         
            +
                # @return [GetPriceBracketResponse]
         
     | 
| 
      
 21 
     | 
    
         
            +
                attr_accessor :price_bracket
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                # TODO: Write general description for this method
         
     | 
| 
      
 24 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 25 
     | 
    
         
            +
                attr_accessor :quantity
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                # A mapping from model property names to API property names.
         
     | 
| 
      
 28 
     | 
    
         
            +
                def self.names
         
     | 
| 
      
 29 
     | 
    
         
            +
                  if @_hash.nil?
         
     | 
| 
      
 30 
     | 
    
         
            +
                    @_hash = {}
         
     | 
| 
      
 31 
     | 
    
         
            +
                    @_hash['amount'] = 'amount'
         
     | 
| 
      
 32 
     | 
    
         
            +
                    @_hash['description'] = 'description'
         
     | 
| 
      
 33 
     | 
    
         
            +
                    @_hash['pricing_scheme'] = 'pricing_scheme'
         
     | 
| 
      
 34 
     | 
    
         
            +
                    @_hash['price_bracket'] = 'price_bracket'
         
     | 
| 
      
 35 
     | 
    
         
            +
                    @_hash['quantity'] = 'quantity'
         
     | 
| 
      
 36 
     | 
    
         
            +
                  end
         
     | 
| 
      
 37 
     | 
    
         
            +
                  @_hash
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                def initialize(amount = nil,
         
     | 
| 
      
 41 
     | 
    
         
            +
                               description = nil,
         
     | 
| 
      
 42 
     | 
    
         
            +
                               pricing_scheme = nil,
         
     | 
| 
      
 43 
     | 
    
         
            +
                               price_bracket = nil,
         
     | 
| 
      
 44 
     | 
    
         
            +
                               quantity = nil)
         
     | 
| 
      
 45 
     | 
    
         
            +
                  @amount = amount
         
     | 
| 
      
 46 
     | 
    
         
            +
                  @description = description
         
     | 
| 
      
 47 
     | 
    
         
            +
                  @pricing_scheme = pricing_scheme
         
     | 
| 
      
 48 
     | 
    
         
            +
                  @price_bracket = price_bracket
         
     | 
| 
      
 49 
     | 
    
         
            +
                  @quantity = quantity
         
     | 
| 
      
 50 
     | 
    
         
            +
                end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                # Creates an instance of the object from a hash.
         
     | 
| 
      
 53 
     | 
    
         
            +
                def self.from_hash(hash)
         
     | 
| 
      
 54 
     | 
    
         
            +
                  return nil unless hash
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  # Extract variables from the hash.
         
     | 
| 
      
 57 
     | 
    
         
            +
                  amount = hash['amount']
         
     | 
| 
      
 58 
     | 
    
         
            +
                  description = hash['description']
         
     | 
| 
      
 59 
     | 
    
         
            +
                  pricing_scheme = GetPricingSchemeResponse.from_hash(hash['pricing_scheme']) if
         
     | 
| 
      
 60 
     | 
    
         
            +
                    hash['pricing_scheme']
         
     | 
| 
      
 61 
     | 
    
         
            +
                  price_bracket = GetPriceBracketResponse.from_hash(hash['price_bracket']) if
         
     | 
| 
      
 62 
     | 
    
         
            +
                    hash['price_bracket']
         
     | 
| 
      
 63 
     | 
    
         
            +
                  quantity = hash['quantity']
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                  # Create object from extracted values.
         
     | 
| 
      
 66 
     | 
    
         
            +
                  GetInvoiceItemResponse.new(amount,
         
     | 
| 
      
 67 
     | 
    
         
            +
                                             description,
         
     | 
| 
      
 68 
     | 
    
         
            +
                                             pricing_scheme,
         
     | 
| 
      
 69 
     | 
    
         
            +
                                             price_bracket,
         
     | 
| 
      
 70 
     | 
    
         
            +
                                             quantity)
         
     | 
| 
      
 71 
     | 
    
         
            +
                end
         
     | 
| 
      
 72 
     | 
    
         
            +
              end
         
     | 
| 
      
 73 
     | 
    
         
            +
            end
         
     |