Class: SupportOps::Calendly::Organizations

Inherits:
Base
  • Object
show all
Defined in:
lib/support_ops_calendly/calendly/organizations.rb

Overview

Defines the module Organizations within the module SupportOps::Calendly.

Author:

  • Jason Colyer

Since:

  • 1.0.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attributes, client, #client=, configure, define_attributes, #delete!, #find, #find!, #initialize, readonly_attributes, #save!, #store_original_attributes

Constructor Details

This class inherits a constructor from SupportOps::Calendly::Base

Instance Attribute Details

#created_atString

Timestamp of when the organization was created

Returns:

  • (String)

    the current value of created_at



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def created_at
  @created_at
end

#kindString

Indicates whether the organization is a single-user or multiple-user organization

Returns:

  • (String)

    the current value of kind



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def kind
  @kind
end

#nameString

The Organization name (in human-readable format)

Returns:

  • (String)

    the current value of name



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def name
  @name
end

#planString

Active subscription plan or trial plan

Returns:

  • (String)

    the current value of plan



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def plan
  @plan
end

#stageString

Current stage of organization

Returns:

  • (String)

    the current value of stage



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def stage
  @stage
end

#updated_atString

Timestamp of when the organization was created or updated

Returns:

  • (String)

    the current value of updated_at



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def updated_at
  @updated_at
end

#uriString

Canonical resource reference

Returns:

  • (String)

    the current value of uri



19
20
21
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 19

def uri
  @uri
end

Class Method Details

.currentObject

Returns basic information about your user’s current organization

Examples:

require 'support_ops_calendly'

SupportOps::Calendly::Configuration.configure do |config|
  config.token = 'abc123'
end

org = SupportOps::Calendly::Organizations.current
pp org.name
# => "Sales Team"

Author:

  • Jason Colyer

Since:

  • 1.0.0



79
80
81
82
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 79

def self.current
  user = Users.current
  Organizations.get!(user.current_organization.split('/').last)
end

.get(object) ⇒ Object

Returns information about a specified Organization

Examples:

require 'support_ops_calendly'

SupportOps::Calendly::Configuration.configure do |config|
  config.token = 'abc123'
end

org = SupportOps::Calendly::Organizations.get('BBBBBBBBBBBBBBBB')
pp org.name
# => "Sales Team"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



102
103
104
105
106
107
108
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 102

def self.get(object)
  if object.is_a? Organizations
    Organizations.new(uri: uri).find
  else
    Organizations.new(uri: object).find
  end
end

.get!(object) ⇒ Object

Returns information about a specified Organization

Examples:

require 'support_ops_calendly'

SupportOps::Calendly::Configuration.configure do |config|
  config.token = 'abc123'
end

org = SupportOps::Calendly::Organizations.get!('BBBBBBBBBBBBBBBB')
pp org.name
# => "Sales Team"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



128
129
130
131
132
133
134
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 128

def self.get!(object)
  if object.is_a? Organizations
    Organizations.new(uri: uri).find!
  else
    Organizations.new(uri: object).find!
  end
end

Instance Method Details

#membersArray

Note:

This is inherited from Base#members

Returns the organization memberships of an organization

Examples:

require 'support_ops_calendly'

SupportOps::Calendly::Configuration.configure do |config|
  config.token = 'abc123'
end

org = SupportOps::Calendly::Organizations.current
members = org.members
pp members.count
#=> 13
pp members.first.user.uuid
#=> "AAAAAAAAAAAAAAAA"

Returns:

  • (Array)

Author:

  • Jason Colyer

Since:

  • 1.0.0



20
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 20

def members; end

#uuidString

Note:

This is inherited from Base#uuid

Returns the UUID of an organization

Examples:

require 'support_ops_calendly'

SupportOps::Calendly::Configuration.configure do |config|
  config.token = 'abc123'
end

org = SupportOps::Calendly::Organizations.current
pp org.uuid
#=> "BBBBBBBBBBBBBBBB"

Returns:

  • (String)

    The UUID

Author:

  • Jason Colyer

Since:

  • 1.0.0



17
# File 'lib/support_ops_calendly/calendly/organizations.rb', line 17

def uuid; end