approval-api-client-ruby
ApprovalApiClient - the Ruby gem for the Insights Service Approval APIs
APIs to query approval service
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- 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 approval-api-client-ruby.gemspec
Then either install the gem locally:
gem install ./approval-api-client-ruby-1.0.0.gem
(for development, run gem install --dev ./approval-api-client-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 'approval-api-client-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 'approval-api-client-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 'approval-api-client-ruby'
# Setup authorization
ApprovalApiClient.configure do |config|
# Configure API key authorization: APIKey_auth
config.api_key['x-rh-identity'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['x-rh-identity'] = 'Bearer'
# Configure HTTP basic authorization: Basic_auth
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = ApprovalApiClient::ActionApi.new
stage_id = 56 # Integer | Id of stage
action_in = ApprovalApiClient::ActionIn.new # ActionIn | Action object that will be added
begin
#Add an action to a given stage
result = api_instance.create_action(stage_id, action_in)
p result
rescue ApprovalApiClient::ApiError => e
puts "Exception when calling ActionApi->create_action: #{e}"
end
Documentation for API Endpoints
All URIs are relative to http://localhost/api/approval
Class | Method | HTTP request | Description |
---|---|---|---|
ApprovalApiClient::ActionApi | create_action | POST /stages/{stage_id}/actions | Add an action to a given stage |
ApprovalApiClient::ActionApi | list_actions_by_stage | GET /stages/{stage_id}/actions | Return actions in a given stage |
ApprovalApiClient::ActionApi | show_action | GET /actions/{id} | Return an user action by id |
ApprovalApiClient::RequestApi | create_request | POST /workflows/{workflow_id}/requests | Add an approval request by given parameters |
ApprovalApiClient::RequestApi | list_requests | GET /requests | Return an array of approval requests |
ApprovalApiClient::RequestApi | list_requests_by_workflow | GET /workflows/{workflow_id}/requests | Return approval requests by given workflow id |
ApprovalApiClient::RequestApi | show_request | GET /requests/{id} | Return an approval request by given id |
ApprovalApiClient::StageApi | list_stages_by_request | GET /requests/{request_id}/stages | Return an array of stages by given request id |
ApprovalApiClient::StageApi | show_stage | GET /stages/{id} | Return an approval stage by given id |
ApprovalApiClient::TemplateApi | list_templates | GET /templates | Return all templates |
ApprovalApiClient::TemplateApi | show_template | GET /templates/{id} | Return a template by given id |
ApprovalApiClient::WorkflowApi | add_workflow_to_template | POST /templates/{template_id}/workflows | Add a workflow by given template id |
ApprovalApiClient::WorkflowApi | destroy_workflow | DELETE /workflows/{id} | Delete approval workflow by given id |
ApprovalApiClient::WorkflowApi | list_workflows | GET /workflows | Return all approval workflows |
ApprovalApiClient::WorkflowApi | list_workflows_by_template | GET /templates/{template_id}/workflows | Return an array of workflows by given template id |
ApprovalApiClient::WorkflowApi | show_workflow | GET /workflows/{id} | Return an approval workflow by given id |
ApprovalApiClient::WorkflowApi | update_workflow | PATCH /workflows/{id} | Update an approval workflow by given id |
Documentation for Models
- ApprovalApiClient::ActionIn
- ApprovalApiClient::ActionOut
- ApprovalApiClient::ActionOutCollection
- ApprovalApiClient::CollectionLinks
- ApprovalApiClient::CollectionMetadata
- ApprovalApiClient::RequestIn
- ApprovalApiClient::RequestOut
- ApprovalApiClient::RequestOutCollection
- ApprovalApiClient::StageOut
- ApprovalApiClient::StageOutCollection
- ApprovalApiClient::TemplateOut
- ApprovalApiClient::TemplateOutCollection
- ApprovalApiClient::WorkflowIn
- ApprovalApiClient::WorkflowOut
- ApprovalApiClient::WorkflowOutCollection
Documentation for Authorization
APIKey_auth
- Type: API key
- API key parameter name: x-rh-identity
- Location: HTTP header
Basic_auth
- Type: HTTP basic authentication
License
This project is available as open source under the terms of the Apache License 2.0.