trustedsearch 1.11.0 → 1.12.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzIwYjM3NGI5ZjAxYWNiNzFhYjIwNmYzN2QyMGFmODYzYTE0MjVlMg==
4
+ OTAyY2JhOTZjMDIxMmE1NWEzMWU3YjkzYWZhOWUwZjU1NDg3ZTc0Nw==
5
5
  data.tar.gz: !binary |-
6
- NDk1ZmQwMjU3MDc4YmM5NTI5MWI5NDA2M2JlZjFiOGY3MzdiZWU3Mw==
6
+ ZTY3ZTg2NWVkM2VkMTk0ZDdiMWJmNmFlMjU0Y2U3NGNlMTRjZTAxNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2I1Y2EzYmRkNmQ4NWYxNWQ3NGUwOTgyMjllZDUyYTU4YzQ2OGNkNDYzYjFk
10
- ZmRiMjYyYzVjYzQwNDkwYTA0MjkzODcwOGFhNTZkMzQwZGVlZmU2ZjFjOTQ2
11
- ZjA0MzMzMDIxMmQ0YWY2YzdkMTZlZTI1NDZlMTdmYzRjMmZhMGE=
9
+ MDQ2MTUwMGI3YTA5YzQ3NWQwMWNhMmU3OWQ4YmY5OTg2NjJiZTFlOTQ1YTA3
10
+ MDRiY2MwNmM0ZjliMmUxYjJlZDVhMWIzODY1OWZmZDIwMTQ5ZWMxNzZiYjgy
11
+ Y2RhMzQ2YjNhMzI4Y2M4ZjYyZmZmYjlkMjljMjUwZGRjZTFhYjQ=
12
12
  data.tar.gz: !binary |-
13
- YTU0MTU2MjgxOWI5MDE0ZDljOTYzZjVmMzg2ZGJkMTRlNDNhZmEzYjAwOTI0
14
- ZjM4Y2ViYWMwODIyMjJmYWU0NzFmY2ViYjQyMzUxMzU3MTBlODhhZGE2NDc0
15
- MGNkYTA5NGQyN2I0OTJkMjQ5YmNjNmNlY2RlNDA3NTM3ODJlOWQ=
13
+ ZmE1MDk0OTg2MzIzYjcxZjdlZTcxZTNiMDQ4MTg5YWNhNTBhNTllMWU2N2Qw
14
+ ZTNiMzI4NTdiZmE0MDA0NDJiNzFhNjg0MTQ0ZGI4MmUxMWFkODM0NmQzNmM4
15
+ NzA0OTFkYmE4NTE1YzIzNmEzNDBkYWYyNWFhNGM3ZDQ4Mzc4OTk=
data/README.md CHANGED
@@ -311,6 +311,91 @@ rake v2:hooks:show[PUBLIC_KEY,PRIVATE_KEY,1]
311
311
  }
312
312
  ```
313
313
 
314
+ ### Locations
315
+
316
+ #### Listings: Retrieve all listings for a given location
317
+ [API documentation](http://developers.trustedsearch.org/#/v2-listings-by-location)
318
+
319
+
320
+ ```ruby
321
+ location_id = "00168e9c-d236-5466-19a9-74ef1af913d4"
322
+ location = TrustedSearch::V2::Location.new
323
+ pp location.listings(location_id).data
324
+
325
+ ```
326
+
327
+ #### Rake
328
+
329
+ ```ruby
330
+ rake v2:locations:listings[PUBLIC_KEY,PRIVATE_KEY,00168e9c-d236-5466-19a9-74ef1af913d4]
331
+ ```
332
+
333
+ #### Response
334
+ ```ruby
335
+
336
+ {
337
+ :status=>"success",
338
+ :code=>200,
339
+ :message=>"",
340
+ :messages=>[],
341
+ :data=>
342
+ [
343
+ {
344
+ :id=>"f43e602d-f2d1-4b75-95a6-920b4a7d60f8",
345
+ :location_id=>"00168e9c-d236-5466-19a9-74ef1af913d4",
346
+ :product_id=>21,
347
+ :listing_status_id=>1,
348
+ :username=>"someUsernameHere",
349
+ :password=>"somePasswordHere",
350
+ :security_answer_1=>"pastor",
351
+ :security_answer_2=>"subway",
352
+ :fulfillment_status_id=>20,
353
+ :url=>"https://plus.google.com/1174700643453653187470/about",
354
+ :duplicate_url=>[],
355
+ :deleted_at=>nil,
356
+ :created_at=>"2014-01-05 21:02:11",
357
+ :updated_at=>"2014-01-22 00:57:34",
358
+ :external_id=>nil,
359
+ },
360
+ {
361
+ :id=>"a234a9-bb7f-40ba-bcab-2efb252e03fd",
362
+ :location_id=>"00168e9c-d236-5466-19a9-74ef1af913d4",
363
+ :product_id=>22,
364
+ :listing_status_id=>1,
365
+ :username=>"someUsernameHere",
366
+ :password=>"somePasswordHere",
367
+ :security_answer_1=>"pastor",
368
+ :security_answer_2=>"subway",
369
+ :fulfillment_status_id=>20,
370
+ :url=>
371
+ "http://www.bing.com/local/details.aspx?lid=YN873234224819592526&q=3423+Resale+Houston+TX",
372
+ :duplicate_url=>[],
373
+ :deleted_at=>nil,
374
+ :created_at=>"2014-01-05 21:02:11",
375
+ :updated_at=>"2014-02-04 18:14:30",
376
+ :external_id=>nil
377
+ },
378
+ {
379
+ :id=>"5f23422-c475-4cd0-822d-e9cd651f2f7d",
380
+ :location_id=>"00168e9c-d236-5466-19a9-74ef1af913d4",
381
+ :product_id=>23,
382
+ :listing_status_id=>1,
383
+ :username=>"someUsernameHere",
384
+ :password=>"somePasswordHere",
385
+ :security_answer_1=>"pastor",
386
+ :security_answer_2=>"subway",
387
+ :fulfillment_status_id=>20,
388
+ :url=>"http://local.yahoo.com/info-162342341?brand=local",
389
+ :duplicate_url=>[],
390
+ :deleted_at=>nil,
391
+ :created_at=>"2014-01-05 21:02:11",
392
+ :updated_at=>"2014-01-21 22:06:36",
393
+ :external_id=>nil,
394
+ }
395
+ ]
396
+ }
397
+ ```
398
+
314
399
  ### Subscriptions
315
400
 
316
401
  #### Index: Retrieve an array of all hook subscriptions you are subscribed to.
data/lib/tasks/v2.rake CHANGED
@@ -3,7 +3,26 @@ namespace :v2 do
3
3
 
4
4
  task :default do
5
5
 
6
- end
6
+ end
7
+
8
+ namespace :locations do
9
+
10
+ desc "Get all listings for a location"
11
+ task :listings, [:public_key, :private_key, :location_id] do |t, args|
12
+ TrustedSearch.public_key = args.public_key
13
+ TrustedSearch.private_key = args.private_key
14
+ TrustedSearch.environment = ( ENV['env'] ? ENV['env'] : 'sandbox')
15
+ location = TrustedSearch::V2::Location.new
16
+ begin
17
+ pp location.listings(args.location_id).data
18
+ rescue Exception => e
19
+ puts "Message: " + e.message.to_s
20
+ #puts "Body:"
21
+ puts e.backtrace
22
+ #puts "Code: " + e.code.to_s
23
+ end
24
+ end
25
+ end
7
26
 
8
27
  namespace :hooks do
9
28
  desc "Get a list of all the hooks."
data/lib/trustedsearch.rb CHANGED
@@ -16,6 +16,7 @@ require_relative "trustedsearch/api"
16
16
  require_relative "trustedsearch/v2/v2"
17
17
  require_relative "trustedsearch/v2/hooks"
18
18
  require_relative "trustedsearch/v2/hook_subscriptions"
19
+ require_relative "trustedsearch/v2/locations"
19
20
 
20
21
  require_relative "trustedsearch/errors/error"
21
22
  require_relative "trustedsearch/errors/api_mock_response"
@@ -0,0 +1,25 @@
1
+ module TrustedSearch
2
+ module V2
3
+ class Location < ApiVersion2
4
+ attr_accessor :resource
5
+
6
+ def initialize
7
+ @resource = 'locations'
8
+ end
9
+
10
+ #Retrieve an array of all available hooks
11
+ def index()
12
+ method_url = @resource
13
+ return self.get(method_url)
14
+ end
15
+
16
+ #Get the details of a single hook
17
+ def listings(location_id = nil)
18
+ method_url = @resource + "/" + location_id + "/listings"
19
+ params = {}
20
+ return self.get(method_url, params)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trustedsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - trustedSEARCH Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-07 00:00:00.000000000 Z
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -158,6 +158,7 @@ files:
158
158
  - lib/trustedsearch/errors/invalid_request_error.rb
159
159
  - lib/trustedsearch/v2/hook_subscriptions.rb
160
160
  - lib/trustedsearch/v2/hooks.rb
161
+ - lib/trustedsearch/v2/locations.rb
161
162
  - lib/trustedsearch/v2/v2.rb
162
163
  - lib/trustedsearch/version.rb
163
164
  homepage: https://github.com/trustedsearch/ruby-trustedsearch
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project:
183
- rubygems_version: 2.2.2
184
+ rubygems_version: 2.4.2
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: trustedSEARCH API Ruby SDK