Class: Pinnacle::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/pinnacle/pinnacle_client.rb,
lib/pinnacle/client.rb

Overview

Reopen the Client class to add custom methods for webhook processing and file uploads.

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, base_url: nil) ⇒ void

Parameters:

  • base_url (String, nil) (defaults to: nil)
  • api_key (String)


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

def initialize(api_key:, base_url: nil)
  @raw_client = Pinnacle::Internal::Http::RawClient.new(
    base_url: base_url || Pinnacle::Environment::DEFAULT,
    headers: {
      "User-Agent" => "rcs/2.0.6-rc.1",
      "X-Fern-Language" => "Ruby",
      "PINNACLE-API-KEY" => api_key.to_s
    }
  )
end

Instance Method Details

#audiencesPinnacle::Audiences::Client



26
27
28
# File 'lib/pinnacle/client.rb', line 26

def audiences
  @audiences ||= Pinnacle::Audiences::Client.new(client: @raw_client)
end

#brandsPinnacle::Brands::Client



21
22
23
# File 'lib/pinnacle/client.rb', line 21

def brands
  @brands ||= Pinnacle::Brands::Client.new(client: @raw_client)
end

#campaignsPinnacle::Campaigns::Client



61
62
63
# File 'lib/pinnacle/client.rb', line 61

def campaigns
  @campaigns ||= Pinnacle::Campaigns::Client.new(client: @raw_client)
end

#contactsPinnacle::Contacts::Client



31
32
33
# File 'lib/pinnacle/client.rb', line 31

def contacts
  @contacts ||= Pinnacle::Contacts::Client.new(client: @raw_client)
end

#conversationsPinnacle::Conversations::Client



36
37
38
# File 'lib/pinnacle/client.rb', line 36

def conversations
  @conversations ||= Pinnacle::Conversations::Client.new(client: @raw_client)
end

#messagesPinnacle::Wrapper::Messages::Client

Returns an enhanced messages client with webhook processing support.



41
42
43
# File 'lib/pinnacle/client.rb', line 41

def messages
  @messages ||= Pinnacle::Messages::Client.new(client: @raw_client)
end

#phone_numbersPinnacle::PhoneNumbers::Client



46
47
48
# File 'lib/pinnacle/client.rb', line 46

def phone_numbers
  @phone_numbers ||= Pinnacle::PhoneNumbers::Client.new(client: @raw_client)
end

#rcsPinnacle::Rcs::Client



51
52
53
# File 'lib/pinnacle/client.rb', line 51

def rcs
  @rcs ||= Pinnacle::Rcs::Client.new(client: @raw_client)
end

#statusPinnacle::Status::Client



66
67
68
# File 'lib/pinnacle/client.rb', line 66

def status
  @status ||= Pinnacle::Status::Client.new(client: @raw_client)
end

#toolsPinnacle::Wrapper::Tools::Client

Returns an enhanced tools client with file upload helper.



71
72
73
# File 'lib/pinnacle/client.rb', line 71

def tools
  @tools ||= Pinnacle::Tools::Client.new(client: @raw_client)
end

#webhooksPinnacle::Webhooks::Client



56
57
58
# File 'lib/pinnacle/client.rb', line 56

def webhooks
  @webhooks ||= Pinnacle::Webhooks::Client.new(client: @raw_client)
end