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.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb,
lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb
Defined Under Namespace
Classes: LocalInstance, LocalList, LocalPage, MobileInstance, MobileList, MobilePage, TollFreeInstance, TollFreeList, TollFreePage
Instance Method Summary collapse
-
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch a AvailablePhoneNumberCountryInstance.
-
#initialize(version, account_sid, country_code) ⇒ AvailablePhoneNumberCountryContext
constructor
Initialize the AvailablePhoneNumberCountryContext.
-
#local ⇒ LocalList, LocalContext
Access the local.
-
#mobile ⇒ MobileList, MobileContext
Access the mobile.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#toll_free ⇒ TollFreeList, TollFreeContext
Access the toll_free.
Constructor Details
#initialize(version, account_sid, country_code) ⇒ AvailablePhoneNumberCountryContext
Initialize the AvailablePhoneNumberCountryContext
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 165 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 @local = nil @toll_free = nil @mobile = nil end |
Instance Method Details
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch a AvailablePhoneNumberCountryInstance
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 184 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) AvailablePhoneNumberCountryInstance.new( @version, payload, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end |
#local ⇒ LocalList, LocalContext
Access the local
205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 205 def local unless @local @local = LocalList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @local end |
#mobile ⇒ MobileList, MobileContext
Access the mobile
237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 237 def mobile unless @mobile @mobile = MobileList.new( @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], ) end @mobile end |
#to_s ⇒ Object
Provide a user friendly representation
251 252 253 254 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 251 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
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 221 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 |