Class: TrustedSearch::V1

Inherits:
Api show all
Defined in:
lib/trustedsearch/api.rb

Instance Method Summary collapse

Methods inherited from APIResource

#class_name, #delete, #end_point, #get, #get_time, #has_keys, #post, #process, #put, #sign_request

Instance Method Details

#base_pathObject



9
10
11
12
13
14
# File 'lib/trustedsearch/api.rb', line 9

def base_path
  if self == APIResource
    raise NotImplementedError.new("APIResource is an abstract class. You should perform actions on its subclasses (i.e. Publisher)")
  end
  "/v1/"
end

#getBusinessUpdate(uuid = nil) ⇒ Object

Makes an API request to /directory-listings If uuid is nil, all are returned.



24
25
26
27
28
29
# File 'lib/trustedsearch/api.rb', line 24

def getBusinessUpdate(uuid = nil)

	method_url = 'directory-listings' + ( ( uuid ) ? "/#{uuid}" : '')
	params = {}
	return self.get(method_url, params)
end

#getBusinessUpdateSince(since) ⇒ Object

Makes an API request to /directory-listings Since is an integer, only changes made since that time are returned.



33
34
35
36
37
38
39
# File 'lib/trustedsearch/api.rb', line 33

def getBusinessUpdateSince( since )

  method_url = 'directory-listings'
  params = {}
  params[:since] = since
  return self.get(method_url, params)
end

#postBusiness(data = []) ⇒ Object

Submit a single business more multiple business for



42
43
44
45
# File 'lib/trustedsearch/api.rb', line 42

def postBusiness( data = [] )
method_url = 'local-business'
return self.post(method_url, {} , data )
end

#postValidate(data = []) ⇒ Object

Validate a record.



47
48
49
50
# File 'lib/trustedsearch/api.rb', line 47

def postValidate( data = [] )
  method_url = 'validate'
  return self.post(method_url, {} , data )
end

#putTestFulfillment(uuid = nil) ⇒ Object



52
53
54
55
# File 'lib/trustedsearch/api.rb', line 52

def putTestFulfillment( uuid = nil)
  method_url = 'test-fulfillment/' + uuid.to_s
  return self.put(method_url)
end

#request(method = 'get', resource_url, params, body) ⇒ Object

Update All request to Version 1.



17
18
19
20
# File 'lib/trustedsearch/api.rb', line 17

def request(method='get', resource_url, params, body)
  TrustedSearch::api_version = 1
  super
end