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.



29226
29227
29228
29229
29230
29231
29232
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29226

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.



29224
29225
29226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29224

def days_until_purge_unused
  @days_until_purge_unused
end

#days_until_purge_usedObject (readonly)

Returns the value of attribute days_until_purge_used.



29224
29225
29226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29224

def days_until_purge_used
  @days_until_purge_used
end

#idObject (readonly)

Returns the value of attribute id.



29224
29225
29226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29224

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29238
29239
29240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29238

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

#to_hashObject



29242
29243
29244
29245
29246
29247
29248
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29242

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

#to_jsonObject



29234
29235
29236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29234

def to_json
  JSON.dump(to_hash)
end