Class: StickyIoRestfulApiV2025731::GlobalFields

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/models/global_fields.rb

Overview

GlobalFields 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(cancellation_url:, chargeback_fee:, customer_service_email:, customer_service_email_from:, customer_service_number:, cvv:, descriptor:, global_monthly_cap:, merchant_id:, reserve_percent:, additional_properties: nil) ⇒ GlobalFields

Returns a new instance of GlobalFields.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 78

def initialize(cancellation_url:, chargeback_fee:, customer_service_email:,
               customer_service_email_from:, customer_service_number:, cvv:,
               descriptor:, global_monthly_cap:, merchant_id:,
               reserve_percent:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @cancellation_url = cancellation_url
  @chargeback_fee = chargeback_fee
  @customer_service_email = customer_service_email
  @customer_service_email_from = customer_service_email_from
  @customer_service_number = customer_service_number
  @cvv = cvv
  @descriptor = descriptor
  @global_monthly_cap = global_monthly_cap
  @merchant_id = merchant_id
  @reserve_percent = reserve_percent
  @additional_properties = additional_properties
end

Instance Attribute Details

#cancellation_urlString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 14

def cancellation_url
  @cancellation_url
end

#chargeback_feeInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 18

def chargeback_fee
  @chargeback_fee
end

#customer_service_emailString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 22

def customer_service_email
  @customer_service_email
end

#customer_service_email_fromString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 26

def customer_service_email_from
  @customer_service_email_from
end

#customer_service_numberInteger

TODO: Write general description for this method

Returns:

  • (Integer)


30
31
32
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 30

def customer_service_number
  @customer_service_number
end

#cvvInteger

TODO: Write general description for this method

Returns:

  • (Integer)


34
35
36
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 34

def cvv
  @cvv
end

#descriptorString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 38

def descriptor
  @descriptor
end

#global_monthly_capInteger

TODO: Write general description for this method

Returns:

  • (Integer)


42
43
44
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 42

def global_monthly_cap
  @global_monthly_cap
end

#merchant_idString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 46

def merchant_id
  @merchant_id
end

#reserve_percentInteger

TODO: Write general description for this method

Returns:

  • (Integer)


50
51
52
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 50

def reserve_percent
  @reserve_percent
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cancellation_url =
    hash.key?('cancellation_url') ? hash['cancellation_url'] : nil
  chargeback_fee =
    hash.key?('chargeback_fee') ? hash['chargeback_fee'] : nil
  customer_service_email =
    hash.key?('customer_service_email') ? hash['customer_service_email'] : nil
  customer_service_email_from =
    hash.key?('customer_service_email_from') ? hash['customer_service_email_from'] : nil
  customer_service_number =
    hash.key?('customer_service_number') ? hash['customer_service_number'] : nil
  cvv = hash.key?('cvv') ? hash['cvv'] : nil
  descriptor = hash.key?('descriptor') ? hash['descriptor'] : nil
  global_monthly_cap =
    hash.key?('global_monthly_cap') ? hash['global_monthly_cap'] : nil
  merchant_id = hash.key?('merchant_id') ? hash['merchant_id'] : nil
  reserve_percent =
    hash.key?('reserve_percent') ? hash['reserve_percent'] : nil

  # 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.
  GlobalFields.new(cancellation_url: cancellation_url,
                   chargeback_fee: chargeback_fee,
                   customer_service_email: customer_service_email,
                   customer_service_email_from: customer_service_email_from,
                   customer_service_number: customer_service_number,
                   cvv: cvv,
                   descriptor: descriptor,
                   global_monthly_cap: global_monthly_cap,
                   merchant_id: merchant_id,
                   reserve_percent: reserve_percent,
                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cancellation_url'] = 'cancellation_url'
  @_hash['chargeback_fee'] = 'chargeback_fee'
  @_hash['customer_service_email'] = 'customer_service_email'
  @_hash['customer_service_email_from'] = 'customer_service_email_from'
  @_hash['customer_service_number'] = 'customer_service_number'
  @_hash['cvv'] = 'cvv'
  @_hash['descriptor'] = 'descriptor'
  @_hash['global_monthly_cap'] = 'global_monthly_cap'
  @_hash['merchant_id'] = 'merchant_id'
  @_hash['reserve_percent'] = 'reserve_percent'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



69
70
71
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 69

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



154
155
156
157
158
159
160
161
162
163
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 154

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cancellation_url: #{@cancellation_url.inspect}, chargeback_fee:"\
  " #{@chargeback_fee.inspect}, customer_service_email: #{@customer_service_email.inspect},"\
  " customer_service_email_from: #{@customer_service_email_from.inspect},"\
  " customer_service_number: #{@customer_service_number.inspect}, cvv: #{@cvv.inspect},"\
  " descriptor: #{@descriptor.inspect}, global_monthly_cap: #{@global_monthly_cap.inspect},"\
  " merchant_id: #{@merchant_id.inspect}, reserve_percent: #{@reserve_percent.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



143
144
145
146
147
148
149
150
151
# File 'lib/sticky_io_restful_api_v2025731/models/global_fields.rb', line 143

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cancellation_url: #{@cancellation_url}, chargeback_fee: #{@chargeback_fee},"\
  " customer_service_email: #{@customer_service_email}, customer_service_email_from:"\
  " #{@customer_service_email_from}, customer_service_number: #{@customer_service_number},"\
  " cvv: #{@cvv}, descriptor: #{@descriptor}, global_monthly_cap: #{@global_monthly_cap},"\
  " merchant_id: #{@merchant_id}, reserve_percent: #{@reserve_percent}, additional_properties:"\
  " #{@additional_properties}>"
end