agrid-client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +65 -0
- data/README.md +15 -0
- data/agrid_client.gemspec +32 -0
- data/lib/agrid_client.rb +69 -0
- data/lib/agrid_client/api/cities_api.rb +80 -0
- data/lib/agrid_client/api/companies_api.rb +265 -0
- data/lib/agrid_client/api/filters_api.rb +91 -0
- data/lib/agrid_client/api/leads_api.rb +87 -0
- data/lib/agrid_client/api/quotes_api.rb +162 -0
- data/lib/agrid_client/api/services_api.rb +83 -0
- data/lib/agrid_client/api_client.rb +365 -0
- data/lib/agrid_client/api_error.rb +36 -0
- data/lib/agrid_client/configuration.rb +167 -0
- data/lib/agrid_client/models/address.rb +121 -0
- data/lib/agrid_client/models/category.rb +75 -0
- data/lib/agrid_client/models/city_company.rb +67 -0
- data/lib/agrid_client/models/city_with_full_state.rb +73 -0
- data/lib/agrid_client/models/city_with_state_name.rb +67 -0
- data/lib/agrid_client/models/company.rb +108 -0
- data/lib/agrid_client/models/company_ranking.rb +45 -0
- data/lib/agrid_client/models/concerns/swagger_model.rb +106 -0
- data/lib/agrid_client/models/customer.rb +90 -0
- data/lib/agrid_client/models/customer_input.rb +73 -0
- data/lib/agrid_client/models/data_check.rb +45 -0
- data/lib/agrid_client/models/filter.rb +75 -0
- data/lib/agrid_client/models/filter_category.rb +73 -0
- data/lib/agrid_client/models/image.rb +37 -0
- data/lib/agrid_client/models/inline_response_200.rb +67 -0
- data/lib/agrid_client/models/inline_response_200_1.rb +78 -0
- data/lib/agrid_client/models/item.rb +90 -0
- data/lib/agrid_client/models/lead.rb +77 -0
- data/lib/agrid_client/models/lead_input.rb +90 -0
- data/lib/agrid_client/models/location.rb +66 -0
- data/lib/agrid_client/models/phone.rb +58 -0
- data/lib/agrid_client/models/price_range.rb +73 -0
- data/lib/agrid_client/models/quote.rb +124 -0
- data/lib/agrid_client/models/sale.rb +28 -0
- data/lib/agrid_client/models/service.rb +90 -0
- data/lib/agrid_client/models/state.rb +67 -0
- data/lib/agrid_client/version.rb +3 -0
- data/spec/api/cities_api_spec.rb +49 -0
- data/spec/api/companies_api_spec.rb +69 -0
- data/spec/api/filters_api_spec.rb +54 -0
- data/spec/api/leads_api_spec.rb +52 -0
- data/spec/api/quotes_api_spec.rb +74 -0
- data/spec/api/services_api_spec.rb +52 -0
- data/spec/models/address_spec.rb +116 -0
- data/spec/models/category_spec.rb +66 -0
- data/spec/models/city_with_full_state_spec.rb +66 -0
- data/spec/models/city_with_state_name_spec.rb +56 -0
- data/spec/models/company_spec.rb +116 -0
- data/spec/models/customer_input_spec.rb +66 -0
- data/spec/models/customer_spec.rb +86 -0
- data/spec/models/filter_category_spec.rb +66 -0
- data/spec/models/filter_spec.rb +66 -0
- data/spec/models/inline_response_200_1_spec.rb +66 -0
- data/spec/models/inline_response_200_spec.rb +46 -0
- data/spec/models/item_spec.rb +86 -0
- data/spec/models/lead_input_spec.rb +86 -0
- data/spec/models/lead_spec.rb +76 -0
- data/spec/models/location_spec.rb +56 -0
- data/spec/models/phone_spec.rb +46 -0
- data/spec/models/price_range_spec.rb +56 -0
- data/spec/models/quote_spec.rb +116 -0
- data/spec/models/service_spec.rb +76 -0
- data/spec/models/state_spec.rb +56 -0
- data/spec/spec_helper.rb +23 -0
- metadata +319 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e1afaef5554ded35df8283b783c46f565e7fcc83
|
4
|
+
data.tar.gz: bc63eb4b43bfdbdb81107746d703490db604e72f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5dce1047cc1e6147b140694e8d60396538a8e443ca10d53ebb4c908bb381af9d4595bce47722808611bc166392390fb28e5f690c662832057538f12061bc1a1e
|
7
|
+
data.tar.gz: d7386812fddd41251cf41ba06eca44fe0df9388d9dddff3b36d277494c8498955681c8afb494b705510cae2465f94fdc09e557d43ac0e5e2a2c39250f3c3f729
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
agrid-client (0.0.1)
|
5
|
+
json (~> 1.4, >= 1.4.6)
|
6
|
+
typhoeus (~> 0.2, >= 0.2.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ZenTest (4.11.0)
|
12
|
+
addressable (2.4.0)
|
13
|
+
autotest (4.4.6)
|
14
|
+
ZenTest (>= 4.4.1)
|
15
|
+
autotest-fsevent (0.2.11)
|
16
|
+
sys-uname
|
17
|
+
autotest-growl (0.2.16)
|
18
|
+
autotest-rails-pure (4.1.2)
|
19
|
+
crack (0.4.3)
|
20
|
+
safe_yaml (~> 1.0.0)
|
21
|
+
diff-lcs (1.2.5)
|
22
|
+
ethon (0.8.1)
|
23
|
+
ffi (>= 1.3.0)
|
24
|
+
ffi (1.9.10)
|
25
|
+
hashdiff (0.3.0)
|
26
|
+
json (1.8.3)
|
27
|
+
rspec (3.4.0)
|
28
|
+
rspec-core (~> 3.4.0)
|
29
|
+
rspec-expectations (~> 3.4.0)
|
30
|
+
rspec-mocks (~> 3.4.0)
|
31
|
+
rspec-core (3.4.4)
|
32
|
+
rspec-support (~> 3.4.0)
|
33
|
+
rspec-expectations (3.4.0)
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
+
rspec-support (~> 3.4.0)
|
36
|
+
rspec-mocks (3.4.1)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.4.0)
|
39
|
+
rspec-support (3.4.1)
|
40
|
+
safe_yaml (1.0.4)
|
41
|
+
sys-uname (1.0.2)
|
42
|
+
ffi (>= 1.0.0)
|
43
|
+
typhoeus (0.8.0)
|
44
|
+
ethon (>= 0.8.0)
|
45
|
+
vcr (2.9.3)
|
46
|
+
webmock (1.24.3)
|
47
|
+
addressable (>= 2.3.6)
|
48
|
+
crack (>= 0.3.2)
|
49
|
+
hashdiff
|
50
|
+
|
51
|
+
PLATFORMS
|
52
|
+
ruby
|
53
|
+
|
54
|
+
DEPENDENCIES
|
55
|
+
agrid-client!
|
56
|
+
autotest (~> 4.4, >= 4.4.6)
|
57
|
+
autotest-fsevent (~> 0.2, >= 0.2.11)
|
58
|
+
autotest-growl (~> 0.2, >= 0.2.16)
|
59
|
+
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
60
|
+
rspec (~> 3.2, >= 3.2.0)
|
61
|
+
vcr (~> 2.9, >= 2.9.3)
|
62
|
+
webmock (~> 1.6, >= 1.6.2)
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
1.11.2
|
data/README.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# swagger_client
|
2
|
+
|
3
|
+
AgridClient - the Ruby gem for the [Agrid Quotes API](http://agrid.com.br/api-doc)
|
4
|
+
|
5
|
+
|
6
|
+
This SDK was partially generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
7
|
+
|
8
|
+
- API version: 1.0
|
9
|
+
- Package version: 0.0.1
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add to your Gemfile `gem 'agrid_client'`
|
14
|
+
|
15
|
+
And run `bundle`
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "agrid_client/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "agrid-client"
|
7
|
+
s.version = AgridClient::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Guilherme B. Moretti"]
|
10
|
+
s.email = ["guilhermebmoretti@gmail.com"]
|
11
|
+
s.homepage = "http://agrid.com.br"
|
12
|
+
s.summary = "Ruby client for Agrid's prices API"
|
13
|
+
s.description = ""
|
14
|
+
s.license = "MIT"
|
15
|
+
|
16
|
+
|
17
|
+
s.add_runtime_dependency 'typhoeus', '~> 0.2', '>= 0.2.1'
|
18
|
+
s.add_runtime_dependency 'json', '~> 1.4', '>= 1.4.6'
|
19
|
+
|
20
|
+
s.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0'
|
21
|
+
s.add_development_dependency 'vcr', '~> 2.9', '>= 2.9.3'
|
22
|
+
s.add_development_dependency 'webmock', '~> 1.6', '>= 1.6.2'
|
23
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
24
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
25
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
26
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11'
|
27
|
+
|
28
|
+
s.files = `find *`.split("\n").uniq.sort.select{ |f| !f.empty? && !(f.to_s =~ /^.*\.gem$/) }
|
29
|
+
s.test_files = `find spec/*`.split("\n")
|
30
|
+
s.executables = []
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
end
|
data/lib/agrid_client.rb
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
=begin
|
2
|
+
Agrid Quotes API
|
3
|
+
|
4
|
+
|
5
|
+
OpenAPI spec version: 1.0
|
6
|
+
|
7
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
8
|
+
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
# Common files
|
13
|
+
require 'agrid_client/api_client'
|
14
|
+
require 'agrid_client/api_error'
|
15
|
+
require 'agrid_client/version'
|
16
|
+
require 'agrid_client/configuration'
|
17
|
+
|
18
|
+
# Models
|
19
|
+
require 'agrid_client/models/address'
|
20
|
+
require 'agrid_client/models/category'
|
21
|
+
require 'agrid_client/models/city_company'
|
22
|
+
require 'agrid_client/models/city_with_full_state'
|
23
|
+
require 'agrid_client/models/city_with_state_name'
|
24
|
+
require 'agrid_client/models/company'
|
25
|
+
require 'agrid_client/models/customer'
|
26
|
+
require 'agrid_client/models/customer_input'
|
27
|
+
require 'agrid_client/models/company_ranking'
|
28
|
+
require 'agrid_client/models/data_check'
|
29
|
+
require 'agrid_client/models/filter'
|
30
|
+
require 'agrid_client/models/image'
|
31
|
+
require 'agrid_client/models/filter_category'
|
32
|
+
require 'agrid_client/models/inline_response_200'
|
33
|
+
require 'agrid_client/models/inline_response_200_1'
|
34
|
+
require 'agrid_client/models/item'
|
35
|
+
require 'agrid_client/models/lead'
|
36
|
+
require 'agrid_client/models/lead_input'
|
37
|
+
require 'agrid_client/models/location'
|
38
|
+
require 'agrid_client/models/phone'
|
39
|
+
require 'agrid_client/models/price_range'
|
40
|
+
require 'agrid_client/models/quote'
|
41
|
+
require 'agrid_client/models/sale'
|
42
|
+
require 'agrid_client/models/service'
|
43
|
+
require 'agrid_client/models/state'
|
44
|
+
|
45
|
+
# APIs
|
46
|
+
require 'agrid_client/api/cities_api'
|
47
|
+
require 'agrid_client/api/companies_api'
|
48
|
+
require 'agrid_client/api/filters_api'
|
49
|
+
require 'agrid_client/api/leads_api'
|
50
|
+
require 'agrid_client/api/quotes_api'
|
51
|
+
require 'agrid_client/api/services_api'
|
52
|
+
|
53
|
+
module AgridClient
|
54
|
+
class << self
|
55
|
+
# Customize default settings for the SDK using block.
|
56
|
+
# AgridClient.configure do |config|
|
57
|
+
# config.username = "xxx"
|
58
|
+
# config.password = "xxx"
|
59
|
+
# end
|
60
|
+
# If no block given, return the default Configuration object.
|
61
|
+
def configure
|
62
|
+
if block_given?
|
63
|
+
yield(Configuration.default)
|
64
|
+
else
|
65
|
+
Configuration.default
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
=begin
|
2
|
+
Agrid Quotes API
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module AgridClient
|
16
|
+
class CitiesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# Returns all cities supported by at least one company
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [String] :state State acronym to filter cities by state
|
27
|
+
# @return [Array<CityWithFullState>]
|
28
|
+
def cities_get(opts = {})
|
29
|
+
data, _status_code, _headers = cities_get_with_http_info(opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# Returns all cities supported by at least one company
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [String] :state State acronym to filter cities by state
|
37
|
+
# @return [Array<(Array<CityWithFullState>, Fixnum, Hash)>] Array<CityWithFullState> data, response status code and response headers
|
38
|
+
def cities_get_with_http_info(opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: CitiesApi#cities_get ..."
|
41
|
+
end
|
42
|
+
|
43
|
+
# resource path
|
44
|
+
local_var_path = "/cities".sub('{format}','json')
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = {}
|
48
|
+
query_params[:'state'] = opts[:'state'] if opts[:'state']
|
49
|
+
|
50
|
+
# header parameters
|
51
|
+
header_params = {}
|
52
|
+
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
local_header_accept = ['application/json']
|
55
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
56
|
+
|
57
|
+
# HTTP header 'Content-Type'
|
58
|
+
local_header_content_type = ['application/json']
|
59
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = nil
|
66
|
+
auth_names = []
|
67
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => 'Array<CityWithFullState>')
|
74
|
+
if @api_client.config.debugging
|
75
|
+
@api_client.config.logger.debug "API called: CitiesApi#cities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
76
|
+
end
|
77
|
+
return data, status_code, headers
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,265 @@
|
|
1
|
+
=begin
|
2
|
+
Agrid Quotes API
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module AgridClient
|
16
|
+
class CompaniesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# Return all cities attended by the company
|
25
|
+
# @param id Company ID
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [CityCompany]
|
28
|
+
def get_cities(id, opts = {})
|
29
|
+
data, _status_code, _headers = get_cities_with_http_info(id, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# Return all cities attended by the company
|
35
|
+
# @param id Company ID
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(CityCompany, Fixnum, Hash)>] CityCompany data, response status code and response headers
|
38
|
+
def get_cities_with_http_info(id, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: CompaniesApi#get_cities ..."
|
41
|
+
end
|
42
|
+
|
43
|
+
# verify the required parameter 'id' is set
|
44
|
+
fail "Missing the required parameter 'id' when calling get_cities" if id.nil?
|
45
|
+
|
46
|
+
# resource path
|
47
|
+
local_var_path = "/companies/{id}/cities".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = {}
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = {}
|
54
|
+
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
local_header_accept = ['application/json']
|
57
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
58
|
+
|
59
|
+
# HTTP header 'Content-Type'
|
60
|
+
local_header_content_type = ['application/json']
|
61
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = nil
|
68
|
+
auth_names = []
|
69
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
70
|
+
:header_params => header_params,
|
71
|
+
:query_params => query_params,
|
72
|
+
:form_params => form_params,
|
73
|
+
:body => post_body,
|
74
|
+
:auth_names => auth_names,
|
75
|
+
:return_type => 'Array<CityCompany>')
|
76
|
+
if @api_client.config.debugging
|
77
|
+
@api_client.config.logger.debug "API called: CompaniesApi#get_cities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
78
|
+
end
|
79
|
+
return data, status_code, headers
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# Return all cities attended by the company
|
84
|
+
# @param id Company ID
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [CityCompany]
|
87
|
+
def get_images(id, opts = {})
|
88
|
+
data, _status_code, _headers = get_images_with_http_info(id, opts)
|
89
|
+
return data
|
90
|
+
end
|
91
|
+
|
92
|
+
#
|
93
|
+
# Return all cities attended by the company
|
94
|
+
# @param id Company ID
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<(CityCompany, Fixnum, Hash)>] CityCompany data, response status code and response headers
|
97
|
+
def get_images_with_http_info(id, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug "Calling API: CompaniesApi#get_images ..."
|
100
|
+
end
|
101
|
+
|
102
|
+
# verify the required parameter 'id' is set
|
103
|
+
fail "Missing the required parameter 'id' when calling get_images" if id.nil?
|
104
|
+
|
105
|
+
# resource path
|
106
|
+
local_var_path = "/companies/{id}/images".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
107
|
+
|
108
|
+
# query parameters
|
109
|
+
query_params = {}
|
110
|
+
|
111
|
+
# header parameters
|
112
|
+
header_params = {}
|
113
|
+
|
114
|
+
# HTTP header 'Accept' (if needed)
|
115
|
+
local_header_accept = ['application/json']
|
116
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
117
|
+
|
118
|
+
# HTTP header 'Content-Type'
|
119
|
+
local_header_content_type = ['application/json']
|
120
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = nil
|
127
|
+
auth_names = []
|
128
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
129
|
+
:header_params => header_params,
|
130
|
+
:query_params => query_params,
|
131
|
+
:form_params => form_params,
|
132
|
+
:body => post_body,
|
133
|
+
:auth_names => auth_names,
|
134
|
+
:return_type => 'Array<Image>')
|
135
|
+
if @api_client.config.debugging
|
136
|
+
@api_client.config.logger.debug "API called: CompaniesApi#get_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
137
|
+
end
|
138
|
+
return data, status_code, headers
|
139
|
+
end
|
140
|
+
|
141
|
+
#
|
142
|
+
# Return a set of companies.
|
143
|
+
# @param service_id Service ID
|
144
|
+
# @param [Hash] opts the optional parameters
|
145
|
+
# @option opts [Integer] :offset Number to skip rows before beginning to return companies
|
146
|
+
# @option opts [Integer] :limit Limit number of companies on response(default is 12)
|
147
|
+
# @return [InlineResponse200]
|
148
|
+
def get_companies(service_id, opts = {})
|
149
|
+
data, _status_code, _headers = get_companies_with_http_info(service_id, opts)
|
150
|
+
return data
|
151
|
+
end
|
152
|
+
|
153
|
+
#
|
154
|
+
# Return a set of companies.
|
155
|
+
# @param service_id Service ID
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @option opts [Integer] :offset Number to skip rows before beginning to return companies
|
158
|
+
# @option opts [Integer] :limit Limit number of companies on response(default is 12)
|
159
|
+
# @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers
|
160
|
+
def get_companies_with_http_info(service_id, opts = {})
|
161
|
+
if @api_client.config.debugging
|
162
|
+
@api_client.config.logger.debug "Calling API: CompaniesApi#get_companies ..."
|
163
|
+
end
|
164
|
+
|
165
|
+
# verify the required parameter 'service_id' is set
|
166
|
+
fail "Missing the required parameter 'service_id' when calling get_companies" if service_id.nil?
|
167
|
+
|
168
|
+
# resource path
|
169
|
+
local_var_path = "/services/{service_id}/companies".sub('{format}','json').sub('{' + 'service_id' + '}', service_id.to_s)
|
170
|
+
|
171
|
+
# query parameters
|
172
|
+
query_params = {}
|
173
|
+
query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
|
174
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
175
|
+
|
176
|
+
# header parameters
|
177
|
+
header_params = {}
|
178
|
+
|
179
|
+
# HTTP header 'Accept' (if needed)
|
180
|
+
local_header_accept = ['application/json']
|
181
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
182
|
+
|
183
|
+
# HTTP header 'Content-Type'
|
184
|
+
local_header_content_type = ['application/json']
|
185
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
186
|
+
|
187
|
+
# form parameters
|
188
|
+
form_params = {}
|
189
|
+
|
190
|
+
# http body (model)
|
191
|
+
post_body = nil
|
192
|
+
auth_names = []
|
193
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
194
|
+
:header_params => header_params,
|
195
|
+
:query_params => query_params,
|
196
|
+
:form_params => form_params,
|
197
|
+
:body => post_body,
|
198
|
+
:auth_names => auth_names,
|
199
|
+
:return_type => 'InlineResponse200')
|
200
|
+
if @api_client.config.debugging
|
201
|
+
@api_client.config.logger.debug "API called: CompaniesApi#get_companies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
202
|
+
end
|
203
|
+
return data, status_code, headers
|
204
|
+
end
|
205
|
+
|
206
|
+
#
|
207
|
+
# Return data of a specific company
|
208
|
+
# @param id Company ID
|
209
|
+
# @param [Hash] opts the optional parameters
|
210
|
+
# @return [Company]
|
211
|
+
def get_company(id, opts = {})
|
212
|
+
data, _status_code, _headers = get_company_with_http_info(id, opts)
|
213
|
+
return data
|
214
|
+
end
|
215
|
+
|
216
|
+
#
|
217
|
+
# Return data of a specific company
|
218
|
+
# @param id Company ID
|
219
|
+
# @param [Hash] opts the optional parameters
|
220
|
+
# @return [Array<(Company, Fixnum, Hash)>] Company data, response status code and response headers
|
221
|
+
def get_company_with_http_info(id, opts = {})
|
222
|
+
if @api_client.config.debugging
|
223
|
+
@api_client.config.logger.debug "Calling API: CompaniesApi#get_company ..."
|
224
|
+
end
|
225
|
+
|
226
|
+
# verify the required parameter 'id' is set
|
227
|
+
fail "Missing the required parameter 'id' when calling get_company" if id.nil?
|
228
|
+
|
229
|
+
# resource path
|
230
|
+
local_var_path = "/companies/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
231
|
+
|
232
|
+
# query parameters
|
233
|
+
query_params = {}
|
234
|
+
|
235
|
+
# header parameters
|
236
|
+
header_params = {}
|
237
|
+
|
238
|
+
# HTTP header 'Accept' (if needed)
|
239
|
+
local_header_accept = ['application/json']
|
240
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
241
|
+
|
242
|
+
# HTTP header 'Content-Type'
|
243
|
+
local_header_content_type = ['application/json']
|
244
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
245
|
+
|
246
|
+
# form parameters
|
247
|
+
form_params = {}
|
248
|
+
|
249
|
+
# http body (model)
|
250
|
+
post_body = nil
|
251
|
+
auth_names = []
|
252
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
253
|
+
:header_params => header_params,
|
254
|
+
:query_params => query_params,
|
255
|
+
:form_params => form_params,
|
256
|
+
:body => post_body,
|
257
|
+
:auth_names => auth_names,
|
258
|
+
:return_type => 'Company')
|
259
|
+
if @api_client.config.debugging
|
260
|
+
@api_client.config.logger.debug "API called: CompaniesApi#get_company\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
261
|
+
end
|
262
|
+
return data, status_code, headers
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|