Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

customerlobby / inspection_support_network   ruby

Repository URL to install this package:

  README.md

InspectionSupportNetwork

A Ruby wrapper for the InspectionSupportNetwork REST API.

Installation

Add this line to your application's Gemfile:

gem 'inspection_support_network'

And then execute:

$ bundle

Or install it yourself as:

$ gem install inspection_support_network

Usage

Configuration

Before you can make calls to InspectionSupportNetwork you must configure the library with valid login credentials. You can request they be generated by InspectionSupportNetwork.

There are two ways to configure the gem. You can pass a hash of configuration options when you create a client, or you can use a configure block.

client = InspectionSupportNetwork.client(
  username: 'bsmith',
  password: 'password',
  company_name: 'test'
  test_mode: true
)

above code will only work for single interaction with InspectionSupportNetwork api for consecutive interactions use the below method

InspectionSupportNetwork.configure do |config|
  config.username = '0c6dbf44-b8cc-4e7d-940d-85f7efdb7d3b'
  config.password = '5d5e68c8-201a-4423-8564-853575fdca70'
  config.company_name = 'bulldoginspect'
  config.test_mode = false
end

client = InspectionSupportNetwork.client

Example Calls

# Get all clients
client.clients

# Get clients after a specified date 
client.clients(after: Date.current.last_month)

# Get clients by search
client.clients_search(q: "John Doe")

# Find a specific client by UUID
client.client("433e88a4-c66d-5015-89d7-f9bf99a0398a")

# Delete specific client
client.delete_client("433e88a4-c66d-5015-89d7-f9bf99a0398a"

# Get all Orders
client.orders

# Get orders after a specified date 
client.orders(after: Date.current.last_month)
  
# Get Orders by search
client.orders_search(address: "2050 Bamako Place", reportnumber: "BSTL0011387", datetime: DateTime.current.last_week)

# Find a specific Order by UUID
client.order("c95937a6-4441-4807-9dce-e0db7c3da0a9")
    
# Get WebDelivery Url for a specific order
client.order_webdelivery_url("c95937a6-4441-4807-9dce-e0db7c3da0a9")
    
# Complete a particular order
client.complete_order("c95937a6-4441-4807-9dce-e0db7c3da0a9", reportnumber: "CAG#018576")

# Get all users
client.users
    
# Get Specific user
client.user("d0feb7f3-5e83-5a2f-b1ba-3634d1f6cad8")
    
# Get Logged in user
client.me

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request