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.



38538
38539
38540
38541
38542
38543
38544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38538

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.



38536
38537
38538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38536

def days_until_purge_unused
  @days_until_purge_unused
end

#days_until_purge_usedObject (readonly)

Returns the value of attribute days_until_purge_used.



38536
38537
38538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38536

def days_until_purge_used
  @days_until_purge_used
end

#idObject (readonly)

Returns the value of attribute id.



38536
38537
38538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38536

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38550
38551
38552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38550

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

#to_hashObject



38554
38555
38556
38557
38558
38559
38560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38554

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

#to_jsonObject



38546
38547
38548
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38546

def to_json
  JSON.dump(to_hash)
end