Class: SignalWire::REST::Namespaces::ShortCodesResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/signalwire/rest/namespaces/short_codes.rb

Overview

Short code management (read + update only).

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ ShortCodesResource

Returns a new instance of ShortCodesResource.



8
9
10
# File 'lib/signalwire/rest/namespaces/short_codes.rb', line 8

def initialize(http)
  super(http, '/api/relay/rest/short_codes')
end

Instance Method Details

#get(short_code_id) ⇒ Object



16
17
18
# File 'lib/signalwire/rest/namespaces/short_codes.rb', line 16

def get(short_code_id)
  @http.get(_path(short_code_id))
end

#list(**params) ⇒ Object



12
13
14
# File 'lib/signalwire/rest/namespaces/short_codes.rb', line 12

def list(**params)
  @http.get(@base_path, params.empty? ? nil : params)
end

#update(short_code_id, **kwargs) ⇒ Object



20
21
22
# File 'lib/signalwire/rest/namespaces/short_codes.rb', line 20

def update(short_code_id, **kwargs)
  @http.put(_path(short_code_id), kwargs)
end