Class: NewStoreApi::SessionTokenResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/session_token_response.rb

Overview

SessionTokenResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(embedded_processor = nil, provider_location_id = nil, secret = nil, payment_method_types = SKIP) ⇒ SessionTokenResponse

Returns a new instance of SessionTokenResponse.



52
53
54
55
56
57
58
# File 'lib/new_store_api/models/session_token_response.rb', line 52

def initialize(embedded_processor = nil, provider_location_id = nil,
               secret = nil, payment_method_types = SKIP)
  @embedded_processor = embedded_processor
  @payment_method_types = payment_method_types unless payment_method_types == SKIP
  @provider_location_id = provider_location_id
  @secret = secret
end

Instance Attribute Details

#embedded_processorString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/new_store_api/models/session_token_response.rb', line 14

def embedded_processor
  @embedded_processor
end

#payment_method_typesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


18
19
20
# File 'lib/new_store_api/models/session_token_response.rb', line 18

def payment_method_types
  @payment_method_types
end

#provider_location_idString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/new_store_api/models/session_token_response.rb', line 22

def provider_location_id
  @provider_location_id
end

#secretString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/new_store_api/models/session_token_response.rb', line 26

def secret
  @secret
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/new_store_api/models/session_token_response.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  embedded_processor =
    hash.key?('embedded_processor') ? hash['embedded_processor'] : nil
  provider_location_id =
    hash.key?('provider_location_id') ? hash['provider_location_id'] : nil
  secret = hash.key?('secret') ? hash['secret'] : nil
  payment_method_types =
    hash.key?('payment_method_types') ? hash['payment_method_types'] : SKIP

  # Create object from extracted values.
  SessionTokenResponse.new(embedded_processor,
                           provider_location_id,
                           secret,
                           payment_method_types)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/new_store_api/models/session_token_response.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['embedded_processor'] = 'embedded_processor'
  @_hash['payment_method_types'] = 'payment_method_types'
  @_hash['provider_location_id'] = 'provider_location_id'
  @_hash['secret'] = 'secret'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
49
50
# File 'lib/new_store_api/models/session_token_response.rb', line 46

def self.nullables
  %w[
    payment_method_types
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
# File 'lib/new_store_api/models/session_token_response.rb', line 39

def self.optionals
  %w[
    payment_method_types
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



89
90
91
92
93
94
# File 'lib/new_store_api/models/session_token_response.rb', line 89

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} embedded_processor: #{@embedded_processor.inspect}, payment_method_types:"\
  " #{@payment_method_types.inspect}, provider_location_id: #{@provider_location_id.inspect},"\
  " secret: #{@secret.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



81
82
83
84
85
86
# File 'lib/new_store_api/models/session_token_response.rb', line 81

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} embedded_processor: #{@embedded_processor}, payment_method_types:"\
  " #{@payment_method_types}, provider_location_id: #{@provider_location_id}, secret:"\
  " #{@secret}>"
end