class SemaphoreClient::Api::Org

Public Class Methods

new(http_client) click to toggle source
# File lib/semaphore_client/api/org.rb, line 4
def initialize(http_client)
  @http_client = http_client
end

Public Instance Methods

get(id, params = nil, options = {}) click to toggle source
# File lib/semaphore_client/api/org.rb, line 22
def get(id, params = nil, options = {})
  get!(id, params, options)
rescue SemaphoreClient::Exceptions::ResponseError
end
get!(id, params = nil, options = {}) click to toggle source
# File lib/semaphore_client/api/org.rb, line 27
def get!(id, params = nil, options = {})
  path = "/orgs/#{id}"
  response = @http_client.get(path, params = {})

  SemaphoreClient::Model::Org.load(response.body)
end
list(params = nil, options = {}) click to toggle source
# File lib/semaphore_client/api/org.rb, line 9
def list(params = nil, options = {})
  list!(params, options)
rescue SemaphoreClient::Exceptions::ResponseError
end
list!(params = nil, options = {}) click to toggle source
# File lib/semaphore_client/api/org.rb, line 14
def list!(params = nil, options = {})
  path = "/orgs"

  @http_client.get(path, params, options).body.map { |e| SemaphoreClient::Model::Org.load(e) }
end