Skip to content

patch-technology/patch-ruby

Repository files navigation

patch_ruby

PatchRuby - the Ruby gem for the Patch API V1

The core API used to integrate with Patch's service

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build patch_ruby.gemspec

Then either install the gem locally:

gem install ./patch_ruby-1.0.0.gem

(for development, run gem install --dev ./patch_ruby-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'patch_ruby', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'patch_ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'patch_ruby'

# Setup authorization
PatchRuby.configure do |config|
  # Configure Bearer authorization: bearer_auth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = PatchRuby::OrdersApi.new
id = 'id_example' # String | 

begin
  #Cancel an order
  result = api_instance.cancel_order(id)
  p result
rescue PatchRuby::ApiError => e
  puts "Exception when calling OrdersApi->cancel_order: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.usepatch.com

Class Method HTTP request Description
PatchRuby::OrdersApi cancel_order PATCH /v1/orders/{id}/cancel Cancel an order
PatchRuby::OrdersApi create_order POST /v1/orders Creates an order
PatchRuby::OrdersApi place_order PATCH /v1/orders/{id}/place Place an order
PatchRuby::OrdersApi retrieve_order GET /v1/orders/{id} Retrieves an order
PatchRuby::OrdersApi retrieve_orders GET /v1/orders Retrieves a list of orders
PatchRuby::PreferencesApi create_preference POST /v1/preferences creates a project preference
PatchRuby::PreferencesApi delete_preference DELETE /v1/preferences/{id} Deletes an organization's preference for a project
PatchRuby::PreferencesApi retrieve_preference GET /v1/preferences/{id} Retrieve the preference
PatchRuby::PreferencesApi retrieve_preferences GET /v1/preferences Retrieves a list of preferences
PatchRuby::ProjectsApi retrieve_project GET /v1/projects/{id} Retrieves a project
PatchRuby::ProjectsApi retrieve_projects GET /v1/projects Retrieves a list of projects

Documentation for Models

Documentation for Authorization

bearer_auth

  • Type: Bearer authentication