Coder Social home page Coder Social logo

approval-api-client-ruby's Introduction

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.