Class: BundleUp::Unify::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/bundleup/unify.rb,
sig/bundleup/unify.rbs

Overview

Client for Unify API endpoints.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, connection_id) ⇒ Client

Returns a new instance of Client.

Parameters:

  • api_key (String)
  • connection_id (String)


9
10
11
12
13
14
15
16
17
18
# File 'lib/bundleup/unify.rb', line 9

def initialize(api_key, connection_id)
  @ticketing = BundleUp::Unify::Ticketing.new(api_key, connection_id)
  @chat = BundleUp::Unify::Chat.new(api_key, connection_id)
  @git = BundleUp::Unify::Git.new(api_key, connection_id)
  @crm = BundleUp::Unify::CRM.new(api_key, connection_id)
  @drive = BundleUp::Unify::Drive.new(api_key, connection_id)
  @calendar = BundleUp::Unify::Calendar.new(api_key, connection_id)
  @api_key = api_key
  @connection_id = connection_id
end

Instance Attribute Details

#api_keyString (readonly)

Returns the value of attribute api_key.

Returns:

  • (String)


7
8
9
# File 'lib/bundleup/unify.rb', line 7

def api_key
  @api_key
end

#connection_idString (readonly)

Returns the value of attribute connection_id.

Returns:

  • (String)


7
8
9
# File 'lib/bundleup/unify.rb', line 7

def connection_id
  @connection_id
end

Instance Method Details

#calendarCalendar

Access the Calendar API for the connection.

Returns:



46
47
48
# File 'lib/bundleup/unify.rb', line 46

def calendar
  @calendar ||= BundleUp::Unify::Calendar.new(api_key, connection_id)
end

#chatChat

Access the Chat API for the connection.

Returns:



21
22
23
# File 'lib/bundleup/unify.rb', line 21

def chat
  @chat ||= BundleUp::Unify::Chat.new(api_key, connection_id)
end

#crmCRM

Access the CRM API for the connection.

Returns:



31
32
33
# File 'lib/bundleup/unify.rb', line 31

def crm
  @crm ||= BundleUp::Unify::CRM.new(api_key, connection_id)
end

#driveDrive

Access the Drive API for the connection.

Returns:



41
42
43
# File 'lib/bundleup/unify.rb', line 41

def drive
  @drive ||= BundleUp::Unify::Drive.new(api_key, connection_id)
end

#gitGit

Access the Git API for the connection.

Returns:



26
27
28
# File 'lib/bundleup/unify.rb', line 26

def git
  @git ||= BundleUp::Unify::Git.new(api_key, connection_id)
end

#mcpObject

Access the Unified MCP server for the connection.



59
60
61
# File 'lib/bundleup/unify.rb', line 59

def mcp
  @mcp ||= BundleUp::Unify::MCP.new(api_key, connection_id)
end

#me(params = {}) ⇒ { data: Me::account }

Fetch the account this connection is authenticated as.

me is the one unified method every provider implements, so it hangs off the Unify client directly instead of a vertical namespace.

Parameters:

  • params (Hash[Symbol, untyped]) (defaults to: {})

Returns:

  • ({ data: Me::account })


54
55
56
# File 'lib/bundleup/unify.rb', line 54

def me(params = {})
  (@me ||= BundleUp::Unify::Me.new(api_key, connection_id)).get(params)
end

#pmPM

Returns:

  • (PM)


11
# File 'sig/bundleup/unify.rbs', line 11

def pm: () -> PM

#ticketingObject

Access the Ticketing API for the connection.



36
37
38
# File 'lib/bundleup/unify.rb', line 36

def ticketing
  @ticketing ||= BundleUp::Unify::Ticketing.new(api_key, connection_id)
end