/sard-api-ruby-client

A ruby client for accessing the SARD API

Primary LanguageRuby

swagger_client

SwaggerClient - the Ruby gem for the SARD API

This is the SARD API. For more information visit <a href="https://www.sardjv.co.uk\">www.sardjv.co.uk.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build swagger_client.gemspec

Then either install the gem locally:

gem install ./swagger_client-1.0.0.gem

(for development, run gem install --dev ./swagger_client-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 'swagger_client', '~> 1.0.0'

Install from Git

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

gem 'swagger_client', :git => 'https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO.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 'swagger_client'

# Setup authorization
SwaggerClient.configure do |config|
  # Configure API key authorization: apiEmail
  config.api_key['X-API-EMAIL'] = '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-API-EMAIL'] = 'Bearer'

  # Configure API key authorization: apiToken
  config.api_key['X-API-TOKEN'] = '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-API-TOKEN'] = 'Bearer'
end

api_instance = SwaggerClient::CouncilMembershipApi.new

opts = { 
  page: 'page_example', # String | 
  per_page: 'per_page_example', # String | 
  filter_user_id: 'filter_user_id_example' # String | 
}

begin
  #council memberships index
  result = api_instance.api_v1_council_memberships_get(opts)
  p result
rescue SwaggerClient::ApiError => e
  puts "Exception when calling CouncilMembershipApi->api_v1_council_memberships_get: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
SwaggerClient::CouncilMembershipApi api_v1_council_memberships_get GET /api/v1/council_memberships council memberships index
SwaggerClient::CouncilMembershipApi api_v1_council_memberships_id_get GET /api/v1/council_memberships/{id} show council membership
SwaggerClient::CouncilMembershipApi api_v1_council_memberships_id_patch PATCH /api/v1/council_memberships/{id} update council membership
SwaggerClient::CouncilMembershipApi api_v1_council_memberships_post POST /api/v1/council_memberships create council membership
SwaggerClient::EleaveCalendarApi api_v1_eleave_calendars_get GET /api/v1/eleave_calendars eleave calendars index
SwaggerClient::EleaveCalendarApi api_v1_eleave_calendars_id_get GET /api/v1/eleave_calendars/{id} show eleave calendar
SwaggerClient::EleaveCalendarApi api_v1_eleave_calendars_id_patch PATCH /api/v1/eleave_calendars/{id} update eleave calendar
SwaggerClient::EleaveCalendarApi api_v1_eleave_calendars_post POST /api/v1/eleave_calendars create eleave calendar
SwaggerClient::OnlineJobPlanApi api_v1_online_job_plans_get GET /api/v1/online_job_plans online job plans index
SwaggerClient::OnlineJobPlanApi api_v1_online_job_plans_id_get GET /api/v1/online_job_plans/{id} show job plan
SwaggerClient::TenantsApi api_v1_tenants_get GET /api/v1/tenants tenants index
SwaggerClient::TenantsApi api_v1_tenants_id_get GET /api/v1/tenants/{id} show tenant
SwaggerClient::UsersApi api_v1_users_get GET /api/v1/users users index
SwaggerClient::UsersApi api_v1_users_id_get GET /api/v1/users/{id} show user
SwaggerClient::UsersApi api_v1_users_id_patch PATCH /api/v1/users/{id} update user
SwaggerClient::UsersApi api_v1_users_post POST /api/v1/users create user

Documentation for Models

Documentation for Authorization

apiEmail

  • Type: API key
  • API key parameter name: X-API-EMAIL
  • Location: HTTP header

apiToken

  • Type: API key
  • API key parameter name: X-API-TOKEN
  • Location: HTTP header