Class: OCI::Rover::Models::RoverWorkload

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/rover/models/rover_workload.rb

Overview

Information about a RoverWorkload.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RoverWorkload

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :id (String)

    The value to assign to the #id property

  • :size (String)

    The value to assign to the #size property

  • :object_count (String)

    The value to assign to the #object_count property

  • :prefix (String)

    The value to assign to the #prefix property

  • :range_start (String)

    The value to assign to the #range_start property

  • :range_end (String)

    The value to assign to the #range_end property

  • :workload_type (String)

    The value to assign to the #workload_type property

  • :work_request_id (String)

    The value to assign to the #work_request_id property



103
104
105
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/oci/rover/models/rover_workload.rb', line 103

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.name = attributes[:'name'] if attributes[:'name']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

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

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

  self.object_count = attributes[:'objectCount'] if attributes[:'objectCount']

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

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

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

  self.range_start = attributes[:'rangeStart'] if attributes[:'rangeStart']

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

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

  self.range_end = attributes[:'rangeEnd'] if attributes[:'rangeEnd']

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

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

  self.workload_type = attributes[:'workloadType'] if attributes[:'workloadType']

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

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

  self.work_request_id = attributes[:'workRequestId'] if attributes[:'workRequestId']

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

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

Instance Attribute Details

#compartment_idString

[Required] The OCID of the compartment containing the workload.

Returns:

  • (String)


17
18
19
# File 'lib/oci/rover/models/rover_workload.rb', line 17

def compartment_id
  @compartment_id
end

#idString

[Required] The Unique Oracle ID (OCID) that is immutable on creation.

Returns:

  • (String)


21
22
23
# File 'lib/oci/rover/models/rover_workload.rb', line 21

def id
  @id
end

#nameString

Name of the Rover Workload

Returns:

  • (String)


13
14
15
# File 'lib/oci/rover/models/rover_workload.rb', line 13

def name
  @name
end

#object_countString

Number of objects in a workload.

Returns:

  • (String)


29
30
31
# File 'lib/oci/rover/models/rover_workload.rb', line 29

def object_count
  @object_count
end

#prefixString

Prefix to filter objects in case it is a bucket.

Returns:

  • (String)


33
34
35
# File 'lib/oci/rover/models/rover_workload.rb', line 33

def prefix
  @prefix
end

#range_endString

End of the range in a bucket.

Returns:

  • (String)


41
42
43
# File 'lib/oci/rover/models/rover_workload.rb', line 41

def range_end
  @range_end
end

#range_startString

Start of the range in a bucket.

Returns:

  • (String)


37
38
39
# File 'lib/oci/rover/models/rover_workload.rb', line 37

def range_start
  @range_start
end

#sizeString

Size of the workload.

Returns:

  • (String)


25
26
27
# File 'lib/oci/rover/models/rover_workload.rb', line 25

def size
  @size
end

#work_request_idString

The compute work request id to track progress of custom image exports.

Returns:

  • (String)


49
50
51
# File 'lib/oci/rover/models/rover_workload.rb', line 49

def work_request_id
  @work_request_id
end

#workload_typeString

[Required] The type of workload

Returns:

  • (String)


45
46
47
# File 'lib/oci/rover/models/rover_workload.rb', line 45

def workload_type
  @workload_type
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/rover/models/rover_workload.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'compartment_id': :'compartmentId',
    'id': :'id',
    'size': :'size',
    'object_count': :'objectCount',
    'prefix': :'prefix',
    'range_start': :'rangeStart',
    'range_end': :'rangeEnd',
    'workload_type': :'workloadType',
    'work_request_id': :'workRequestId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/rover/models/rover_workload.rb', line 70

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'compartment_id': :'String',
    'id': :'String',
    'size': :'String',
    'object_count': :'String',
    'prefix': :'String',
    'range_start': :'String',
    'range_end': :'String',
    'workload_type': :'String',
    'work_request_id': :'String'
    # 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



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/oci/rover/models/rover_workload.rb', line 161

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

  self.class == other.class &&
    name == other.name &&
    compartment_id == other.compartment_id &&
    id == other.id &&
    size == other.size &&
    object_count == other.object_count &&
    prefix == other.prefix &&
    range_start == other.range_start &&
    range_end == other.range_end &&
    workload_type == other.workload_type &&
    work_request_id == other.work_request_id
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



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/rover/models/rover_workload.rb', line 200

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


180
181
182
# File 'lib/oci/rover/models/rover_workload.rb', line 180

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



189
190
191
# File 'lib/oci/rover/models/rover_workload.rb', line 189

def hash
  [name, compartment_id, id, size, object_count, prefix, range_start, range_end, workload_type, work_request_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



233
234
235
236
237
238
239
240
241
242
# File 'lib/oci/rover/models/rover_workload.rb', line 233

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



227
228
229
# File 'lib/oci/rover/models/rover_workload.rb', line 227

def to_s
  to_hash.to_s
end