Class: CloudWaba::Client

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/cloud_waba/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_id: nil, app_secret: nil, phone_number_id: nil, business_account_id: nil, access_token: nil, api_version: nil) ⇒ Client

Returns a new instance of Client.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cloud_waba/client.rb', line 70

def initialize(
  app_id: nil,
  app_secret: nil,
  phone_number_id: nil,
  business_account_id: nil,
  access_token: nil,
  api_version: nil
)
  @config = ::CloudWaba::Utils.import_config(
    app_id: app_id,
    app_secret: app_secret,
    phone_number_id: phone_number_id,
    business_account_id: ,
    access_token: access_token,
    api_version: api_version
  )
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



58
59
60
# File 'lib/cloud_waba/client.rb', line 58

def config
  @config
end

Instance Method Details

#messagesObject



88
89
90
# File 'lib/cloud_waba/client.rb', line 88

def messages
  ::API::Messages::Service.new(config: @config)
end

#templatesObject



92
93
94
# File 'lib/cloud_waba/client.rb', line 92

def templates
  ::API::Templates::Service.new(config: @config)
end