Skip to content

Commit

Permalink
Adds the verifier field to the project response (#49)
Browse files Browse the repository at this point in the history
* Add verifier field

* Add verifier field
  • Loading branch information
pcothenet authored Nov 4, 2021
1 parent 4cc8d07 commit b7623d1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/health_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Notify slack
uses: kpritam/slack-job-status-action@v1
with:
if: failure()
if: ${{ failure() }}
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel: eng-notifications
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.15.1] - 2021-11-04

### Added

- Adds verifier to project responses

## [1.15.0] - 2021-10-04

### Added
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
patch_ruby (1.15.0)
patch_ruby (1.15.1)
typhoeus (~> 1.0, >= 1.0.1)

GEM
Expand All @@ -18,7 +18,7 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.1.9)
diff-lcs (1.4.4)
ethon (0.14.0)
ethon (0.15.0)
ffi (>= 1.15.0)
factory_bot (6.2.0)
activesupport (>= 5.0.0)
Expand Down
2 changes: 1 addition & 1 deletion lib/patch_ruby/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ApiClient
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
def initialize(config = Configuration.default)
@config = config
@user_agent = "patch-ruby/1.15.0"
@user_agent = "patch-ruby/1.15.1"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
Expand Down
2 changes: 1 addition & 1 deletion lib/patch_ruby/models/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Order
# The current state of the order.
attr_accessor :state

# The current state of the allocated carbon offsets of the order.
# DEPRECATED. Indicates if the order has been fully allocated to projects.
attr_accessor :allocation_state

# The total price in cents USD of the carbon offsets purchased through this order.
Expand Down
14 changes: 12 additions & 2 deletions lib/patch_ruby/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ class Project
# The remaining mass in grams available for purchase for this project.
attr_accessor :remaining_mass_g

# An object returning the Standard associated with this project.
# The name of the project verifier. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project.
attr_accessor :verifier

# An object returning the Standard associated with this project. Standards provide guidance on GHG quantification, monitoring, and reporting. Standards can include protocols/methodologies and guidance documents.
attr_accessor :standard

# An array returning the UN Sustainable Development Goals associated with this project.
Expand Down Expand Up @@ -107,6 +110,7 @@ def self.attribute_map
:'photos' => :'photos',
:'average_price_per_tonne_cents_usd' => :'average_price_per_tonne_cents_usd',
:'remaining_mass_g' => :'remaining_mass_g',
:'verifier' => :'verifier',
:'standard' => :'standard',
:'sdgs' => :'sdgs',
:'tagline' => :'tagline',
Expand Down Expand Up @@ -136,6 +140,7 @@ def self.openapi_types
:'photos' => :'Array<Photo>',
:'average_price_per_tonne_cents_usd' => :'Integer',
:'remaining_mass_g' => :'Integer',
:'verifier' => :'String',
:'standard' => :'Standard',
:'sdgs' => :'Array<Sdg>',
:'tagline' => :'String',
Expand Down Expand Up @@ -240,6 +245,10 @@ def initialize(attributes = {})
self.remaining_mass_g = attributes[:'remaining_mass_g']
end

if attributes.key?(:'verifier')
self.verifier = attributes[:'verifier']
end

if attributes.key?(:'standard')
self.standard = attributes[:'standard']
end
Expand Down Expand Up @@ -348,6 +357,7 @@ def ==(o)
photos == o.photos &&
average_price_per_tonne_cents_usd == o.average_price_per_tonne_cents_usd &&
remaining_mass_g == o.remaining_mass_g &&
verifier == o.verifier &&
standard == o.standard &&
sdgs == o.sdgs &&
tagline == o.tagline &&
Expand All @@ -363,7 +373,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, standard, sdgs, tagline, technology_type].hash
[id, production, name, description, type, mechanism, country, state, latitude, longitude, developer, photos, average_price_per_tonne_cents_usd, remaining_mass_g, verifier, standard, sdgs, tagline, technology_type].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion lib/patch_ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Patch
VERSION = '1.15.0'
VERSION = '1.15.1'
end
1 change: 0 additions & 1 deletion spec/integration/projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
expect(project.average_price_per_tonne_cents_usd)
.to be_an_instance_of(Integer)
expect(project.remaining_mass_g).to be_an_instance_of(Integer)
expect(project.state).to be_an_instance_of(String)
expect(project.longitude).to be_an_instance_of(Float)
expect(project.latitude).to be_an_instance_of(Float)

Expand Down

0 comments on commit b7623d1

Please sign in to comment.