Class: Io::Flow::V0::Models::CustomerPurgeSettings

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

Overview

Represent settings for when to purge customer data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CustomerPurgeSettings

Returns a new instance of CustomerPurgeSettings.



28675
28676
28677
28678
28679
28680
28681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28675

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :days_until_purge_unused, :days_until_purge_used], 'CustomerPurgeSettings')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @days_until_purge_unused = HttpClient::Preconditions.assert_class('days_until_purge_unused', opts.delete(:days_until_purge_unused), Integer)
  @days_until_purge_used = HttpClient::Preconditions.assert_class('days_until_purge_used', opts.delete(:days_until_purge_used), Integer)
end

Instance Attribute Details

#days_until_purge_unusedObject (readonly)

Returns the value of attribute days_until_purge_unused.



28673
28674
28675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28673

def days_until_purge_unused
  @days_until_purge_unused
end

#days_until_purge_usedObject (readonly)

Returns the value of attribute days_until_purge_used.



28673
28674
28675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28673

def days_until_purge_used
  @days_until_purge_used
end

#idObject (readonly)

Returns the value of attribute id.



28673
28674
28675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28673

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28687
28688
28689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28687

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

#to_hashObject



28691
28692
28693
28694
28695
28696
28697
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28691

def to_hash
  {
    :id => id,
    :days_until_purge_unused => days_until_purge_unused,
    :days_until_purge_used => days_until_purge_used
  }
end

#to_jsonObject



28683
28684
28685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28683

def to_json
  JSON.dump(to_hash)
end