Creizer-Meli 3.0.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.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +137 -0
  4. data/Rakefile +10 -0
  5. data/creizer-meli.gemspec +33 -0
  6. data/docs/Attributes.md +31 -0
  7. data/docs/AttributesValueStruct.md +19 -0
  8. data/docs/AttributesValues.md +21 -0
  9. data/docs/CategoriesApi.md +150 -0
  10. data/docs/InlineObject.md +27 -0
  11. data/docs/Item.md +41 -0
  12. data/docs/ItemPictures.md +17 -0
  13. data/docs/ItemsApi.md +152 -0
  14. data/docs/ItemsHealthApi.md +150 -0
  15. data/docs/OAuth20Api.md +117 -0
  16. data/docs/RestClientApi.md +204 -0
  17. data/docs/Variations.md +25 -0
  18. data/docs/VariationsAttributeCombinations.md +21 -0
  19. data/examples/get_token.rb +21 -0
  20. data/examples/restclient_post.rb +73 -0
  21. data/lib/meli.rb +52 -0
  22. data/lib/meli/api/categories_api.rb +216 -0
  23. data/lib/meli/api/items_api.rb +226 -0
  24. data/lib/meli/api/items_health_api.rb +216 -0
  25. data/lib/meli/api/o_auth20_api.rb +178 -0
  26. data/lib/meli/api/rest_client_api.rb +306 -0
  27. data/lib/meli/api_client.rb +387 -0
  28. data/lib/meli/api_error.rb +57 -0
  29. data/lib/meli/configuration.rb +297 -0
  30. data/lib/meli/models/attributes.rb +273 -0
  31. data/lib/meli/models/attributes_value_struct.rb +215 -0
  32. data/lib/meli/models/attributes_values.rb +226 -0
  33. data/lib/meli/models/inline_object.rb +251 -0
  34. data/lib/meli/models/item.rb +375 -0
  35. data/lib/meli/models/item_pictures.rb +206 -0
  36. data/lib/meli/models/variations.rb +246 -0
  37. data/lib/meli/models/variations_attribute_combinations.rb +224 -0
  38. data/lib/meli/version.rb +15 -0
  39. data/spec/api/categories_api_spec.rb +70 -0
  40. data/spec/api/items_api_spec.rb +71 -0
  41. data/spec/api/items_health_api_spec.rb +70 -0
  42. data/spec/api/o_auth20_api_spec.rb +65 -0
  43. data/spec/api/rest_client_api_spec.rb +85 -0
  44. data/spec/api_client_spec.rb +226 -0
  45. data/spec/configuration_spec.rb +42 -0
  46. data/spec/models/attributes_spec.rb +83 -0
  47. data/spec/models/attributes_value_struct_spec.rb +47 -0
  48. data/spec/models/attributes_values_spec.rb +53 -0
  49. data/spec/models/inline_object_spec.rb +71 -0
  50. data/spec/models/item_pictures_spec.rb +41 -0
  51. data/spec/models/item_spec.rb +113 -0
  52. data/spec/models/variations_attribute_combinations_spec.rb +53 -0
  53. data/spec/models/variations_spec.rb +65 -0
  54. data/spec/spec_helper.rb +111 -0
  55. metadata +173 -0
@@ -0,0 +1,41 @@
1
+ # Meli::Item
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **title** | **String** | |
8
+ **category_id** | **String** | |
9
+ **price** | **Integer** | |
10
+ **currency_id** | **String** | |
11
+ **available_quantity** | **String** | |
12
+ **buying_mode** | **String** | |
13
+ **listing_type_id** | **String** | |
14
+ **condition** | **String** | |
15
+ **description** | **String** | |
16
+ **video_id** | **String** | |
17
+ **pictures** | [**Array<ItemPictures>**](ItemPictures.md) | |
18
+ **attributes** | [**Array<Attributes>**](Attributes.md) | | [optional]
19
+ **variations** | [**Array<Variations>**](Variations.md) | | [optional]
20
+
21
+ ## Code Sample
22
+
23
+ ```ruby
24
+ require 'Meli'
25
+
26
+ instance = Meli::Item.new(title: Item de test - No Ofertar,
27
+ category_id: MLA5991,
28
+ price: 350,
29
+ currency_id: ARS,
30
+ available_quantity: 12,
31
+ buying_mode: buy_it_now,
32
+ listing_type_id: bronze,
33
+ condition: new,
34
+ description: Item de Teste. Mercado Livre SDK,
35
+ video_id: RXWn6kftTHY,
36
+ pictures: null,
37
+ attributes: null,
38
+ variations: null)
39
+ ```
40
+
41
+
@@ -0,0 +1,17 @@
1
+ # Meli::ItemPictures
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **source** | **String** | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'Meli'
13
+
14
+ instance = Meli::ItemPictures.new(source: https://http2.mlstatic.com/storage/developers-site-cms-admin/openapi/319968615067-mp3.jpg)
15
+ ```
16
+
17
+
@@ -0,0 +1,152 @@
1
+ # Meli::ItemsApi
2
+
3
+ All URIs are relative to *https://api.mercadolibre.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**items_id_get**](ItemsApi.md#items_id_get) | **GET** /items/{id} | Return a Item.
8
+ [**items_id_put**](ItemsApi.md#items_id_put) | **PUT** /items/{id} | Update a Item.
9
+ [**items_post**](ItemsApi.md#items_post) | **POST** /items | Create a Item.
10
+
11
+
12
+
13
+ ## items_id_get
14
+
15
+ > Object items_id_get(id)
16
+
17
+ Return a Item.
18
+
19
+ ### Example
20
+
21
+ ```ruby
22
+ # load the gem
23
+ require 'Meli'
24
+
25
+ api_instance = Meli::ItemsApi.new
26
+ id = 'id_example' # String |
27
+
28
+ begin
29
+ #Return a Item.
30
+ result = api_instance.items_id_get(id)
31
+ p result
32
+ rescue Meli::ApiError => e
33
+ puts "Exception when calling ItemsApi->items_id_get: #{e}"
34
+ end
35
+ ```
36
+
37
+ ### Parameters
38
+
39
+
40
+ Name | Type | Description | Notes
41
+ ------------- | ------------- | ------------- | -------------
42
+ **id** | **String**| |
43
+
44
+ ### Return type
45
+
46
+ **Object**
47
+
48
+ ### Authorization
49
+
50
+ No authorization required
51
+
52
+ ### HTTP request headers
53
+
54
+ - **Content-Type**: Not defined
55
+ - **Accept**: application/json
56
+
57
+
58
+ ## items_id_put
59
+
60
+ > Object items_id_put(id, access_token, item)
61
+
62
+ Update a Item.
63
+
64
+ ### Example
65
+
66
+ ```ruby
67
+ # load the gem
68
+ require 'Meli'
69
+
70
+ api_instance = Meli::ItemsApi.new
71
+ id = 'id_example' # String |
72
+ access_token = 'access_token_example' # String |
73
+ item = Meli::Item.new # Item |
74
+
75
+ begin
76
+ #Update a Item.
77
+ result = api_instance.items_id_put(id, access_token, item)
78
+ p result
79
+ rescue Meli::ApiError => e
80
+ puts "Exception when calling ItemsApi->items_id_put: #{e}"
81
+ end
82
+ ```
83
+
84
+ ### Parameters
85
+
86
+
87
+ Name | Type | Description | Notes
88
+ ------------- | ------------- | ------------- | -------------
89
+ **id** | **String**| |
90
+ **access_token** | **String**| |
91
+ **item** | [**Item**](Item.md)| |
92
+
93
+ ### Return type
94
+
95
+ **Object**
96
+
97
+ ### Authorization
98
+
99
+ No authorization required
100
+
101
+ ### HTTP request headers
102
+
103
+ - **Content-Type**: application/json
104
+ - **Accept**: application/json
105
+
106
+
107
+ ## items_post
108
+
109
+ > Object items_post(access_token, item)
110
+
111
+ Create a Item.
112
+
113
+ ### Example
114
+
115
+ ```ruby
116
+ # load the gem
117
+ require 'Meli'
118
+
119
+ api_instance = Meli::ItemsApi.new
120
+ access_token = 'access_token_example' # String |
121
+ item = Meli::Item.new # Item |
122
+
123
+ begin
124
+ #Create a Item.
125
+ result = api_instance.items_post(access_token, item)
126
+ p result
127
+ rescue Meli::ApiError => e
128
+ puts "Exception when calling ItemsApi->items_post: #{e}"
129
+ end
130
+ ```
131
+
132
+ ### Parameters
133
+
134
+
135
+ Name | Type | Description | Notes
136
+ ------------- | ------------- | ------------- | -------------
137
+ **access_token** | **String**| |
138
+ **item** | [**Item**](Item.md)| |
139
+
140
+ ### Return type
141
+
142
+ **Object**
143
+
144
+ ### Authorization
145
+
146
+ No authorization required
147
+
148
+ ### HTTP request headers
149
+
150
+ - **Content-Type**: application/json
151
+ - **Accept**: application/json
152
+
@@ -0,0 +1,150 @@
1
+ # Meli::ItemsHealthApi
2
+
3
+ All URIs are relative to *https://api.mercadolibre.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**items_id_health_actions_get**](ItemsHealthApi.md#items_id_health_actions_get) | **GET** /items/{id}/health/actions | Return item health actions by id.
8
+ [**items_id_health_get**](ItemsHealthApi.md#items_id_health_get) | **GET** /items/{id}/health | Return health by id.
9
+ [**sites_site_id_health_levels_get**](ItemsHealthApi.md#sites_site_id_health_levels_get) | **GET** /sites/{site_id}/health_levels | Return health levels.
10
+
11
+
12
+
13
+ ## items_id_health_actions_get
14
+
15
+ > Object items_id_health_actions_get(id, access_token)
16
+
17
+ Return item health actions by id.
18
+
19
+ ### Example
20
+
21
+ ```ruby
22
+ # load the gem
23
+ require 'Meli'
24
+
25
+ api_instance = Meli::ItemsHealthApi.new
26
+ id = 'id_example' # String |
27
+ access_token = 'access_token_example' # String |
28
+
29
+ begin
30
+ #Return item health actions by id.
31
+ result = api_instance.items_id_health_actions_get(id, access_token)
32
+ p result
33
+ rescue Meli::ApiError => e
34
+ puts "Exception when calling ItemsHealthApi->items_id_health_actions_get: #{e}"
35
+ end
36
+ ```
37
+
38
+ ### Parameters
39
+
40
+
41
+ Name | Type | Description | Notes
42
+ ------------- | ------------- | ------------- | -------------
43
+ **id** | **String**| |
44
+ **access_token** | **String**| |
45
+
46
+ ### Return type
47
+
48
+ **Object**
49
+
50
+ ### Authorization
51
+
52
+ No authorization required
53
+
54
+ ### HTTP request headers
55
+
56
+ - **Content-Type**: Not defined
57
+ - **Accept**: application/json
58
+
59
+
60
+ ## items_id_health_get
61
+
62
+ > Object items_id_health_get(id, access_token)
63
+
64
+ Return health by id.
65
+
66
+ ### Example
67
+
68
+ ```ruby
69
+ # load the gem
70
+ require 'Meli'
71
+
72
+ api_instance = Meli::ItemsHealthApi.new
73
+ id = 'id_example' # String |
74
+ access_token = 'access_token_example' # String |
75
+
76
+ begin
77
+ #Return health by id.
78
+ result = api_instance.items_id_health_get(id, access_token)
79
+ p result
80
+ rescue Meli::ApiError => e
81
+ puts "Exception when calling ItemsHealthApi->items_id_health_get: #{e}"
82
+ end
83
+ ```
84
+
85
+ ### Parameters
86
+
87
+
88
+ Name | Type | Description | Notes
89
+ ------------- | ------------- | ------------- | -------------
90
+ **id** | **String**| |
91
+ **access_token** | **String**| |
92
+
93
+ ### Return type
94
+
95
+ **Object**
96
+
97
+ ### Authorization
98
+
99
+ No authorization required
100
+
101
+ ### HTTP request headers
102
+
103
+ - **Content-Type**: Not defined
104
+ - **Accept**: application/json
105
+
106
+
107
+ ## sites_site_id_health_levels_get
108
+
109
+ > Object sites_site_id_health_levels_get(site_id)
110
+
111
+ Return health levels.
112
+
113
+ ### Example
114
+
115
+ ```ruby
116
+ # load the gem
117
+ require 'Meli'
118
+
119
+ api_instance = Meli::ItemsHealthApi.new
120
+ site_id = 'site_id_example' # String |
121
+
122
+ begin
123
+ #Return health levels.
124
+ result = api_instance.sites_site_id_health_levels_get(site_id)
125
+ p result
126
+ rescue Meli::ApiError => e
127
+ puts "Exception when calling ItemsHealthApi->sites_site_id_health_levels_get: #{e}"
128
+ end
129
+ ```
130
+
131
+ ### Parameters
132
+
133
+
134
+ Name | Type | Description | Notes
135
+ ------------- | ------------- | ------------- | -------------
136
+ **site_id** | **String**| |
137
+
138
+ ### Return type
139
+
140
+ **Object**
141
+
142
+ ### Authorization
143
+
144
+ No authorization required
145
+
146
+ ### HTTP request headers
147
+
148
+ - **Content-Type**: Not defined
149
+ - **Accept**: application/json
150
+
@@ -0,0 +1,117 @@
1
+ # Meli::OAuth20Api
2
+
3
+ All URIs are relative to *https://api.mercadolibre.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**auth**](OAuth20Api.md#auth) | **GET** /authorization | Authentication Endpoint
8
+ [**get_token**](OAuth20Api.md#get_token) | **POST** /oauth/token | Request Access Token
9
+
10
+
11
+
12
+ ## auth
13
+
14
+ > auth(response_type, client_id, redirect_uri)
15
+
16
+ Authentication Endpoint
17
+
18
+ ### Example
19
+
20
+ ```ruby
21
+ # load the gem
22
+ require 'Meli'
23
+
24
+ api_instance = Meli::OAuth20Api.new
25
+ response_type = 'code' # String |
26
+ client_id = 'client_id_example' # String |
27
+ redirect_uri = 'redirect_uri_example' # String |
28
+
29
+ begin
30
+ #Authentication Endpoint
31
+ api_instance.auth(response_type, client_id, redirect_uri)
32
+ rescue Meli::ApiError => e
33
+ puts "Exception when calling OAuth20Api->auth: #{e}"
34
+ end
35
+ ```
36
+
37
+ ### Parameters
38
+
39
+
40
+ Name | Type | Description | Notes
41
+ ------------- | ------------- | ------------- | -------------
42
+ **response_type** | **String**| | [default to 'code']
43
+ **client_id** | **String**| |
44
+ **redirect_uri** | **String**| |
45
+
46
+ ### Return type
47
+
48
+ nil (empty response body)
49
+
50
+ ### Authorization
51
+
52
+ No authorization required
53
+
54
+ ### HTTP request headers
55
+
56
+ - **Content-Type**: Not defined
57
+ - **Accept**: application/json
58
+
59
+
60
+ ## get_token
61
+
62
+ > Object get_token(opts)
63
+
64
+ Request Access Token
65
+
66
+ Partner makes a request to the token endpoint by adding the following parameters described below
67
+
68
+ ### Example
69
+
70
+ ```ruby
71
+ # load the gem
72
+ require 'Meli'
73
+
74
+ api_instance = Meli::OAuth20Api.new
75
+ opts = {
76
+ grant_type: 'grant_type_example', # String |
77
+ client_id: 'client_id_example', # String |
78
+ client_secret: 'client_secret_example', # String |
79
+ redirect_uri: 'redirect_uri_example', # String |
80
+ code: 'code_example', # String |
81
+ refresh_token: 'refresh_token_example' # String |
82
+ }
83
+
84
+ begin
85
+ #Request Access Token
86
+ result = api_instance.get_token(opts)
87
+ p result
88
+ rescue Meli::ApiError => e
89
+ puts "Exception when calling OAuth20Api->get_token: #{e}"
90
+ end
91
+ ```
92
+
93
+ ### Parameters
94
+
95
+
96
+ Name | Type | Description | Notes
97
+ ------------- | ------------- | ------------- | -------------
98
+ **grant_type** | **String**| | [optional]
99
+ **client_id** | **String**| | [optional]
100
+ **client_secret** | **String**| | [optional]
101
+ **redirect_uri** | **String**| | [optional]
102
+ **code** | **String**| | [optional]
103
+ **refresh_token** | **String**| | [optional]
104
+
105
+ ### Return type
106
+
107
+ **Object**
108
+
109
+ ### Authorization
110
+
111
+ No authorization required
112
+
113
+ ### HTTP request headers
114
+
115
+ - **Content-Type**: application/x-www-form-urlencoded
116
+ - **Accept**: application/json
117
+