Class: OCI::Opensearch::Models::BenchmarkDetails
- Inherits:
-
Object
- Object
- OCI::Opensearch::Models::BenchmarkDetails
- Defined in:
- lib/oci/opensearch/models/benchmark_details.rb
Overview
Benchmark test configuration detail.
Constant Summary collapse
- PERF_TEST_LENGTH_ENUM =
[ PERF_TEST_LENGTH_STANDARD = 'STANDARD'.freeze, PERF_TEST_LENGTH_LONG = 'LONG'.freeze ].freeze
Instance Attribute Summary collapse
-
#control_cluster_id ⇒ String
[Required] Control Cluster Id Information.
-
#perf_test_length ⇒ String
[Required] Execution Length of Perf Test (default set to STANDARD).
-
#test1_cluster_id ⇒ String
Required Test Cluster Id needed to run perf test.
-
#test2_cluster_id ⇒ String
Optional Test Cluster Id needed to run perf test.
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 = {}) ⇒ BenchmarkDetails
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 = {}) ⇒ BenchmarkDetails
Initializes the object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 66 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.perf_test_length = attributes[:'perfTestLength'] if attributes[:'perfTestLength'] self.perf_test_length = "STANDARD" if perf_test_length.nil? && !attributes.key?(:'perfTestLength') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :perfTestLength and :perf_test_length' if attributes.key?(:'perfTestLength') && attributes.key?(:'perf_test_length') self.perf_test_length = attributes[:'perf_test_length'] if attributes[:'perf_test_length'] self.perf_test_length = "STANDARD" if perf_test_length.nil? && !attributes.key?(:'perfTestLength') && !attributes.key?(:'perf_test_length') # rubocop:disable Style/StringLiterals self.control_cluster_id = attributes[:'controlClusterId'] if attributes[:'controlClusterId'] raise 'You cannot provide both :controlClusterId and :control_cluster_id' if attributes.key?(:'controlClusterId') && attributes.key?(:'control_cluster_id') self.control_cluster_id = attributes[:'control_cluster_id'] if attributes[:'control_cluster_id'] self.test1_cluster_id = attributes[:'test1ClusterId'] if attributes[:'test1ClusterId'] raise 'You cannot provide both :test1ClusterId and :test1_cluster_id' if attributes.key?(:'test1ClusterId') && attributes.key?(:'test1_cluster_id') self.test1_cluster_id = attributes[:'test1_cluster_id'] if attributes[:'test1_cluster_id'] self.test2_cluster_id = attributes[:'test2ClusterId'] if attributes[:'test2ClusterId'] raise 'You cannot provide both :test2ClusterId and :test2_cluster_id' if attributes.key?(:'test2ClusterId') && attributes.key?(:'test2_cluster_id') self.test2_cluster_id = attributes[:'test2_cluster_id'] if attributes[:'test2_cluster_id'] end |
Instance Attribute Details
#control_cluster_id ⇒ String
[Required] Control Cluster Id Information
22 23 24 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 22 def control_cluster_id @control_cluster_id end |
#perf_test_length ⇒ String
[Required] Execution Length of Perf Test (default set to STANDARD)
18 19 20 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 18 def perf_test_length @perf_test_length end |
#test1_cluster_id ⇒ String
Required Test Cluster Id needed to run perf test
26 27 28 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 26 def test1_cluster_id @test1_cluster_id end |
#test2_cluster_id ⇒ String
Optional Test Cluster Id needed to run perf test
30 31 32 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 30 def test2_cluster_id @test2_cluster_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 33 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'perf_test_length': :'perfTestLength', 'control_cluster_id': :'controlClusterId', 'test1_cluster_id': :'test1ClusterId', 'test2_cluster_id': :'test2ClusterId' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 45 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'perf_test_length': :'String', 'control_cluster_id': :'String', 'test1_cluster_id': :'String', 'test2_cluster_id': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
114 115 116 117 118 119 120 121 122 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 114 def ==(other) return true if equal?(other) self.class == other.class && perf_test_length == other.perf_test_length && control_cluster_id == other.control_cluster_id && test1_cluster_id == other.test1_cluster_id && test2_cluster_id == other.test2_cluster_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 147 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
127 128 129 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 127 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
136 137 138 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 136 def hash [perf_test_length, control_cluster_id, test1_cluster_id, test2_cluster_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
180 181 182 183 184 185 186 187 188 189 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 180 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
174 175 176 |
# File 'lib/oci/opensearch/models/benchmark_details.rb', line 174 def to_s to_hash.to_s end |