Class: MistApi::SynthetictestConfigCustomProbe

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

Overview

SynthetictestConfigCustomProbe 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(aggressiveness = SynthetictestConfigAggressivenessEnum::AUTO, target = SKIP, threshold = SKIP, type = SynthetictestConfigCustomProbeTypeEnum::ICMP) ⇒ SynthetictestConfigCustomProbe

Returns a new instance of SynthetictestConfigCustomProbe.



54
55
56
57
58
59
60
61
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 54

def initialize(aggressiveness = SynthetictestConfigAggressivenessEnum::AUTO,
               target = SKIP, threshold = SKIP,
               type = SynthetictestConfigCustomProbeTypeEnum::ICMP)
  @aggressiveness = aggressiveness unless aggressiveness == SKIP
  @target = target unless target == SKIP
  @threshold = threshold unless threshold == SKIP
  @type = type unless type == SKIP
end

Instance Attribute Details

#aggressivenessSynthetictestConfigAggressivenessEnum

enum: ‘auto`, `high`, `low`



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

def aggressiveness
  @aggressiveness
end

#targetString

Can be URL (e.g. x.com, x.com:8080/path/to/resource), IP address, or IP:port combination

Returns:

  • (String)


19
20
21
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 19

def target
  @target
end

#thresholdInteger

In milliseconds

Returns:

  • (Integer)


23
24
25
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 23

def threshold
  @threshold
end

#typeSynthetictestConfigCustomProbeTypeEnum

enum: ‘application`, `curl`, `icmp`, `reachability`, `tcp`



27
28
29
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 27

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  aggressiveness =
    hash['aggressiveness'] ||= SynthetictestConfigAggressivenessEnum::AUTO
  target = hash.key?('target') ? hash['target'] : SKIP
  threshold = hash.key?('threshold') ? hash['threshold'] : SKIP
  type = hash['type'] ||= SynthetictestConfigCustomProbeTypeEnum::ICMP

  # Create object from extracted values.
  SynthetictestConfigCustomProbe.new(aggressiveness,
                                     target,
                                     threshold,
                                     type)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aggressiveness'] = 'aggressiveness'
  @_hash['target'] = 'target'
  @_hash['threshold'] = 'threshold'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 40

def self.optionals
  %w[
    aggressiveness
    target
    threshold
    type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



89
90
91
92
93
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 89

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} aggressiveness: #{@aggressiveness.inspect}, target: #{@target.inspect},"\
  " threshold: #{@threshold.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



82
83
84
85
86
# File 'lib/mist_api/models/synthetictest_config_custom_probe.rb', line 82

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} aggressiveness: #{@aggressiveness}, target: #{@target}, threshold:"\
  " #{@threshold}, type: #{@type}>"
end