patch_ruby 1.14.0 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/Gemfile.lock +3 -2
  4. data/README.md +11 -12
  5. data/lib/patch_ruby/api/estimates_api.rb +1 -1
  6. data/lib/patch_ruby/api/orders_api.rb +1 -1
  7. data/lib/patch_ruby/api/projects_api.rb +1 -1
  8. data/lib/patch_ruby/api/technology_types_api.rb +84 -0
  9. data/lib/patch_ruby/api_client.rb +2 -2
  10. data/lib/patch_ruby/api_error.rb +1 -1
  11. data/lib/patch_ruby/configuration.rb +4 -4
  12. data/lib/patch_ruby/models/allocation.rb +1 -1
  13. data/lib/patch_ruby/models/create_bitcoin_estimate_request.rb +1 -1
  14. data/lib/patch_ruby/models/create_ethereum_estimate_request.rb +1 -1
  15. data/lib/patch_ruby/models/create_flight_estimate_request.rb +1 -1
  16. data/lib/patch_ruby/models/create_mass_estimate_request.rb +6 -6
  17. data/lib/patch_ruby/models/create_order_request.rb +6 -6
  18. data/lib/patch_ruby/models/create_shipping_estimate_request.rb +1 -1
  19. data/lib/patch_ruby/models/create_success_response.rb +1 -1
  20. data/lib/patch_ruby/models/create_vehicle_estimate_request.rb +1 -1
  21. data/lib/patch_ruby/models/error_response.rb +1 -1
  22. data/lib/patch_ruby/models/estimate.rb +1 -1
  23. data/lib/patch_ruby/models/estimate_list_response.rb +1 -1
  24. data/lib/patch_ruby/models/estimate_response.rb +1 -1
  25. data/lib/patch_ruby/models/{create_preference_request.rb → highlight.rb} +47 -16
  26. data/lib/patch_ruby/models/meta_index_object.rb +1 -1
  27. data/lib/patch_ruby/models/order.rb +7 -7
  28. data/lib/patch_ruby/models/order_list_response.rb +1 -1
  29. data/lib/patch_ruby/models/order_response.rb +1 -1
  30. data/lib/patch_ruby/models/parent_technology_type.rb +2 -1
  31. data/lib/patch_ruby/models/photo.rb +1 -1
  32. data/lib/patch_ruby/models/project.rb +44 -25
  33. data/lib/patch_ruby/models/project_list_response.rb +1 -1
  34. data/lib/patch_ruby/models/project_response.rb +1 -1
  35. data/lib/patch_ruby/models/sdg.rb +1 -1
  36. data/lib/patch_ruby/models/standard.rb +1 -1
  37. data/lib/patch_ruby/models/technology_type.rb +13 -2
  38. data/lib/patch_ruby/models/{preference_response.rb → technology_type_list_response.rb} +10 -8
  39. data/lib/patch_ruby/version.rb +2 -2
  40. data/lib/patch_ruby.rb +4 -6
  41. data/patch_ruby.gemspec +1 -1
  42. data/spec/api/technology_types_api_spec.rb +46 -0
  43. data/spec/api_client_spec.rb +1 -1
  44. data/spec/configuration_spec.rb +1 -1
  45. data/spec/integration/orders_spec.rb +1 -3
  46. data/spec/integration/projects/technology_types_spec.rb +14 -0
  47. data/spec/integration/projects_spec.rb +2 -1
  48. data/spec/models/project_spec.rb +1 -1
  49. data/spec/spec_helper.rb +1 -1
  50. metadata +30 -47
  51. data/lib/patch_ruby/models/preference.rb +0 -264
  52. data/lib/patch_ruby/models/preference_list_response.rb +0 -273
  53. data/spec/api/preferences_api_spec.rb +0 -82
  54. data/spec/factories/create_preference_requests.rb +0 -5
  55. data/spec/factories/preference_list_responses.rb +0 -8
  56. data/spec/factories/preference_responses.rb +0 -7
  57. data/spec/factories/preferences.rb +0 -7
  58. data/spec/integration/preferences_spec.rb +0 -32
  59. data/spec/models/create_preference_request_spec.rb +0 -47
  60. data/spec/models/preference_list_response_spec.rb +0 -64
  61. data/spec/models/preference_response_spec.rb +0 -58
  62. data/spec/models/preference_spec.rb +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 983c0272228fcb5224e71c3004a104f5312d3288963e5915bc3d7b793b3c8f7a
4
- data.tar.gz: 83e8d6569fc5ce0cb705de13de8d5de3d2f0dfc4a2ca132167d2a1cc8f67b206
3
+ metadata.gz: b7201e7d6d90f73abe60b5c3eb36f3943eef438f1a36c6bed03d2d33b54b244f
4
+ data.tar.gz: 0277c0aed322fbeb668ab104308556a2611bcfbb834716164d18b32e52b81923
5
5
  SHA512:
6
- metadata.gz: 444ac13006a538ae0f84673b82ca88b840a57b342614d4f7e4acac672e25b6176e2ce3449a9c3fe4a4b2dd06a355f423eeb40f87c2ef12cffab93080358a846c
7
- data.tar.gz: cc20f9980d10d998f16d5db881311f3413584c119e249df48d42751f31962710131f4b422cabaa1861cd0b74592fc748db7a5058a74e97dbdefd36d5e2d1f7fd
6
+ metadata.gz: 6bd8bdcd39d35a4f7898ab239ce7498fe5a5fc7e8fff9cbbc335d0c86ac6661e23a5799a9e07ffaa1f8e792c855607e31e92f4eecab4bf8ee9013fdc65697d99
7
+ data.tar.gz: 469e81c991ef8a95db6b789ff865f32f567bbd38eba2720a54a7e09ef38bbde27b4593a1c4ee6f8ec6048b7ef8c582716b638c554a4e4523b308addb7ea4d181
data/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.16.0] - 2021-12-07
9
+
10
+ ### Removed
11
+
12
+ - Removes the `preferences` endpoints (deprecated)
13
+
14
+ ## [1.15.2] - 2021-11-08
15
+
16
+ ### Added
17
+
18
+ - Adds highlights to project responses
19
+
20
+ ## [1.15.1] - 2021-11-04
21
+
22
+ ### Added
23
+
24
+ - Adds verifier to project responses
25
+
26
+ ## [1.15.0] - 2021-10-04
27
+
28
+ ### Added
29
+
30
+ - Added the ability to fetch project technology types via `Patch::TechnologyType.retrieve_technology_types()`
31
+
8
32
  ## [1.14.0] - 2021-09-21
9
33
 
10
34
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- patch_ruby (1.14.0)
4
+ patch_ruby (1.16.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -18,7 +18,7 @@ GEM
18
18
  coderay (1.1.3)
19
19
  concurrent-ruby (1.1.9)
20
20
  diff-lcs (1.4.4)
21
- ethon (0.14.0)
21
+ ethon (0.15.0)
22
22
  ffi (>= 1.15.0)
23
23
  factory_bot (6.2.0)
24
24
  activesupport (>= 5.0.0)
@@ -70,6 +70,7 @@ GEM
70
70
  zeitwerk (2.4.2)
71
71
 
72
72
  PLATFORMS
73
+ arm64-darwin-20
73
74
  x86_64-darwin-20
74
75
 
75
76
  DEPENDENCIES
data/README.md CHANGED
@@ -53,9 +53,6 @@ end
53
53
 
54
54
  In Patch, orders represent a purchase of carbon offsets or negative emissions by mass. Place orders directly if you know the amount of carbon dioxide you would like to sequester. If you do not know how much to purchase, use an estimate.
55
55
 
56
- In Patch, orders represent a purchase of carbon offsets or negative emissions by mass.
57
- Place orders directly if you know the amount of carbon dioxide you would like to sequester.
58
- If you do not know how much to purchase, use an estimate.
59
56
  You can also create an order with a maximum desired price, and we'll allocate enough mass to
60
57
  fulfill the order for you.
61
58
 
@@ -218,7 +215,13 @@ page = 1 # Pass in which page of preferences you'd like
218
215
  Patch::Preference.retrieve_preferences(page: page)
219
216
  ```
220
217
 
221
- ## Development
218
+ ## Contributing
219
+
220
+ 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!
221
+
222
+ On the other hand, contributions to the README, as well as new test cases are always very welcome!
223
+
224
+ ### Testing locally
222
225
 
223
226
  To build the gem locally, run:
224
227
 
@@ -232,20 +235,16 @@ This will create a .gem file. To install the local gem:
232
235
  gem install patch_ruby-1.x.x.gem
233
236
  ```
234
237
 
235
- Install dependencies:
236
-
237
- ```bash
238
- bundle install
239
- ```
238
+ ### Running tests
240
239
 
241
- Set up required environment variables:
240
+ Set up the required environment variable.
242
241
 
243
242
  ```bash
244
243
  export SANDBOX_API_KEY=<SANDBOX API KEY>
245
244
  ```
246
245
 
247
- Run tests:
246
+ then run the tests:
248
247
 
249
248
  ```bash
250
- bundle exec rspec
249
+ make test
251
250
  ```
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -0,0 +1,84 @@
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: engineering@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 TechnologyTypesApi
17
+ OPERATIONS = [
18
+ :retrieve_technology_types,
19
+ ]
20
+
21
+ attr_accessor :api_client
22
+
23
+ def initialize(api_client = ApiClient.default)
24
+ @api_client = api_client
25
+ end
26
+ # Retrieves the list of technology_types
27
+ # Retrieves a list of all technology_types.
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [TechnologyTypeListResponse]
30
+ def retrieve_technology_types(opts = {})
31
+
32
+ data, _status_code, _headers = retrieve_technology_types_with_http_info(opts)
33
+ data
34
+ end
35
+
36
+ # Retrieves the list of technology_types
37
+ # Retrieves a list of all technology_types.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(TechnologyTypeListResponse, Integer, Hash)>] TechnologyTypeListResponse data, response status code and response headers
40
+ def retrieve_technology_types_with_http_info(opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug 'Calling API: TechnologyTypesApi.retrieve_technology_types ...'
43
+ end
44
+ # resource path
45
+ local_var_path = '/v1/projects/technology_types'
46
+
47
+ # query parameters
48
+ query_params = opts[:query_params] || {}
49
+
50
+ # header parameters
51
+ header_params = opts[:header_params] || {}
52
+ # HTTP header 'Accept' (if needed)
53
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:debug_body]
60
+
61
+ # return_type
62
+ return_type = opts[:debug_return_type] || 'TechnologyTypeListResponse'
63
+
64
+ # auth_names
65
+ auth_names = opts[:debug_auth_names] || ['bearer_auth']
66
+
67
+ new_options = opts.merge(
68
+ :operation => :"TechnologyTypesApi.retrieve_technology_types",
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type
75
+ )
76
+
77
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "API called: TechnologyTypesApi#retrieve_technology_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+ end
84
+ end
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -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.14.0"
34
+ @user_agent = "patch-ruby/1.16.0"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -229,12 +229,12 @@ module Patch
229
229
  def server_settings
230
230
  [
231
231
  {
232
- url: "https://{defaultHost}",
232
+ url: "{defaultUrl}",
233
233
  description: "No description provided",
234
234
  variables: {
235
- defaultHost: {
235
+ defaultUrl: {
236
236
  description: "No description provided",
237
- default_value: "api.patch.io",
237
+ default_value: "https://api.patch.io",
238
238
  }
239
239
  }
240
240
  }
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -101,8 +101,8 @@ module Patch
101
101
  invalid_properties.push('invalid value for "mass_g", mass_g cannot be nil.')
102
102
  end
103
103
 
104
- if @mass_g > 2000000000
105
- invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 2000000000.')
104
+ if @mass_g > 100000000000
105
+ invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 100000000000.')
106
106
  end
107
107
 
108
108
  if @mass_g < 0
@@ -116,7 +116,7 @@ module Patch
116
116
  # @return true if the model is valid
117
117
  def valid?
118
118
  return false if @mass_g.nil?
119
- return false if @mass_g > 2000000000
119
+ return false if @mass_g > 100000000000
120
120
  return false if @mass_g < 0
121
121
  true
122
122
  end
@@ -128,8 +128,8 @@ module Patch
128
128
  fail ArgumentError, 'mass_g cannot be nil'
129
129
  end
130
130
 
131
- if mass_g > 2000000000
132
- fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 2000000000.'
131
+ if mass_g > 100000000000
132
+ fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 100000000000.'
133
133
  end
134
134
 
135
135
  if mass_g < 0
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -102,8 +102,8 @@ module Patch
102
102
  # @return Array for valid properties with the reasons
103
103
  def list_invalid_properties
104
104
  invalid_properties = Array.new
105
- if !@mass_g.nil? && @mass_g > 2000000000
106
- invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 2000000000.')
105
+ if !@mass_g.nil? && @mass_g > 100000000000
106
+ invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 100000000000.')
107
107
  end
108
108
 
109
109
  if !@mass_g.nil? && @mass_g < 0
@@ -120,7 +120,7 @@ module Patch
120
120
  # Check to see if the all the properties in the model are valid
121
121
  # @return true if the model is valid
122
122
  def valid?
123
- return false if !@mass_g.nil? && @mass_g > 2000000000
123
+ return false if !@mass_g.nil? && @mass_g > 100000000000
124
124
  return false if !@mass_g.nil? && @mass_g < 0
125
125
  return false if !@total_price_cents_usd.nil? && @total_price_cents_usd < 1
126
126
  true
@@ -129,8 +129,8 @@ module Patch
129
129
  # Custom attribute writer method with validation
130
130
  # @param [Object] mass_g Value to be assigned
131
131
  def mass_g=(mass_g)
132
- if !mass_g.nil? && mass_g > 2000000000
133
- fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 2000000000.'
132
+ if !mass_g.nil? && mass_g > 100000000000
133
+ fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 100000000000.'
134
134
  end
135
135
 
136
136
  if !mass_g.nil? && mass_g < 0
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10
 
@@ -14,13 +14,22 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Patch
17
- class CreatePreferenceRequest
18
- attr_accessor :project_id
17
+ class Highlight
18
+ # A unique identifier for each highlight.
19
+ attr_accessor :slug
20
+
21
+ # A short string that spotlights a characteristic about the project.
22
+ attr_accessor :title
23
+
24
+ # A URL for the corresponding icon.
25
+ attr_accessor :icon_url
19
26
 
20
27
  # Attribute mapping from ruby-style variable name to JSON key.
21
28
  def self.attribute_map
22
29
  {
23
- :'project_id' => :'project_id'
30
+ :'slug' => :'slug',
31
+ :'title' => :'title',
32
+ :'icon_url' => :'icon_url'
24
33
  }
25
34
  end
26
35
 
@@ -32,7 +41,9 @@ module Patch
32
41
  # Attribute type mapping.
33
42
  def self.openapi_types
34
43
  {
35
- :'project_id' => :'String'
44
+ :'slug' => :'String',
45
+ :'title' => :'String',
46
+ :'icon_url' => :'String'
36
47
  }
37
48
  end
38
49
 
@@ -47,8 +58,8 @@ module Patch
47
58
  # Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
48
59
  # Eg. Order.create_order delegates to OrdersApi.new.create_order
49
60
  def self.method_missing(message, *args, &block)
50
- if Object.const_defined?('Patch::CreatePreferenceRequestsApi::OPERATIONS') && Patch::CreatePreferenceRequestsApi::OPERATIONS.include?(message)
51
- Patch::CreatePreferenceRequestsApi.new.send(message, *args)
61
+ if Object.const_defined?('Patch::HighlightsApi::OPERATIONS') && Patch::HighlightsApi::OPERATIONS.include?(message)
62
+ Patch::HighlightsApi.new.send(message, *args)
52
63
  else
53
64
  super
54
65
  end
@@ -58,19 +69,27 @@ module Patch
58
69
  # @param [Hash] attributes Model attributes in the form of hash
59
70
  def initialize(attributes = {})
60
71
  if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::CreatePreferenceRequest` initialize method"
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::Highlight` initialize method"
62
73
  end
63
74
 
64
75
  # check to see if the attribute exists and convert string to symbol for hash key
65
76
  attributes = attributes.each_with_object({}) { |(k, v), h|
66
77
  if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::CreatePreferenceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::Highlight`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
79
  end
69
80
  h[k.to_sym] = v
70
81
  }
71
82
 
72
- if attributes.key?(:'project_id')
73
- self.project_id = attributes[:'project_id']
83
+ if attributes.key?(:'slug')
84
+ self.slug = attributes[:'slug']
85
+ end
86
+
87
+ if attributes.key?(:'title')
88
+ self.title = attributes[:'title']
89
+ end
90
+
91
+ if attributes.key?(:'icon_url')
92
+ self.icon_url = attributes[:'icon_url']
74
93
  end
75
94
  end
76
95
 
@@ -78,8 +97,16 @@ module Patch
78
97
  # @return Array for valid properties with the reasons
79
98
  def list_invalid_properties
80
99
  invalid_properties = Array.new
81
- if @project_id.nil?
82
- invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
100
+ if @slug.nil?
101
+ invalid_properties.push('invalid value for "slug", slug cannot be nil.')
102
+ end
103
+
104
+ if @title.nil?
105
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
106
+ end
107
+
108
+ if @icon_url.nil?
109
+ invalid_properties.push('invalid value for "icon_url", icon_url cannot be nil.')
83
110
  end
84
111
 
85
112
  invalid_properties
@@ -88,7 +115,9 @@ module Patch
88
115
  # Check to see if the all the properties in the model are valid
89
116
  # @return true if the model is valid
90
117
  def valid?
91
- return false if @project_id.nil?
118
+ return false if @slug.nil?
119
+ return false if @title.nil?
120
+ return false if @icon_url.nil?
92
121
  true
93
122
  end
94
123
 
@@ -97,7 +126,9 @@ module Patch
97
126
  def ==(o)
98
127
  return true if self.equal?(o)
99
128
  self.class == o.class &&
100
- project_id == o.project_id
129
+ slug == o.slug &&
130
+ title == o.title &&
131
+ icon_url == o.icon_url
101
132
  end
102
133
 
103
134
  # @see the `==` method
@@ -109,7 +140,7 @@ module Patch
109
140
  # Calculates hash code according to all attributes.
110
141
  # @return [Integer] Hash code
111
142
  def hash
112
- [project_id].hash
143
+ [slug, title, icon_url].hash
113
144
  end
114
145
 
115
146
  # Builds the object from hash
@@ -4,7 +4,7 @@
4
4
  #The core API used to integrate with Patch's service
5
5
 
6
6
  The version of the OpenAPI document: v1
7
- Contact: developers@usepatch.com
7
+ Contact: engineering@usepatch.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.1
10
10