Class: OCI::ApmSynthetics::Models::WorkerSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_synthetics/models/worker_summary.rb

Overview

Information about On-premise VP worker.

Constant Summary collapse

WORKER_TYPE_ENUM =
[
  WORKER_TYPE_DOCKER = 'DOCKER'.freeze,
  WORKER_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_ENABLED = 'ENABLED'.freeze,
  STATUS_DISABLED = 'DISABLED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WorkerSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 163

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.name = attributes[:'name'] if attributes[:'name']

  self.version_details = attributes[:'versionDetails'] if attributes[:'versionDetails']

  raise 'You cannot provide both :versionDetails and :version_details' if attributes.key?(:'versionDetails') && attributes.key?(:'version_details')

  self.version_details = attributes[:'version_details'] if attributes[:'version_details']

  self.configuration_details = attributes[:'configurationDetails'] if attributes[:'configurationDetails']

  raise 'You cannot provide both :configurationDetails and :configuration_details' if attributes.key?(:'configurationDetails') && attributes.key?(:'configuration_details')

  self.configuration_details = attributes[:'configuration_details'] if attributes[:'configuration_details']

  self.worker_type = attributes[:'workerType'] if attributes[:'workerType']

  raise 'You cannot provide both :workerType and :worker_type' if attributes.key?(:'workerType') && attributes.key?(:'worker_type')

  self.worker_type = attributes[:'worker_type'] if attributes[:'worker_type']

  self.status = attributes[:'status'] if attributes[:'status']

  self.priority = attributes[:'priority'] if attributes[:'priority']

  self.geo_info = attributes[:'geoInfo'] if attributes[:'geoInfo']

  raise 'You cannot provide both :geoInfo and :geo_info' if attributes.key?(:'geoInfo') && attributes.key?(:'geo_info')

  self.geo_info = attributes[:'geo_info'] if attributes[:'geo_info']

  self.monitor_list = attributes[:'monitorList'] if attributes[:'monitorList']

  raise 'You cannot provide both :monitorList and :monitor_list' if attributes.key?(:'monitorList') && attributes.key?(:'monitor_list')

  self.monitor_list = attributes[:'monitor_list'] if attributes[:'monitor_list']

  self.time_last_syncup = attributes[:'timeLastSyncup'] if attributes[:'timeLastSyncup']

  raise 'You cannot provide both :timeLastSyncup and :time_last_syncup' if attributes.key?(:'timeLastSyncup') && attributes.key?(:'time_last_syncup')

  self.time_last_syncup = attributes[:'time_last_syncup'] if attributes[:'time_last_syncup']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

  raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')

  self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')

  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
end

Instance Attribute Details

#configuration_detailsObject

Configuration details of the On-premise VP worker.

Returns:

  • (Object)


41
42
43
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 41

def configuration_details
  @configuration_details
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


94
95
96
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 94

def defined_tags
  @defined_tags
end

#display_nameString

[Required] Unique On-premise VP worker name that cannot be edited. The name should not contain any confidential information.

Returns:

  • (String)


29
30
31
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 29

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


88
89
90
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 88

def freeform_tags
  @freeform_tags
end

#geo_infoString

Geographical information of the On-premise VP worker.

Returns:

  • (String)


57
58
59
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 57

def geo_info
  @geo_info
end

#idString

[Required] The OCID of the On-premise VP worker.

Returns:

  • (String)


25
26
27
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 25

def id
  @id
end

#monitor_listArray<OCI::ApmSynthetics::Models::WorkerMonitorList>

Monitors list assigned to the On-premise VP worker.



61
62
63
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 61

def monitor_list
  @monitor_list
end

#nameString

[Required] Unique permanent name of the On-premise VP worker. This is the same as the displayName.

Returns:

  • (String)


33
34
35
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 33

def name
  @name
end

#priorityInteger

[Required] Priority of the On-premise VP worker to schedule monitors.

Returns:

  • (Integer)


53
54
55
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 53

def priority
  @priority
end

#statusString

[Required] Enables or disables the On-premise VP worker.

Returns:

  • (String)


49
50
51
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 49

def status
  @status
end

#time_createdDateTime

The time the resource was created, expressed in RFC 3339 timestamp format. Example: 2020-02-12T22:47:12.613Z

Returns:

  • (DateTime)


75
76
77
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 75

def time_created
  @time_created
end

#time_last_syncupDateTime

The time the resource was last synced, expressed in RFC 3339 timestamp format. Example: 2020-02-12T22:47:12.613Z

Returns:

  • (DateTime)


68
69
70
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 68

def time_last_syncup
  @time_last_syncup
end

#time_updatedDateTime

The time the resource was updated, expressed in RFC 3339 timestamp format. Example: 2020-02-13T22:47:12.613Z

Returns:

  • (DateTime)


82
83
84
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 82

def time_updated
  @time_updated
end

#version_detailsOCI::ApmSynthetics::Models::OnPremiseVpWorkerVersionDetails

This attribute is required.



37
38
39
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 37

def version_details
  @version_details
end

#worker_typeString

[Required] Type of the On-premise VP worker.

Returns:

  • (String)


45
46
47
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 45

def worker_type
  @worker_type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 97

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'name': :'name',
    'version_details': :'versionDetails',
    'configuration_details': :'configurationDetails',
    'worker_type': :'workerType',
    'status': :'status',
    'priority': :'priority',
    'geo_info': :'geoInfo',
    'monitor_list': :'monitorList',
    'time_last_syncup': :'timeLastSyncup',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 120

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'name': :'String',
    'version_details': :'OCI::ApmSynthetics::Models::OnPremiseVpWorkerVersionDetails',
    'configuration_details': :'Object',
    'worker_type': :'String',
    'status': :'String',
    'priority': :'Integer',
    'geo_info': :'String',
    'monitor_list': :'Array<OCI::ApmSynthetics::Models::WorkerMonitorList>',
    'time_last_syncup': :'DateTime',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 277

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    name == other.name &&
    version_details == other.version_details &&
    configuration_details == other.configuration_details &&
    worker_type == other.worker_type &&
    status == other.status &&
    priority == other.priority &&
    geo_info == other.geo_info &&
    monitor_list == other.monitor_list &&
    time_last_syncup == other.time_last_syncup &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 321

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


301
302
303
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 301

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



310
311
312
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 310

def hash
  [id, display_name, name, version_details, configuration_details, worker_type, status, priority, geo_info, monitor_list, time_last_syncup, time_created, time_updated, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



354
355
356
357
358
359
360
361
362
363
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 354

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



348
349
350
# File 'lib/oci/apm_synthetics/models/worker_summary.rb', line 348

def to_s
  to_hash.to_s
end