Class: MailSlurpClient::InvokeTransformerOptions
- Inherits:
-
Object
- Object
- MailSlurpClient::InvokeTransformerOptions
- Defined in:
- lib/mailslurp_client/models/invoke_transformer_options.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ai_transform_id ⇒ Object
Returns the value of attribute ai_transform_id.
-
#ai_transform_mapping_id ⇒ Object
Returns the value of attribute ai_transform_mapping_id.
-
#content_selector ⇒ Object
Returns the value of attribute content_selector.
-
#entity_id ⇒ Object
Returns the value of attribute entity_id.
-
#entity_type ⇒ Object
Returns the value of attribute entity_type.
-
#raw_conditions ⇒ Object
Returns the value of attribute raw_conditions.
-
#raw_input ⇒ Object
Returns the value of attribute raw_input.
-
#raw_instructions ⇒ Object
Returns the value of attribute raw_instructions.
-
#raw_output_schema ⇒ Object
Returns the value of attribute raw_output_schema.
-
#save_results ⇒ Object
Returns the value of attribute save_results.
Class Method Summary collapse
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ InvokeTransformerOptions
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ InvokeTransformerOptions
Initializes the object
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 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 109 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::InvokeTransformerOptions` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::InvokeTransformerOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'ai_transform_id') self.ai_transform_id = attributes[:'ai_transform_id'] end if attributes.key?(:'ai_transform_mapping_id') self.ai_transform_mapping_id = attributes[:'ai_transform_mapping_id'] end if attributes.key?(:'raw_input') self.raw_input = attributes[:'raw_input'] end if attributes.key?(:'entity_id') self.entity_id = attributes[:'entity_id'] end if attributes.key?(:'entity_type') self.entity_type = attributes[:'entity_type'] end if attributes.key?(:'raw_conditions') if (value = attributes[:'raw_conditions']).is_a?(Array) self.raw_conditions = value end end if attributes.key?(:'raw_instructions') if (value = attributes[:'raw_instructions']).is_a?(Array) self.raw_instructions = value end end if attributes.key?(:'raw_output_schema') self.raw_output_schema = attributes[:'raw_output_schema'] end if attributes.key?(:'content_selector') self.content_selector = attributes[:'content_selector'] end if attributes.key?(:'save_results') self.save_results = attributes[:'save_results'] end end |
Instance Attribute Details
#ai_transform_id ⇒ Object
Returns the value of attribute ai_transform_id.
17 18 19 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 17 def ai_transform_id @ai_transform_id end |
#ai_transform_mapping_id ⇒ Object
Returns the value of attribute ai_transform_mapping_id.
19 20 21 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 19 def ai_transform_mapping_id @ai_transform_mapping_id end |
#content_selector ⇒ Object
Returns the value of attribute content_selector.
33 34 35 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 33 def content_selector @content_selector end |
#entity_id ⇒ Object
Returns the value of attribute entity_id.
23 24 25 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 23 def entity_id @entity_id end |
#entity_type ⇒ Object
Returns the value of attribute entity_type.
25 26 27 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 25 def entity_type @entity_type end |
#raw_conditions ⇒ Object
Returns the value of attribute raw_conditions.
27 28 29 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 27 def raw_conditions @raw_conditions end |
#raw_input ⇒ Object
Returns the value of attribute raw_input.
21 22 23 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 21 def raw_input @raw_input end |
#raw_instructions ⇒ Object
Returns the value of attribute raw_instructions.
29 30 31 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 29 def raw_instructions @raw_instructions end |
#raw_output_schema ⇒ Object
Returns the value of attribute raw_output_schema.
31 32 33 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 31 def raw_output_schema @raw_output_schema end |
#save_results ⇒ Object
Returns the value of attribute save_results.
35 36 37 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 35 def save_results @save_results end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 60 def self.attribute_map { :'ai_transform_id' => :'aiTransformId', :'ai_transform_mapping_id' => :'aiTransformMappingId', :'raw_input' => :'rawInput', :'entity_id' => :'entityId', :'entity_type' => :'entityType', :'raw_conditions' => :'rawConditions', :'raw_instructions' => :'rawInstructions', :'raw_output_schema' => :'rawOutputSchema', :'content_selector' => :'contentSelector', :'save_results' => :'saveResults' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
236 237 238 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 236 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 92 def self.openapi_nullable Set.new([ :'ai_transform_id', :'ai_transform_mapping_id', :'raw_input', :'entity_id', :'entity_type', :'raw_conditions', :'raw_instructions', :'raw_output_schema', :'content_selector', :'save_results' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 76 def self.openapi_types { :'ai_transform_id' => :'String', :'ai_transform_mapping_id' => :'String', :'raw_input' => :'String', :'entity_id' => :'String', :'entity_type' => :'String', :'raw_conditions' => :'Array<String>', :'raw_instructions' => :'Array<String>', :'raw_output_schema' => :'StructuredOutputSchema', :'content_selector' => :'String', :'save_results' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 206 def ==(o) return true if self.equal?(o) self.class == o.class && ai_transform_id == o.ai_transform_id && ai_transform_mapping_id == o.ai_transform_mapping_id && raw_input == o.raw_input && entity_id == o.entity_id && entity_type == o.entity_type && raw_conditions == o.raw_conditions && raw_instructions == o.raw_instructions && raw_output_schema == o.raw_output_schema && content_selector == o.content_selector && save_results == o.save_results end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 264 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model MailSlurpClient.const_get(type).build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 333 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 243 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if 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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean
223 224 225 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 223 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
229 230 231 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 229 def hash [ai_transform_id, ai_transform_mapping_id, raw_input, entity_id, entity_type, raw_conditions, raw_instructions, raw_output_schema, content_selector, save_results].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
169 170 171 172 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 169 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
309 310 311 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 309 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 315 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 |
#to_s ⇒ String
Returns the string representation of the object
303 304 305 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 303 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
176 177 178 179 180 181 182 |
# File 'lib/mailslurp_client/models/invoke_transformer_options.rb', line 176 def valid? entity_type_validator = EnumAttributeValidator.new('String', ["EMAIL", "SMS", "ATTACHMENT"]) return false unless entity_type_validator.valid?(@entity_type) content_selector_validator = EnumAttributeValidator.new('String', ["RAW", "BODY", "BODY_ATTACHMENTS"]) return false unless content_selector_validator.valid?(@content_selector) true end |