Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb,
lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb
Defined Under Namespace
Classes: AssignedAddOnExtensionContext, AssignedAddOnExtensionInstance, AssignedAddOnExtensionList, AssignedAddOnExtensionPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the AssignedAddOnInstance.
-
#extensions(sid = :unset) ⇒ AssignedAddOnExtensionList, AssignedAddOnExtensionContext
Access the extensions.
-
#fetch ⇒ AssignedAddOnInstance
Fetch the AssignedAddOnInstance.
-
#initialize(version, account_sid, resource_sid, sid) ⇒ AssignedAddOnContext
constructor
Initialize the AssignedAddOnContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, account_sid, resource_sid, sid) ⇒ AssignedAddOnContext
Initialize the AssignedAddOnContext
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 168 def initialize(version, account_sid, resource_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, resource_sid: resource_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:resource_sid]}/AssignedAddOns/#{@solution[:sid]}.json" # Dependents @extensions = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the AssignedAddOnInstance
181 182 183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 181 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#extensions(sid = :unset) ⇒ AssignedAddOnExtensionList, AssignedAddOnExtensionContext
Access the extensions
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 215 def extensions(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return AssignedAddOnExtensionContext.new(@version, @solution[:account_sid], @solution[:resource_sid], @solution[:sid],sid ) end unless @extensions @extensions = AssignedAddOnExtensionList.new( @version, account_sid: @solution[:account_sid], resource_sid: @solution[:resource_sid], assigned_add_on_sid: @solution[:sid], ) end @extensions end |
#fetch ⇒ AssignedAddOnInstance
Fetch the AssignedAddOnInstance
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 193 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AssignedAddOnInstance.new( @version, payload, account_sid: @solution[:account_sid], resource_sid: @solution[:resource_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
240 241 242 243 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 240 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.AssignedAddOnContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
233 234 235 236 |
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb', line 233 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.AssignedAddOnContext #{context}>" end |