Class: Varejonline::API::ThirdParties
- Inherits:
-
Client
- Object
- Client
- Varejonline::API::ThirdParties
show all
- Defined in:
- lib/varejonline/api/third_parties.rb
Instance Attribute Summary
Attributes inherited from Client
#access_token
Instance Method Summary
collapse
Methods inherited from Client
#card_negotiations, #category_levels, #client_classes, #companies, #credit_limits, #default_entries, #entities, #initialize, #installments, #orders, #payables, #payment_conditions, #payments, #product_categories, #products, #provisions, #receivables, #sales_history, #sellers, #third_parties, #user_data
#require_all
Instance Method Details
#block_credit_limit(id, justification) ⇒ Object
47
48
49
|
# File 'lib/varejonline/api/third_parties.rb', line 47
def block_credit_limit(id, justification)
return parse_response(self.class.put("/#{id}/limites_credito/bloquear", body: build_body( {"motivo" => justification} ), headers: ))
end
|
#create(data) ⇒ Object
Also known as:
new
21
22
23
24
25
26
|
# File 'lib/varejonline/api/third_parties.rb', line 21
def create(data)
return parse_response(self.class.post('/', body: build_body(data), headers: )) if data.is_a?(Hash)
return parse_response(self.class.post('/', body: build_body(data.as_parameter), headers: )) if data.is_a?(Varejonline::Entity::Administrative::ThirdParty)
raise ArgumentError
end
|
36
37
38
|
# File 'lib/varejonline/api/third_parties.rb', line 36
def credit_limit_information(id)
return parse_response(self.class.get("/#{id}/limites_credito", body: build_body, headers: ))
end
|
#find(id) ⇒ Object
17
18
19
|
# File 'lib/varejonline/api/third_parties.rb', line 17
def find(id)
return parse_response(self.class.get("/#{id}", body: build_body, headers: ))
end
|
#list(searcher = nil) ⇒ Object
10
11
12
13
14
15
|
# File 'lib/varejonline/api/third_parties.rb', line 10
def list(searcher = nil)
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Administrative::ThirdPartySearcher)
return parse_response(self.class.get('/', body: build_body(searcher.as_parameter), headers: )) if searcher
return parse_response(self.class.get('/', body: build_body, headers: )) unless searcher
end
|
#unlock_credit_limit(id, justification) ⇒ Object
51
52
53
|
# File 'lib/varejonline/api/third_parties.rb', line 51
def unlock_credit_limit(id, justification)
return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", body: build_body( {"motivo" => justification} ), headers: ))
end
|
#update(id, data) ⇒ Object
29
30
31
32
33
34
|
# File 'lib/varejonline/api/third_parties.rb', line 29
def update(id, data)
return parse_response(self.class.put("/#{id}", body: build_body(data), headers: )) if data.is_a?(Hash)
return parse_response(self.class.put("/#{id}", body: build_body(data.as_parameter), headers: )) if data.is_a?(Varejonline::Entity::Administrative::ThirdParty)
raise ArgumentError
end
|
#update_credit_limit(id, data) ⇒ Object
40
41
42
43
44
45
|
# File 'lib/varejonline/api/third_parties.rb', line 40
def update_credit_limit(id, data)
return parse_response(self.class.put("/#{id}/limites_credito/#{id}", body: build_body(data), headers: )) if data.is_a?(Hash)
return parse_response(self.class.put("/#{id}/limites_credito/#{id}", body: build_body(data.as_parameter), headers: )) if data.is_a?(Varejonline::Entity::Commercial::CreditLimit)
raise ArgumentError
end
|