agrid-client 0.0.1

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.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +65 -0
  4. data/README.md +15 -0
  5. data/agrid_client.gemspec +32 -0
  6. data/lib/agrid_client.rb +69 -0
  7. data/lib/agrid_client/api/cities_api.rb +80 -0
  8. data/lib/agrid_client/api/companies_api.rb +265 -0
  9. data/lib/agrid_client/api/filters_api.rb +91 -0
  10. data/lib/agrid_client/api/leads_api.rb +87 -0
  11. data/lib/agrid_client/api/quotes_api.rb +162 -0
  12. data/lib/agrid_client/api/services_api.rb +83 -0
  13. data/lib/agrid_client/api_client.rb +365 -0
  14. data/lib/agrid_client/api_error.rb +36 -0
  15. data/lib/agrid_client/configuration.rb +167 -0
  16. data/lib/agrid_client/models/address.rb +121 -0
  17. data/lib/agrid_client/models/category.rb +75 -0
  18. data/lib/agrid_client/models/city_company.rb +67 -0
  19. data/lib/agrid_client/models/city_with_full_state.rb +73 -0
  20. data/lib/agrid_client/models/city_with_state_name.rb +67 -0
  21. data/lib/agrid_client/models/company.rb +108 -0
  22. data/lib/agrid_client/models/company_ranking.rb +45 -0
  23. data/lib/agrid_client/models/concerns/swagger_model.rb +106 -0
  24. data/lib/agrid_client/models/customer.rb +90 -0
  25. data/lib/agrid_client/models/customer_input.rb +73 -0
  26. data/lib/agrid_client/models/data_check.rb +45 -0
  27. data/lib/agrid_client/models/filter.rb +75 -0
  28. data/lib/agrid_client/models/filter_category.rb +73 -0
  29. data/lib/agrid_client/models/image.rb +37 -0
  30. data/lib/agrid_client/models/inline_response_200.rb +67 -0
  31. data/lib/agrid_client/models/inline_response_200_1.rb +78 -0
  32. data/lib/agrid_client/models/item.rb +90 -0
  33. data/lib/agrid_client/models/lead.rb +77 -0
  34. data/lib/agrid_client/models/lead_input.rb +90 -0
  35. data/lib/agrid_client/models/location.rb +66 -0
  36. data/lib/agrid_client/models/phone.rb +58 -0
  37. data/lib/agrid_client/models/price_range.rb +73 -0
  38. data/lib/agrid_client/models/quote.rb +124 -0
  39. data/lib/agrid_client/models/sale.rb +28 -0
  40. data/lib/agrid_client/models/service.rb +90 -0
  41. data/lib/agrid_client/models/state.rb +67 -0
  42. data/lib/agrid_client/version.rb +3 -0
  43. data/spec/api/cities_api_spec.rb +49 -0
  44. data/spec/api/companies_api_spec.rb +69 -0
  45. data/spec/api/filters_api_spec.rb +54 -0
  46. data/spec/api/leads_api_spec.rb +52 -0
  47. data/spec/api/quotes_api_spec.rb +74 -0
  48. data/spec/api/services_api_spec.rb +52 -0
  49. data/spec/models/address_spec.rb +116 -0
  50. data/spec/models/category_spec.rb +66 -0
  51. data/spec/models/city_with_full_state_spec.rb +66 -0
  52. data/spec/models/city_with_state_name_spec.rb +56 -0
  53. data/spec/models/company_spec.rb +116 -0
  54. data/spec/models/customer_input_spec.rb +66 -0
  55. data/spec/models/customer_spec.rb +86 -0
  56. data/spec/models/filter_category_spec.rb +66 -0
  57. data/spec/models/filter_spec.rb +66 -0
  58. data/spec/models/inline_response_200_1_spec.rb +66 -0
  59. data/spec/models/inline_response_200_spec.rb +46 -0
  60. data/spec/models/item_spec.rb +86 -0
  61. data/spec/models/lead_input_spec.rb +86 -0
  62. data/spec/models/lead_spec.rb +76 -0
  63. data/spec/models/location_spec.rb +56 -0
  64. data/spec/models/phone_spec.rb +46 -0
  65. data/spec/models/price_range_spec.rb +56 -0
  66. data/spec/models/quote_spec.rb +116 -0
  67. data/spec/models/service_spec.rb +76 -0
  68. data/spec/models/state_spec.rb +56 -0
  69. data/spec/spec_helper.rb +23 -0
  70. metadata +319 -0
@@ -0,0 +1,124 @@
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 'date'
14
+ require_relative 'concerns/swagger_model'
15
+
16
+ module AgridClient
17
+ class Quote
18
+ include SwaggerModel
19
+
20
+ # Unique Id
21
+ attr_accessor :id
22
+
23
+ # Quote title
24
+ attr_accessor :title
25
+
26
+ # Quote price
27
+ attr_accessor :price
28
+
29
+ # Array of images to ilustrate the quote
30
+ attr_accessor :images
31
+
32
+ # Company that offers this quote
33
+ attr_accessor :company
34
+
35
+ # Service that contain this quote
36
+ attr_accessor :service
37
+
38
+ # Items included on this quote
39
+ attr_accessor :categories
40
+
41
+ # Goodsfor used to filter quotes
42
+ attr_accessor :filters
43
+
44
+ attr_accessor :active_sale
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'id' => :'id',
50
+ :'title' => :'title',
51
+ :'price' => :'price',
52
+ :'images' => :'images',
53
+ :'company' => :'company',
54
+ :'service' => :'service',
55
+ :'categories' => :'categories',
56
+ :'filters' => :'filters',
57
+ :'active_sale' => :'active_sale'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ :'id' => :'String',
65
+ :'title' => :'String',
66
+ :'price' => :'Float',
67
+ :'images' => :'Array<String>',
68
+ :'company' => :'Company',
69
+ :'service' => :'Service',
70
+ :'categories' => :'Array<Category>',
71
+ :'filters' => :'Array<Filter>',
72
+ :'active_sale' => :'Sale'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
+
84
+ if attributes[:'id']
85
+ self.id = attributes[:'id']
86
+ end
87
+ if attributes[:'title']
88
+ self.title = attributes[:'title']
89
+ end
90
+ if attributes[:'price']
91
+ self.price = attributes[:'price']
92
+ end
93
+ if attributes[:'images']
94
+ if (value = attributes[:'images']).is_a?(Array)
95
+ self.images = value
96
+ end
97
+ end
98
+ if attributes[:'company']
99
+ self.company = attributes[:'company']
100
+ end
101
+ if attributes[:'service']
102
+ self.service = attributes[:'service']
103
+ end
104
+ if attributes[:'categories']
105
+ if (value = attributes[:'categories']).is_a?(Array)
106
+ self.categories = value
107
+ end
108
+ end
109
+ if attributes[:'filters']
110
+ if (value = attributes[:'filters']).is_a?(Array)
111
+ self.filters = value
112
+ end
113
+ end
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ id == o.id
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,28 @@
1
+ require 'date'
2
+ require_relative 'concerns/swagger_model'
3
+
4
+ module AgridClient
5
+ class Sale
6
+ include SwaggerModel
7
+
8
+ attr_accessor :price, :expiration_date, :note
9
+
10
+ # Attribute mapping from ruby-style variable name to JSON key.
11
+ def self.attribute_map
12
+ {
13
+ :'price' => :'price',
14
+ :'expiration_date' => :'expiration_date',
15
+ :'note' => :'note',
16
+ }
17
+ end
18
+
19
+ # Attribute type mapping.
20
+ def self.swagger_types
21
+ {
22
+ :'price' => :'Float',
23
+ :'expiration_date' => :'DateTime',
24
+ :'note' => :'String',
25
+ }
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,90 @@
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 'date'
14
+ require_relative 'concerns/swagger_model'
15
+
16
+ module AgridClient
17
+ class Service
18
+ include SwaggerModel
19
+
20
+ # Unique Id
21
+ attr_accessor :id
22
+
23
+ # Service title
24
+ attr_accessor :title
25
+
26
+ # Describes if the service is online or not
27
+ attr_accessor :online
28
+
29
+ # Tags used to categorize service
30
+ attr_accessor :tags
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'title' => :'title',
37
+ :'online' => :'online',
38
+ :'tags' => :'tags'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'id' => :'String',
46
+ :'title' => :'String',
47
+ :'online' => :'BOOLEAN',
48
+ :'tags' => :'Array<String>'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
59
+
60
+ if attributes[:'id']
61
+ self.id = attributes[:'id']
62
+ end
63
+ if attributes[:'title']
64
+ self.title = attributes[:'title']
65
+ end
66
+ if attributes[:'online']
67
+ self.online = attributes[:'online']
68
+ end
69
+ if attributes[:'tags']
70
+ if (value = attributes[:'tags']).is_a?(Array)
71
+ self.tags = value
72
+ end
73
+ end
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ id == o.id
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,67 @@
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 'date'
14
+ require_relative 'concerns/swagger_model'
15
+
16
+ module AgridClient
17
+ class State
18
+ include SwaggerModel
19
+
20
+ # Acronym of state
21
+ attr_accessor :acronym
22
+
23
+ # Fullname of state
24
+ attr_accessor :title
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'acronym' => :'acronym',
30
+ :'title' => :'title'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'acronym' => :'String',
38
+ :'title' => :'String'
39
+ }
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ return unless attributes.is_a?(Hash)
46
+
47
+ # convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
49
+
50
+ if attributes[:'acronym']
51
+ self.acronym = attributes[:'acronym']
52
+ end
53
+ if attributes[:'title']
54
+ self.title = attributes[:'title']
55
+ end
56
+ end
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] Object to be compared
60
+ def ==(o)
61
+ return true if self.equal?(o)
62
+ self.class == o.class &&
63
+ acronym == o.acronym &&
64
+ title == o.title
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,3 @@
1
+ module AgridClient
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,49 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for AgridClient::CitiesApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'CitiesApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = AgridClient::CitiesApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of CitiesApi' do
30
+ it 'should create an instact of CitiesApi' do
31
+ @instance.should be_a(AgridClient::CitiesApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for cities_get
36
+ #
37
+ # Returns all cities supported by at least one company
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :state State acronym to filter cities by state
40
+ # @return [Array<CityWithFullState>]
41
+ describe 'cities_get test' do
42
+ it "should work" do
43
+ VCR.use_cassette('cities') do
44
+ expect(@instance.cities_get).to be_a(Array)
45
+ end
46
+ end
47
+ end
48
+
49
+ end
@@ -0,0 +1,69 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for AgridClient::CompaniesApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'CompaniesApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = AgridClient::CompaniesApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of CompaniesApi' do
30
+ it 'should create an instact of CompaniesApi' do
31
+ @instance.should be_a(AgridClient::CompaniesApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_companies
36
+ #
37
+ # Return a set of companies.
38
+ # @param service_id Service ID
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [Integer] :offset Number to skip rows before beginning to return companies
41
+ # @option opts [Integer] :limit Limit number of companies on response(default is 12)
42
+ # @return [InlineResponse200]
43
+ describe 'get_companies test' do
44
+ it "should work" do
45
+ # assertion here
46
+ # should be_a()
47
+ # should be_nil
48
+ # should ==
49
+ # should_not ==
50
+ end
51
+ end
52
+
53
+ # unit tests for get_company
54
+ #
55
+ # Return data of a specific company
56
+ # @param id Company ID
57
+ # @param [Hash] opts the optional parameters
58
+ # @return [Company]
59
+ describe 'get_company test' do
60
+ it "should work" do
61
+ # assertion here
62
+ # should be_a()
63
+ # should be_nil
64
+ # should ==
65
+ # should_not ==
66
+ end
67
+ end
68
+
69
+ end
@@ -0,0 +1,54 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for AgridClient::FiltersApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'FiltersApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = AgridClient::FiltersApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of FiltersApi' do
30
+ it 'should create an instact of FiltersApi' do
31
+ @instance.should be_a(AgridClient::FiltersApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for services_service_id_filters_get
36
+ #
37
+ # Returns all filters of a service.\n You can some of the query parameters in /v1/services/:service_id/quotes\n to fetch all filters and filter_categories of the set of that quotes.
38
+ # @param service_id param to filter quotes by service
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :city_id the city id
41
+ # @option opts [Float] :min_price the minimium price for a quote
42
+ # @option opts [Float] :max_price the maximum price for a quote
43
+ # @return [Filter]
44
+ describe 'services_service_id_filters_get test' do
45
+ it "should work" do
46
+ # assertion here
47
+ # should be_a()
48
+ # should be_nil
49
+ # should ==
50
+ # should_not ==
51
+ end
52
+ end
53
+
54
+ end