Class: Twilio::REST::Trunking::V1::TrunkContext::OriginationUrlContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Trunking::V1::TrunkContext::OriginationUrlContext
- Defined in:
- lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the OriginationUrlInstance.
-
#fetch ⇒ OriginationUrlInstance
Fetch the OriginationUrlInstance.
-
#initialize(version, trunk_sid, sid) ⇒ OriginationUrlContext
constructor
Initialize the OriginationUrlContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) ⇒ OriginationUrlInstance
Update the OriginationUrlInstance.
Constructor Details
#initialize(version, trunk_sid, sid) ⇒ OriginationUrlContext
Initialize the OriginationUrlContext
167 168 169 170 171 172 173 174 175 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 167 def initialize(version, trunk_sid, sid) super(version) # Path Solution @solution = { trunk_sid: trunk_sid, sid: sid, } @uri = "/Trunks/#{@solution[:trunk_sid]}/OriginationUrls/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the OriginationUrlInstance
179 180 181 182 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 179 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ OriginationUrlInstance
Fetch the OriginationUrlInstance
187 188 189 190 191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 187 def fetch payload = @version.fetch('GET', @uri) OriginationUrlInstance.new( @version, payload, trunk_sid: @solution[:trunk_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
241 242 243 244 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 241 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Trunking.V1.OriginationUrlContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
234 235 236 237 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 234 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Trunking.V1.OriginationUrlContext #{context}>" end |
#update(weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset) ⇒ OriginationUrlInstance
Update the OriginationUrlInstance
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb', line 206 def update( weight: :unset, priority: :unset, enabled: :unset, friendly_name: :unset, sip_url: :unset ) data = Twilio::Values.of({ 'Weight' => weight, 'Priority' => priority, 'Enabled' => enabled, 'FriendlyName' => friendly_name, 'SipUrl' => sip_url, }) payload = @version.update('POST', @uri, data: data) OriginationUrlInstance.new( @version, payload, trunk_sid: @solution[:trunk_sid], sid: @solution[:sid], ) end |