Class: Pingram::TemplatePatchRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Pingram::TemplatePatchRequest
- Defined in:
- lib/pingram/models/template_patch_request.rb
Overview
Request body for updating a template. Include only properties that apply to the channel in the path. EMAIL: html, subject, senderName, etc. | INAPP_WEB: title, redirectURL, instant, batch | SMS/CALL: text | PUSH/WEB_PUSH: title, message, icon, url | SLACK: text, blocks, username, icon
Instance Attribute Summary collapse
-
#batch ⇒ Object
Returns the value of attribute batch.
-
#blocks ⇒ Object
Slack message blocks (optional).
-
#html ⇒ Object
HTML body of the email.
-
#icon ⇒ Object
Web push: icon URL.
-
#image_url ⇒ Object
Image URL shown in the in-app notification.
-
#instant ⇒ Object
Returns the value of attribute instant.
-
#internal ⇒ Object
Internal editor representation of the email content (e.g. Bee or Redactor JSON).
-
#message ⇒ Object
Push notification body text.
-
#preview_text ⇒ Object
Preview text (e.g. for inbox).
-
#redirect_url ⇒ Object
URL to open when the user taps the notification.
-
#sender_email ⇒ Object
Sender email address.
-
#sender_name ⇒ Object
Sender display name.
-
#subject ⇒ Object
Email subject line.
-
#text ⇒ Object
Message text (SMS or call).
-
#title ⇒ Object
Notification title (in-app).
-
#url ⇒ Object
Web push: URL to open when the notification is clicked.
-
#username ⇒ Object
Slack bot username.
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 = {}) ⇒ TemplatePatchRequest
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 = {}) ⇒ TemplatePatchRequest
Initializes the object
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 |
# File 'lib/pingram/models/template_patch_request.rb', line 132 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequest` 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 `Pingram::TemplatePatchRequest`. 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?(:'html') self.html = attributes[:'html'] end if attributes.key?(:'preview_text') self.preview_text = attributes[:'preview_text'] end if attributes.key?(:'internal') self.internal = attributes[:'internal'] end if attributes.key?(:'subject') self.subject = attributes[:'subject'] end if attributes.key?(:'sender_name') self.sender_name = attributes[:'sender_name'] end if attributes.key?(:'sender_email') self.sender_email = attributes[:'sender_email'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'redirect_url') self.redirect_url = attributes[:'redirect_url'] end if attributes.key?(:'image_url') self.image_url = attributes[:'image_url'] end if attributes.key?(:'instant') self.instant = attributes[:'instant'] end if attributes.key?(:'batch') self.batch = attributes[:'batch'] end if attributes.key?(:'text') self.text = attributes[:'text'] end if attributes.key?(:'message') self. = attributes[:'message'] end if attributes.key?(:'icon') self.icon = attributes[:'icon'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'blocks') if (value = attributes[:'blocks']).is_a?(Array) self.blocks = value end end if attributes.key?(:'username') self.username = attributes[:'username'] end end |
Instance Attribute Details
#batch ⇒ Object
Returns the value of attribute batch.
48 49 50 |
# File 'lib/pingram/models/template_patch_request.rb', line 48 def batch @batch end |
#blocks ⇒ Object
Slack message blocks (optional).
63 64 65 |
# File 'lib/pingram/models/template_patch_request.rb', line 63 def blocks @blocks end |
#html ⇒ Object
HTML body of the email.
20 21 22 |
# File 'lib/pingram/models/template_patch_request.rb', line 20 def html @html end |
#icon ⇒ Object
Web push: icon URL. Slack: bot icon (emoji or URL).
57 58 59 |
# File 'lib/pingram/models/template_patch_request.rb', line 57 def icon @icon end |
#image_url ⇒ Object
Image URL shown in the in-app notification.
44 45 46 |
# File 'lib/pingram/models/template_patch_request.rb', line 44 def image_url @image_url end |
#instant ⇒ Object
Returns the value of attribute instant.
46 47 48 |
# File 'lib/pingram/models/template_patch_request.rb', line 46 def instant @instant end |
#internal ⇒ Object
Internal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
26 27 28 |
# File 'lib/pingram/models/template_patch_request.rb', line 26 def internal @internal end |
#message ⇒ Object
Push notification body text. (title is shared with INAPP_WEB above.)
54 55 56 |
# File 'lib/pingram/models/template_patch_request.rb', line 54 def end |
#preview_text ⇒ Object
Preview text (e.g. for inbox).
23 24 25 |
# File 'lib/pingram/models/template_patch_request.rb', line 23 def preview_text @preview_text end |
#redirect_url ⇒ Object
URL to open when the user taps the notification.
41 42 43 |
# File 'lib/pingram/models/template_patch_request.rb', line 41 def redirect_url @redirect_url end |
#sender_email ⇒ Object
Sender email address.
35 36 37 |
# File 'lib/pingram/models/template_patch_request.rb', line 35 def sender_email @sender_email end |
#sender_name ⇒ Object
Sender display name.
32 33 34 |
# File 'lib/pingram/models/template_patch_request.rb', line 32 def sender_name @sender_name end |
#subject ⇒ Object
Email subject line.
29 30 31 |
# File 'lib/pingram/models/template_patch_request.rb', line 29 def subject @subject end |
#text ⇒ Object
Message text (SMS or call).
51 52 53 |
# File 'lib/pingram/models/template_patch_request.rb', line 51 def text @text end |
#title ⇒ Object
Notification title (in-app).
38 39 40 |
# File 'lib/pingram/models/template_patch_request.rb', line 38 def title @title end |
#url ⇒ Object
Web push: URL to open when the notification is clicked.
60 61 62 |
# File 'lib/pingram/models/template_patch_request.rb', line 60 def url @url end |
#username ⇒ Object
Slack bot username.
66 67 68 |
# File 'lib/pingram/models/template_patch_request.rb', line 66 def username @username end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
92 93 94 |
# File 'lib/pingram/models/template_patch_request.rb', line 92 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
97 98 99 |
# File 'lib/pingram/models/template_patch_request.rb', line 97 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/pingram/models/template_patch_request.rb', line 69 def self.attribute_map { :'html' => :'html', :'preview_text' => :'previewText', :'internal' => :'internal', :'subject' => :'subject', :'sender_name' => :'senderName', :'sender_email' => :'senderEmail', :'title' => :'title', :'redirect_url' => :'redirectURL', :'image_url' => :'imageURL', :'instant' => :'instant', :'batch' => :'batch', :'text' => :'text', :'message' => :'message', :'icon' => :'icon', :'url' => :'url', :'blocks' => :'blocks', :'username' => :'username' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/pingram/models/template_patch_request.rb', line 271 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
125 126 127 128 |
# File 'lib/pingram/models/template_patch_request.rb', line 125 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/pingram/models/template_patch_request.rb', line 102 def self.openapi_types { :'html' => :'String', :'preview_text' => :'String', :'internal' => :'String', :'subject' => :'String', :'sender_name' => :'String', :'sender_email' => :'String', :'title' => :'String', :'redirect_url' => :'String', :'image_url' => :'String', :'instant' => :'TemplatePatchRequestInstant', :'batch' => :'TemplatePatchRequestBatch', :'text' => :'String', :'message' => :'String', :'icon' => :'String', :'url' => :'String', :'blocks' => :'Array<Hash<String, Object>>', :'username' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/pingram/models/template_patch_request.rb', line 234 def ==(o) return true if self.equal?(o) self.class == o.class && html == o.html && preview_text == o.preview_text && internal == o.internal && subject == o.subject && sender_name == o.sender_name && sender_email == o.sender_email && title == o.title && redirect_url == o.redirect_url && image_url == o.image_url && instant == o.instant && batch == o.batch && text == o.text && == o. && icon == o.icon && url == o.url && blocks == o.blocks && username == o.username end |
#eql?(o) ⇒ Boolean
258 259 260 |
# File 'lib/pingram/models/template_patch_request.rb', line 258 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
264 265 266 |
# File 'lib/pingram/models/template_patch_request.rb', line 264 def hash [html, preview_text, internal, subject, sender_name, sender_email, title, redirect_url, image_url, instant, batch, text, , icon, url, blocks, username].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
219 220 221 222 223 |
# File 'lib/pingram/models/template_patch_request.rb', line 219 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/pingram/models/template_patch_request.rb', line 293 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
227 228 229 230 |
# File 'lib/pingram/models/template_patch_request.rb', line 227 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |