Class: SignalWire::REST::CrudResource
Overview
Standard CRUD resource with list/create/get/update/delete.
Direct Known Subclasses
Namespaces::CompatApplications, Namespaces::CompatCalls, Namespaces::CompatFaxes, Namespaces::CompatLamlBins, Namespaces::CompatMessages, Namespaces::CompatQueues, Namespaces::DatasphereDocuments, Namespaces::FabricResource, Namespaces::NumberGroupsResource, Namespaces::PhoneNumbersResource, Namespaces::QueuesResource, Namespaces::VerifiedCallersResource, Namespaces::VideoConferences, Namespaces::VideoRooms
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize
Class Method Details
.update_method ⇒ Object
129
130
131
|
# File 'lib/signalwire/rest/http_client.rb', line 129
def self.update_method
@update_method || 'PATCH'
end
|
.update_method=(m) ⇒ Object
133
134
135
|
# File 'lib/signalwire/rest/http_client.rb', line 133
def self.update_method=(m)
@update_method = m
end
|
Instance Method Details
#create(**kwargs) ⇒ Object
141
142
143
|
# File 'lib/signalwire/rest/http_client.rb', line 141
def create(**kwargs)
@http.post(@base_path, kwargs)
end
|
#delete(resource_id) ⇒ Object
154
155
156
|
# File 'lib/signalwire/rest/http_client.rb', line 154
def delete(resource_id)
@http.delete(_path(resource_id))
end
|
#get(resource_id) ⇒ Object
145
146
147
|
# File 'lib/signalwire/rest/http_client.rb', line 145
def get(resource_id)
@http.get(_path(resource_id))
end
|
#list(**params) ⇒ Object
137
138
139
|
# File 'lib/signalwire/rest/http_client.rb', line 137
def list(**params)
@http.get(@base_path, params.empty? ? nil : params)
end
|
#update(resource_id, **kwargs) ⇒ Object
149
150
151
152
|
# File 'lib/signalwire/rest/http_client.rb', line 149
def update(resource_id, **kwargs)
m = self.class.update_method.downcase
@http.send(m, _path(resource_id), kwargs)
end
|