Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext

Inherits:
InstanceContext
  • Object
show all
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, LocalPage, MachineToMachineInstance, MachineToMachineList, MachineToMachinePage, MobileInstance, MobileList, MobilePage, NationalInstance, NationalList, NationalPage, SharedCostInstance, SharedCostList, SharedCostPage, TollFreeInstance, TollFreeList, TollFreePage, VoipInstance, VoipList, VoipPage

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, country_code) ⇒ AvailablePhoneNumberCountryContext

Initialize the AvailablePhoneNumberCountryContext

Parameters:



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 135

def initialize(version, , country_code)
    super(version)

    # Path Solution
    @solution = { 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

#fetchAvailablePhoneNumberCountryInstance

Fetch the AvailablePhoneNumberCountryInstance

Returns:



154
155
156
157
158
159
160
161
162
163
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 154

def fetch

    payload = @version.fetch('GET', @uri)
    AvailablePhoneNumberCountryInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        country_code: @solution[:country_code],
    )
end

#inspectObject

Provide a detailed, user friendly representation



252
253
254
255
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 252

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.AvailablePhoneNumberCountryContext #{context}>"
end

#localLocalList, LocalContext

Access the local

Returns:



235
236
237
238
239
240
241
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 235

def local
  unless @local
    @local = LocalList.new(
            @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
  end
  @local
end

#machine_to_machineMachineToMachineList, MachineToMachineContext

Access the machine_to_machine

Returns:



202
203
204
205
206
207
208
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 202

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

#mobileMobileList, MobileContext

Access the mobile

Returns:



191
192
193
194
195
196
197
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 191

def mobile
  unless @mobile
    @mobile = MobileList.new(
            @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
  end
  @mobile
end

#nationalNationalList, NationalContext

Access the national

Returns:



180
181
182
183
184
185
186
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 180

def national
  unless @national
    @national = NationalList.new(
            @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
  end
  @national
end

#shared_costSharedCostList, SharedCostContext

Access the shared_cost

Returns:



224
225
226
227
228
229
230
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 224

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_sObject

Provide a user friendly representation



245
246
247
248
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 245

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.AvailablePhoneNumberCountryContext #{context}>"
end

#toll_freeTollFreeList, TollFreeContext

Access the toll_free

Returns:



213
214
215
216
217
218
219
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 213

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

#voipVoipList, VoipContext

Access the voip

Returns:



169
170
171
172
173
174
175
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 169

def voip
  unless @voip
    @voip = VoipList.new(
            @version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
  end
  @voip
end