class Readiness::Calendly::Organizations

@since 1.0.12
@author Jason Colyer
Defines the class Organizations within the module {Readiness::Calendly}.
#

def self.current(client)

Other tags:
    See: https://developer.calendly.com/api-docs/848e5e20591ee-organization - Calendly API > Organizations > Organization

Returns:
  • (Object) - An instance of {Readiness::Calendly::Organizations}

Parameters:
  • client (Object) -- An instance of {Readiness::Calendly::Client}

Other tags:
    Since: - 1.0.12

Other tags:
    Author: - Jason Colyer
def self.current(client)
  user = Users.current(client)
  Organizations.find(client, user.current_organization.split('/').last)
end

def self.find(client, oid)

Other tags:
    See: https://developer.calendly.com/api-docs/848e5e20591ee-organization - Calendly API > Organizations > Organization

Returns:
  • (Object) - An instance of {Readiness::Calendly::Organizations}

Parameters:
  • oid (String) -- The organization ID to find
  • client (Object) -- An instance of {Readiness::Calendly::Client}

Other tags:
    Since: - 1.0.12

Other tags:
    Author: - Jason Colyer
def self.find(client, oid)
  response = client.connection.get "organizations/#{oid}"
  handle_request_error(0, 'Calendly', response.status,  { action: 'get', id: oid }) unless response.status == 200
  Organizations.new(Oj.load(response.body)['resource'])
end

def self.find!(client, oid)

Other tags:
    See: https://developer.calendly.com/api-docs/848e5e20591ee-organization - Calendly API > Organizations > Organization

Returns:
  • (Object) - An instance of {Readiness::Calendly::Organizations}

Parameters:
  • oid (String) -- The organization ID to find
  • client (Object) -- An instance of {Readiness::Calendly::Client}

Other tags:
    Since: - 1.0.12

Other tags:
    Author: - Jason Colyer
def self.find!(client, oid)
  response = client.connection.get "organizations/#{oid}"
  handle_request_error(1, 'Calendly', response.status, { action: 'Find organization', id: oid }) unless response.status == 200
  Organizations.new(Oj.load(response.body)['resource'])
end

def self.members(client, organization)

Other tags:
    See: https://developer.calendly.com/api-docs/eaed2e61a6bc3-list-organization-memberships - Calendly API > Organizations > List Organization Memberships

Returns:
  • (Array) -

Parameters:
  • organization (String) -- An instance of {Readiness::Calendly::Organizations}
  • client (Object) -- An instance of {Readiness::Calendly::Client}

Other tags:
    Since: - 1.0.12

Other tags:
    Author: - Jason Colyer
def self.members(client, organization)
  Readiness::Calendly::OrganizationMemberships.list(client, organization)
end

def initialize(object = {})

Parameters:
  • object (Object) -- An instance of {Readiness::Calendly::Organizations}

Other tags:
    Since: - 1.0.12

Other tags:
    Author: - Jason Colyer
def initialize(object = {})
  @created_at = object['created_at']
  @name = object['name']
  @plan = object['plan']
  @stage = object['stage']
  @updated_at = object['updated_at']
  @uri = object['uri']
end