Class: MistApi::ConstInsightMetricsProperty

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

Overview

ConstInsightMetricsProperty 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(ctype = SKIP, description = SKIP, example = SKIP, intervals = SKIP, keys = SKIP, params = SKIP, report_durations = SKIP, report_scopes = SKIP, scopes = SKIP, sle_baselined = SKIP, sle_classifiers = SKIP, type = SKIP, unit = SKIP, values = SKIP) ⇒ ConstInsightMetricsProperty

Returns a new instance of ConstInsightMetricsProperty.



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/const_insight_metrics_property.rb', line 113

def initialize(ctype = SKIP, description = SKIP, example = SKIP,
               intervals = SKIP, keys = SKIP, params = SKIP,
               report_durations = SKIP, report_scopes = SKIP, scopes = SKIP,
               sle_baselined = SKIP, sle_classifiers = SKIP, type = SKIP,
               unit = SKIP, values = SKIP)
  @ctype = ctype unless ctype == SKIP
  @description = description unless description == SKIP
  @example = example unless example == SKIP
  @intervals = intervals unless intervals == SKIP
  @keys = keys unless keys == SKIP
  @params = params unless params == SKIP
  @report_durations = report_durations unless report_durations == SKIP
  @report_scopes = report_scopes unless report_scopes == SKIP
  @scopes = scopes unless scopes == SKIP
  @sle_baselined = sle_baselined unless sle_baselined == SKIP
  @sle_classifiers = sle_classifiers unless sle_classifiers == SKIP
  @type = type unless type == SKIP
  @unit = unit unless unit == SKIP
  @values = values unless values == SKIP
end

Instance Attribute Details

#ctypeArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def ctype
  @ctype
end

#descriptionString

TODO: Write general description for this method

Returns:

  • (String)


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

def description
  @description
end

#exampleConstInsightMetricsPropertyExampleAnyOf

TODO: Write general description for this method



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

def example
  @example
end

#intervalsHash[String, ConstInsightMetricsPropertyInterval]

Property key is the interval (e.g. 10m, 1h, …)

Returns:



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

def intervals
  @intervals
end

#keysObject

Property key is the interval (e.g. 10m, 1h, …)

Returns:

  • (Object)


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

def keys
  @keys
end

#paramsHash[String, ConstInsightMetricsPropertyParam]

Property key is the parameter name

Returns:



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

def params
  @params
end

#report_durationsHash[String, ConstInsightMetricsPropertyReportDuration]

Property key is the duration (e.g. 1d, 1w, …)



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

def report_durations
  @report_durations
end

#report_scopesArray[String]

Property key is the duration (e.g. 1d, 1w, …)

Returns:

  • (Array[String])


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

def report_scopes
  @report_scopes
end

#scopesArray[ConstInsightMetricsPropertyScopeEnum]

Property key is the duration (e.g. 1d, 1w, …)



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

def scopes
  @scopes
end

#sle_baselinedTrueClass | FalseClass

Property key is the duration (e.g. 1d, 1w, …)

Returns:

  • (TrueClass | FalseClass)


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

def sle_baselined
  @sle_baselined
end

#sle_classifiersArray[String]

Property key is the duration (e.g. 1d, 1w, …)

Returns:

  • (Array[String])


54
55
56
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 54

def sle_classifiers
  @sle_classifiers
end

#typeString

Property key is the duration (e.g. 1d, 1w, …)

Returns:

  • (String)


58
59
60
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 58

def type
  @type
end

#unitString

Property key is the duration (e.g. 1d, 1w, …)

Returns:

  • (String)


62
63
64
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 62

def unit
  @unit
end

#valuesObject

Property key is the duration (e.g. 1d, 1w, …)

Returns:

  • (Object)


66
67
68
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 66

def values
  @values
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 135

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ctype = hash.key?('ctype') ? hash['ctype'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  example = hash.key?('example') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:ConstInsightMetricsPropertyExampleAnyOf2), hash['example']
  ) : SKIP
  intervals = ConstInsightMetricsPropertyInterval.from_hash(hash['intervals']) if
    hash['intervals']

  intervals = SKIP unless hash.key?('intervals')
  keys = hash.key?('keys') ? hash['keys'] : SKIP
  params = ConstInsightMetricsPropertyParam.from_hash(hash['params']) if hash['params']

  params = SKIP unless hash.key?('params')
  if hash['report_durations']
    report_durations = ConstInsightMetricsPropertyReportDuration.from_hash(hash['report_durations'])
  end

  report_durations = SKIP unless hash.key?('report_durations')
  report_scopes = hash.key?('report_scopes') ? hash['report_scopes'] : SKIP
  scopes = hash.key?('scopes') ? hash['scopes'] : SKIP
  sle_baselined = hash.key?('sle_baselined') ? hash['sle_baselined'] : SKIP
  sle_classifiers =
    hash.key?('sle_classifiers') ? hash['sle_classifiers'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  unit = hash.key?('unit') ? hash['unit'] : SKIP
  values = hash.key?('values') ? hash['values'] : SKIP

  # Create object from extracted values.
  ConstInsightMetricsProperty.new(ctype,
                                  description,
                                  example,
                                  intervals,
                                  keys,
                                  params,
                                  report_durations,
                                  report_scopes,
                                  scopes,
                                  sle_baselined,
                                  sle_classifiers,
                                  type,
                                  unit,
                                  values)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ctype'] = 'ctype'
  @_hash['description'] = 'description'
  @_hash['example'] = 'example'
  @_hash['intervals'] = 'intervals'
  @_hash['keys'] = 'keys'
  @_hash['params'] = 'params'
  @_hash['report_durations'] = 'report_durations'
  @_hash['report_scopes'] = 'report_scopes'
  @_hash['scopes'] = 'scopes'
  @_hash['sle_baselined'] = 'sle_baselined'
  @_hash['sle_classifiers'] = 'sle_classifiers'
  @_hash['type'] = 'type'
  @_hash['unit'] = 'unit'
  @_hash['values'] = 'values'
  @_hash
end

.nullablesObject

An array for nullable fields



109
110
111
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 109

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    ctype
    description
    example
    intervals
    keys
    params
    report_durations
    report_scopes
    scopes
    sle_baselined
    sle_classifiers
    type
    unit
    values
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



185
186
187
188
189
190
191
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 185

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



204
205
206
207
208
209
210
211
212
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 204

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ctype: #{@ctype.inspect}, description: #{@description.inspect}, example:"\
  " #{@example.inspect}, intervals: #{@intervals.inspect}, keys: #{@keys.inspect}, params:"\
  " #{@params.inspect}, report_durations: #{@report_durations.inspect}, report_scopes:"\
  " #{@report_scopes.inspect}, scopes: #{@scopes.inspect}, sle_baselined:"\
  " #{@sle_baselined.inspect}, sle_classifiers: #{@sle_classifiers.inspect}, type:"\
  " #{@type.inspect}, unit: #{@unit.inspect}, values: #{@values.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



194
195
196
197
198
199
200
201
# File 'lib/mist_api/models/const_insight_metrics_property.rb', line 194

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ctype: #{@ctype}, description: #{@description}, example: #{@example},"\
  " intervals: #{@intervals}, keys: #{@keys}, params: #{@params}, report_durations:"\
  " #{@report_durations}, report_scopes: #{@report_scopes}, scopes: #{@scopes}, sle_baselined:"\
  " #{@sle_baselined}, sle_classifiers: #{@sle_classifiers}, type: #{@type}, unit: #{@unit},"\
  " values: #{@values}>"
end