Class: LaunchDarklyApi::AgentOptimizationPost
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- LaunchDarklyApi::AgentOptimizationPost
- Defined in:
- lib/launchdarkly_api/models/agent_optimization_post.rb
Instance Attribute Summary collapse
-
#acceptance_statements ⇒ Object
Returns the value of attribute acceptance_statements.
-
#ai_config_key ⇒ Object
Returns the value of attribute ai_config_key.
-
#auto_commit ⇒ Object
Returns the value of attribute auto_commit.
-
#ground_truth_responses ⇒ Object
Returns the value of attribute ground_truth_responses.
-
#judge_model ⇒ Object
Returns the value of attribute judge_model.
-
#judges ⇒ Object
Returns the value of attribute judges.
-
#key ⇒ Object
Returns the value of attribute key.
-
#label ⇒ Object
Returns the value of attribute label.
-
#latency_optimization ⇒ Object
Returns the value of attribute latency_optimization.
-
#max_attempts ⇒ Object
Returns the value of attribute max_attempts.
-
#metric_key ⇒ Object
Returns the value of attribute metric_key.
-
#model_choices ⇒ Object
Returns the value of attribute model_choices.
-
#token_limit ⇒ Object
Returns the value of attribute token_limit.
-
#token_optimization ⇒ Object
Returns the value of attribute token_optimization.
-
#user_input_options ⇒ Object
Returns the value of attribute user_input_options.
-
#variable_choices ⇒ Object
Returns the value of attribute variable_choices.
-
#variation_key ⇒ Object
Returns the value of attribute variation_key.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AgentOptimizationPost
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ AgentOptimizationPost
Initializes the object
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 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 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 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 116 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `LaunchDarklyApi::AgentOptimizationPost` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `LaunchDarklyApi::AgentOptimizationPost`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'key') self.key = attributes[:'key'] else self.key = nil end if attributes.key?(:'ai_config_key') self.ai_config_key = attributes[:'ai_config_key'] else self.ai_config_key = nil end if attributes.key?(:'max_attempts') self.max_attempts = attributes[:'max_attempts'] else self.max_attempts = nil end if attributes.key?(:'model_choices') if (value = attributes[:'model_choices']).is_a?(Array) self.model_choices = value end end if attributes.key?(:'judge_model') self.judge_model = attributes[:'judge_model'] else self.judge_model = nil end if attributes.key?(:'variable_choices') if (value = attributes[:'variable_choices']).is_a?(Array) self.variable_choices = value end end if attributes.key?(:'acceptance_statements') if (value = attributes[:'acceptance_statements']).is_a?(Array) self.acceptance_statements = value end end if attributes.key?(:'judges') if (value = attributes[:'judges']).is_a?(Array) self.judges = value end end if attributes.key?(:'user_input_options') if (value = attributes[:'user_input_options']).is_a?(Array) self. = value end end if attributes.key?(:'ground_truth_responses') if (value = attributes[:'ground_truth_responses']).is_a?(Array) self.ground_truth_responses = value end end if attributes.key?(:'metric_key') self.metric_key = attributes[:'metric_key'] end if attributes.key?(:'token_limit') self.token_limit = attributes[:'token_limit'] end if attributes.key?(:'variation_key') self.variation_key = attributes[:'variation_key'] end if attributes.key?(:'label') self.label = attributes[:'label'] end if attributes.key?(:'latency_optimization') self.latency_optimization = attributes[:'latency_optimization'] end if attributes.key?(:'token_optimization') self.token_optimization = attributes[:'token_optimization'] end if attributes.key?(:'auto_commit') self.auto_commit = attributes[:'auto_commit'] end end |
Instance Attribute Details
#acceptance_statements ⇒ Object
Returns the value of attribute acceptance_statements.
30 31 32 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 30 def acceptance_statements @acceptance_statements end |
#ai_config_key ⇒ Object
Returns the value of attribute ai_config_key.
20 21 22 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 20 def ai_config_key @ai_config_key end |
#auto_commit ⇒ Object
Returns the value of attribute auto_commit.
50 51 52 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 50 def auto_commit @auto_commit end |
#ground_truth_responses ⇒ Object
Returns the value of attribute ground_truth_responses.
36 37 38 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 36 def ground_truth_responses @ground_truth_responses end |
#judge_model ⇒ Object
Returns the value of attribute judge_model.
26 27 28 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 26 def judge_model @judge_model end |
#judges ⇒ Object
Returns the value of attribute judges.
32 33 34 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 32 def judges @judges end |
#key ⇒ Object
Returns the value of attribute key.
18 19 20 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 18 def key @key end |
#label ⇒ Object
Returns the value of attribute label.
44 45 46 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 44 def label @label end |
#latency_optimization ⇒ Object
Returns the value of attribute latency_optimization.
46 47 48 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 46 def latency_optimization @latency_optimization end |
#max_attempts ⇒ Object
Returns the value of attribute max_attempts.
22 23 24 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 22 def max_attempts @max_attempts end |
#metric_key ⇒ Object
Returns the value of attribute metric_key.
38 39 40 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 38 def metric_key @metric_key end |
#model_choices ⇒ Object
Returns the value of attribute model_choices.
24 25 26 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 24 def model_choices @model_choices end |
#token_limit ⇒ Object
Returns the value of attribute token_limit.
40 41 42 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 40 def token_limit @token_limit end |
#token_optimization ⇒ Object
Returns the value of attribute token_optimization.
48 49 50 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 48 def token_optimization @token_optimization end |
#user_input_options ⇒ Object
Returns the value of attribute user_input_options.
34 35 36 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 34 def @user_input_options end |
#variable_choices ⇒ Object
Returns the value of attribute variable_choices.
28 29 30 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 28 def variable_choices @variable_choices end |
#variation_key ⇒ Object
Returns the value of attribute variation_key.
42 43 44 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 42 def variation_key @variation_key end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
76 77 78 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 76 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
81 82 83 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 81 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 53 def self.attribute_map { :'key' => :'key', :'ai_config_key' => :'aiConfigKey', :'max_attempts' => :'maxAttempts', :'model_choices' => :'modelChoices', :'judge_model' => :'judgeModel', :'variable_choices' => :'variableChoices', :'acceptance_statements' => :'acceptanceStatements', :'judges' => :'judges', :'user_input_options' => :'userInputOptions', :'ground_truth_responses' => :'groundTruthResponses', :'metric_key' => :'metricKey', :'token_limit' => :'tokenLimit', :'variation_key' => :'variationKey', :'label' => :'label', :'latency_optimization' => :'latencyOptimization', :'token_optimization' => :'tokenOptimization', :'auto_commit' => :'autoCommit' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 333 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
109 110 111 112 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 109 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 86 def self.openapi_types { :'key' => :'String', :'ai_config_key' => :'String', :'max_attempts' => :'Integer', :'model_choices' => :'Array<String>', :'judge_model' => :'String', :'variable_choices' => :'Array<Hash<String, Object>>', :'acceptance_statements' => :'Array<AgentOptimizationAcceptanceStatement>', :'judges' => :'Array<AgentOptimizationJudge>', :'user_input_options' => :'Array<String>', :'ground_truth_responses' => :'Array<String>', :'metric_key' => :'String', :'token_limit' => :'Integer', :'variation_key' => :'String', :'label' => :'String', :'latency_optimization' => :'Boolean', :'token_optimization' => :'Boolean', :'auto_commit' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 296 def ==(o) return true if self.equal?(o) self.class == o.class && key == o.key && ai_config_key == o.ai_config_key && max_attempts == o.max_attempts && model_choices == o.model_choices && judge_model == o.judge_model && variable_choices == o.variable_choices && acceptance_statements == o.acceptance_statements && judges == o.judges && == o. && ground_truth_responses == o.ground_truth_responses && metric_key == o.metric_key && token_limit == o.token_limit && variation_key == o.variation_key && label == o.label && latency_optimization == o.latency_optimization && token_optimization == o.token_optimization && auto_commit == o.auto_commit end |
#eql?(o) ⇒ Boolean
320 321 322 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 320 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
326 327 328 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 326 def hash [key, ai_config_key, max_attempts, model_choices, judge_model, variable_choices, acceptance_statements, judges, , ground_truth_responses, metric_key, token_limit, variation_key, label, latency_optimization, token_optimization, auto_commit].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 221 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @key.nil? invalid_properties.push('invalid value for "key", key cannot be nil.') end if @ai_config_key.nil? invalid_properties.push('invalid value for "ai_config_key", ai_config_key cannot be nil.') end if @max_attempts.nil? invalid_properties.push('invalid value for "max_attempts", max_attempts cannot be nil.') end if @judge_model.nil? invalid_properties.push('invalid value for "judge_model", judge_model cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 355 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
245 246 247 248 249 250 251 252 |
# File 'lib/launchdarkly_api/models/agent_optimization_post.rb', line 245 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @key.nil? return false if @ai_config_key.nil? return false if @max_attempts.nil? return false if @judge_model.nil? true end |