Class: Verizon::ResourcesServiceEndpoint

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/resources_service_endpoint.rb

Overview

Service Endpoint path, address, and port.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(uri: SKIP, fqdn: SKIP, i_pv4_address: SKIP, i_pv6_address: SKIP, port: SKIP) ⇒ ResourcesServiceEndpoint

Returns a new instance of ResourcesServiceEndpoint.



59
60
61
62
63
64
65
66
# File 'lib/verizon/models/resources_service_endpoint.rb', line 59

def initialize(uri: SKIP, fqdn: SKIP, i_pv4_address: SKIP,
               i_pv6_address: SKIP, port: SKIP)
  @uri = uri unless uri == SKIP
  @fqdn = fqdn unless fqdn == SKIP
  @i_pv4_address = i_pv4_address unless i_pv4_address == SKIP
  @i_pv6_address = i_pv6_address unless i_pv6_address == SKIP
  @port = port unless port == SKIP
end

Instance Attribute Details

#fqdnString

FQDN of Service Endpoint if available.

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/resources_service_endpoint.rb', line 18

def fqdn
  @fqdn
end

#i_pv4_addressString

IPv4 Address of Service Endpoint if available.

Returns:

  • (String)


22
23
24
# File 'lib/verizon/models/resources_service_endpoint.rb', line 22

def i_pv4_address
  @i_pv4_address
end

#i_pv6_addressString

IPv6 Address of Service Endpoint if available.

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/resources_service_endpoint.rb', line 26

def i_pv6_address
  @i_pv6_address
end

#portInteger

Port information of Service Endpoint if IPv4 or IPv6 is mentioned.

Returns:

  • (Integer)


30
31
32
# File 'lib/verizon/models/resources_service_endpoint.rb', line 30

def port
  @port
end

#uriString

URI of Service Endpoint if available.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/resources_service_endpoint.rb', line 14

def uri
  @uri
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/verizon/models/resources_service_endpoint.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  uri = hash.key?('URI') ? hash['URI'] : SKIP
  fqdn = hash.key?('FQDN') ? hash['FQDN'] : SKIP
  i_pv4_address = hash.key?('IPv4Address') ? hash['IPv4Address'] : SKIP
  i_pv6_address = hash.key?('IPv6Address') ? hash['IPv6Address'] : SKIP
  port = hash.key?('port') ? hash['port'] : SKIP

  # Create object from extracted values.
  ResourcesServiceEndpoint.new(uri: uri,
                               fqdn: fqdn,
                               i_pv4_address: i_pv4_address,
                               i_pv6_address: i_pv6_address,
                               port: port)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/verizon/models/resources_service_endpoint.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['uri'] = 'URI'
  @_hash['fqdn'] = 'FQDN'
  @_hash['i_pv4_address'] = 'IPv4Address'
  @_hash['i_pv6_address'] = 'IPv6Address'
  @_hash['port'] = 'port'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/verizon/models/resources_service_endpoint.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/verizon/models/resources_service_endpoint.rb', line 44

def self.optionals
  %w[
    uri
    fqdn
    i_pv4_address
    i_pv6_address
    port
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



95
96
97
98
99
100
# File 'lib/verizon/models/resources_service_endpoint.rb', line 95

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} uri: #{@uri.inspect}, fqdn: #{@fqdn.inspect}, i_pv4_address:"\
  " #{@i_pv4_address.inspect}, i_pv6_address: #{@i_pv6_address.inspect}, port:"\
  " #{@port.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



88
89
90
91
92
# File 'lib/verizon/models/resources_service_endpoint.rb', line 88

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} uri: #{@uri}, fqdn: #{@fqdn}, i_pv4_address: #{@i_pv4_address},"\
  " i_pv6_address: #{@i_pv6_address}, port: #{@port}>"
end