Class: SignalWire::REST::Namespaces::GenericResources
- Inherits:
-
BaseResource
- Object
- BaseResource
- SignalWire::REST::Namespaces::GenericResources
- Defined in:
- lib/signalwire/rest/namespaces/fabric.rb
Overview
Generic resource operations across all fabric resource types.
Instance Method Summary collapse
- #assign_domain_application(resource_id, **kwargs) ⇒ Object
-
#assign_phone_route(resource_id, **kwargs) ⇒ Object
deprecated
Deprecated.
For the common binding cases use
phone_numbers.set_*helpers. - #delete(resource_id) ⇒ Object
- #get(resource_id) ⇒ Object
- #list(**params) ⇒ Object
- #list_addresses(resource_id, **params) ⇒ Object
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from SignalWire::REST::BaseResource
Instance Method Details
#assign_domain_application(resource_id, **kwargs) ⇒ Object
153 154 155 |
# File 'lib/signalwire/rest/namespaces/fabric.rb', line 153 def assign_domain_application(resource_id, **kwargs) @http.post(_path(resource_id, 'domain_applications'), kwargs) end |
#assign_phone_route(resource_id, **kwargs) ⇒ Object
Deprecated.
For the common binding cases use phone_numbers.set_* helpers.
This endpoint (+POST /api/fabric/resources/id/phone_routes+) accepts only a narrow set of legacy resource types as the attach target. It *does not work* for swml_webhook / cxml_webhook / ai_agent bindings – those are configured on the phone number and the Fabric resource is auto-materialized (see phone_numbers.set_swml_webhook etc.). The authoritative list of accepting resource types lives in the OpenAPI spec; routing here for those types returns 404 or 422.
141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/signalwire/rest/namespaces/fabric.rb', line 141 def assign_phone_route(resource_id, **kwargs) Kernel.warn( "DEPRECATION: assign_phone_route does not bind phone numbers to " \ "swml_webhook/cxml_webhook/ai_agent resources -- those are " \ "configured via phone_numbers.set_swml_webhook / set_cxml_webhook " \ "/ set_ai_agent. This method applies only to a narrow set of " \ "legacy resource types. See porting-sdk's phone-binding.md.", uplevel: 1 ) @http.post(_path(resource_id, 'phone_routes'), kwargs) end |
#delete(resource_id) ⇒ Object
124 125 126 |
# File 'lib/signalwire/rest/namespaces/fabric.rb', line 124 def delete(resource_id) @http.delete(_path(resource_id)) end |
#get(resource_id) ⇒ Object
120 121 122 |
# File 'lib/signalwire/rest/namespaces/fabric.rb', line 120 def get(resource_id) @http.get(_path(resource_id)) end |
#list(**params) ⇒ Object
116 117 118 |
# File 'lib/signalwire/rest/namespaces/fabric.rb', line 116 def list(**params) @http.get(@base_path, params.empty? ? nil : params) end |
#list_addresses(resource_id, **params) ⇒ Object
128 129 130 |
# File 'lib/signalwire/rest/namespaces/fabric.rb', line 128 def list_addresses(resource_id, **params) @http.get(_path(resource_id, 'addresses'), params.empty? ? nil : params) end |