Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/voip.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/local.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/mobile.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/national.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/toll_free.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/shared_cost.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country/machine_to_machine.rb
Defined Under Namespace
Classes: LocalInstance, LocalList, LocalListResponse, LocalPage, LocalPageMetadata, MachineToMachineInstance, MachineToMachineList, MachineToMachineListResponse, MachineToMachinePage, MachineToMachinePageMetadata, MobileInstance, MobileList, MobileListResponse, MobilePage, MobilePageMetadata, NationalInstance, NationalList, NationalListResponse, NationalPage, NationalPageMetadata, SharedCostInstance, SharedCostList, SharedCostListResponse, SharedCostPage, SharedCostPageMetadata, TollFreeInstance, TollFreeList, TollFreeListResponse, TollFreePage, TollFreePageMetadata, VoipInstance, VoipList, VoipListResponse, VoipPage, VoipPageMetadata
Instance Method Summary collapse
-
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch the AvailablePhoneNumberCountryInstance.
-
#fetch_with_metadata ⇒ AvailablePhoneNumberCountryInstance
Fetch the AvailablePhoneNumberCountryInstanceMetadata.
-
#initialize(version, account_sid, country_code) ⇒ AvailablePhoneNumberCountryContext
constructor
Initialize the AvailablePhoneNumberCountryContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#local ⇒ LocalList, LocalContext
Access the local.
-
#machine_to_machine ⇒ MachineToMachineList, MachineToMachineContext
Access the machine_to_machine.
-
#mobile ⇒ MobileList, MobileContext
Access the mobile.
-
#national ⇒ NationalList, NationalContext
Access the national.
-
#shared_cost ⇒ SharedCostList, SharedCostContext
Access the shared_cost.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#toll_free ⇒ TollFreeList, TollFreeContext
Access the toll_free.
-
#voip ⇒ VoipList, VoipContext
Access the voip.
Constructor Details
#initialize(version, account_sid, country_code) ⇒ AvailablePhoneNumberCountryContext
Initialize the AvailablePhoneNumberCountryContext
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 170 def initialize(version, account_sid, country_code) super(version) # Path Solution @solution = { account_sid: account_sid, country_code: country_code, } @uri = "/Accounts/#{@solution[:account_sid]}/AvailablePhoneNumbers/#{@solution[:country_code]}.json" # Dependents @voip = nil @national = nil @mobile = nil @machine_to_machine = nil @toll_free = nil @shared_cost = nil @local = nil end |
Instance Method Details
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch the AvailablePhoneNumberCountryInstance
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 190 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AvailablePhoneNumberCountryInstance.new( @version, payload, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end |
#fetch_with_metadata ⇒ AvailablePhoneNumberCountryInstance
Fetch the AvailablePhoneNumberCountryInstanceMetadata
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 210 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) available_phone_number_country_instance = AvailablePhoneNumberCountryInstance.new( @version, response.body, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) AvailablePhoneNumberCountryInstanceMetadata.new( @version, available_phone_number_country_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
320 321 322 323 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 320 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.AvailablePhoneNumberCountryContext #{context}>" end |
#local ⇒ LocalList, LocalContext
Access the local
303 304 305 306 307 308 309 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 303 def local unless @local @local = LocalList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @local end |
#machine_to_machine ⇒ MachineToMachineList, MachineToMachineContext
Access the machine_to_machine
270 271 272 273 274 275 276 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 270 def machine_to_machine unless @machine_to_machine @machine_to_machine = MachineToMachineList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @machine_to_machine end |
#mobile ⇒ MobileList, MobileContext
Access the mobile
259 260 261 262 263 264 265 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 259 def mobile unless @mobile @mobile = MobileList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @mobile end |
#national ⇒ NationalList, NationalContext
Access the national
248 249 250 251 252 253 254 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 248 def national unless @national @national = NationalList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @national end |
#shared_cost ⇒ SharedCostList, SharedCostContext
Access the shared_cost
292 293 294 295 296 297 298 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 292 def shared_cost unless @shared_cost @shared_cost = SharedCostList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @shared_cost end |
#to_s ⇒ Object
Provide a user friendly representation
313 314 315 316 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 313 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.AvailablePhoneNumberCountryContext #{context}>" end |
#toll_free ⇒ TollFreeList, TollFreeContext
Access the toll_free
281 282 283 284 285 286 287 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 281 def toll_free unless @toll_free @toll_free = TollFreeList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @toll_free end |
#voip ⇒ VoipList, VoipContext
Access the voip
237 238 239 240 241 242 243 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 237 def voip unless @voip @voip = VoipList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @voip end |