rtx-api 0.6.8 → 0.6.9
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/rtx/api/client.rb +14 -8
- data/lib/rtx/api/resources.rb +10 -0
- data/lib/rtx/api/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: bd6746ab9c688a9e5b34add57fb8c93be50e568d0da534584741a2619cde9fa2
         | 
| 4 | 
            +
              data.tar.gz: 2c4cb390bc2375e0dc767d41eaed34be09f5766f06963f0658b68f3fde38a970
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 24c2e204dad5522a92904a9dde6f7f641d3138524e1b12fcd203bbc6ae0d422debf2b243aa0f44d889be8dab06a67c0b956f62c540a89cb2ffe9ca1befbb5121
         | 
| 7 | 
            +
              data.tar.gz: e4a0472c93bce630146a1e5e2a18c2dc781b049abc2c2b8d654c6673519bba54592e5fbe0a60300d366080aedc1cc51cc2c342d6325f847c7ce6dd51af734dc5
         | 
    
        data/lib/rtx/api/client.rb
    CHANGED
    
    | @@ -104,7 +104,7 @@ module RTX | |
| 104 104 | 
             
                  end
         | 
| 105 105 |  | 
| 106 106 | 
             
                  def collection(resource_name, attrs = {})
         | 
| 107 | 
            -
                    request = self.class.get("#{rtx_api_url}/#{resource_path(resource_name)}",
         | 
| 107 | 
            +
                    request = self.class.get("#{rtx_api_url}/#{resource_path(resource_name, attrs)}",
         | 
| 108 108 | 
             
                                             options(:get, attrs))
         | 
| 109 109 | 
             
                    handle_request(request)
         | 
| 110 110 | 
             
                  end
         | 
| @@ -112,8 +112,10 @@ module RTX | |
| 112 112 | 
             
                  def detail(resource_name, resource_id, attrs = {})
         | 
| 113 113 | 
             
                    raise API::Errors::RequestError, 'id was not provided' if resource_id.nil?
         | 
| 114 114 |  | 
| 115 | 
            -
                    request = self.class.get( | 
| 116 | 
            -
             | 
| 115 | 
            +
                    request = self.class.get(
         | 
| 116 | 
            +
                      "#{rtx_api_url}/#{resource_path(resource_name, attrs)}/#{resource_id}",
         | 
| 117 | 
            +
                      options(:get, attrs)
         | 
| 118 | 
            +
                    )
         | 
| 117 119 | 
             
                    handle_request(request)
         | 
| 118 120 | 
             
                  end
         | 
| 119 121 |  | 
| @@ -126,16 +128,20 @@ module RTX | |
| 126 128 | 
             
                  def put(resource_name, resource_id, attrs = {})
         | 
| 127 129 | 
             
                    raise API::Errors::RequestError, 'id was not provided' if resource_id.nil?
         | 
| 128 130 |  | 
| 129 | 
            -
                    request = self.class.put( | 
| 130 | 
            -
             | 
| 131 | 
            +
                    request = self.class.put(
         | 
| 132 | 
            +
                      "#{rtx_api_url}/#{resource_path(resource_name, attrs)}/#{resource_id}",
         | 
| 133 | 
            +
                      options(:put, attrs)
         | 
| 134 | 
            +
                    )
         | 
| 131 135 | 
             
                    handle_request(request)
         | 
| 132 136 | 
             
                  end
         | 
| 133 137 |  | 
| 134 138 | 
             
                  def patch(resource_name, resource_id, attrs = {})
         | 
| 135 139 | 
             
                    raise API::Errors::RequestError, 'id was not provided' if resource_id.nil?
         | 
| 136 140 |  | 
| 137 | 
            -
                    request = self.class.patch( | 
| 138 | 
            -
             | 
| 141 | 
            +
                    request = self.class.patch(
         | 
| 142 | 
            +
                      "#{rtx_api_url}/#{resource_path(resource_name, attrs)}/#{resource_id}",
         | 
| 143 | 
            +
                      options(:patch, attrs)
         | 
| 144 | 
            +
                    )
         | 
| 139 145 | 
             
                    handle_request(request)
         | 
| 140 146 | 
             
                  end
         | 
| 141 147 |  | 
| @@ -149,7 +155,7 @@ module RTX | |
| 149 155 | 
             
                  end
         | 
| 150 156 |  | 
| 151 157 | 
             
                  def get(resource_name, attrs = {}, file_type = 'json')
         | 
| 152 | 
            -
                    request = self.class.get("#{rtx_api_url}/#{resource_path(resource_name)}",
         | 
| 158 | 
            +
                    request = self.class.get("#{rtx_api_url}/#{resource_path(resource_name, attrs)}",
         | 
| 153 159 | 
             
                                             options(:get, attrs))
         | 
| 154 160 |  | 
| 155 161 | 
             
                    handle_request(request, file_type)
         | 
    
        data/lib/rtx/api/resources.rb
    CHANGED
    
    | @@ -7,12 +7,14 @@ module RTX | |
| 7 7 | 
             
                  def self.allowed_resources
         | 
| 8 8 | 
             
                    {
         | 
| 9 9 | 
             
                      accounts: 'accounts',
         | 
| 10 | 
            +
                      account_children: 'account_children',
         | 
| 10 11 | 
             
                      account_settings: 'account_settings',
         | 
| 11 12 | 
             
                      alerts: 'alerts',
         | 
| 12 13 | 
             
                      alert_frequencies: 'alert_frequencies',
         | 
| 13 14 | 
             
                      alert_types: 'alert_types',
         | 
| 14 15 | 
             
                      auth_tokens: 'auth/tokens',
         | 
| 15 16 | 
             
                      campaigns: 'campaigns',
         | 
| 17 | 
            +
                      child_integrations: 'child_integrations',
         | 
| 16 18 | 
             
                      competitors_brands_overview_csv: 'intel/locations/tags_overview/export',
         | 
| 17 19 | 
             
                      competitors_overview_csv: 'export/csv/intel/locations',
         | 
| 18 20 | 
             
                      contacts: 'contacts',
         | 
| @@ -62,6 +64,10 @@ module RTX | |
| 62 64 | 
             
                      local_search_location_reports: {
         | 
| 63 65 | 
             
                        required_values: %i[account_id location_id],
         | 
| 64 66 | 
             
                        resource_method: :build_local_search_location_reports_path
         | 
| 67 | 
            +
                      },
         | 
| 68 | 
            +
                      metrics_child_overviews: {
         | 
| 69 | 
            +
                        required_values: %i[account_id],
         | 
| 70 | 
            +
                        resource_method: :build_metrics_child_overviews_path
         | 
| 65 71 | 
             
                      }
         | 
| 66 72 | 
             
                    }.freeze
         | 
| 67 73 | 
             
                  end
         | 
| @@ -81,6 +87,10 @@ module RTX | |
| 81 87 | 
             
                  def self.build_local_search_location_reports_path(attrs)
         | 
| 82 88 | 
             
                    "local_search/#{attrs[:account_id]}/locations/#{attrs[:location_id]}/reports"
         | 
| 83 89 | 
             
                  end
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                  def self.build_metrics_child_overviews_path(attrs)
         | 
| 92 | 
            +
                    "metrics/#{attrs[:account_id]}/child_overview"
         | 
| 93 | 
            +
                  end
         | 
| 84 94 | 
             
                end
         | 
| 85 95 | 
             
              end
         | 
| 86 96 | 
             
            end
         | 
    
        data/lib/rtx/api/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rtx-api
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.6. | 
| 4 | 
            +
              version: 0.6.9
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Review Trackers Engineering
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024- | 
| 11 | 
            +
            date: 2024-08-20 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: httparty
         |