Class: Verizon::FlowInfo

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

Overview

FlowInfo Model.

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(flow_server: SKIP, flow_device: SKIP, flow_direction: SKIP, flow_protocol: SKIP, qci_option: SKIP, additional_properties: nil) ⇒ FlowInfo

Returns a new instance of FlowInfo.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/verizon/models/flow_info.rb', line 59

def initialize(flow_server: SKIP, flow_device: SKIP, flow_direction: SKIP,
               flow_protocol: SKIP, qci_option: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @flow_server = flow_server unless flow_server == SKIP
  @flow_device = flow_device unless flow_device == SKIP
  @flow_direction = flow_direction unless flow_direction == SKIP
  @flow_protocol = flow_protocol unless flow_protocol == SKIP
  @qci_option = qci_option unless qci_option == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#flow_deviceString

TODO: Write general description for this method

Returns:

  • (String)


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

def flow_device
  @flow_device
end

#flow_directionString

TODO: Write general description for this method

Returns:

  • (String)


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

def flow_direction
  @flow_direction
end

#flow_protocolString

TODO: Write general description for this method

Returns:

  • (String)


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

def flow_protocol
  @flow_protocol
end

#flow_serverString

TODO: Write general description for this method

Returns:

  • (String)


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

def flow_server
  @flow_server
end

#qci_optionString

TODO: Write general description for this method

Returns:

  • (String)


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

def qci_option
  @qci_option
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/verizon/models/flow_info.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  flow_server = hash.key?('flowServer') ? hash['flowServer'] : SKIP
  flow_device = hash.key?('flowDevice') ? hash['flowDevice'] : SKIP
  flow_direction = hash.key?('flowDirection') ? hash['flowDirection'] : SKIP
  flow_protocol = hash.key?('flowProtocol') ? hash['flowProtocol'] : SKIP
  qci_option = hash.key?('qciOption') ? hash['qciOption'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  FlowInfo.new(flow_server: flow_server,
               flow_device: flow_device,
               flow_direction: flow_direction,
               flow_protocol: flow_protocol,
               qci_option: qci_option,
               additional_properties: additional_properties)
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/flow_info.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['flow_server'] = 'flowServer'
  @_hash['flow_device'] = 'flowDevice'
  @_hash['flow_direction'] = 'flowDirection'
  @_hash['flow_protocol'] = 'flowProtocol'
  @_hash['qci_option'] = 'qciOption'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/verizon/models/flow_info.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/flow_info.rb', line 44

def self.optionals
  %w[
    flow_server
    flow_device
    flow_direction
    flow_protocol
    qci_option
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
114
# File 'lib/verizon/models/flow_info.rb', line 109

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} flow_server: #{@flow_server.inspect}, flow_device: #{@flow_device.inspect},"\
  " flow_direction: #{@flow_direction.inspect}, flow_protocol: #{@flow_protocol.inspect},"\
  " qci_option: #{@qci_option.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
106
# File 'lib/verizon/models/flow_info.rb', line 101

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} flow_server: #{@flow_server}, flow_device: #{@flow_device}, flow_direction:"\
  " #{@flow_direction}, flow_protocol: #{@flow_protocol}, qci_option: #{@qci_option},"\
  " additional_properties: #{@additional_properties}>"
end