processout 3.0.0 → 3.2.0
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.
- checksums.yaml +4 -4
- data/lib/processout/customer.rb +13 -0
- data/lib/processout/export_layout.rb +337 -0
- data/lib/processout/export_layout_configuration.rb +132 -0
- data/lib/processout/export_layout_configuration_amount.rb +81 -0
- data/lib/processout/export_layout_configuration_column.rb +81 -0
- data/lib/processout/export_layout_configuration_configuration_options_amount.rb +81 -0
- data/lib/processout/export_layout_configuration_configuration_options_time.rb +70 -0
- data/lib/processout/export_layout_configuration_options.rb +144 -0
- data/lib/processout/export_layout_configuration_time.rb +70 -0
- data/lib/processout/external_three_ds.rb +136 -0
- data/lib/processout/invoice.rb +62 -0
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/token.rb +5 -1
- data/lib/processout/transaction_operation.rb +22 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +54 -0
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e8daa8d1cc656514933e0ec155f7122c3ebf83dc38d0822fe84b35f564d21b3
|
4
|
+
data.tar.gz: e7368e3ca75fbb6fa7433b9be63eb17b08b4ea5a4ff6efa1ac24a9d0731b1900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e480c86976daefe7ba9a42a43c3d370460b153ab9fd741060c2223cc33377cdb1b577fdaa91babc56eb5ac68ac2583196fbdc92712a267f0caaf87404c8fd76
|
7
|
+
data.tar.gz: bef5723beeea07634c8bf20b83358e2c83688961d6446b63f27c9d8aeb3af7378127f907aff70f7f93ee29265169a24ed00d1501deaff628e9c2cbbe7fa42111
|
data/lib/processout/customer.rb
CHANGED
@@ -21,6 +21,7 @@ module ProcessOut
|
|
21
21
|
attr_reader :email
|
22
22
|
attr_reader :first_name
|
23
23
|
attr_reader :last_name
|
24
|
+
attr_reader :company_name
|
24
25
|
attr_reader :address1
|
25
26
|
attr_reader :address2
|
26
27
|
attr_reader :city
|
@@ -164,6 +165,10 @@ module ProcessOut
|
|
164
165
|
@last_name = val
|
165
166
|
end
|
166
167
|
|
168
|
+
def company_name=(val)
|
169
|
+
@company_name = val
|
170
|
+
end
|
171
|
+
|
167
172
|
def address1=(val)
|
168
173
|
@address1 = val
|
169
174
|
end
|
@@ -265,6 +270,7 @@ module ProcessOut
|
|
265
270
|
self.email = data.fetch(:email, nil)
|
266
271
|
self.first_name = data.fetch(:first_name, nil)
|
267
272
|
self.last_name = data.fetch(:last_name, nil)
|
273
|
+
self.company_name = data.fetch(:company_name, nil)
|
268
274
|
self.address1 = data.fetch(:address1, nil)
|
269
275
|
self.address2 = data.fetch(:address2, nil)
|
270
276
|
self.city = data.fetch(:city, nil)
|
@@ -306,6 +312,7 @@ module ProcessOut
|
|
306
312
|
"email": self.email,
|
307
313
|
"first_name": self.first_name,
|
308
314
|
"last_name": self.last_name,
|
315
|
+
"company_name": self.company_name,
|
309
316
|
"address1": self.address1,
|
310
317
|
"address2": self.address2,
|
311
318
|
"city": self.city,
|
@@ -372,6 +379,9 @@ module ProcessOut
|
|
372
379
|
if data.include? "last_name"
|
373
380
|
self.last_name = data["last_name"]
|
374
381
|
end
|
382
|
+
if data.include? "company_name"
|
383
|
+
self.company_name = data["company_name"]
|
384
|
+
end
|
375
385
|
if data.include? "address1"
|
376
386
|
self.address1 = data["address1"]
|
377
387
|
end
|
@@ -447,6 +457,7 @@ module ProcessOut
|
|
447
457
|
self.email = data.fetch(:email, self.email)
|
448
458
|
self.first_name = data.fetch(:first_name, self.first_name)
|
449
459
|
self.last_name = data.fetch(:last_name, self.last_name)
|
460
|
+
self.company_name = data.fetch(:company_name, self.company_name)
|
450
461
|
self.address1 = data.fetch(:address1, self.address1)
|
451
462
|
self.address2 = data.fetch(:address2, self.address2)
|
452
463
|
self.city = data.fetch(:city, self.city)
|
@@ -649,6 +660,7 @@ module ProcessOut
|
|
649
660
|
"email" => @email,
|
650
661
|
"first_name" => @first_name,
|
651
662
|
"last_name" => @last_name,
|
663
|
+
"company_name" => @company_name,
|
652
664
|
"address1" => @address1,
|
653
665
|
"address2" => @address2,
|
654
666
|
"city" => @city,
|
@@ -723,6 +735,7 @@ module ProcessOut
|
|
723
735
|
"email" => @email,
|
724
736
|
"first_name" => @first_name,
|
725
737
|
"last_name" => @last_name,
|
738
|
+
"company_name" => @company_name,
|
726
739
|
"address1" => @address1,
|
727
740
|
"address2" => @address2,
|
728
741
|
"city" => @city,
|
@@ -0,0 +1,337 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class ExportLayout
|
10
|
+
|
11
|
+
attr_reader :id
|
12
|
+
attr_reader :project
|
13
|
+
attr_reader :project_id
|
14
|
+
attr_reader :created_at
|
15
|
+
attr_reader :name
|
16
|
+
attr_reader :type
|
17
|
+
attr_reader :is_default
|
18
|
+
attr_reader :configuration
|
19
|
+
|
20
|
+
|
21
|
+
def id=(val)
|
22
|
+
@id = val
|
23
|
+
end
|
24
|
+
|
25
|
+
def project=(val)
|
26
|
+
if val.nil?
|
27
|
+
@project = val
|
28
|
+
return
|
29
|
+
end
|
30
|
+
|
31
|
+
if val.instance_of? Project
|
32
|
+
@project = val
|
33
|
+
else
|
34
|
+
obj = Project.new(@client)
|
35
|
+
obj.fill_with_data(val)
|
36
|
+
@project = obj
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def project_id=(val)
|
42
|
+
@project_id = val
|
43
|
+
end
|
44
|
+
|
45
|
+
def created_at=(val)
|
46
|
+
@created_at = val
|
47
|
+
end
|
48
|
+
|
49
|
+
def name=(val)
|
50
|
+
@name = val
|
51
|
+
end
|
52
|
+
|
53
|
+
def type=(val)
|
54
|
+
@type = val
|
55
|
+
end
|
56
|
+
|
57
|
+
def is_default=(val)
|
58
|
+
@is_default = val
|
59
|
+
end
|
60
|
+
|
61
|
+
def configuration=(val)
|
62
|
+
if val.nil?
|
63
|
+
@configuration = val
|
64
|
+
return
|
65
|
+
end
|
66
|
+
|
67
|
+
if val.instance_of? ExportLayoutConfiguration
|
68
|
+
@configuration = val
|
69
|
+
else
|
70
|
+
obj = ExportLayoutConfiguration.new(@client)
|
71
|
+
obj.fill_with_data(val)
|
72
|
+
@configuration = obj
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
# Initializes the ExportLayout object
|
79
|
+
# Params:
|
80
|
+
# +client+:: +ProcessOut+ client instance
|
81
|
+
# +data+:: data that can be used to fill the object
|
82
|
+
def initialize(client, data = {})
|
83
|
+
@client = client
|
84
|
+
|
85
|
+
self.id = data.fetch(:id, nil)
|
86
|
+
self.project = data.fetch(:project, nil)
|
87
|
+
self.project_id = data.fetch(:project_id, nil)
|
88
|
+
self.created_at = data.fetch(:created_at, nil)
|
89
|
+
self.name = data.fetch(:name, nil)
|
90
|
+
self.type = data.fetch(:type, nil)
|
91
|
+
self.is_default = data.fetch(:is_default, nil)
|
92
|
+
self.configuration = data.fetch(:configuration, nil)
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
# Create a new ExportLayout using the current client
|
97
|
+
def new(data = {})
|
98
|
+
ExportLayout.new(@client, data)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Overrides the JSON marshaller to only send the fields we want
|
102
|
+
def to_json(options)
|
103
|
+
{
|
104
|
+
"id": self.id,
|
105
|
+
"project": self.project,
|
106
|
+
"project_id": self.project_id,
|
107
|
+
"created_at": self.created_at,
|
108
|
+
"name": self.name,
|
109
|
+
"type": self.type,
|
110
|
+
"is_default": self.is_default,
|
111
|
+
"configuration": self.configuration,
|
112
|
+
}.to_json
|
113
|
+
end
|
114
|
+
|
115
|
+
# Fills the object with data coming from the API
|
116
|
+
# Params:
|
117
|
+
# +data+:: +Hash+ of data coming from the API
|
118
|
+
def fill_with_data(data)
|
119
|
+
if data.nil?
|
120
|
+
return self
|
121
|
+
end
|
122
|
+
if data.include? "id"
|
123
|
+
self.id = data["id"]
|
124
|
+
end
|
125
|
+
if data.include? "project"
|
126
|
+
self.project = data["project"]
|
127
|
+
end
|
128
|
+
if data.include? "project_id"
|
129
|
+
self.project_id = data["project_id"]
|
130
|
+
end
|
131
|
+
if data.include? "created_at"
|
132
|
+
self.created_at = data["created_at"]
|
133
|
+
end
|
134
|
+
if data.include? "name"
|
135
|
+
self.name = data["name"]
|
136
|
+
end
|
137
|
+
if data.include? "type"
|
138
|
+
self.type = data["type"]
|
139
|
+
end
|
140
|
+
if data.include? "is_default"
|
141
|
+
self.is_default = data["is_default"]
|
142
|
+
end
|
143
|
+
if data.include? "configuration"
|
144
|
+
self.configuration = data["configuration"]
|
145
|
+
end
|
146
|
+
|
147
|
+
self
|
148
|
+
end
|
149
|
+
|
150
|
+
# Prefills the object with the data passed as parameters
|
151
|
+
# Params:
|
152
|
+
# +data+:: +Hash+ of data
|
153
|
+
def prefill(data)
|
154
|
+
if data.nil?
|
155
|
+
return self
|
156
|
+
end
|
157
|
+
self.id = data.fetch(:id, self.id)
|
158
|
+
self.project = data.fetch(:project, self.project)
|
159
|
+
self.project_id = data.fetch(:project_id, self.project_id)
|
160
|
+
self.created_at = data.fetch(:created_at, self.created_at)
|
161
|
+
self.name = data.fetch(:name, self.name)
|
162
|
+
self.type = data.fetch(:type, self.type)
|
163
|
+
self.is_default = data.fetch(:is_default, self.is_default)
|
164
|
+
self.configuration = data.fetch(:configuration, self.configuration)
|
165
|
+
|
166
|
+
self
|
167
|
+
end
|
168
|
+
|
169
|
+
# Get all the export layouts.
|
170
|
+
# Params:
|
171
|
+
# +options+:: +Hash+ of options
|
172
|
+
def all(options = {})
|
173
|
+
self.prefill(options)
|
174
|
+
|
175
|
+
request = Request.new(@client)
|
176
|
+
path = "/exports/layouts"
|
177
|
+
data = {
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
response = Response.new(request.get(path, data, options))
|
182
|
+
return_values = Array.new
|
183
|
+
|
184
|
+
a = Array.new
|
185
|
+
body = response.body
|
186
|
+
for v in body['export_layouts']
|
187
|
+
tmp = ExportLayout.new(@client)
|
188
|
+
tmp.fill_with_data(v)
|
189
|
+
a.push(tmp)
|
190
|
+
end
|
191
|
+
|
192
|
+
return_values.push(a)
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
return_values[0]
|
197
|
+
end
|
198
|
+
|
199
|
+
# Find an export layout by its ID.
|
200
|
+
# Params:
|
201
|
+
# +export_layout_id+:: ID of the export layout
|
202
|
+
# +options+:: +Hash+ of options
|
203
|
+
def find(export_layout_id, options = {})
|
204
|
+
self.prefill(options)
|
205
|
+
|
206
|
+
request = Request.new(@client)
|
207
|
+
path = "/exports/layouts/" + CGI.escape(export_layout_id) + ""
|
208
|
+
data = {
|
209
|
+
|
210
|
+
}
|
211
|
+
|
212
|
+
response = Response.new(request.get(path, data, options))
|
213
|
+
return_values = Array.new
|
214
|
+
|
215
|
+
body = response.body
|
216
|
+
body = body["export_layout"]
|
217
|
+
|
218
|
+
|
219
|
+
obj = ExportLayout.new(@client)
|
220
|
+
return_values.push(obj.fill_with_data(body))
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
return_values[0]
|
225
|
+
end
|
226
|
+
|
227
|
+
# Find the default export layout for given export type.
|
228
|
+
# Params:
|
229
|
+
# +export_type+:: Export type for which the default layout is assigned.
|
230
|
+
# +options+:: +Hash+ of options
|
231
|
+
def find_default(export_type, options = {})
|
232
|
+
self.prefill(options)
|
233
|
+
|
234
|
+
request = Request.new(@client)
|
235
|
+
path = "/exports/layouts/default/" + CGI.escape(export_type) + ""
|
236
|
+
data = {
|
237
|
+
|
238
|
+
}
|
239
|
+
|
240
|
+
response = Response.new(request.get(path, data, options))
|
241
|
+
return_values = Array.new
|
242
|
+
|
243
|
+
body = response.body
|
244
|
+
body = body["export_layout"]
|
245
|
+
|
246
|
+
|
247
|
+
obj = ExportLayout.new(@client)
|
248
|
+
return_values.push(obj.fill_with_data(body))
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
return_values[0]
|
253
|
+
end
|
254
|
+
|
255
|
+
# Create a new export layout.
|
256
|
+
# Params:
|
257
|
+
# +options+:: +Hash+ of options
|
258
|
+
def create(options = {})
|
259
|
+
self.prefill(options)
|
260
|
+
|
261
|
+
request = Request.new(@client)
|
262
|
+
path = "/exports/layouts"
|
263
|
+
data = {
|
264
|
+
"name" => @name,
|
265
|
+
"type" => @type,
|
266
|
+
"is_default" => @is_default,
|
267
|
+
"configuration" => @configuration
|
268
|
+
}
|
269
|
+
|
270
|
+
response = Response.new(request.post(path, data, options))
|
271
|
+
return_values = Array.new
|
272
|
+
|
273
|
+
body = response.body
|
274
|
+
body = body["export_layout"]
|
275
|
+
|
276
|
+
|
277
|
+
return_values.push(self.fill_with_data(body))
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
return_values[0]
|
282
|
+
end
|
283
|
+
|
284
|
+
# Update the export layout.
|
285
|
+
# Params:
|
286
|
+
# +export_layout_id+:: ID of the export layout
|
287
|
+
# +options+:: +Hash+ of options
|
288
|
+
def update(export_layout_id, options = {})
|
289
|
+
self.prefill(options)
|
290
|
+
|
291
|
+
request = Request.new(@client)
|
292
|
+
path = "/exports/layouts/" + CGI.escape(export_layout_id) + ""
|
293
|
+
data = {
|
294
|
+
"name" => @name,
|
295
|
+
"is_default" => @is_default,
|
296
|
+
"configuration" => @configuration
|
297
|
+
}
|
298
|
+
|
299
|
+
response = Response.new(request.put(path, data, options))
|
300
|
+
return_values = Array.new
|
301
|
+
|
302
|
+
body = response.body
|
303
|
+
body = body["export_layout"]
|
304
|
+
|
305
|
+
|
306
|
+
return_values.push(self.fill_with_data(body))
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
return_values[0]
|
311
|
+
end
|
312
|
+
|
313
|
+
# Delete the export layout.
|
314
|
+
# Params:
|
315
|
+
# +export_layout_id+:: ID of the export layout
|
316
|
+
# +options+:: +Hash+ of options
|
317
|
+
def delete(export_layout_id, options = {})
|
318
|
+
self.prefill(options)
|
319
|
+
|
320
|
+
request = Request.new(@client)
|
321
|
+
path = "/exports/layouts/" + CGI.escape(export_layout_id) + ""
|
322
|
+
data = {
|
323
|
+
|
324
|
+
}
|
325
|
+
|
326
|
+
response = Response.new(request.delete(path, data, options))
|
327
|
+
return_values = Array.new
|
328
|
+
|
329
|
+
return_values.push(response.success)
|
330
|
+
|
331
|
+
|
332
|
+
return_values[0]
|
333
|
+
end
|
334
|
+
|
335
|
+
|
336
|
+
end
|
337
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class ExportLayoutConfiguration
|
10
|
+
|
11
|
+
attr_reader :columns
|
12
|
+
attr_reader :time
|
13
|
+
attr_reader :amount
|
14
|
+
|
15
|
+
|
16
|
+
def columns=(val)
|
17
|
+
if val.nil?
|
18
|
+
@columns = []
|
19
|
+
return
|
20
|
+
end
|
21
|
+
|
22
|
+
if val.length > 0 and val[0].instance_of? ExportLayoutConfigurationColumn
|
23
|
+
@columns = val
|
24
|
+
else
|
25
|
+
l = Array.new
|
26
|
+
for v in val
|
27
|
+
obj = ExportLayoutConfigurationColumn.new(@client)
|
28
|
+
obj.fill_with_data(v)
|
29
|
+
l.push(obj)
|
30
|
+
end
|
31
|
+
@columns = l
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def time=(val)
|
37
|
+
if val.nil?
|
38
|
+
@time = val
|
39
|
+
return
|
40
|
+
end
|
41
|
+
|
42
|
+
if val.instance_of? ExportLayoutConfigurationTime
|
43
|
+
@time = val
|
44
|
+
else
|
45
|
+
obj = ExportLayoutConfigurationTime.new(@client)
|
46
|
+
obj.fill_with_data(val)
|
47
|
+
@time = obj
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
def amount=(val)
|
53
|
+
if val.nil?
|
54
|
+
@amount = val
|
55
|
+
return
|
56
|
+
end
|
57
|
+
|
58
|
+
if val.instance_of? ExportLayoutConfigurationAmount
|
59
|
+
@amount = val
|
60
|
+
else
|
61
|
+
obj = ExportLayoutConfigurationAmount.new(@client)
|
62
|
+
obj.fill_with_data(val)
|
63
|
+
@amount = obj
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
# Initializes the ExportLayoutConfiguration object
|
70
|
+
# Params:
|
71
|
+
# +client+:: +ProcessOut+ client instance
|
72
|
+
# +data+:: data that can be used to fill the object
|
73
|
+
def initialize(client, data = {})
|
74
|
+
@client = client
|
75
|
+
|
76
|
+
self.columns = data.fetch(:columns, nil)
|
77
|
+
self.time = data.fetch(:time, nil)
|
78
|
+
self.amount = data.fetch(:amount, nil)
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
# Create a new ExportLayoutConfiguration using the current client
|
83
|
+
def new(data = {})
|
84
|
+
ExportLayoutConfiguration.new(@client, data)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Overrides the JSON marshaller to only send the fields we want
|
88
|
+
def to_json(options)
|
89
|
+
{
|
90
|
+
"columns": self.columns,
|
91
|
+
"time": self.time,
|
92
|
+
"amount": self.amount,
|
93
|
+
}.to_json
|
94
|
+
end
|
95
|
+
|
96
|
+
# Fills the object with data coming from the API
|
97
|
+
# Params:
|
98
|
+
# +data+:: +Hash+ of data coming from the API
|
99
|
+
def fill_with_data(data)
|
100
|
+
if data.nil?
|
101
|
+
return self
|
102
|
+
end
|
103
|
+
if data.include? "columns"
|
104
|
+
self.columns = data["columns"]
|
105
|
+
end
|
106
|
+
if data.include? "time"
|
107
|
+
self.time = data["time"]
|
108
|
+
end
|
109
|
+
if data.include? "amount"
|
110
|
+
self.amount = data["amount"]
|
111
|
+
end
|
112
|
+
|
113
|
+
self
|
114
|
+
end
|
115
|
+
|
116
|
+
# Prefills the object with the data passed as parameters
|
117
|
+
# Params:
|
118
|
+
# +data+:: +Hash+ of data
|
119
|
+
def prefill(data)
|
120
|
+
if data.nil?
|
121
|
+
return self
|
122
|
+
end
|
123
|
+
self.columns = data.fetch(:columns, self.columns)
|
124
|
+
self.time = data.fetch(:time, self.time)
|
125
|
+
self.amount = data.fetch(:amount, self.amount)
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class ExportLayoutConfigurationAmount
|
10
|
+
|
11
|
+
attr_reader :precision
|
12
|
+
attr_reader :separator
|
13
|
+
|
14
|
+
|
15
|
+
def precision=(val)
|
16
|
+
@precision = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def separator=(val)
|
20
|
+
@separator = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the ExportLayoutConfigurationAmount object
|
25
|
+
# Params:
|
26
|
+
# +client+:: +ProcessOut+ client instance
|
27
|
+
# +data+:: data that can be used to fill the object
|
28
|
+
def initialize(client, data = {})
|
29
|
+
@client = client
|
30
|
+
|
31
|
+
self.precision = data.fetch(:precision, nil)
|
32
|
+
self.separator = data.fetch(:separator, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new ExportLayoutConfigurationAmount using the current client
|
37
|
+
def new(data = {})
|
38
|
+
ExportLayoutConfigurationAmount.new(@client, data)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Overrides the JSON marshaller to only send the fields we want
|
42
|
+
def to_json(options)
|
43
|
+
{
|
44
|
+
"precision": self.precision,
|
45
|
+
"separator": self.separator,
|
46
|
+
}.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
# Fills the object with data coming from the API
|
50
|
+
# Params:
|
51
|
+
# +data+:: +Hash+ of data coming from the API
|
52
|
+
def fill_with_data(data)
|
53
|
+
if data.nil?
|
54
|
+
return self
|
55
|
+
end
|
56
|
+
if data.include? "precision"
|
57
|
+
self.precision = data["precision"]
|
58
|
+
end
|
59
|
+
if data.include? "separator"
|
60
|
+
self.separator = data["separator"]
|
61
|
+
end
|
62
|
+
|
63
|
+
self
|
64
|
+
end
|
65
|
+
|
66
|
+
# Prefills the object with the data passed as parameters
|
67
|
+
# Params:
|
68
|
+
# +data+:: +Hash+ of data
|
69
|
+
def prefill(data)
|
70
|
+
if data.nil?
|
71
|
+
return self
|
72
|
+
end
|
73
|
+
self.precision = data.fetch(:precision, self.precision)
|
74
|
+
self.separator = data.fetch(:separator, self.separator)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# The content of this file was automatically generated
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
require "json"
|
5
|
+
require "processout/networking/request"
|
6
|
+
require "processout/networking/response"
|
7
|
+
|
8
|
+
module ProcessOut
|
9
|
+
class ExportLayoutConfigurationColumn
|
10
|
+
|
11
|
+
attr_reader :name
|
12
|
+
attr_reader :rename
|
13
|
+
|
14
|
+
|
15
|
+
def name=(val)
|
16
|
+
@name = val
|
17
|
+
end
|
18
|
+
|
19
|
+
def rename=(val)
|
20
|
+
@rename = val
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# Initializes the ExportLayoutConfigurationColumn object
|
25
|
+
# Params:
|
26
|
+
# +client+:: +ProcessOut+ client instance
|
27
|
+
# +data+:: data that can be used to fill the object
|
28
|
+
def initialize(client, data = {})
|
29
|
+
@client = client
|
30
|
+
|
31
|
+
self.name = data.fetch(:name, nil)
|
32
|
+
self.rename = data.fetch(:rename, nil)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
# Create a new ExportLayoutConfigurationColumn using the current client
|
37
|
+
def new(data = {})
|
38
|
+
ExportLayoutConfigurationColumn.new(@client, data)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Overrides the JSON marshaller to only send the fields we want
|
42
|
+
def to_json(options)
|
43
|
+
{
|
44
|
+
"name": self.name,
|
45
|
+
"rename": self.rename,
|
46
|
+
}.to_json
|
47
|
+
end
|
48
|
+
|
49
|
+
# Fills the object with data coming from the API
|
50
|
+
# Params:
|
51
|
+
# +data+:: +Hash+ of data coming from the API
|
52
|
+
def fill_with_data(data)
|
53
|
+
if data.nil?
|
54
|
+
return self
|
55
|
+
end
|
56
|
+
if data.include? "name"
|
57
|
+
self.name = data["name"]
|
58
|
+
end
|
59
|
+
if data.include? "rename"
|
60
|
+
self.rename = data["rename"]
|
61
|
+
end
|
62
|
+
|
63
|
+
self
|
64
|
+
end
|
65
|
+
|
66
|
+
# Prefills the object with the data passed as parameters
|
67
|
+
# Params:
|
68
|
+
# +data+:: +Hash+ of data
|
69
|
+
def prefill(data)
|
70
|
+
if data.nil?
|
71
|
+
return self
|
72
|
+
end
|
73
|
+
self.name = data.fetch(:name, self.name)
|
74
|
+
self.rename = data.fetch(:rename, self.rename)
|
75
|
+
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|