Class: Phaxio::Resources::PortOrder

Inherits:
Phaxio::Resource show all
Defined in:
lib/phaxio/resources/port_order.rb

Overview

Provides functionality for viewing and managing port orders.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Phaxio::Resource

response_collection, response_record

Instance Attribute Details

#account_identifierString

Returns The identifier for the account associated with the numbers.

Returns:

  • (String)

    The identifier for the account associated with the numbers.



# File 'lib/phaxio/resources/port_order.rb', line 20

#bill_received_atTime

Returns the time the bill for the order was received.

Returns:

  • (Time)

    the time the bill for the order was received.



# File 'lib/phaxio/resources/port_order.rb', line 80

#billing_address1String

Returns the first billing address line.

Returns:

  • (String)

    the first billing address line.



# File 'lib/phaxio/resources/port_order.rb', line 41

#billing_address2String

Returns the second billing address line.

Returns:

  • (String)

    the second billing address line.



# File 'lib/phaxio/resources/port_order.rb', line 44

#billing_cityString

Returns the billing address city.

Returns:

  • (String)

    the billing address city.



# File 'lib/phaxio/resources/port_order.rb', line 47

#billing_numberString

Returns the E.164 billing number.

Returns:

  • (String)

    the E.164 billing number.



# File 'lib/phaxio/resources/port_order.rb', line 38

#billing_stateString

Returns the billing address state.

Returns:

  • (String)

    the billing address state.



# File 'lib/phaxio/resources/port_order.rb', line 50

#billing_zipString

Returns the billing address zip.

Returns:

  • (String)

    the billing address zip.



# File 'lib/phaxio/resources/port_order.rb', line 53

#completed_atTime

Returns the time the order was completed.

Returns:

  • (Time)

    the time the order was completed.



89
90
91
# File 'lib/phaxio/resources/port_order.rb', line 89

has_time_attributes %w[
  created_at updated_at bill_received_at requested_for completed_at
]

#contact_emailString

Returns The email address for the order.

Returns:

  • (String)

    The email address for the order.



# File 'lib/phaxio/resources/port_order.rb', line 17

#contact_numberString

Returns the E.164 contact number.

Returns:

  • (String)

    the E.164 contact number.



# File 'lib/phaxio/resources/port_order.rb', line 14

#created_atTime

Returns the time the order was created.

Returns:

  • (Time)

    the time the order was created.



# File 'lib/phaxio/resources/port_order.rb', line 74

#esigString

Returns the electronic signature used to sign the order.

Returns:

  • (String)

    the electronic signature used to sign the order.



# File 'lib/phaxio/resources/port_order.rb', line 56

#has_billtrue | false

Returns whether or not a bill will be provided. (only present on new orders).

Returns:

  • (true | false)

    whether or not a bill will be provided. (only present on new orders)



# File 'lib/phaxio/resources/port_order.rb', line 59

#idInteger

Returns the ID associated with this order.

Returns:

  • (Integer)

    the ID associated with this order.



# File 'lib/phaxio/resources/port_order.rb', line 8

Returns whether or not the legal agreement is accepted. (only present on new orders).

Returns:

  • (true | false)

    whether or not the legal agreement is accepted. (only present on new orders)



67
68
69
70
71
72
# File 'lib/phaxio/resources/port_order.rb', line 67

has_normal_attributes %w[
  id contact_number contact_email name_on_account name_of_business provider_name
  billing_number billing_address1 billing_address2 account_identifier
  billing_city billing_state billing_zip esig legal_agreement port_type port_out_pin
  status
]

#name_of_businessString

Returns the name of the business.

Returns:

  • (String)

    the name of the business.



# File 'lib/phaxio/resources/port_order.rb', line 32

#name_on_accountString

Returns the name associated with the account.

Returns:

  • (String)

    the name associated with the account.



# File 'lib/phaxio/resources/port_order.rb', line 29

#port_numbersPhaxio::Resource::Collection<Phaxio::Resources::PortNumber>

Returns a collection of port numbers associated with the order.

Returns:



97
# File 'lib/phaxio/resources/port_order.rb', line 97

has_collection_attributes({port_numbers: PortNumber})

#port_out_pinString

Returns The PIN or password needed to port out the numbers.

Returns:

  • (String)

    The PIN or password needed to port out the numbers.



# File 'lib/phaxio/resources/port_order.rb', line 26

#port_typeString

Returns Type of numbers to be ported. Either “business” or “residential”.

Returns:

  • (String)

    Type of numbers to be ported. Either “business” or “residential”.



# File 'lib/phaxio/resources/port_order.rb', line 23

#provider_nameString

Returns the provider name.

Returns:

  • (String)

    the provider name.



# File 'lib/phaxio/resources/port_order.rb', line 35

#requested_forTime

Returns the time the order was requested for.

Returns:

  • (Time)

    the time the order was requested for.



# File 'lib/phaxio/resources/port_order.rb', line 83

#statusString

Returns the status of this order.

Returns:

  • (String)

    the status of this order.



# File 'lib/phaxio/resources/port_order.rb', line 11

#updated_atTime

Returns the time the order was updated.

Returns:

  • (Time)

    the time the order was updated.



# File 'lib/phaxio/resources/port_order.rb', line 77

Class Method Details

.create(params = {}) ⇒ Phaxio::Resources::PortOrder

Create a port order.

Parameters:

  • params (Hash) (defaults to: {})

    Any parameters to send to Phaxio.

    • port_numbers [Array<String>] - Numbers to port.

    • contact_number [String] - Number to contact about the port.

    • contact_email [String] - The email address for the order.

    • account_identifier [String] - The identifier for the account associated with the numbers.

    • port_type [String] - Type of numbers to be ported. Either “business” or “residential”.

    • port_out_pin [String] - The PIN or password needed to port out the numbers.

    • name_on_account [String] - Name on the account for the port.

    • name_of_business [String] - Name of business associated with the port.

    • provider_name [String] - Name of provider for the port.

    • esig [String] - Electronic signature used to sign the order.

    • legal_agreement [true | false] - Indicates acceptance of the legal agreement.

    • has_bill [true | false] - Indicates whether or not a bill will be provided. If true, billing number and address fields are not needed.

    • billing_number [String] - Billing number.

    • billing_address1 [String] - Billing address line 1

    • billing_address2 [String] - Billing address line 2

    • billing_city [String] - Billing address city.

    • billing_state [String] - Billing address state.

    • billing_zip [String] - Billing address zip.

Returns:

Raises:

See Also:



140
141
142
143
# File 'lib/phaxio/resources/port_order.rb', line 140

def create params = {}
  response = Client.request :post, port_orders_endpoint, params
  response_record response
end

.get(id, params = {}) ⇒ Phaxio::Resource::PortOrder Also known as: retrieve, find

Get port order info.

Parameters:

  • id (Integer)

    The ID of the order to retrieve.

  • params (Hash) (defaults to: {})

    A hash of parameters to send to Phaxio. This action takes no unique parameters.

Returns:

  • (Phaxio::Resource::PortOrder)

Raises:

See Also:



153
154
155
156
# File 'lib/phaxio/resources/port_order.rb', line 153

def get id, params = {}
  response = Client.request :get, port_order_endpoint(id.to_i), params
  response_record response
end

.list(params = {}) ⇒ Phaxio::Resource::Collection<Phaxio::Resources::PortOrder>

Note:

This action accepts paging parameters:

  • per_page [Integer] - The maximum number of results to return per call (i.e. “page”). Max 1000.

  • page [Integer] - The page number to return for the request. 1-based.

List port orders in date range.

Parameters:

  • params (Hash) (defaults to: {})

    Any parameters to send to Phaxio.

    • created_before [String] - RFC 3339 timestamp representing the end of the range.

    • created_after [String] - RFC 3339 timestamp representing the beginning of the range.

Returns:

Raises:

See Also:



110
111
112
113
# File 'lib/phaxio/resources/port_order.rb', line 110

def list params = {}
  response = Client.request :get, port_orders_endpoint, params
  response_collection response
end