class Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext

Public Class Methods

new(version, account_sid, country_code) click to toggle source

Initialize the AvailablePhoneNumberCountryContext @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] requesting the available
phone number Country resource.

@param [String] country_code The

{ISO-3166-1}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] country code of
the country to fetch available phone number information about.

@return [AvailablePhoneNumberCountryContext] AvailablePhoneNumberCountryContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
156 def initialize(version, account_sid, country_code)
157   super(version)
158 
159   # Path Solution
160   @solution = {account_sid: account_sid, country_code: country_code, }
161   @uri = "/Accounts/#{@solution[:account_sid]}/AvailablePhoneNumbers/#{@solution[:country_code]}.json"
162 
163   # Dependents
164   @local = nil
165   @toll_free = nil
166   @mobile = nil
167   @national = nil
168   @voip = nil
169   @shared_cost = nil
170   @machine_to_machine = nil
171 end

Public Instance Methods

fetch() click to toggle source

Fetch the AvailablePhoneNumberCountryInstance @return [AvailablePhoneNumberCountryInstance] Fetched AvailablePhoneNumberCountryInstance

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
176 def fetch
177   payload = @version.fetch('GET', @uri)
178 
179   AvailablePhoneNumberCountryInstance.new(
180       @version,
181       payload,
182       account_sid: @solution[:account_sid],
183       country_code: @solution[:country_code],
184   )
185 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
308 def inspect
309   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
310   "#<Twilio.Api.V2010.AvailablePhoneNumberCountryContext #{context}>"
311 end
local() click to toggle source

Access the local @return [LocalList] @return [LocalContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
191 def local
192   unless @local
193     @local = LocalList.new(
194         @version,
195         account_sid: @solution[:account_sid],
196         country_code: @solution[:country_code],
197     )
198   end
199 
200   @local
201 end
machine_to_machine() click to toggle source

Access the machine_to_machine @return [MachineToMachineList] @return [MachineToMachineContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
287 def machine_to_machine
288   unless @machine_to_machine
289     @machine_to_machine = MachineToMachineList.new(
290         @version,
291         account_sid: @solution[:account_sid],
292         country_code: @solution[:country_code],
293     )
294   end
295 
296   @machine_to_machine
297 end
mobile() click to toggle source

Access the mobile @return [MobileList] @return [MobileContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
223 def mobile
224   unless @mobile
225     @mobile = MobileList.new(
226         @version,
227         account_sid: @solution[:account_sid],
228         country_code: @solution[:country_code],
229     )
230   end
231 
232   @mobile
233 end
national() click to toggle source

Access the national @return [NationalList] @return [NationalContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
239 def national
240   unless @national
241     @national = NationalList.new(
242         @version,
243         account_sid: @solution[:account_sid],
244         country_code: @solution[:country_code],
245     )
246   end
247 
248   @national
249 end
shared_cost() click to toggle source

Access the shared_cost @return [SharedCostList] @return [SharedCostContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
271 def shared_cost
272   unless @shared_cost
273     @shared_cost = SharedCostList.new(
274         @version,
275         account_sid: @solution[:account_sid],
276         country_code: @solution[:country_code],
277     )
278   end
279 
280   @shared_cost
281 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
301 def to_s
302   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
303   "#<Twilio.Api.V2010.AvailablePhoneNumberCountryContext #{context}>"
304 end
toll_free() click to toggle source

Access the toll_free @return [TollFreeList] @return [TollFreeContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
207 def toll_free
208   unless @toll_free
209     @toll_free = TollFreeList.new(
210         @version,
211         account_sid: @solution[:account_sid],
212         country_code: @solution[:country_code],
213     )
214   end
215 
216   @toll_free
217 end
voip() click to toggle source

Access the voip @return [VoipList] @return [VoipContext]

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
255 def voip
256   unless @voip
257     @voip = VoipList.new(
258         @version,
259         account_sid: @solution[:account_sid],
260         country_code: @solution[:country_code],
261     )
262   end
263 
264   @voip
265 end