tangocard-raas 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +175 -0
  3. data/README.md +542 -0
  4. data/lib/raas.rb +61 -0
  5. data/lib/raas/api_helper.rb +181 -0
  6. data/lib/raas/configuration.rb +72 -0
  7. data/lib/raas/controllers/accounts_controller.rb +189 -0
  8. data/lib/raas/controllers/base_controller.rb +68 -0
  9. data/lib/raas/controllers/catalog_controller.rb +47 -0
  10. data/lib/raas/controllers/customers_controller.rb +137 -0
  11. data/lib/raas/controllers/exchange_rates_controller.rb +36 -0
  12. data/lib/raas/controllers/orders_controller.rb +199 -0
  13. data/lib/raas/controllers/status_controller.rb +46 -0
  14. data/lib/raas/exceptions/api_exception.rb +16 -0
  15. data/lib/raas/exceptions/raas_client_exception.rb +58 -0
  16. data/lib/raas/exceptions/raas_generic_exception.rb +53 -0
  17. data/lib/raas/exceptions/raas_server_exception.rb +58 -0
  18. data/lib/raas/http/auth/basic_auth.rb +17 -0
  19. data/lib/raas/http/faraday_client.rb +43 -0
  20. data/lib/raas/http/http_call_back.rb +17 -0
  21. data/lib/raas/http/http_client.rb +84 -0
  22. data/lib/raas/http/http_context.rb +15 -0
  23. data/lib/raas/http/http_method_enum.rb +7 -0
  24. data/lib/raas/http/http_request.rb +44 -0
  25. data/lib/raas/http/http_response.rb +19 -0
  26. data/lib/raas/models/account_model.rb +88 -0
  27. data/lib/raas/models/account_summary_model.rb +61 -0
  28. data/lib/raas/models/base_model.rb +32 -0
  29. data/lib/raas/models/brand_model.rb +129 -0
  30. data/lib/raas/models/catalog_model.rb +47 -0
  31. data/lib/raas/models/create_account_request_model.rb +51 -0
  32. data/lib/raas/models/create_customer_request_model.rb +42 -0
  33. data/lib/raas/models/create_order_request_model.rb +132 -0
  34. data/lib/raas/models/currency_breakdown_model.rb +69 -0
  35. data/lib/raas/models/customer_model.rb +75 -0
  36. data/lib/raas/models/exchange_rate_model.rb +61 -0
  37. data/lib/raas/models/exchange_rate_response_model.rb +47 -0
  38. data/lib/raas/models/get_orders_response_model.rb +47 -0
  39. data/lib/raas/models/item_model.rb +133 -0
  40. data/lib/raas/models/name_email_model.rb +51 -0
  41. data/lib/raas/models/order_model.rb +187 -0
  42. data/lib/raas/models/page_model.rb +60 -0
  43. data/lib/raas/models/raas_client_error_model.rb +60 -0
  44. data/lib/raas/models/raas_server_error_model.rb +42 -0
  45. data/lib/raas/models/resend_order_response_model.rb +43 -0
  46. data/lib/raas/models/reward_credential_model.rb +51 -0
  47. data/lib/raas/models/reward_model.rb +56 -0
  48. data/lib/raas/models/system_status_response_model.rb +33 -0
  49. data/lib/raas/raas_client.rb +53 -0
  50. metadata +175 -0
@@ -0,0 +1,51 @@
1
+ # This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Raas
4
+ class NameEmailModel < BaseModel
5
+ # Email Address
6
+ # @return [String]
7
+ attr_accessor :email
8
+
9
+ # First Name
10
+ # @return [String]
11
+ attr_accessor :first_name
12
+
13
+ # Last Name
14
+ # @return [String]
15
+ attr_accessor :last_name
16
+
17
+ # A mapping from model property names to API property names
18
+ def self.names
19
+ if @_hash.nil?
20
+ @_hash = {}
21
+ @_hash["email"] = "email"
22
+ @_hash["first_name"] = "firstName"
23
+ @_hash["last_name"] = "lastName"
24
+ end
25
+ @_hash
26
+ end
27
+
28
+ def initialize(email = nil,
29
+ first_name = nil,
30
+ last_name = nil)
31
+ @email = email
32
+ @first_name = first_name
33
+ @last_name = last_name
34
+ end
35
+
36
+ # Creates an instance of the object from a hash
37
+ def self.from_hash(hash)
38
+ return nil unless hash
39
+
40
+ # Extract variables from the hash
41
+ email = hash['email']
42
+ first_name = hash['firstName']
43
+ last_name = hash['lastName']
44
+
45
+ # Create object from extracted values
46
+ NameEmailModel.new(email,
47
+ first_name,
48
+ last_name)
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,187 @@
1
+ # This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ require 'date'
4
+ module Raas
5
+ class OrderModel < BaseModel
6
+ # Account Identifier
7
+ # @return [String]
8
+ attr_accessor :account_identifier
9
+
10
+ # Amount Charged
11
+ # @return [CurrencyBreakdownModel]
12
+ attr_accessor :amount_charged
13
+
14
+ # Created At
15
+ # @return [DateTime]
16
+ attr_accessor :created_at
17
+
18
+ # Customer Identifier
19
+ # @return [String]
20
+ attr_accessor :customer_identifier
21
+
22
+ # Denomination
23
+ # @return [CurrencyBreakdownModel]
24
+ attr_accessor :denomination
25
+
26
+ # Reference Order ID
27
+ # @return [String]
28
+ attr_accessor :reference_order_id
29
+
30
+ # Reward
31
+ # @return [RewardModel]
32
+ attr_accessor :reward
33
+
34
+ # Reward Name
35
+ # @return [String]
36
+ attr_accessor :reward_name
37
+
38
+ # Send Email
39
+ # @return [Boolean]
40
+ attr_accessor :send_email
41
+
42
+ # Status
43
+ # @return [String]
44
+ attr_accessor :status
45
+
46
+ # UTID
47
+ # @return [String]
48
+ attr_accessor :utid
49
+
50
+ # Campaign
51
+ # @return [String]
52
+ attr_accessor :campaign
53
+
54
+ # Email Subject
55
+ # @return [String]
56
+ attr_accessor :email_subject
57
+
58
+ # External Reference ID
59
+ # @return [String]
60
+ attr_accessor :external_ref_id
61
+
62
+ # Message
63
+ # @return [String]
64
+ attr_accessor :message
65
+
66
+ # Notes
67
+ # @return [String]
68
+ attr_accessor :notes
69
+
70
+ # Recipient
71
+ # @return [NameEmailModel]
72
+ attr_accessor :recipient
73
+
74
+ # Sender
75
+ # @return [NameEmailModel]
76
+ attr_accessor :sender
77
+
78
+ # A mapping from model property names to API property names
79
+ def self.names
80
+ if @_hash.nil?
81
+ @_hash = {}
82
+ @_hash["account_identifier"] = "accountIdentifier"
83
+ @_hash["amount_charged"] = "amountCharged"
84
+ @_hash["created_at"] = "createdAt"
85
+ @_hash["customer_identifier"] = "customerIdentifier"
86
+ @_hash["denomination"] = "denomination"
87
+ @_hash["reference_order_id"] = "referenceOrderID"
88
+ @_hash["reward"] = "reward"
89
+ @_hash["reward_name"] = "rewardName"
90
+ @_hash["send_email"] = "sendEmail"
91
+ @_hash["status"] = "status"
92
+ @_hash["utid"] = "utid"
93
+ @_hash["campaign"] = "campaign"
94
+ @_hash["email_subject"] = "emailSubject"
95
+ @_hash["external_ref_id"] = "externalRefID"
96
+ @_hash["message"] = "message"
97
+ @_hash["notes"] = "notes"
98
+ @_hash["recipient"] = "recipient"
99
+ @_hash["sender"] = "sender"
100
+ end
101
+ @_hash
102
+ end
103
+
104
+ def initialize(account_identifier = nil,
105
+ amount_charged = nil,
106
+ created_at = nil,
107
+ customer_identifier = nil,
108
+ denomination = nil,
109
+ reference_order_id = nil,
110
+ reward = nil,
111
+ reward_name = nil,
112
+ send_email = nil,
113
+ status = nil,
114
+ utid = nil,
115
+ campaign = nil,
116
+ email_subject = nil,
117
+ external_ref_id = nil,
118
+ message = nil,
119
+ notes = nil,
120
+ recipient = nil,
121
+ sender = nil)
122
+ @account_identifier = account_identifier
123
+ @amount_charged = amount_charged
124
+ @created_at = created_at
125
+ @customer_identifier = customer_identifier
126
+ @denomination = denomination
127
+ @reference_order_id = reference_order_id
128
+ @reward = reward
129
+ @reward_name = reward_name
130
+ @send_email = send_email
131
+ @status = status
132
+ @utid = utid
133
+ @campaign = campaign
134
+ @email_subject = email_subject
135
+ @external_ref_id = external_ref_id
136
+ @message = message
137
+ @notes = notes
138
+ @recipient = recipient
139
+ @sender = sender
140
+ end
141
+
142
+ # Creates an instance of the object from a hash
143
+ def self.from_hash(hash)
144
+ return nil unless hash
145
+
146
+ # Extract variables from the hash
147
+ account_identifier = hash['accountIdentifier']
148
+ amount_charged = CurrencyBreakdownModel.from_hash(hash['amountCharged']) if hash['amountCharged']
149
+ created_at = DateTime.rfc3339(hash['createdAt']) if hash['createdAt']
150
+ customer_identifier = hash['customerIdentifier']
151
+ denomination = CurrencyBreakdownModel.from_hash(hash['denomination']) if hash['denomination']
152
+ reference_order_id = hash['referenceOrderID']
153
+ reward = RewardModel.from_hash(hash['reward']) if hash['reward']
154
+ reward_name = hash['rewardName']
155
+ send_email = hash['sendEmail']
156
+ status = hash['status']
157
+ utid = hash['utid']
158
+ campaign = hash['campaign']
159
+ email_subject = hash['emailSubject']
160
+ external_ref_id = hash['externalRefID']
161
+ message = hash['message']
162
+ notes = hash['notes']
163
+ recipient = NameEmailModel.from_hash(hash['recipient']) if hash['recipient']
164
+ sender = NameEmailModel.from_hash(hash['sender']) if hash['sender']
165
+
166
+ # Create object from extracted values
167
+ OrderModel.new(account_identifier,
168
+ amount_charged,
169
+ created_at,
170
+ customer_identifier,
171
+ denomination,
172
+ reference_order_id,
173
+ reward,
174
+ reward_name,
175
+ send_email,
176
+ status,
177
+ utid,
178
+ campaign,
179
+ email_subject,
180
+ external_ref_id,
181
+ message,
182
+ notes,
183
+ recipient,
184
+ sender)
185
+ end
186
+ end
187
+ end
@@ -0,0 +1,60 @@
1
+ # This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Raas
4
+ class PageModel < BaseModel
5
+ # Page Number
6
+ # @return [Integer]
7
+ attr_accessor :number
8
+
9
+ # Elements per page
10
+ # @return [Integer]
11
+ attr_accessor :elements_per_block
12
+
13
+ # Result Count
14
+ # @return [Integer]
15
+ attr_accessor :result_count
16
+
17
+ # Total Count
18
+ # @return [Integer]
19
+ attr_accessor :total_count
20
+
21
+ # A mapping from model property names to API property names
22
+ def self.names
23
+ if @_hash.nil?
24
+ @_hash = {}
25
+ @_hash["number"] = "number"
26
+ @_hash["elements_per_block"] = "elementsPerBlock"
27
+ @_hash["result_count"] = "resultCount"
28
+ @_hash["total_count"] = "totalCount"
29
+ end
30
+ @_hash
31
+ end
32
+
33
+ def initialize(number = nil,
34
+ elements_per_block = nil,
35
+ result_count = nil,
36
+ total_count = nil)
37
+ @number = number
38
+ @elements_per_block = elements_per_block
39
+ @result_count = result_count
40
+ @total_count = total_count
41
+ end
42
+
43
+ # Creates an instance of the object from a hash
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash
48
+ number = hash['number']
49
+ elements_per_block = hash['elementsPerBlock']
50
+ result_count = hash['resultCount']
51
+ total_count = hash['totalCount']
52
+
53
+ # Create object from extracted values
54
+ PageModel.new(number,
55
+ elements_per_block,
56
+ result_count,
57
+ total_count)
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,60 @@
1
+ # This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Raas
4
+ class RaasClientErrorModel < BaseModel
5
+ # Error Path
6
+ # @return [String]
7
+ attr_accessor :path
8
+
9
+ # Error Message
10
+ # @return [String]
11
+ attr_accessor :message
12
+
13
+ # Constraint
14
+ # @return [String]
15
+ attr_accessor :constraint
16
+
17
+ # Invalid Value
18
+ # @return [String]
19
+ attr_accessor :invalid_value
20
+
21
+ # A mapping from model property names to API property names
22
+ def self.names
23
+ if @_hash.nil?
24
+ @_hash = {}
25
+ @_hash["path"] = "path"
26
+ @_hash["message"] = "message"
27
+ @_hash["constraint"] = "constraint"
28
+ @_hash["invalid_value"] = "invalidValue"
29
+ end
30
+ @_hash
31
+ end
32
+
33
+ def initialize(path = nil,
34
+ message = nil,
35
+ constraint = nil,
36
+ invalid_value = nil)
37
+ @path = path
38
+ @message = message
39
+ @constraint = constraint
40
+ @invalid_value = invalid_value
41
+ end
42
+
43
+ # Creates an instance of the object from a hash
44
+ def self.from_hash(hash)
45
+ return nil unless hash
46
+
47
+ # Extract variables from the hash
48
+ path = hash['path']
49
+ message = hash['message']
50
+ constraint = hash['constraint']
51
+ invalid_value = hash['invalidValue']
52
+
53
+ # Create object from extracted values
54
+ RaasClientErrorModel.new(path,
55
+ message,
56
+ constraint,
57
+ invalid_value)
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,42 @@
1
+ # This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Raas
4
+ class RaasServerErrorModel < BaseModel
5
+ # Error Message
6
+ # @return [String]
7
+ attr_accessor :message
8
+
9
+ # Error Code
10
+ # @return [Integer]
11
+ attr_accessor :code
12
+
13
+ # A mapping from model property names to API property names
14
+ def self.names
15
+ if @_hash.nil?
16
+ @_hash = {}
17
+ @_hash["message"] = "message"
18
+ @_hash["code"] = "code"
19
+ end
20
+ @_hash
21
+ end
22
+
23
+ def initialize(message = nil,
24
+ code = nil)
25
+ @message = message
26
+ @code = code
27
+ end
28
+
29
+ # Creates an instance of the object from a hash
30
+ def self.from_hash(hash)
31
+ return nil unless hash
32
+
33
+ # Extract variables from the hash
34
+ message = hash['message']
35
+ code = hash['code']
36
+
37
+ # Create object from extracted values
38
+ RaasServerErrorModel.new(message,
39
+ code)
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,43 @@
1
+ # This file was automatically generated for Tango Card, Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ require 'date'
4
+ module Raas
5
+ class ResendOrderResponseModel < BaseModel
6
+ # When the resend request was created
7
+ # @return [DateTime]
8
+ attr_accessor :created_at
9
+
10
+ # The order resend id
11
+ # @return [Integer]
12
+ attr_accessor :id
13
+
14
+ # A mapping from model property names to API property names
15
+ def self.names
16
+ if @_hash.nil?
17
+ @_hash = {}
18
+ @_hash["created_at"] = "createdAt"
19
+ @_hash["id"] = "id"
20
+ end
21
+ @_hash
22
+ end
23
+
24
+ def initialize(created_at = nil,
25
+ id = nil)
26
+ @created_at = created_at
27
+ @id = id
28
+ end
29
+
30
+ # Creates an instance of the object from a hash
31
+ def self.from_hash(hash)
32
+ return nil unless hash
33
+
34
+ # Extract variables from the hash
35
+ created_at = DateTime.rfc3339(hash['createdAt']) if hash['createdAt']
36
+ id = hash['id']
37
+
38
+ # Create object from extracted values
39
+ ResendOrderResponseModel.new(created_at,
40
+ id)
41
+ end
42
+ end
43
+ end