patch_ruby 1.17.0 → 1.17.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b155fa6ec075f760c3a917898b8e970995c500ff5b3d31488216e018d98418c
4
- data.tar.gz: 212fccee52313135c68c8568df430d6bce2e41de56610c84c5badb2b5c7d13e0
3
+ metadata.gz: 01aa479a3dfd04193fba725fe8f26d0cb4754ed829dcd55824fe34c9b2b3e608
4
+ data.tar.gz: bf650d916330ce6be13d0794c802b916ba67d9b1867e1a02e4730537c219bb45
5
5
  SHA512:
6
- metadata.gz: d0af1c92005e56b3a1249cef852bf0cd6005d4e734c9a237bed90c1704f8ef676a725fad3c7d95daee0e83bfbfbaaefedebf7bcc71c69ad3cd7d6d89ae5917f6
7
- data.tar.gz: 46bf38a886fd7c4767b3cd5a87794e55b683c0ffeaecd688700b2d9b028460608bff5d355aef0d591807e12208497d9b8cecb13e38c27aba7c81d79e7637fe37
6
+ metadata.gz: 147ff1b520b0629f9e0c293a386a695fc33a77fbbd22149006046e9de8d204cf1891e8631d897d64b83004b79fef9931ba7461a850b5831a4522feec211285fb
7
+ data.tar.gz: e2a1cf40776a588973f778fd73ebe1699e4b0ee767dce56d704aa788a8cc6ae54d50ecd484c303862ef4cd73556c731fa66e204429fd1d500547c845eef13995
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- patch_ruby (1.17.0)
4
+ patch_ruby (1.17.1)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -188,33 +188,6 @@ Patch::Project.retrieve_projects(type: type)
188
188
  minimum_available_mass = 100
189
189
  Patch::Project.retrieve_projects(minimum_available_mass: minimum_available_mass)
190
190
  ```
191
-
192
- ### Preferences
193
-
194
- Preferences are how you route your orders in Patch. If you don't have a preference, Patch will allocate your order to the least expensive option. If you do have a preference, all of your orders will be sent to that project. You can set your preferences via API, or through the [Patch Dashboard](https://dashboard.patch.io/projects).
195
-
196
- [API Reference](https://docs.patch.io/#/?id=preferences)
197
-
198
- #### Examples
199
-
200
- ```ruby
201
- # Create a preference
202
- project_id = 'pro_test_1234' # Pass in the project_id for your preference
203
- Patch::Preference.create_preference(project_id: project_id)
204
-
205
- # Retrieve a preference
206
- preference_id = 'pre_test_1234' # Pass in the preferences's id
207
- Patch::Preference.retrieve_preference(preference_id)
208
-
209
- # Delete a preference
210
- preference_id = 'pre_test_1234' # Pass in the preferences's id
211
- Patch::Preference.delete_preference(preference_id)
212
-
213
- # Retrieve a list of preferences
214
- page = 1 # Pass in which page of preferences you'd like
215
- Patch::Preference.retrieve_preferences(page: page)
216
- ```
217
-
218
191
  ## Contributing
219
192
 
220
193
  While we value open-source contributions to this SDK, the core of this library is generated programmatically. Complex additions made directly to the library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
@@ -31,7 +31,7 @@ module Patch
31
31
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
32
  def initialize(config = Configuration.default)
33
33
  @config = config
34
- @user_agent = "patch-ruby/1.17.0"
34
+ @user_agent = "patch-ruby/1.17.1"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.3.1
11
11
  =end
12
12
 
13
13
  module Patch
14
- VERSION = '1.17.0'
14
+ VERSION = '1.17.1'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patch_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patch Technology
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -95,7 +95,6 @@ files:
95
95
  - lib/patch_ruby.rb
96
96
  - lib/patch_ruby/api/estimates_api.rb
97
97
  - lib/patch_ruby/api/orders_api.rb
98
- - lib/patch_ruby/api/preferences_api.rb
99
98
  - lib/patch_ruby/api/projects_api.rb
100
99
  - lib/patch_ruby/api/technology_types_api.rb
101
100
  - lib/patch_ruby/api_client.rb
@@ -199,48 +198,48 @@ signing_key:
199
198
  specification_version: 4
200
199
  summary: Ruby wrapper for the Patch API
201
200
  test_files:
202
- - spec/api/orders_api_spec.rb
203
- - spec/api/projects_api_spec.rb
204
201
  - spec/api/technology_types_api_spec.rb
202
+ - spec/api/orders_api_spec.rb
205
203
  - spec/api/estimates_api_spec.rb
204
+ - spec/api/projects_api_spec.rb
206
205
  - spec/api_client_spec.rb
207
206
  - spec/configuration_spec.rb
208
207
  - spec/constants.rb
209
- - spec/factories/allocations.rb
210
- - spec/factories/meta_index_objects.rb
208
+ - spec/factories/project_list_responses.rb
211
209
  - spec/factories/error_responses.rb
212
- - spec/factories/create_mass_estimate_requests.rb
213
210
  - spec/factories/sdgs.rb
214
- - spec/factories/order_responses.rb
215
- - spec/factories/order_list_responses.rb
216
- - spec/factories/estimates.rb
211
+ - spec/factories/meta_index_objects.rb
212
+ - spec/factories/create_mass_estimate_requests.rb
217
213
  - spec/factories/project_responses.rb
218
- - spec/factories/projects.rb
214
+ - spec/factories/estimates.rb
215
+ - spec/factories/parent_technology_type.rb
219
216
  - spec/factories/technology_type.rb
217
+ - spec/factories/order_responses.rb
220
218
  - spec/factories/estimate_responses.rb
219
+ - spec/factories/allocations.rb
221
220
  - spec/factories/estimate_list_responses.rb
222
221
  - spec/factories/orders.rb
223
- - spec/factories/parent_technology_type.rb
222
+ - spec/factories/projects.rb
223
+ - spec/factories/order_list_responses.rb
224
224
  - spec/factories/create_order_requests.rb
225
- - spec/factories/project_list_responses.rb
226
- - spec/integration/projects_spec.rb
227
- - spec/integration/orders_spec.rb
228
225
  - spec/integration/projects/technology_types_spec.rb
226
+ - spec/integration/orders_spec.rb
227
+ - spec/integration/projects_spec.rb
229
228
  - spec/integration/estimates_spec.rb
230
- - spec/models/allocation_spec.rb
229
+ - spec/models/project_spec.rb
231
230
  - spec/models/order_response_spec.rb
232
231
  - spec/models/error_response_spec.rb
233
- - spec/models/create_order_request_spec.rb
234
- - spec/models/project_list_response_spec.rb
235
- - spec/models/estimate_list_response_spec.rb
236
- - spec/models/project_spec.rb
237
- - spec/models/estimate_response_spec.rb
238
- - spec/models/order_list_response_spec.rb
239
- - spec/models/order_spec.rb
240
232
  - spec/models/project_response_spec.rb
241
233
  - spec/models/meta_index_object_spec.rb
242
- - spec/models/estimate_spec.rb
243
234
  - spec/models/create_mass_estimate_request_spec.rb
235
+ - spec/models/estimate_list_response_spec.rb
236
+ - spec/models/allocation_spec.rb
237
+ - spec/models/create_order_request_spec.rb
238
+ - spec/models/order_list_response_spec.rb
239
+ - spec/models/project_list_response_spec.rb
240
+ - spec/models/estimate_spec.rb
241
+ - spec/models/order_spec.rb
242
+ - spec/models/estimate_response_spec.rb
244
243
  - spec/patch_ruby_spec.rb
245
244
  - spec/spec_helper.rb
246
245
  - spec/support/shared/generated_classes.rb
@@ -1,284 +0,0 @@
1
- =begin
2
- #Patch API V1
3
-
4
- #The core API used to integrate with Patch's service
5
-
6
- The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.1
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Patch
16
- class PreferencesApi
17
- OPERATIONS = [
18
- :create_preference,
19
- :delete_preference,
20
- :retrieve_preference,
21
- :retrieve_preferences,
22
- ]
23
-
24
- attr_accessor :api_client
25
-
26
- def initialize(api_client = ApiClient.default)
27
- @api_client = api_client
28
- end
29
- # creates a project preference
30
- # Creates a project preference for the given organization. If you have a `preference` in place, all of your orders will be directed to the project the preference points to.
31
- # @param create_preference_request [CreatePreferenceRequest]
32
- # @param [Hash] opts the optional parameters
33
- # @return [PreferenceResponse]
34
- def create_preference(create_preference_request = {}, opts = {})
35
- _create_preference_request = Patch::CreatePreferenceRequest.new(create_preference_request)
36
- data, _status_code, _headers = create_preference_with_http_info(_create_preference_request, opts)
37
- data
38
- end
39
-
40
- # creates a project preference
41
- # Creates a project preference for the given organization. If you have a `preference` in place, all of your orders will be directed to the project the preference points to.
42
- # @param create_preference_request [CreatePreferenceRequest]
43
- # @param [Hash] opts the optional parameters
44
- # @return [Array<(PreferenceResponse, Integer, Hash)>] PreferenceResponse data, response status code and response headers
45
- def create_preference_with_http_info(create_preference_request, opts = {})
46
- if @api_client.config.debugging
47
- @api_client.config.logger.debug 'Calling API: PreferencesApi.create_preference ...'
48
- end
49
- # verify the required parameter 'create_preference_request' is set
50
- if @api_client.config.client_side_validation && create_preference_request.nil?
51
- fail ArgumentError, "Missing the required parameter 'create_preference_request' when calling PreferencesApi.create_preference"
52
- end
53
- # resource path
54
- local_var_path = '/v1/preferences'
55
-
56
- # query parameters
57
- query_params = opts[:query_params] || {}
58
-
59
- # header parameters
60
- header_params = opts[:header_params] || {}
61
- # HTTP header 'Accept' (if needed)
62
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
- # HTTP header 'Content-Type'
64
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
65
-
66
- # form parameters
67
- form_params = opts[:form_params] || {}
68
-
69
- # http body (model)
70
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_preference_request)
71
-
72
- # return_type
73
- return_type = opts[:debug_return_type] || 'PreferenceResponse'
74
-
75
- # auth_names
76
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
77
-
78
- new_options = opts.merge(
79
- :operation => :"PreferencesApi.create_preference",
80
- :header_params => header_params,
81
- :query_params => query_params,
82
- :form_params => form_params,
83
- :body => post_body,
84
- :auth_names => auth_names,
85
- :return_type => return_type
86
- )
87
-
88
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
89
- if @api_client.config.debugging
90
- @api_client.config.logger.debug "API called: PreferencesApi#create_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
- end
92
- return data, status_code, headers
93
- end
94
-
95
- # Deletes an organization's preference for a project
96
- # Deletes the given `preference`. Once a preference is deleted, it cannot be undone. If you want to restore your previous preference, create a new one.
97
- # @param id [String]
98
- # @param [Hash] opts the optional parameters
99
- # @return [PreferenceResponse]
100
- def delete_preference(id, opts = {})
101
-
102
- data, _status_code, _headers = delete_preference_with_http_info(id, opts)
103
- data
104
- end
105
-
106
- # Deletes an organization&#39;s preference for a project
107
- # Deletes the given &#x60;preference&#x60;. Once a preference is deleted, it cannot be undone. If you want to restore your previous preference, create a new one.
108
- # @param id [String]
109
- # @param [Hash] opts the optional parameters
110
- # @return [Array<(PreferenceResponse, Integer, Hash)>] PreferenceResponse data, response status code and response headers
111
- def delete_preference_with_http_info(id, opts = {})
112
- if @api_client.config.debugging
113
- @api_client.config.logger.debug 'Calling API: PreferencesApi.delete_preference ...'
114
- end
115
- # verify the required parameter 'id' is set
116
- if @api_client.config.client_side_validation && id.nil?
117
- fail ArgumentError, "Missing the required parameter 'id' when calling PreferencesApi.delete_preference"
118
- end
119
- # resource path
120
- local_var_path = '/v1/preferences/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
121
-
122
- # query parameters
123
- query_params = opts[:query_params] || {}
124
-
125
- # header parameters
126
- header_params = opts[:header_params] || {}
127
- # HTTP header 'Accept' (if needed)
128
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
129
-
130
- # form parameters
131
- form_params = opts[:form_params] || {}
132
-
133
- # http body (model)
134
- post_body = opts[:debug_body]
135
-
136
- # return_type
137
- return_type = opts[:debug_return_type] || 'PreferenceResponse'
138
-
139
- # auth_names
140
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
141
-
142
- new_options = opts.merge(
143
- :operation => :"PreferencesApi.delete_preference",
144
- :header_params => header_params,
145
- :query_params => query_params,
146
- :form_params => form_params,
147
- :body => post_body,
148
- :auth_names => auth_names,
149
- :return_type => return_type
150
- )
151
-
152
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
153
- if @api_client.config.debugging
154
- @api_client.config.logger.debug "API called: PreferencesApi#delete_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
- end
156
- return data, status_code, headers
157
- end
158
-
159
- # Retrieve the preference
160
- # Retrieve the preference and project of an organization. You can only retrieve preferences associated with your organization.
161
- # @param id [String]
162
- # @param [Hash] opts the optional parameters
163
- # @return [PreferenceResponse]
164
- def retrieve_preference(id, opts = {})
165
-
166
- data, _status_code, _headers = retrieve_preference_with_http_info(id, opts)
167
- data
168
- end
169
-
170
- # Retrieve the preference
171
- # Retrieve the preference and project of an organization. You can only retrieve preferences associated with your organization.
172
- # @param id [String]
173
- # @param [Hash] opts the optional parameters
174
- # @return [Array<(PreferenceResponse, Integer, Hash)>] PreferenceResponse data, response status code and response headers
175
- def retrieve_preference_with_http_info(id, opts = {})
176
- if @api_client.config.debugging
177
- @api_client.config.logger.debug 'Calling API: PreferencesApi.retrieve_preference ...'
178
- end
179
- # verify the required parameter 'id' is set
180
- if @api_client.config.client_side_validation && id.nil?
181
- fail ArgumentError, "Missing the required parameter 'id' when calling PreferencesApi.retrieve_preference"
182
- end
183
- # resource path
184
- local_var_path = '/v1/preferences/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
185
-
186
- # query parameters
187
- query_params = opts[:query_params] || {}
188
-
189
- # header parameters
190
- header_params = opts[:header_params] || {}
191
- # HTTP header 'Accept' (if needed)
192
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
193
-
194
- # form parameters
195
- form_params = opts[:form_params] || {}
196
-
197
- # http body (model)
198
- post_body = opts[:debug_body]
199
-
200
- # return_type
201
- return_type = opts[:debug_return_type] || 'PreferenceResponse'
202
-
203
- # auth_names
204
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
205
-
206
- new_options = opts.merge(
207
- :operation => :"PreferencesApi.retrieve_preference",
208
- :header_params => header_params,
209
- :query_params => query_params,
210
- :form_params => form_params,
211
- :body => post_body,
212
- :auth_names => auth_names,
213
- :return_type => return_type
214
- )
215
-
216
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
217
- if @api_client.config.debugging
218
- @api_client.config.logger.debug "API called: PreferencesApi#retrieve_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
- end
220
- return data, status_code, headers
221
- end
222
-
223
- # Retrieves a list of preferences
224
- # Retrieves a list of preferences and associated projects of an organization. You can only retrieve preferences associated with your organization.
225
- # @param [Hash] opts the optional parameters
226
- # @option opts [Integer] :page
227
- # @return [PreferenceListResponse]
228
- def retrieve_preferences(opts = {})
229
-
230
- data, _status_code, _headers = retrieve_preferences_with_http_info(opts)
231
- data
232
- end
233
-
234
- # Retrieves a list of preferences
235
- # Retrieves a list of preferences and associated projects of an organization. You can only retrieve preferences associated with your organization.
236
- # @param [Hash] opts the optional parameters
237
- # @option opts [Integer] :page
238
- # @return [Array<(PreferenceListResponse, Integer, Hash)>] PreferenceListResponse data, response status code and response headers
239
- def retrieve_preferences_with_http_info(opts = {})
240
- if @api_client.config.debugging
241
- @api_client.config.logger.debug 'Calling API: PreferencesApi.retrieve_preferences ...'
242
- end
243
- # resource path
244
- local_var_path = '/v1/preferences'
245
-
246
- # query parameters
247
- query_params = opts[:query_params] || {}
248
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
249
-
250
- # header parameters
251
- header_params = opts[:header_params] || {}
252
- # HTTP header 'Accept' (if needed)
253
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
254
-
255
- # form parameters
256
- form_params = opts[:form_params] || {}
257
-
258
- # http body (model)
259
- post_body = opts[:debug_body]
260
-
261
- # return_type
262
- return_type = opts[:debug_return_type] || 'PreferenceListResponse'
263
-
264
- # auth_names
265
- auth_names = opts[:debug_auth_names] || ['bearer_auth']
266
-
267
- new_options = opts.merge(
268
- :operation => :"PreferencesApi.retrieve_preferences",
269
- :header_params => header_params,
270
- :query_params => query_params,
271
- :form_params => form_params,
272
- :body => post_body,
273
- :auth_names => auth_names,
274
- :return_type => return_type
275
- )
276
-
277
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
278
- if @api_client.config.debugging
279
- @api_client.config.logger.debug "API called: PreferencesApi#retrieve_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
280
- end
281
- return data, status_code, headers
282
- end
283
- end
284
- end