Class: Io::Flow::V0::Models::EmailNotificationForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ EmailNotificationForm

Returns a new instance of EmailNotificationForm.



37689
37690
37691
37692
37693
37694
37695
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37689

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:to, :created_at, :data], 'EmailNotificationForm')
  @to = (x = opts.delete(:to); x.is_a?(::Io::Flow::V0::Models::EmailRecipient) ? x : ::Io::Flow::V0::Models::EmailRecipient.new(x))
  @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime)
  @data = (x = opts.delete(:data); x.is_a?(::Io::Flow::V0::Models::EmailNotificationData) ? x : ::Io::Flow::V0::Models::EmailNotificationData.from_json(x))
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



37687
37688
37689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37687

def created_at
  @created_at
end

#dataObject (readonly)

Returns the value of attribute data.



37687
37688
37689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37687

def data
  @data
end

#toObject (readonly)

Returns the value of attribute to.



37687
37688
37689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37687

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37701
37702
37703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37701

def copy(incoming={})
  EmailNotificationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



37705
37706
37707
37708
37709
37710
37711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37705

def to_hash
  {
    :to => to.to_hash,
    :created_at => created_at,
    :data => data.to_hash
  }
end

#to_jsonObject



37697
37698
37699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37697

def to_json
  JSON.dump(to_hash)
end