Skip to content

Commit 30c8353

Browse files
committed
update filter name
1 parent 5a7920d commit 30c8353

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Adds Sustainable Development Goals (SDGs) field to projects
13-
- Adds filtering to Projects by country, type, remaining inventory
13+
- Adds filtering to Projects by country, type, minimum_available_mass
1414

1515
### Changed
1616

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ When fetching Projects, you can add filters to the query to narrow the result. C
148148

149149
- `country`
150150
- `type`
151-
- `remaining_mass_g`
151+
- `minimum_available_mass`
152152

153153
[API Reference](https://docs.usepatch.com/#/?id=projects)
154154

@@ -163,16 +163,16 @@ page = 1 # Pass in which page of projects you'd like
163163
Patch::Project.retrieve_projects(page: page)
164164

165165
# Retrieve all projects from the United States
166-
country = 'US' # Pass in the country code of the country you'd like to get Projects from
166+
country = 'US'
167167
Patch::Project.retrieve_projects(country: country)
168168

169169
# Retrieve all biomass projects
170-
type = 'biomass' # Pass in the type of Projects you'd like to get
170+
type = 'biomass'
171171
Patch::Project.retrieve_projects(type: type)
172172

173173
# Retrieve a list of projects with at least 100 grams of available offsets
174-
remaining_mass_g = 100 # Pass in the type of Projects you'd like to get
175-
Patch::Project.retrieve_projects(remaining_mass_g: remaining_mass_g)
174+
minimum_available_mass = 100
175+
Patch::Project.retrieve_projects(minimum_available_mass: minimum_available_mass)
176176
```
177177

178178
### Preferences

lib/patch_ruby/api/projects_api.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def initialize(api_client = ApiClient.default)
2525
@api_client = api_client
2626
end
2727
# Retrieves a project
28-
# Retrieves a project available on Patch's platform.
29-
# @param id [String]
28+
# Retrieves a project available on Patch's platform.
29+
# @param id [String]
3030
# @param [Hash] opts the optional parameters
3131
# @return [ProjectResponse]
3232
def retrieve_project(id, opts = {})
@@ -35,8 +35,8 @@ def retrieve_project(id, opts = {})
3535
end
3636

3737
# Retrieves a project
38-
# Retrieves a project available on Patch's platform.
39-
# @param id [String]
38+
# Retrieves a project available on Patch's platform.
39+
# @param id [String]
4040
# @param [Hash] opts the optional parameters
4141
# @return [Array<(ProjectResponse, Integer, Hash)>] ProjectResponse data, response status code and response headers
4242
def retrieve_project_with_http_info(id, opts = {})
@@ -62,10 +62,10 @@ def retrieve_project_with_http_info(id, opts = {})
6262
form_params = opts[:form_params] || {}
6363

6464
# http body (model)
65-
post_body = opts[:body]
65+
post_body = opts[:body]
6666

6767
# return_type
68-
return_type = opts[:return_type] || 'ProjectResponse'
68+
return_type = opts[:return_type] || 'ProjectResponse'
6969

7070
# auth_names
7171
auth_names = opts[:auth_names] || ['bearer_auth']
@@ -87,25 +87,25 @@ def retrieve_project_with_http_info(id, opts = {})
8787
end
8888

8989
# Retrieves a list of projects
90-
# Retrieves a list of projects available for purchase on Patch's platform.
90+
# Retrieves a list of projects available for purchase on Patch's platform.
9191
# @param [Hash] opts the optional parameters
92-
# @option opts [Integer] :page
93-
# @option opts [String] :country
94-
# @option opts [String] :type
95-
# @option opts [Integer] :remainaing_mass_g
92+
# @option opts [Integer] :page
93+
# @option opts [String] :country
94+
# @option opts [String] :type
95+
# @option opts [Integer] :minimum_available_mass
9696
# @return [ProjectListResponse]
9797
def retrieve_projects(opts = {})
9898
data, _status_code, _headers = retrieve_projects_with_http_info(opts)
9999
data
100100
end
101101

102102
# Retrieves a list of projects
103-
# Retrieves a list of projects available for purchase on Patch&#39;s platform.
103+
# Retrieves a list of projects available for purchase on Patch&#39;s platform.
104104
# @param [Hash] opts the optional parameters
105-
# @option opts [Integer] :page
106-
# @option opts [String] :country
107-
# @option opts [String] :type
108-
# @option opts [Integer] :remainaing_mass_g
105+
# @option opts [Integer] :page
106+
# @option opts [String] :country
107+
# @option opts [String] :type
108+
# @option opts [Integer] :minimum_available_mass
109109
# @return [Array<(ProjectListResponse, Integer, Hash)>] ProjectListResponse data, response status code and response headers
110110
def retrieve_projects_with_http_info(opts = {})
111111
if @api_client.config.debugging
@@ -119,7 +119,7 @@ def retrieve_projects_with_http_info(opts = {})
119119
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
120120
query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
121121
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
122-
query_params[:'remainaing_mass_g'] = opts[:'remainaing_mass_g'] if !opts[:'remainaing_mass_g'].nil?
122+
query_params[:'minimum_available_mass'] = opts[:'minimum_available_mass'] if !opts[:'minimum_available_mass'].nil?
123123

124124
# header parameters
125125
header_params = opts[:header_params] || {}
@@ -130,10 +130,10 @@ def retrieve_projects_with_http_info(opts = {})
130130
form_params = opts[:form_params] || {}
131131

132132
# http body (model)
133-
post_body = opts[:body]
133+
post_body = opts[:body]
134134

135135
# return_type
136-
return_type = opts[:return_type] || 'ProjectListResponse'
136+
return_type = opts[:return_type] || 'ProjectListResponse'
137137

138138
# auth_names
139139
auth_names = opts[:auth_names] || ['bearer_auth']

spec/integration/projects_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
expect(project.type).to eq type
3636
end
3737

38-
remaining_mass_g = 100
39-
projects = Patch::Project.retrieve_projects(remaining_mass_g: remaining_mass_g)
38+
minimum_available_mass = 100
39+
projects = Patch::Project.retrieve_projects(minimum_available_mass: minimum_available_mass)
4040
projects.data.map do |project|
41-
expect(project.remaining_mass_g >= remaining_mass_g).to be true
41+
expect(project.remaining_mass_g >= minimum_available_mass).to be true
4242
end
4343
end
4444

0 commit comments

Comments
 (0)