This is the official Shiro API Ruby library gem maintained by OpenShiro. The Shiro Ruby library provides convenient access to the Stripe API from applications written in the Ruby language.
See the API docs and also this post on Getting Started with the Shiro API.
To install the gem:
gem install shiro
Include it in your Rails gemfile with:
bundle add shiro
or directly in the gemfile:
gem "shiro", "~> 0.1.1"
The library needs to be configured with your account's api key which is available in your Shiro account under API Keys.
require "shiro"
Shiro.configure do |config|
config[:api_key] = "your_api_key..."
end
List deployments
deployments = Shiro::Deployment.list
Retrieve a single deployment
deployment = Shiro::Deployment.retrieve("dpmt_lWokJnPAwQCeV2ZWovjG7BNr")
Update a deployment
updated_deployment = Shiro::Deployment.update("dpmt_lWokJnPAwQCeV2ZWovjG7BNr", { name: "New Deployment Name" })
Generate a completion for a deployment
content = Shiro::GenerateCompletion.create("dpmt_lWokJnPAwQCeV2ZWovjG7BNr",
environment: "PRODUCTION",
prompt_id: "prmt_WnAlbE5lEMtxAG2Qly6jo2dV", # optional
input_variables: { "key": "value" }
)
Retrieve current user's details
current_user = Shiro::Me.retrieve
Delete current user's account
response = Shiro::Me.destroy
List prompts
prompts = Shiro::Prompt.list
Retrieve a single prompt
prompt = Shiro::Prompt.retrieve("prmt_WnAlbE5lEMtxAG2Qly6jo2dV")
New features and bug fixes are released on the latest major version of the Shiro Python library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
Run the tests:
rake test