Class: MistApi::AppProbingCustomApp

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/app_probing_custom_app.rb

Overview

AppProbingCustomApp 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(address = SKIP, app_type = SKIP, hostnames = SKIP, key = SKIP, name = SKIP, network = SKIP, packet_size = SKIP, protocol = AppProbingCustomAppProtocolEnum::HTTP, url = SKIP, vrf = SKIP) ⇒ AppProbingCustomApp

Returns a new instance of AppProbingCustomApp.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 89

def initialize(address = SKIP, app_type = SKIP, hostnames = SKIP,
               key = SKIP, name = SKIP, network = SKIP, packet_size = SKIP,
               protocol = AppProbingCustomAppProtocolEnum::HTTP, url = SKIP,
               vrf = SKIP)
  @address = address unless address == SKIP
  @app_type = app_type unless app_type == SKIP
  @hostnames = hostnames unless hostnames == SKIP
  @key = key unless key == SKIP
  @name = name unless name == SKIP
  @network = network unless network == SKIP
  @packet_size = packet_size unless packet_size == SKIP
  @protocol = protocol unless protocol == SKIP
  @url = url unless url == SKIP
  @vrf = vrf unless vrf == SKIP
end

Instance Attribute Details

#addressString

Required if ‘protocol`==`icmp`

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 14

def address
  @address
end

#app_typeString

Required if ‘protocol`==`icmp`

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 18

def app_type
  @app_type
end

#hostnamesArray[String]

If ‘protocol`==`http`

Returns:

  • (Array[String])


22
23
24
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 22

def hostnames
  @hostnames
end

#keyString

If ‘protocol`==`http`

Returns:

  • (String)


26
27
28
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 26

def key
  @key
end

#nameString

If ‘protocol`==`http`

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 30

def name
  @name
end

#networkString

If ‘protocol`==`http`

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 34

def network
  @network
end

#packet_sizeInteger

If ‘protocol`==`icmp`

Returns:

  • (Integer)


38
39
40
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 38

def packet_size
  @packet_size
end

#protocolAppProbingCustomAppProtocolEnum

enum: ‘http`, `icmp`



42
43
44
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 42

def protocol
  @protocol
end

#urlString

If ‘protocol`==`http`

Returns:

  • (String)


46
47
48
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 46

def url
  @url
end

#vrfString

If ‘protocol`==`http`

Returns:

  • (String)


50
51
52
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 50

def vrf
  @vrf
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 106

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address = hash.key?('address') ? hash['address'] : SKIP
  app_type = hash.key?('app_type') ? hash['app_type'] : SKIP
  hostnames = hash.key?('hostnames') ? hash['hostnames'] : SKIP
  key = hash.key?('key') ? hash['key'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  network = hash.key?('network') ? hash['network'] : SKIP
  packet_size = hash.key?('packetSize') ? hash['packetSize'] : SKIP
  protocol = hash['protocol'] ||= AppProbingCustomAppProtocolEnum::HTTP
  url = hash.key?('url') ? hash['url'] : SKIP
  vrf = hash.key?('vrf') ? hash['vrf'] : SKIP

  # Create object from extracted values.
  AppProbingCustomApp.new(address,
                          app_type,
                          hostnames,
                          key,
                          name,
                          network,
                          packet_size,
                          protocol,
                          url,
                          vrf)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address'] = 'address'
  @_hash['app_type'] = 'app_type'
  @_hash['hostnames'] = 'hostnames'
  @_hash['key'] = 'key'
  @_hash['name'] = 'name'
  @_hash['network'] = 'network'
  @_hash['packet_size'] = 'packetSize'
  @_hash['protocol'] = 'protocol'
  @_hash['url'] = 'url'
  @_hash['vrf'] = 'vrf'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 85

def self.nullables
  []
end

.optionalsObject

An array for optional fields



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 69

def self.optionals
  %w[
    address
    app_type
    hostnames
    key
    name
    network
    packet_size
    protocol
    url
    vrf
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



143
144
145
146
147
148
149
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 143

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} address: #{@address.inspect}, app_type: #{@app_type.inspect}, hostnames:"\
  " #{@hostnames.inspect}, key: #{@key.inspect}, name: #{@name.inspect}, network:"\
  " #{@network.inspect}, packet_size: #{@packet_size.inspect}, protocol: #{@protocol.inspect},"\
  " url: #{@url.inspect}, vrf: #{@vrf.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



135
136
137
138
139
140
# File 'lib/mist_api/models/app_probing_custom_app.rb', line 135

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} address: #{@address}, app_type: #{@app_type}, hostnames: #{@hostnames},"\
  " key: #{@key}, name: #{@name}, network: #{@network}, packet_size: #{@packet_size},"\
  " protocol: #{@protocol}, url: #{@url}, vrf: #{@vrf}>"
end