Class: PaypalServerSdk::PhoneNumber

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/phone_number.rb

Overview

The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(national_number:) ⇒ PhoneNumber

Returns a new instance of PhoneNumber.



38
39
40
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 38

def initialize(national_number:)
  @national_number = national_number
end

Instance Attribute Details

#national_numberString

The national number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en). The combined length of the country calling code (CC) and the national number must not be greater than 15 digits. The national number consists of a national destination code (NDC) and subscriber number (SN).

Returns:

  • (String)


19
20
21
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 19

def national_number
  @national_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



43
44
45
46
47
48
49
50
51
52
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 43

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  national_number =
    hash.key?('national_number') ? hash['national_number'] : nil

  # Create object from extracted values.
  PhoneNumber.new(national_number: national_number)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['national_number'] = 'national_number'
  @_hash
end

.nullablesObject

An array for nullable fields



34
35
36
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 34

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
# File 'lib/paypal_server_sdk/models/phone_number.rb', line 29

def self.optionals
  []
end