Skip to content

Commit

Permalink
Remove unused preferences files + update README (#56)
Browse files Browse the repository at this point in the history
* Clean-up for preferences

* Update PR template
  • Loading branch information
pcothenet authored Feb 3, 2022
1 parent 44a5554 commit efe1b4c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 314 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
- [ ] Have you built the gem locally and made queries against it successfully?
- [ ] Did you update the changelog?
- [ ] Did you bump the package version [in the code generator](https://github.com/patch-technology/client-code-generation/blob/main/configs/ruby-config.json#L11-L12)?
- [ ] If endpoints were removed, did you manually remove the corresponding files? (this should be rare)
- [ ] For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
patch_ruby (1.17.0)
patch_ruby (1.17.1)
typhoeus (~> 1.0, >= 1.0.1)

GEM
Expand Down
27 changes: 0 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,33 +188,6 @@ Patch::Project.retrieve_projects(type: type)
minimum_available_mass = 100
Patch::Project.retrieve_projects(minimum_available_mass: minimum_available_mass)
```

### Preferences

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).

[API Reference](https://docs.patch.io/#/?id=preferences)

#### Examples

```ruby
# Create a preference
project_id = 'pro_test_1234' # Pass in the project_id for your preference
Patch::Preference.create_preference(project_id: project_id)

# Retrieve a preference
preference_id = 'pre_test_1234' # Pass in the preferences's id
Patch::Preference.retrieve_preference(preference_id)

# Delete a preference
preference_id = 'pre_test_1234' # Pass in the preferences's id
Patch::Preference.delete_preference(preference_id)

# Retrieve a list of preferences
page = 1 # Pass in which page of preferences you'd like
Patch::Preference.retrieve_preferences(page: page)
```

## Contributing

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!
Expand Down
284 changes: 0 additions & 284 deletions lib/patch_ruby/api/preferences_api.rb

This file was deleted.

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.17.0"
@user_agent = "patch-ruby/1.17.1"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
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.17.0'
VERSION = '1.17.1'
end

0 comments on commit efe1b4c

Please sign in to comment.