Class: OCI::Rover::Models::RoverWorkload
- Inherits:
-
Object
- Object
- OCI::Rover::Models::RoverWorkload
- Defined in:
- lib/oci/rover/models/rover_workload.rb
Overview
Information about a RoverWorkload.
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
[Required] The OCID of the compartment containing the workload.
-
#id ⇒ String
[Required] The Unique Oracle ID (OCID) that is immutable on creation.
-
#name ⇒ String
Name of the Rover Workload.
-
#object_count ⇒ String
Number of objects in a workload.
-
#prefix ⇒ String
Prefix to filter objects in case it is a bucket.
-
#range_end ⇒ String
End of the range in a bucket.
-
#range_start ⇒ String
Start of the range in a bucket.
-
#size ⇒ String
Size of the workload.
-
#work_request_id ⇒ String
The compute work request id to track progress of custom image exports.
-
#workload_type ⇒ String
[Required] The type of workload.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ RoverWorkload
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ RoverWorkload
Initializes the object
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_id ⇒ String
[Required] The OCID of the compartment containing the workload.
17 18 19 |
# File 'lib/oci/rover/models/rover_workload.rb', line 17 def compartment_id @compartment_id end |
#id ⇒ String
[Required] The Unique Oracle ID (OCID) that is immutable on creation.
21 22 23 |
# File 'lib/oci/rover/models/rover_workload.rb', line 21 def id @id end |
#name ⇒ String
Name of the Rover Workload
13 14 15 |
# File 'lib/oci/rover/models/rover_workload.rb', line 13 def name @name end |
#object_count ⇒ String
Number of objects in a workload.
29 30 31 |
# File 'lib/oci/rover/models/rover_workload.rb', line 29 def object_count @object_count end |
#prefix ⇒ String
Prefix to filter objects in case it is a bucket.
33 34 35 |
# File 'lib/oci/rover/models/rover_workload.rb', line 33 def prefix @prefix end |
#range_end ⇒ String
End of the range in a bucket.
41 42 43 |
# File 'lib/oci/rover/models/rover_workload.rb', line 41 def range_end @range_end end |
#range_start ⇒ String
Start of the range in a bucket.
37 38 39 |
# File 'lib/oci/rover/models/rover_workload.rb', line 37 def range_start @range_start end |
#size ⇒ String
Size of the workload.
25 26 27 |
# File 'lib/oci/rover/models/rover_workload.rb', line 25 def size @size end |
#work_request_id ⇒ String
The compute work request id to track progress of custom image exports.
49 50 51 |
# File 'lib/oci/rover/models/rover_workload.rb', line 49 def work_request_id @work_request_id end |
#workload_type ⇒ String
[Required] The type of workload
45 46 47 |
# File 'lib/oci/rover/models/rover_workload.rb', line 45 def workload_type @workload_type end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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
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
180 181 182 |
# File 'lib/oci/rover/models/rover_workload.rb', line 180 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
227 228 229 |
# File 'lib/oci/rover/models/rover_workload.rb', line 227 def to_s to_hash.to_s end |