Class: Lockally::SendMessage
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Lockally::SendMessage
- Defined in:
- lib/lockally/models/send_message.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#bcc ⇒ Object
Returns the value of attribute bcc.
-
#cc ⇒ Object
Returns the value of attribute cc.
-
#from ⇒ Object
Returns the value of attribute from.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#html ⇒ Object
Returns the value of attribute html.
-
#send_at ⇒ Object
Returns the value of attribute send_at.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#template_id ⇒ Object
Returns the value of attribute template_id.
-
#text ⇒ Object
Returns the value of attribute text.
-
#to ⇒ Object
Returns the value of attribute to.
-
#unsubscribe ⇒ Object
Returns the value of attribute unsubscribe.
-
#variables ⇒ Object
Returns the value of attribute variables.
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 = {}) ⇒ SendMessage
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 = {}) ⇒ SendMessage
Initializes the object
100 101 102 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 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 |
# File 'lib/lockally/models/send_message.rb', line 100 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::SendMessage` 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 `Lockally::SendMessage`. 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?(:'from') self.from = attributes[:'from'] else self.from = nil end if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end else self.to = nil end if attributes.key?(:'cc') if (value = attributes[:'cc']).is_a?(Array) self.cc = value end end if attributes.key?(:'bcc') if (value = attributes[:'bcc']).is_a?(Array) self.bcc = value end end if attributes.key?(:'subject') self.subject = attributes[:'subject'] end if attributes.key?(:'text') self.text = attributes[:'text'] end if attributes.key?(:'html') self.html = attributes[:'html'] end if attributes.key?(:'headers') if (value = attributes[:'headers']).is_a?(Hash) self.headers = value end end if attributes.key?(:'unsubscribe') self.unsubscribe = attributes[:'unsubscribe'] end if attributes.key?(:'template_id') self.template_id = attributes[:'template_id'] end if attributes.key?(:'variables') if (value = attributes[:'variables']).is_a?(Hash) self.variables = value end end if attributes.key?(:'send_at') self.send_at = attributes[:'send_at'] end if attributes.key?(:'attachments') if (value = attributes[:'attachments']).is_a?(Array) self. = value end end end |
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments.
42 43 44 |
# File 'lib/lockally/models/send_message.rb', line 42 def @attachments end |
#bcc ⇒ Object
Returns the value of attribute bcc.
24 25 26 |
# File 'lib/lockally/models/send_message.rb', line 24 def bcc @bcc end |
#cc ⇒ Object
Returns the value of attribute cc.
22 23 24 |
# File 'lib/lockally/models/send_message.rb', line 22 def cc @cc end |
#from ⇒ Object
Returns the value of attribute from.
18 19 20 |
# File 'lib/lockally/models/send_message.rb', line 18 def from @from end |
#headers ⇒ Object
Returns the value of attribute headers.
32 33 34 |
# File 'lib/lockally/models/send_message.rb', line 32 def headers @headers end |
#html ⇒ Object
Returns the value of attribute html.
30 31 32 |
# File 'lib/lockally/models/send_message.rb', line 30 def html @html end |
#send_at ⇒ Object
Returns the value of attribute send_at.
40 41 42 |
# File 'lib/lockally/models/send_message.rb', line 40 def send_at @send_at end |
#subject ⇒ Object
Returns the value of attribute subject.
26 27 28 |
# File 'lib/lockally/models/send_message.rb', line 26 def subject @subject end |
#template_id ⇒ Object
Returns the value of attribute template_id.
36 37 38 |
# File 'lib/lockally/models/send_message.rb', line 36 def template_id @template_id end |
#text ⇒ Object
Returns the value of attribute text.
28 29 30 |
# File 'lib/lockally/models/send_message.rb', line 28 def text @text end |
#to ⇒ Object
Returns the value of attribute to.
20 21 22 |
# File 'lib/lockally/models/send_message.rb', line 20 def to @to end |
#unsubscribe ⇒ Object
Returns the value of attribute unsubscribe.
34 35 36 |
# File 'lib/lockally/models/send_message.rb', line 34 def unsubscribe @unsubscribe end |
#variables ⇒ Object
Returns the value of attribute variables.
38 39 40 |
# File 'lib/lockally/models/send_message.rb', line 38 def variables @variables end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
64 65 66 |
# File 'lib/lockally/models/send_message.rb', line 64 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
69 70 71 |
# File 'lib/lockally/models/send_message.rb', line 69 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/lockally/models/send_message.rb', line 45 def self.attribute_map { :'from' => :'from', :'to' => :'to', :'cc' => :'cc', :'bcc' => :'bcc', :'subject' => :'subject', :'text' => :'text', :'html' => :'html', :'headers' => :'headers', :'unsubscribe' => :'unsubscribe', :'template_id' => :'template_id', :'variables' => :'variables', :'send_at' => :'send_at', :'attachments' => :'attachments' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/lockally/models/send_message.rb', line 272 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
93 94 95 96 |
# File 'lib/lockally/models/send_message.rb', line 93 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/lockally/models/send_message.rb', line 74 def self.openapi_types { :'from' => :'String', :'to' => :'Array<String>', :'cc' => :'Array<String>', :'bcc' => :'Array<String>', :'subject' => :'String', :'text' => :'String', :'html' => :'String', :'headers' => :'Hash<String, String>', :'unsubscribe' => :'Boolean', :'template_id' => :'String', :'variables' => :'Hash<String, String>', :'send_at' => :'Time', :'attachments' => :'Array<V1SendPostRequestAttachmentsInner>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/lockally/models/send_message.rb', line 239 def ==(o) return true if self.equal?(o) self.class == o.class && from == o.from && to == o.to && cc == o.cc && bcc == o.bcc && subject == o.subject && text == o.text && html == o.html && headers == o.headers && unsubscribe == o.unsubscribe && template_id == o.template_id && variables == o.variables && send_at == o.send_at && == o. end |
#eql?(o) ⇒ Boolean
259 260 261 |
# File 'lib/lockally/models/send_message.rb', line 259 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
265 266 267 |
# File 'lib/lockally/models/send_message.rb', line 265 def hash [from, to, cc, bcc, subject, text, html, headers, unsubscribe, template_id, variables, send_at, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/lockally/models/send_message.rb', line 185 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @from.nil? invalid_properties.push('invalid value for "from", from cannot be nil.') end if @to.nil? invalid_properties.push('invalid value for "to", to cannot be nil.') end if @to.length < 1 invalid_properties.push('invalid value for "to", number of items must be greater than or equal to 1.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/lockally/models/send_message.rb', line 294 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
205 206 207 208 209 210 211 |
# File 'lib/lockally/models/send_message.rb', line 205 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @from.nil? return false if @to.nil? return false if @to.length < 1 true end |