Class: Twilio::REST::Supersim::V1::NetworkContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Supersim::V1::NetworkContext
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/network.rb
Instance Method Summary collapse
-
#fetch ⇒ NetworkInstance
Fetch the NetworkInstance.
-
#fetch_with_metadata ⇒ NetworkInstance
Fetch the NetworkInstanceMetadata.
-
#initialize(version, sid) ⇒ NetworkContext
constructor
Initialize the NetworkContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ NetworkContext
Initialize the NetworkContext
183 184 185 186 187 188 189 190 191 192 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 183 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Networks/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ NetworkInstance
Fetch the NetworkInstance
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 196 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) NetworkInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ NetworkInstance
Fetch the NetworkInstanceMetadata
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 215 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) network_instance = NetworkInstance.new( @version, response.body, sid: @solution[:sid], ) NetworkInstanceMetadata.new( @version, network_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
247 248 249 250 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 247 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.NetworkContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
240 241 242 243 |
# File 'lib/twilio-ruby/rest/supersim/v1/network.rb', line 240 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.NetworkContext #{context}>" end |