Skip to content

Commit 1b05bc9

Browse files
authored
Merge pull request #14 from patch-technology/ta/patch-fee-and-price-type-change
adds patch_fee_cents_usd field
2 parents 939bdd1 + 09524a8 commit 1b05bc9

File tree

16 files changed

+63
-15
lines changed

16 files changed

+63
-15
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010

1111
- [ ] Have you added an integration test for the changes?
1212
- [ ] Have you built the gem locally and made queries against it successfully?
13+
- [ ] Did you update the changelog?
14+
- [ ] Did you bump the package version?
15+
- [ ] For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ jobs:
2626

2727
- name: Run RSpec
2828
env:
29-
PATCH_RUBY_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
29+
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
3030
run: bundle exec rspec

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Layout/SpaceInsideParens:
113113
# EnforcedStyle: single_quotes
114114

115115
# Detect hard tabs, no hard tabs.
116-
Layout/Tab:
116+
Layout/IndentationStyle:
117117
Enabled: true
118118

119119
# Blank lines should not have any spaces.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.2.3] - 2020-09-28
11+
12+
### Added
13+
14+
- `patch_fee_cents_usd` field to `orders`
15+
1016
## [1.2.2] - 2020-09-18
1117

1218
### Added

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
patch_ruby (1.2.2)
4+
patch_ruby (1.2.3)
55
json (~> 2.1, >= 2.1.0)
66
typhoeus (~> 1.0, >= 1.0.1)
77

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SHELL = /bin/bash
2+
3+
build:
4+
rubocop -a && \
5+
bundle install
6+
7+
test:
8+
bundle exec rspec
9+
10+
.PHONY: build test

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require 'patch_ruby'
3838

3939
Patch.configure do |config|
4040
# Configure the Patch gem with your API key here
41-
config.access_token = ENV['PATCH_RUBY_API_KEY']
41+
config.access_token = ENV['SANDBOX_API_KEY']
4242
end
4343
```
4444

@@ -161,7 +161,7 @@ $ bundle install
161161

162162
Set up required environment variables:
163163
```
164-
$ export PATCH_RUBY_API_KEY=<SANDBOX API KEY>
164+
$ export SANDBOX_API_KEY=<SANDBOX API KEY>
165165
```
166166

167167
Run tests:

lib/patch_ruby/models/order.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class Order
2626

2727
attr_accessor :price_cents_usd
2828

29+
attr_accessor :patch_fee_cents_usd
30+
2931
attr_accessor :allocations
3032

3133
attr_accessor :metadata
@@ -61,6 +63,7 @@ def self.attribute_map
6163
:'state' => :'state',
6264
:'allocation_state' => :'allocation_state',
6365
:'price_cents_usd' => :'price_cents_usd',
66+
:'patch_fee_cents_usd' => :'patch_fee_cents_usd',
6467
:'allocations' => :'allocations',
6568
:'metadata' => :'metadata'
6669
}
@@ -75,6 +78,7 @@ def self.openapi_types
7578
:'state' => :'String',
7679
:'allocation_state' => :'String',
7780
:'price_cents_usd' => :'String',
81+
:'patch_fee_cents_usd' => :'String',
7882
:'allocations' => :'Array<Allocation>',
7983
:'metadata' => :'Object'
8084
}
@@ -130,6 +134,10 @@ def initialize(attributes = {})
130134
self.price_cents_usd = attributes[:'price_cents_usd']
131135
end
132136

137+
if attributes.key?(:'patch_fee_cents_usd')
138+
self.patch_fee_cents_usd = attributes[:'patch_fee_cents_usd']
139+
end
140+
133141
if attributes.key?(:'allocations')
134142
if (value = attributes[:'allocations']).is_a?(Array)
135143
self.allocations = value
@@ -252,6 +260,7 @@ def ==(o)
252260
state == o.state &&
253261
allocation_state == o.allocation_state &&
254262
price_cents_usd == o.price_cents_usd &&
263+
patch_fee_cents_usd == o.patch_fee_cents_usd &&
255264
allocations == o.allocations &&
256265
metadata == o.metadata
257266
end
@@ -265,7 +274,7 @@ def eql?(o)
265274
# Calculates hash code according to all attributes.
266275
# @return [Integer] Hash code
267276
def hash
268-
[id, mass_g, production, state, allocation_state, price_cents_usd, allocations, metadata].hash
277+
[id, mass_g, production, state, allocation_state, price_cents_usd, patch_fee_cents_usd, allocations, metadata].hash
269278
end
270279

271280
# Builds the object from hash

lib/patch_ruby/models/photo.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,17 @@ def initialize(attributes = {})
6565
# @return Array for valid properties with the reasons
6666
def list_invalid_properties
6767
invalid_properties = Array.new
68+
if @url.nil?
69+
invalid_properties.push('invalid value for "url", url cannot be nil.')
70+
end
71+
6872
invalid_properties
6973
end
7074

7175
# Check to see if the all the properties in the model are valid
7276
# @return true if the model is valid
7377
def valid?
78+
return false if @url.nil?
7479
true
7580
end
7681

lib/patch_ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module Patch
14-
VERSION = '1.2.2'
14+
VERSION = '1.2.3'
1515
end

0 commit comments

Comments
 (0)