Class: UnivapayClientSdk::SubscriptionUserData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/subscription_user_data.rb

Overview

Customer-facing payment method summary data.

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(type: SKIP, cardholder_name: SKIP, email: SKIP, brand: SKIP, gateway: SKIP, service_provider: SKIP, additional_properties: nil) ⇒ SubscriptionUserData

Returns a new instance of SubscriptionUserData.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 71

def initialize(type: SKIP, cardholder_name: SKIP, email: SKIP, brand: SKIP,
               gateway: SKIP, service_provider: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @type = type unless type == SKIP
  @cardholder_name = cardholder_name unless cardholder_name == SKIP
  @email = email unless email == SKIP
  @brand = brand unless brand == SKIP
  @gateway = gateway unless gateway == SKIP
  @service_provider = service_provider unless service_provider == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#brandString

Brand or network name.

Returns:

  • (String)


26
27
28
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 26

def brand
  @brand
end

#cardholder_nameString

Cardholder name value.

Returns:

  • (String)


18
19
20
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 18

def cardholder_name
  @cardholder_name
end

#emailString

Customer email address.

Returns:

  • (String)


22
23
24
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 22

def email
  @email
end

#gatewayString

Gateway identifier.

Returns:

  • (String)


30
31
32
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 30

def gateway
  @gateway
end

#service_providerString

Service provider identifier.

Returns:

  • (String)


34
35
36
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 34

def service_provider
  @service_provider
end

#typeString

Type of the resource.

Returns:

  • (String)


14
15
16
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 14

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 87

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : SKIP
  cardholder_name =
    hash.key?('cardholder_name') ? hash['cardholder_name'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  brand = hash.key?('brand') ? hash['brand'] : SKIP
  gateway = hash.key?('gateway') ? hash['gateway'] : SKIP
  service_provider =
    hash.key?('service_provider') ? hash['service_provider'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  SubscriptionUserData.new(type: type,
                           cardholder_name: cardholder_name,
                           email: email,
                           brand: brand,
                           gateway: gateway,
                           service_provider: service_provider,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'type'
  @_hash['cardholder_name'] = 'cardholder_name'
  @_hash['email'] = 'email'
  @_hash['brand'] = 'brand'
  @_hash['gateway'] = 'gateway'
  @_hash['service_provider'] = 'service_provider'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
64
65
66
67
68
69
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 61

def self.nullables
  %w[
    cardholder_name
    email
    brand
    gateway
    service_provider
  ]
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 49

def self.optionals
  %w[
    type
    cardholder_name
    email
    brand
    gateway
    service_provider
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



126
127
128
129
130
131
132
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 126

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type.inspect}, cardholder_name: #{@cardholder_name.inspect},"\
  " email: #{@email.inspect}, brand: #{@brand.inspect}, gateway: #{@gateway.inspect},"\
  " service_provider: #{@service_provider.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



118
119
120
121
122
123
# File 'lib/univapay_client_sdk/models/subscription_user_data.rb', line 118

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} type: #{@type}, cardholder_name: #{@cardholder_name}, email: #{@email},"\
  " brand: #{@brand}, gateway: #{@gateway}, service_provider: #{@service_provider},"\
  " additional_properties: #{@additional_properties}>"
end