Class: Posthubify::SendersResource

Inherits:
Object
  • Object
show all
Defined in:
lib/posthubify/resources/telecom.rb

Overview

Alphanumeric sender IDs (Node sdk .senders).

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ SendersResource

Returns a new instance of SendersResource.



33
34
35
# File 'lib/posthubify/resources/telecom.rb', line 33

def initialize(http)
  @http = http
end

Instance Method Details

#listObject

List registered senders.



38
39
40
# File 'lib/posthubify/resources/telecom.rb', line 38

def list
  @http.data('GET', '/senders')
end

#register(input) ⇒ Object

Register an alphanumeric brand name ({ ‘senderId’ => …, ‘countries’ => […], ‘profileId’ => … }).



43
44
45
# File 'lib/posthubify/resources/telecom.rb', line 43

def register(input)
  @http.data('POST', '/senders', body: input)
end

#release(id) ⇒ Object

Release the sender.



48
49
50
# File 'lib/posthubify/resources/telecom.rb', line 48

def release(id)
  @http.data('DELETE', "/senders/#{id}")
end