Class: Courier::Send::BrandSettingsEmail
- Inherits:
-
Object
- Object
- Courier::Send::BrandSettingsEmail
- Defined in:
- lib/trycourier/send/types/brand_settings_email.rb
Instance Attribute Summary collapse
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#footer ⇒ Object
readonly
Returns the value of attribute footer.
-
#head ⇒ Object
readonly
Returns the value of attribute head.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#template_override ⇒ Object
readonly
Returns the value of attribute template_override.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Send::BrandSettingsEmail
Deserialize a JSON object to an instance of BrandSettingsEmail.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(template_override: nil, head: nil, footer: nil, header: nil, additional_properties: nil) ⇒ Send::BrandSettingsEmail constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of BrandSettingsEmail to a JSON object.
Constructor Details
#initialize(template_override: nil, head: nil, footer: nil, header: nil, additional_properties: nil) ⇒ Send::BrandSettingsEmail
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 20 def initialize(template_override: nil, head: nil, footer: nil, header: nil, additional_properties: nil) # @type [Send::BrandTemplateOverride] @template_override = template_override # @type [Send::EmailHead] @head = head # @type [Send::EmailFooter] @footer = # @type [Send::EmailHeader] @header = header # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end |
Instance Attribute Details
#additional_properties ⇒ Object (readonly)
Returns the value of attribute additional_properties.
12 13 14 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 12 def additional_properties @additional_properties end |
#footer ⇒ Object (readonly)
Returns the value of attribute footer.
12 13 14 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 12 def @footer end |
#head ⇒ Object (readonly)
Returns the value of attribute head.
12 13 14 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 12 def head @head end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
12 13 14 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 12 def header @header end |
#template_override ⇒ Object (readonly)
Returns the value of attribute template_override.
12 13 14 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 12 def template_override @template_override end |
Class Method Details
.from_json(json_object:) ⇒ Send::BrandSettingsEmail
Deserialize a JSON object to an instance of BrandSettingsEmail
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["templateOverride"].nil? template_override = nil else template_override = parsed_json["templateOverride"].to_json template_override = Send::BrandTemplateOverride.from_json(json_object: template_override) end if parsed_json["head"].nil? head = nil else head = parsed_json["head"].to_json head = Send::EmailHead.from_json(json_object: head) end if parsed_json["footer"].nil? = nil else = parsed_json["footer"].to_json = Send::EmailFooter.from_json(json_object: ) end if parsed_json["header"].nil? header = nil else header = parsed_json["header"].to_json header = Send::EmailHeader.from_json(json_object: header) end new(template_override: template_override, head: head, footer: , header: header, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
79 80 81 82 83 84 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 79 def self.validate_raw(obj:) obj.template_override.nil? || Send::BrandTemplateOverride.validate_raw(obj: obj.template_override) obj.head.nil? || Send::EmailHead.validate_raw(obj: obj.head) obj..nil? || Send::EmailFooter.validate_raw(obj: obj.) obj.header.nil? || Send::EmailHeader.validate_raw(obj: obj.header) end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of BrandSettingsEmail to a JSON object
71 72 73 |
# File 'lib/trycourier/send/types/brand_settings_email.rb', line 71 def to_json(*_args) { "templateOverride": @template_override, "head": @head, "footer": @footer, "header": @header }.to_json end |