Class: Gupshup::REST::Api

Inherits:
Domain
  • Object
show all
Defined in:
lib/gupshup-rb/rest/api.rb,
lib/gupshup-rb/rest/api/v1.rb,
lib/gupshup-rb/rest/api/v1/message.rb

Defined Under Namespace

Classes: V1

Instance Attribute Summary

Attributes inherited from Domain

#client

Instance Method Summary collapse

Methods inherited from Domain

#absolute_url, #request

Constructor Details

#initialize(gupshup) ⇒ Api

Initialize the Api Domain



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/gupshup-rb/rest/api.rb', line 6

def initialize(gupshup)
  super

  #@base_url = 'https://api.gupshup.com'
  #@host = 'api.gupshup.com'
  #@port = 443
  @uri = "https://api.gupshup.io/sm/api/v1/msg"

  # Versions
  @v1 = nil
end

Instance Method Details

#messages(sid = :unset) ⇒ Gupshup::REST::Api::V1::AccountContext::MessageInstance, Gupshup::REST::Api::V1::AccountContext::MessageList

Parameters:

  • sid (String) (defaults to: :unset)

    The unique string that that we created to identify the Message resource.

Returns:

  • (Gupshup::REST::Api::V1::AccountContext::MessageInstance)

    if sid was passed.

  • (Gupshup::REST::Api::V1::AccountContext::MessageList)


29
30
31
# File 'lib/gupshup-rb/rest/api.rb', line 29

def messages(sid=:unset)
  self.messages(sid)
end

#to_sObject

Provide a user friendly representation



35
36
37
# File 'lib/gupshup-rb/rest/api.rb', line 35

def to_s
  '#<Gupshup::REST::Api>'
end

#v1Object

Version v1 of api



20
21
22
# File 'lib/gupshup-rb/rest/api.rb', line 20

def v1
  @v1 ||= V1.new self
end