Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpritchett/helloextend-ruby-client
💎 Ruby HTTP API client gem for the extend.com warranty service API
https://github.com/dpritchett/helloextend-ruby-client
api-client ecommerce extend http openapi ruby swagger warranties
Last synced: about 1 month ago
JSON representation
💎 Ruby HTTP API client gem for the extend.com warranty service API
- Host: GitHub
- URL: https://github.com/dpritchett/helloextend-ruby-client
- Owner: dpritchett
- License: mit
- Created: 2020-04-24T15:55:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T18:49:29.000Z (over 4 years ago)
- Last Synced: 2024-11-15T22:03:59.013Z (2 months ago)
- Topics: api-client, ecommerce, extend, http, openapi, ruby, swagger, warranties
- Language: JavaScript
- Homepage: https://rubygems.org/gems/helloextend_api_client
- Size: 3.14 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Extend API autogenerated client in Ruby
[![Gem Version](https://badge.fury.io/rb/helloextend_api_client.svg)](https://badge.fury.io/rb/helloextend_api_client)
[![CircleCI build status for master branch](https://circleci.com/gh/dpritchett/helloextend-ruby-client.svg?style=shield)](https://circleci.com/gh/dpritchett/helloextend-ruby-client)![ruby client demo screencast](./img/extend-ruby-api-demo.gif)
## HOWTO
* Register for an Extend merchant demo account at https://demo.merchants.extend.com/login
* Copy your Extend sandbox credentials from https://demo.merchants.extend.com/dashboard/settings into environment variables:
```bash
# from https://demo.merchants.extend.com/dashboard/settingsexport EXTEND_STORE_ID="my-store-id
export EXTEND_API_KEY="my-api-key"
```* (OPTIONAL — I [checked in a copy already](./reference/openapi_spec.json)) Find the current swagger source from extend's site. This part was hard — they don't explicitly publish it!
* Download that source as `./reference/openapi_spec.json`
* Generate a new ruby client from that spec: `make build-ruby-client` (uses a docker image to generate ruby bindings from the JSON file)
* Build and install the resulting ruby gem:
```console
> make install-gem
cd ./clients/ruby && \
gem build openapi_client.gemspec && \
gem install ./openapi_client-1.0.0.gem
Successfully built RubyGem
Name: openapi_client
Version: 1.0.0
File: openapi_client-1.0.0.gem
Successfully installed openapi_client-1.0.0
Parsing documentation for openapi_client-1.0.0
Installing ri documentation for openapi_client-1.0.0
Done installing documentation for openapi_client after 1 seconds
1 gem installed
```* Execute [the test client](./test_client.rb) to create a new product for your store via the demo(sandbox) API:
```console
> ruby ./test_client.rb
{:brand=>"ACME Brand", :createdAt=>1587580830481.0, :enabled=>false, :title=>"Product title", :updatedAt=>1587580830481.0, :referenceId=>"2895", :plans=>[]}
#
```