reso_api 1.8.1 → 1.8.3
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 +4 -4
 - data/lib/reso_api/app/models/reso/api/client.rb +5 -4
 - data/lib/reso_api/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7a3efb2a9891062ced2dad4008a4d221cf2a1dc7d6d45c60ff608241c44e2c1f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: dbf17d720054cd4b6ec943ee6bfc222a3755100b152be46da82f66c6fe3801bd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2b18a127f72208d80b243e70383c7ffb688c114315c76215b42c5d50d355a7cd559c2d83d0821c0a6da5795f4f4060d529ca97c16482f56c7760fd11c1518f67
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: cde3c7fa7b844239706dd4e71b165b2f8aa557ec93a945c083f58c9c589bbb430e87085284715efed8d1c70a2e0744efdbbacfe8a689d9fcac055945c9bdcdec
         
     | 
| 
         @@ -55,12 +55,14 @@ module RESO 
     | 
|
| 
       55 
55 
     | 
    
         | 
| 
       56 
56 
     | 
    
         
             
                  FILTERABLE_ENDPOINTS.keys.each do |method_name|
         
     | 
| 
       57 
57 
     | 
    
         
             
                    define_method method_name do |*args, &block|
         
     | 
| 
      
 58 
     | 
    
         
            +
                      filter = hash[:filter]
         
     | 
| 
      
 59 
     | 
    
         
            +
                      filter = [filter, "OriginatingSystemName eq '#{osn}'"]].compact.join(" and ") if osn.present?
         
     | 
| 
       58 
60 
     | 
    
         
             
                      hash = args.first.is_a?(Hash) ? args.first : {}
         
     | 
| 
       59 
61 
     | 
    
         
             
                      endpoint = FILTERABLE_ENDPOINTS[method_name]
         
     | 
| 
       60 
62 
     | 
    
         
             
                      response = {}
         
     | 
| 
       61 
63 
     | 
    
         
             
                      params = {
         
     | 
| 
       62 
64 
     | 
    
         
             
                        "$select": hash[:select],
         
     | 
| 
       63 
     | 
    
         
            -
                        "$filter":  
     | 
| 
      
 65 
     | 
    
         
            +
                        "$filter": filter,
         
     | 
| 
       64 
66 
     | 
    
         
             
                        "$top": hash[:top].presence,
         
     | 
| 
       65 
67 
     | 
    
         
             
                        "$skip": hash[:skip],
         
     | 
| 
       66 
68 
     | 
    
         
             
                        "$orderby": hash[:orderby].to_a.presence,
         
     | 
| 
         @@ -72,7 +74,7 @@ module RESO 
     | 
|
| 
       72 
74 
     | 
    
         
             
                      }.compact
         
     | 
| 
       73 
75 
     | 
    
         
             
                      if !block.nil?
         
     | 
| 
       74 
76 
     | 
    
         
             
                        response = perform_call(endpoint, params)
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
       76 
78 
     | 
    
         
             
                        if response["value"].class.eql?(Array)
         
     | 
| 
       77 
79 
     | 
    
         
             
                          hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
         
     | 
| 
       78 
80 
     | 
    
         
             
                        end
         
     | 
| 
         @@ -164,7 +166,6 @@ module RESO 
     | 
|
| 
       164 
166 
     | 
    
         
             
                    params = params.presence || {}
         
     | 
| 
       165 
167 
     | 
    
         
             
                    retries = 0
         
     | 
| 
       166 
168 
     | 
    
         | 
| 
       167 
     | 
    
         
            -
                    params['$filter'] = "OriginatingSystemName eq '#{osn}'" if osn.present?
         
     | 
| 
       168 
169 
     | 
    
         
             
                    query = params.present? ? URI.encode_www_form(params).gsub("+", " ") : ""
         
     | 
| 
       169 
170 
     | 
    
         
             
                    uri.query && uri.query.length > 0 ? uri.query += '&' + query : uri.query = query
         
     | 
| 
       170 
171 
     | 
    
         
             
                    return URI::decode(uri.request_uri) if params.dig(:$debug).present?
         
     | 
| 
         @@ -225,7 +226,7 @@ module RESO 
     | 
|
| 
       225 
226 
     | 
    
         
             
                    params['$filter'] = "OriginatingSystemName eq '#{osn}'" if osn.present?
         
     | 
| 
       226 
227 
     | 
    
         | 
| 
       227 
228 
     | 
    
         
             
                    response = perform_call(endpoint, params, max_retries = 0)
         
     | 
| 
       228 
     | 
    
         
            -
                    (!response.is_a?(Hash) || !response.key?('error')) && response['statusCode'].blank?
         
     | 
| 
      
 229 
     | 
    
         
            +
                    (!response.is_a?(Hash) || !response.key?('error')) && response['statusCode'].blank? && response['status'].blank?
         
     | 
| 
       229 
230 
     | 
    
         
             
                  rescue StandardError
         
     | 
| 
       230 
231 
     | 
    
         
             
                    false
         
     | 
| 
       231 
232 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/reso_api/version.rb
    CHANGED