Class: Twilio::REST::Supersim::V1::SimContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Supersim::V1::SimContext
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/sim.rb,
lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb,
lib/twilio-ruby/rest/supersim/v1/sim/sim_ip_address.rb
Defined Under Namespace
Classes: BillingPeriodInstance, BillingPeriodList, BillingPeriodPage, SimIpAddressInstance, SimIpAddressList, SimIpAddressPage
Instance Method Summary collapse
-
#billing_periods ⇒ BillingPeriodList, BillingPeriodContext
Access the billing_periods.
-
#fetch ⇒ SimInstance
Fetch the SimInstance.
-
#initialize(version, sid) ⇒ SimContext
constructor
Initialize the SimContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sim_ip_addresses ⇒ SimIpAddressList, SimIpAddressContext
Access the sim_ip_addresses.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset) ⇒ SimInstance
Update the SimInstance.
Constructor Details
#initialize(version, sid) ⇒ SimContext
Initialize the SimContext
182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 182 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Sims/#{@solution[:sid]}" # Dependents @billing_periods = nil @sim_ip_addresses = nil end |
Instance Method Details
#billing_periods ⇒ BillingPeriodList, BillingPeriodContext
Access the billing_periods
257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 257 def billing_periods unless @billing_periods @billing_periods = BillingPeriodList.new( @version, sim_sid: @solution[:sid], ) end @billing_periods end |
#fetch ⇒ SimInstance
Fetch the SimInstance
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 196 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) SimInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
285 286 287 288 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 285 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.SimContext #{context}>" end |
#sim_ip_addresses ⇒ SimIpAddressList, SimIpAddressContext
Access the sim_ip_addresses
268 269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 268 def sim_ip_addresses unless @sim_ip_addresses @sim_ip_addresses = SimIpAddressList.new( @version, sim_sid: @solution[:sid], ) end @sim_ip_addresses end |
#to_s ⇒ Object
Provide a user friendly representation
278 279 280 281 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 278 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Supersim.V1.SimContext #{context}>" end |
#update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset) ⇒ SimInstance
Update the SimInstance
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 221 def update( unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset ) data = Twilio::Values.of({ 'UniqueName' => unique_name, 'Status' => status, 'Fleet' => fleet, 'CallbackUrl' => callback_url, 'CallbackMethod' => callback_method, 'AccountSid' => account_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) SimInstance.new( @version, payload, sid: @solution[:sid], ) end |