tachain-sdk 0.1.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 +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +226 -0
- data/Rakefile +10 -0
- data/git_push.sh +54 -0
- data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
- data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
- data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
- data/lib/tachain-sdk/api/api_order_api.rb +846 -0
- data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
- data/lib/tachain-sdk/api/api_production_api.rb +466 -0
- data/lib/tachain-sdk/api_client.rb +397 -0
- data/lib/tachain-sdk/api_error.rb +58 -0
- data/lib/tachain-sdk/api_model_base.rb +88 -0
- data/lib/tachain-sdk/configuration.rb +329 -0
- data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
- data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
- data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
- data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
- data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
- data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
- data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
- data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
- data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_string.rb +200 -0
- data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
- data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
- data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
- data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
- data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
- data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
- data/lib/tachain-sdk/models/company.rb +780 -0
- data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
- data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
- data/lib/tachain-sdk/models/customer.rb +569 -0
- data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
- data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
- data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
- data/lib/tachain-sdk/models/factory.rb +545 -0
- data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
- data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
- data/lib/tachain-sdk/models/model1.rb +157 -0
- data/lib/tachain-sdk/models/model3.rb +202 -0
- data/lib/tachain-sdk/models/model4.rb +202 -0
- data/lib/tachain-sdk/models/order.rb +974 -0
- data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
- data/lib/tachain-sdk/models/order_line.rb +1184 -0
- data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
- data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
- data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
- data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
- data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
- data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
- data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
- data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
- data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
- data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
- data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
- data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
- data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
- data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
- data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
- data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
- data/lib/tachain-sdk/models/supplier.rb +585 -0
- data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
- data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
- data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
- data/lib/tachain-sdk/models/trader.rb +506 -0
- data/lib/tachain-sdk/signed_api_client.rb +65 -0
- data/lib/tachain-sdk/version.rb +15 -0
- data/lib/tachain-sdk.rb +108 -0
- data/spec/spec_helper.rb +111 -0
- data/tachain-sdk.gemspec +39 -0
- metadata +165 -0
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Tactic Chain Public API
|
|
3
|
+
|
|
4
|
+
#Public integration endpoints. Set your own base URL and credential before calling.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TachainSdk
|
|
17
|
+
# 客户信息表
|
|
18
|
+
class Customer < ApiModelBase
|
|
19
|
+
# 客户ID
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# 关联的公司ID
|
|
23
|
+
attr_accessor :company_id
|
|
24
|
+
|
|
25
|
+
# 客户编码
|
|
26
|
+
attr_accessor :code
|
|
27
|
+
|
|
28
|
+
# 最后下单日期
|
|
29
|
+
attr_accessor :last_order_date
|
|
30
|
+
|
|
31
|
+
# 平均订单额
|
|
32
|
+
attr_accessor :avg_order_amount
|
|
33
|
+
|
|
34
|
+
# 采购内容
|
|
35
|
+
attr_accessor :purchase_content
|
|
36
|
+
|
|
37
|
+
# -9 禁用, -1 删除, 0 正常
|
|
38
|
+
attr_accessor :status
|
|
39
|
+
|
|
40
|
+
# 租户ID
|
|
41
|
+
attr_accessor :tenant_id
|
|
42
|
+
|
|
43
|
+
# 环境类型:0 正式,1 测试
|
|
44
|
+
attr_accessor :environment_type
|
|
45
|
+
|
|
46
|
+
# 创建用户ID
|
|
47
|
+
attr_accessor :created_by
|
|
48
|
+
|
|
49
|
+
# 修改用户ID
|
|
50
|
+
attr_accessor :updated_by
|
|
51
|
+
|
|
52
|
+
# 创建时间
|
|
53
|
+
attr_accessor :created_at
|
|
54
|
+
|
|
55
|
+
# 更新时间
|
|
56
|
+
attr_accessor :updated_at
|
|
57
|
+
|
|
58
|
+
# 销售范围,多个创建多条数据
|
|
59
|
+
attr_accessor :sales_scope
|
|
60
|
+
|
|
61
|
+
# 客户类型
|
|
62
|
+
attr_accessor :type
|
|
63
|
+
|
|
64
|
+
# 客户等级
|
|
65
|
+
attr_accessor :customer_level
|
|
66
|
+
|
|
67
|
+
# 联系人
|
|
68
|
+
attr_accessor :contact_person
|
|
69
|
+
|
|
70
|
+
# 联系邮箱
|
|
71
|
+
attr_accessor :contact_email
|
|
72
|
+
|
|
73
|
+
# 联系电话
|
|
74
|
+
attr_accessor :contact_phone
|
|
75
|
+
|
|
76
|
+
# 开票地址
|
|
77
|
+
attr_accessor :billing_address
|
|
78
|
+
|
|
79
|
+
# 收货地址
|
|
80
|
+
attr_accessor :shipping_address
|
|
81
|
+
|
|
82
|
+
# 备注
|
|
83
|
+
attr_accessor :remark
|
|
84
|
+
|
|
85
|
+
# 自定义标签用使用|进行分割
|
|
86
|
+
attr_accessor :custom_tags
|
|
87
|
+
|
|
88
|
+
# 所属公司ID
|
|
89
|
+
attr_accessor :belong_company_id
|
|
90
|
+
|
|
91
|
+
attr_accessor :company
|
|
92
|
+
|
|
93
|
+
# 标签数组
|
|
94
|
+
attr_accessor :scopes
|
|
95
|
+
|
|
96
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
97
|
+
def self.attribute_map
|
|
98
|
+
{
|
|
99
|
+
:'id' => :'id',
|
|
100
|
+
:'company_id' => :'companyId',
|
|
101
|
+
:'code' => :'code',
|
|
102
|
+
:'last_order_date' => :'lastOrderDate',
|
|
103
|
+
:'avg_order_amount' => :'avgOrderAmount',
|
|
104
|
+
:'purchase_content' => :'purchaseContent',
|
|
105
|
+
:'status' => :'status',
|
|
106
|
+
:'tenant_id' => :'tenantId',
|
|
107
|
+
:'environment_type' => :'environmentType',
|
|
108
|
+
:'created_by' => :'createdBy',
|
|
109
|
+
:'updated_by' => :'updatedBy',
|
|
110
|
+
:'created_at' => :'createdAt',
|
|
111
|
+
:'updated_at' => :'updatedAt',
|
|
112
|
+
:'sales_scope' => :'salesScope',
|
|
113
|
+
:'type' => :'type',
|
|
114
|
+
:'customer_level' => :'customerLevel',
|
|
115
|
+
:'contact_person' => :'contactPerson',
|
|
116
|
+
:'contact_email' => :'contactEmail',
|
|
117
|
+
:'contact_phone' => :'contactPhone',
|
|
118
|
+
:'billing_address' => :'billingAddress',
|
|
119
|
+
:'shipping_address' => :'shippingAddress',
|
|
120
|
+
:'remark' => :'remark',
|
|
121
|
+
:'custom_tags' => :'customTags',
|
|
122
|
+
:'belong_company_id' => :'belongCompanyId',
|
|
123
|
+
:'company' => :'company',
|
|
124
|
+
:'scopes' => :'scopes'
|
|
125
|
+
}
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Returns attribute mapping this model knows about
|
|
129
|
+
def self.acceptable_attribute_map
|
|
130
|
+
attribute_map
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Returns all the JSON keys this model knows about
|
|
134
|
+
def self.acceptable_attributes
|
|
135
|
+
acceptable_attribute_map.values
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Attribute type mapping.
|
|
139
|
+
def self.openapi_types
|
|
140
|
+
{
|
|
141
|
+
:'id' => :'String',
|
|
142
|
+
:'company_id' => :'String',
|
|
143
|
+
:'code' => :'String',
|
|
144
|
+
:'last_order_date' => :'Date',
|
|
145
|
+
:'avg_order_amount' => :'Float',
|
|
146
|
+
:'purchase_content' => :'String',
|
|
147
|
+
:'status' => :'Integer',
|
|
148
|
+
:'tenant_id' => :'String',
|
|
149
|
+
:'environment_type' => :'Integer',
|
|
150
|
+
:'created_by' => :'String',
|
|
151
|
+
:'updated_by' => :'String',
|
|
152
|
+
:'created_at' => :'Time',
|
|
153
|
+
:'updated_at' => :'Time',
|
|
154
|
+
:'sales_scope' => :'String',
|
|
155
|
+
:'type' => :'String',
|
|
156
|
+
:'customer_level' => :'String',
|
|
157
|
+
:'contact_person' => :'String',
|
|
158
|
+
:'contact_email' => :'String',
|
|
159
|
+
:'contact_phone' => :'String',
|
|
160
|
+
:'billing_address' => :'String',
|
|
161
|
+
:'shipping_address' => :'String',
|
|
162
|
+
:'remark' => :'String',
|
|
163
|
+
:'custom_tags' => :'String',
|
|
164
|
+
:'belong_company_id' => :'String',
|
|
165
|
+
:'company' => :'Company',
|
|
166
|
+
:'scopes' => :'Array<String>'
|
|
167
|
+
}
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# List of attributes with nullable: true
|
|
171
|
+
def self.openapi_nullable
|
|
172
|
+
Set.new([
|
|
173
|
+
:'company_id',
|
|
174
|
+
:'code',
|
|
175
|
+
:'last_order_date',
|
|
176
|
+
:'avg_order_amount',
|
|
177
|
+
:'purchase_content',
|
|
178
|
+
:'updated_by',
|
|
179
|
+
:'updated_at',
|
|
180
|
+
:'type',
|
|
181
|
+
:'customer_level',
|
|
182
|
+
:'contact_person',
|
|
183
|
+
:'contact_email',
|
|
184
|
+
:'contact_phone',
|
|
185
|
+
:'billing_address',
|
|
186
|
+
:'shipping_address',
|
|
187
|
+
:'remark',
|
|
188
|
+
:'custom_tags',
|
|
189
|
+
])
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Initializes the object
|
|
193
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
194
|
+
def initialize(attributes = {})
|
|
195
|
+
if (!attributes.is_a?(Hash))
|
|
196
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::Customer` initialize method"
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
200
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
201
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
202
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
203
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::Customer`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
204
|
+
end
|
|
205
|
+
h[k.to_sym] = v
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if attributes.key?(:'id')
|
|
209
|
+
self.id = attributes[:'id']
|
|
210
|
+
else
|
|
211
|
+
self.id = nil
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if attributes.key?(:'company_id')
|
|
215
|
+
self.company_id = attributes[:'company_id']
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if attributes.key?(:'code')
|
|
219
|
+
self.code = attributes[:'code']
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
if attributes.key?(:'last_order_date')
|
|
223
|
+
self.last_order_date = attributes[:'last_order_date']
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
if attributes.key?(:'avg_order_amount')
|
|
227
|
+
self.avg_order_amount = attributes[:'avg_order_amount']
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if attributes.key?(:'purchase_content')
|
|
231
|
+
self.purchase_content = attributes[:'purchase_content']
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if attributes.key?(:'status')
|
|
235
|
+
self.status = attributes[:'status']
|
|
236
|
+
else
|
|
237
|
+
self.status = nil
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if attributes.key?(:'tenant_id')
|
|
241
|
+
self.tenant_id = attributes[:'tenant_id']
|
|
242
|
+
else
|
|
243
|
+
self.tenant_id = nil
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if attributes.key?(:'environment_type')
|
|
247
|
+
self.environment_type = attributes[:'environment_type']
|
|
248
|
+
else
|
|
249
|
+
self.environment_type = nil
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
if attributes.key?(:'created_by')
|
|
253
|
+
self.created_by = attributes[:'created_by']
|
|
254
|
+
else
|
|
255
|
+
self.created_by = nil
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
if attributes.key?(:'updated_by')
|
|
259
|
+
self.updated_by = attributes[:'updated_by']
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if attributes.key?(:'created_at')
|
|
263
|
+
self.created_at = attributes[:'created_at']
|
|
264
|
+
else
|
|
265
|
+
self.created_at = nil
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
if attributes.key?(:'updated_at')
|
|
269
|
+
self.updated_at = attributes[:'updated_at']
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
if attributes.key?(:'sales_scope')
|
|
273
|
+
self.sales_scope = attributes[:'sales_scope']
|
|
274
|
+
else
|
|
275
|
+
self.sales_scope = nil
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if attributes.key?(:'type')
|
|
279
|
+
self.type = attributes[:'type']
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
if attributes.key?(:'customer_level')
|
|
283
|
+
self.customer_level = attributes[:'customer_level']
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
if attributes.key?(:'contact_person')
|
|
287
|
+
self.contact_person = attributes[:'contact_person']
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
if attributes.key?(:'contact_email')
|
|
291
|
+
self.contact_email = attributes[:'contact_email']
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
if attributes.key?(:'contact_phone')
|
|
295
|
+
self.contact_phone = attributes[:'contact_phone']
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
if attributes.key?(:'billing_address')
|
|
299
|
+
self.billing_address = attributes[:'billing_address']
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
if attributes.key?(:'shipping_address')
|
|
303
|
+
self.shipping_address = attributes[:'shipping_address']
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
if attributes.key?(:'remark')
|
|
307
|
+
self.remark = attributes[:'remark']
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
if attributes.key?(:'custom_tags')
|
|
311
|
+
self.custom_tags = attributes[:'custom_tags']
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
if attributes.key?(:'belong_company_id')
|
|
315
|
+
self.belong_company_id = attributes[:'belong_company_id']
|
|
316
|
+
else
|
|
317
|
+
self.belong_company_id = nil
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
if attributes.key?(:'company')
|
|
321
|
+
self.company = attributes[:'company']
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
if attributes.key?(:'scopes')
|
|
325
|
+
if (value = attributes[:'scopes']).is_a?(Array)
|
|
326
|
+
self.scopes = value
|
|
327
|
+
end
|
|
328
|
+
else
|
|
329
|
+
self.scopes = nil
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
334
|
+
# @return Array for valid properties with the reasons
|
|
335
|
+
def list_invalid_properties
|
|
336
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
337
|
+
invalid_properties = Array.new
|
|
338
|
+
if @id.nil?
|
|
339
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
if @status.nil?
|
|
343
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
if @tenant_id.nil?
|
|
347
|
+
invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
if @environment_type.nil?
|
|
351
|
+
invalid_properties.push('invalid value for "environment_type", environment_type cannot be nil.')
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
if @created_by.nil?
|
|
355
|
+
invalid_properties.push('invalid value for "created_by", created_by cannot be nil.')
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
if @created_at.nil?
|
|
359
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
if @sales_scope.nil?
|
|
363
|
+
invalid_properties.push('invalid value for "sales_scope", sales_scope cannot be nil.')
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
if @belong_company_id.nil?
|
|
367
|
+
invalid_properties.push('invalid value for "belong_company_id", belong_company_id cannot be nil.')
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
if @scopes.nil?
|
|
371
|
+
invalid_properties.push('invalid value for "scopes", scopes cannot be nil.')
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
invalid_properties
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Check to see if the all the properties in the model are valid
|
|
378
|
+
# @return true if the model is valid
|
|
379
|
+
def valid?
|
|
380
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
381
|
+
return false if @id.nil?
|
|
382
|
+
return false if @status.nil?
|
|
383
|
+
return false if @tenant_id.nil?
|
|
384
|
+
return false if @environment_type.nil?
|
|
385
|
+
return false if @created_by.nil?
|
|
386
|
+
return false if @created_at.nil?
|
|
387
|
+
return false if @sales_scope.nil?
|
|
388
|
+
return false if @belong_company_id.nil?
|
|
389
|
+
return false if @scopes.nil?
|
|
390
|
+
true
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Custom attribute writer method with validation
|
|
394
|
+
# @param [Object] id Value to be assigned
|
|
395
|
+
def id=(id)
|
|
396
|
+
if id.nil?
|
|
397
|
+
fail ArgumentError, 'id cannot be nil'
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
@id = id
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Custom attribute writer method with validation
|
|
404
|
+
# @param [Object] status Value to be assigned
|
|
405
|
+
def status=(status)
|
|
406
|
+
if status.nil?
|
|
407
|
+
fail ArgumentError, 'status cannot be nil'
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
@status = status
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
# Custom attribute writer method with validation
|
|
414
|
+
# @param [Object] tenant_id Value to be assigned
|
|
415
|
+
def tenant_id=(tenant_id)
|
|
416
|
+
if tenant_id.nil?
|
|
417
|
+
fail ArgumentError, 'tenant_id cannot be nil'
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
@tenant_id = tenant_id
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Custom attribute writer method with validation
|
|
424
|
+
# @param [Object] environment_type Value to be assigned
|
|
425
|
+
def environment_type=(environment_type)
|
|
426
|
+
if environment_type.nil?
|
|
427
|
+
fail ArgumentError, 'environment_type cannot be nil'
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
@environment_type = environment_type
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# Custom attribute writer method with validation
|
|
434
|
+
# @param [Object] created_by Value to be assigned
|
|
435
|
+
def created_by=(created_by)
|
|
436
|
+
if created_by.nil?
|
|
437
|
+
fail ArgumentError, 'created_by cannot be nil'
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
@created_by = created_by
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
# Custom attribute writer method with validation
|
|
444
|
+
# @param [Object] created_at Value to be assigned
|
|
445
|
+
def created_at=(created_at)
|
|
446
|
+
if created_at.nil?
|
|
447
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
@created_at = created_at
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Custom attribute writer method with validation
|
|
454
|
+
# @param [Object] sales_scope Value to be assigned
|
|
455
|
+
def sales_scope=(sales_scope)
|
|
456
|
+
if sales_scope.nil?
|
|
457
|
+
fail ArgumentError, 'sales_scope cannot be nil'
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
@sales_scope = sales_scope
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
# Custom attribute writer method with validation
|
|
464
|
+
# @param [Object] belong_company_id Value to be assigned
|
|
465
|
+
def belong_company_id=(belong_company_id)
|
|
466
|
+
if belong_company_id.nil?
|
|
467
|
+
fail ArgumentError, 'belong_company_id cannot be nil'
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
@belong_company_id = belong_company_id
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
# Custom attribute writer method with validation
|
|
474
|
+
# @param [Object] scopes Value to be assigned
|
|
475
|
+
def scopes=(scopes)
|
|
476
|
+
if scopes.nil?
|
|
477
|
+
fail ArgumentError, 'scopes cannot be nil'
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
@scopes = scopes
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
# Checks equality by comparing each attribute.
|
|
484
|
+
# @param [Object] Object to be compared
|
|
485
|
+
def ==(o)
|
|
486
|
+
return true if self.equal?(o)
|
|
487
|
+
self.class == o.class &&
|
|
488
|
+
id == o.id &&
|
|
489
|
+
company_id == o.company_id &&
|
|
490
|
+
code == o.code &&
|
|
491
|
+
last_order_date == o.last_order_date &&
|
|
492
|
+
avg_order_amount == o.avg_order_amount &&
|
|
493
|
+
purchase_content == o.purchase_content &&
|
|
494
|
+
status == o.status &&
|
|
495
|
+
tenant_id == o.tenant_id &&
|
|
496
|
+
environment_type == o.environment_type &&
|
|
497
|
+
created_by == o.created_by &&
|
|
498
|
+
updated_by == o.updated_by &&
|
|
499
|
+
created_at == o.created_at &&
|
|
500
|
+
updated_at == o.updated_at &&
|
|
501
|
+
sales_scope == o.sales_scope &&
|
|
502
|
+
type == o.type &&
|
|
503
|
+
customer_level == o.customer_level &&
|
|
504
|
+
contact_person == o.contact_person &&
|
|
505
|
+
contact_email == o.contact_email &&
|
|
506
|
+
contact_phone == o.contact_phone &&
|
|
507
|
+
billing_address == o.billing_address &&
|
|
508
|
+
shipping_address == o.shipping_address &&
|
|
509
|
+
remark == o.remark &&
|
|
510
|
+
custom_tags == o.custom_tags &&
|
|
511
|
+
belong_company_id == o.belong_company_id &&
|
|
512
|
+
company == o.company &&
|
|
513
|
+
scopes == o.scopes
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
# @see the `==` method
|
|
517
|
+
# @param [Object] Object to be compared
|
|
518
|
+
def eql?(o)
|
|
519
|
+
self == o
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
# Calculates hash code according to all attributes.
|
|
523
|
+
# @return [Integer] Hash code
|
|
524
|
+
def hash
|
|
525
|
+
[id, company_id, code, last_order_date, avg_order_amount, purchase_content, status, tenant_id, environment_type, created_by, updated_by, created_at, updated_at, sales_scope, type, customer_level, contact_person, contact_email, contact_phone, billing_address, shipping_address, remark, custom_tags, belong_company_id, company, scopes].hash
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
# Builds the object from hash
|
|
529
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
530
|
+
# @return [Object] Returns the model itself
|
|
531
|
+
def self.build_from_hash(attributes)
|
|
532
|
+
return nil unless attributes.is_a?(Hash)
|
|
533
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
534
|
+
transformed_hash = {}
|
|
535
|
+
openapi_types.each_pair do |key, type|
|
|
536
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
537
|
+
transformed_hash["#{key}"] = nil
|
|
538
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
539
|
+
# check to ensure the input is an array given that the attribute
|
|
540
|
+
# is documented as an array but the input is not
|
|
541
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
542
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
543
|
+
end
|
|
544
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
545
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
546
|
+
end
|
|
547
|
+
end
|
|
548
|
+
new(transformed_hash)
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# Returns the object in the form of hash
|
|
552
|
+
# @return [Hash] Returns the object in the form of hash
|
|
553
|
+
def to_hash
|
|
554
|
+
hash = {}
|
|
555
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
556
|
+
value = self.send(attr)
|
|
557
|
+
if value.nil?
|
|
558
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
559
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
hash[param] = _to_hash(value)
|
|
563
|
+
end
|
|
564
|
+
hash
|
|
565
|
+
end
|
|
566
|
+
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
end
|