Class: SupportOps::Calendly::Users

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

Overview

Defines the module Users 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, #members, readonly_attributes, #save!, #store_original_attributes

Constructor Details

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

Instance Attribute Details

#avatar_urlString

The URL of the user’s avatar (image)

Returns:

  • (String)

    the current value of avatar_url



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def avatar_url
  @avatar_url
end

#created_atString

The moment when the user’s record was created (e.g. “2020-01-02T03:04:05.678123Z”)

Returns:

  • (String)

    the current value of created_at



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def created_at
  @created_at
end

#current_organizationString

A unique reference to the user’s current organization

Returns:

  • (String)

    the current value of current_organization



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def current_organization
  @current_organization
end

#emailString

The user’s email address

Returns:

  • (String)

    the current value of email



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def email
  @email
end

#localeString

The user’s language preference

Returns:

  • (String)

    the current value of locale



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def locale
  @locale
end

#nameString

The user’s name (human-readable format)

Returns:

  • (String)

    the current value of name



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def name
  @name
end

#resource_typeString

Resource type to support polymorphic associations.

Returns:

  • (String)

    the current value of resource_type



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def resource_type
  @resource_type
end

#scheduling_urlString

The URL of the user’s Calendly landing page (that lists all the user’s event types)

Returns:

  • (String)

    the current value of scheduling_url



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def scheduling_url
  @scheduling_url
end

#slugString

The portion of URL for the user’s scheduling page (where invitees book sessions), rendered in a human-readable format

Returns:

  • (String)

    the current value of slug



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def slug
  @slug
end

#time_notationString

Time notation used by the user; accepts “12h” or “24h” as a value.

Returns:

  • (String)

    the current value of time_notation



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def time_notation
  @time_notation
end

#timezoneString

The time zone to use when presenting time to the user

Returns:

  • (String)

    the current value of timezone



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def timezone
  @timezone
end

#updated_atString

The moment when the user’s record was last updated (e.g. “2020-01-02T03:04:05.678123Z”)

Returns:

  • (String)

    the current value of updated_at



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def updated_at
  @updated_at
end

#uriString

Canonical reference (unique identifier) for the user

Returns:

  • (String)

    the current value of uri



25
26
27
# File 'lib/support_ops_calendly/calendly/users.rb', line 25

def uri
  @uri
end

Class Method Details

.currentObject

Returns basic information about your user account.

Examples:

require 'support_ops_calendly'

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

user = SupportOps::Calendly::Users.current
pp user.email
# => "admin@example.com"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



70
71
72
73
74
# File 'lib/support_ops_calendly/calendly/users.rb', line 70

def self.current
  response = client.connection.get('users/me')
  body = Oj.load(response.body)
  Users.new(body['resource'])
end

.get(object) ⇒ Object

Returns information about a specified User

Examples:

require 'support_ops_calendly'

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

user = SupportOps::Calendly::Users.get('AAAAAAAAAAAAAAAA')
pp user.email
# => "admin@example.com"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



94
95
96
97
98
99
100
# File 'lib/support_ops_calendly/calendly/users.rb', line 94

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

.get!(object) ⇒ Object

Returns information about a specified User

Examples:

require 'support_ops_calendly'

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

user = SupportOps::Calendly::Users.get!('AAAAAAAAAAAAAAAA')
pp user.email
# => "admin@example.com"

See Also:

Author:

  • Jason Colyer

Since:

  • 1.0.0



120
121
122
123
124
125
126
# File 'lib/support_ops_calendly/calendly/users.rb', line 120

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

Instance Method Details

#uuidString

Note:

This is inherited from Base#uuid

Returns the UUID of a user

Examples:

require 'support_ops_calendly'

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

user = SupportOps::Calendly::Users.current
pp user.uuid
#=> "AAAAAAAAAAAAAAAA"

Returns:

  • (String)

    The UUID

Author:

  • Jason Colyer

Since:

  • 1.0.0



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

def uuid; end