## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Numbers # This is the public Twilio REST API. # # NOTE: This class is auto generated by OpenAPI Generator. # https://openapi-generator.tech # Do not edit the class manually. # module Twilio module REST class Numbers < NumbersBase class V1 < Version class PortingPortInPhoneNumberList < ListResource ## # Initialize the PortingPortInPhoneNumberList # @param [Version] version Version that contains the resource # @return [PortingPortInPhoneNumberList] PortingPortInPhoneNumberList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end class PortingPortInPhoneNumberContext < InstanceContext ## # Initialize the PortingPortInPhoneNumberContext # @param [Version] version Version that contains the resource # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request. # @param [String] phone_number_sid The SID of the Phone number. This is a unique identifier of the phone number. # @return [PortingPortInPhoneNumberContext] PortingPortInPhoneNumberContext def initialize(version, port_in_request_sid, phone_number_sid) super(version) # Path Solution @solution = { port_in_request_sid: port_in_request_sid, phone_number_sid: phone_number_sid, } @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}/PhoneNumber/#{@solution[:phone_number_sid]}" end ## # Delete the PortingPortInPhoneNumberInstance # @return [Boolean] True if delete succeeds, false otherwise def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end ## # Fetch the PortingPortInPhoneNumberInstance # @return [PortingPortInPhoneNumberInstance] Fetched PortingPortInPhoneNumberInstance def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) PortingPortInPhoneNumberInstance.new( @version, payload, port_in_request_sid: @solution[:port_in_request_sid], phone_number_sid: @solution[:phone_number_sid], ) end ## # Provide a user friendly representation def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#" end end class PortingPortInPhoneNumberPage < Page ## # Initialize the PortingPortInPhoneNumberPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [PortingPortInPhoneNumberPage] PortingPortInPhoneNumberPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of PortingPortInPhoneNumberInstance # @param [Hash] payload Payload response from the API # @return [PortingPortInPhoneNumberInstance] PortingPortInPhoneNumberInstance def get_instance(payload) PortingPortInPhoneNumberInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class PortingPortInPhoneNumberInstance < InstanceResource ## # Initialize the PortingPortInPhoneNumberInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingPortInPhoneNumber # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [PortingPortInPhoneNumberInstance] PortingPortInPhoneNumberInstance def initialize(version, payload , port_in_request_sid: nil, phone_number_sid: nil) super(version) # Marshaled Properties @properties = { 'port_in_request_sid' => payload['port_in_request_sid'], 'phone_number_sid' => payload['phone_number_sid'], 'url' => payload['url'], 'account_sid' => payload['account_sid'], 'phone_number_type' => payload['phone_number_type'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'country' => payload['country'], 'missing_required_fields' => payload['missing_required_fields'], 'last_updated' => Twilio.deserialize_iso8601_datetime(payload['last_updated']), 'phone_number' => payload['phone_number'], 'portable' => payload['portable'], 'not_portability_reason' => payload['not_portability_reason'], 'not_portability_reason_code' => payload['not_portability_reason_code'] == nil ? payload['not_portability_reason_code'] : payload['not_portability_reason_code'].to_i, 'port_in_phone_number_status' => payload['port_in_phone_number_status'], 'port_out_pin' => payload['port_out_pin'] == nil ? payload['port_out_pin'] : payload['port_out_pin'].to_i, 'rejection_reason' => payload['rejection_reason'], 'rejection_reason_code' => payload['rejection_reason_code'] == nil ? payload['rejection_reason_code'] : payload['rejection_reason_code'].to_i, } # Context @instance_context = nil @params = { 'port_in_request_sid' => port_in_request_sid || @properties['port_in_request_sid'] ,'phone_number_sid' => phone_number_sid || @properties['phone_number_sid'] , } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [PortingPortInPhoneNumberContext] CallContext for this CallInstance def context unless @instance_context @instance_context = PortingPortInPhoneNumberContext.new(@version , @params['port_in_request_sid'], @params['phone_number_sid']) end @instance_context end ## # @return [String] The SID of the Port In request. This is a unique identifier of the port in request. def port_in_request_sid @properties['port_in_request_sid'] end ## # @return [String] The SID of the Port In request phone number. This is a unique identifier of the phone number. def phone_number_sid @properties['phone_number_sid'] end ## # @return [String] def url @properties['url'] end ## # @return [String] The SID of the account that the phone number belongs to. def account_sid @properties['account_sid'] end ## # @return [String] The type of the phone number. def phone_number_type @properties['phone_number_type'] end ## # @return [Time] The date when the phone number was created. def date_created @properties['date_created'] end ## # @return [String] The country of the phone number. def country @properties['country'] end ## # @return [Boolean] The phone number is missing required fields. def missing_required_fields @properties['missing_required_fields'] end ## # @return [Time] The timestamp when the status was last updated. def last_updated @properties['last_updated'] end ## # @return [String] The phone number. def phone_number @properties['phone_number'] end ## # @return [Boolean] The phone number is portable. def portable @properties['portable'] end ## # @return [String] The reason why the phone number is not portable. def not_portability_reason @properties['not_portability_reason'] end ## # @return [String] The code of the reason why the phone number is not portable. def not_portability_reason_code @properties['not_portability_reason_code'] end ## # @return [String] The status of the phone number in the port in request. def port_in_phone_number_status @properties['port_in_phone_number_status'] end ## # @return [String] The pin required for the losing carrier to port out the phone number. def port_out_pin @properties['port_out_pin'] end ## # @return [String] The rejection reason returned by the vendor. def rejection_reason @properties['rejection_reason'] end ## # @return [String] The rejection reason code returned by the vendor. def rejection_reason_code @properties['rejection_reason_code'] end ## # Delete the PortingPortInPhoneNumberInstance # @return [Boolean] True if delete succeeds, false otherwise def delete context.delete end ## # Fetch the PortingPortInPhoneNumberInstance # @return [PortingPortInPhoneNumberInstance] Fetched PortingPortInPhoneNumberInstance def fetch context.fetch end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end