class Confy::Api::Orgs

Organizations are owned by users and only (s)he can add/remove teams and projects for that organization. A default organization will be created for every user.

Public Class Methods

new(client) click to toggle source
# File lib/confy/api/orgs.rb, line 8
def initialize(client)
  @client = client
end

Public Instance Methods

list(options = {}) click to toggle source

List all organizations the authenticated user is a member of.

'/orgs' GET

# File lib/confy/api/orgs.rb, line 15
def list(options = {})
  body = options.fetch(:query, {})

  @client.get("/orgs", body, options)
end
retrieve(org, options = {}) click to toggle source

Get the given organization if the authenticated user is a member.

'/orgs/:org' GET

org - Name of the organization

# File lib/confy/api/orgs.rb, line 26
def retrieve(org, options = {})
  body = options.fetch(:query, {})

  @client.get("/orgs/#{org}", body, options)
end
update(org, email, options = {}) click to toggle source

Update the given organization if the authenticated user is the owner. __Email__ is the only thing which can be updated.

'/orgs/:org' PATCH

org - Name of the organization email - Billing email of the organization

# File lib/confy/api/orgs.rb, line 38
def update(org, email, options = {})
  body = options.fetch(:body, {})
  body[:email] = email

  @client.patch("/orgs/#{org}", body, options)
end