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,329 @@
|
|
|
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
|
+
module TachainSdk
|
|
14
|
+
class Configuration
|
|
15
|
+
# Defines url scheme
|
|
16
|
+
attr_accessor :scheme
|
|
17
|
+
|
|
18
|
+
# Defines url host
|
|
19
|
+
attr_accessor :host
|
|
20
|
+
|
|
21
|
+
# Defines url base path
|
|
22
|
+
attr_accessor :base_path
|
|
23
|
+
|
|
24
|
+
# Define server configuration index
|
|
25
|
+
attr_accessor :server_index
|
|
26
|
+
|
|
27
|
+
# Define server operation configuration index
|
|
28
|
+
attr_accessor :server_operation_index
|
|
29
|
+
|
|
30
|
+
# Default server variables
|
|
31
|
+
attr_accessor :server_variables
|
|
32
|
+
|
|
33
|
+
# Default server operation variables
|
|
34
|
+
attr_accessor :server_operation_variables
|
|
35
|
+
|
|
36
|
+
# Defines API keys used with API Key authentications.
|
|
37
|
+
#
|
|
38
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
|
39
|
+
#
|
|
40
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
|
41
|
+
# config.api_key['api_key'] = 'xxx'
|
|
42
|
+
attr_accessor :api_key
|
|
43
|
+
|
|
44
|
+
# Defines API key prefixes used with API Key authentications.
|
|
45
|
+
#
|
|
46
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
|
47
|
+
#
|
|
48
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
|
49
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
|
50
|
+
attr_accessor :api_key_prefix
|
|
51
|
+
|
|
52
|
+
# Defines the username used with HTTP basic authentication.
|
|
53
|
+
#
|
|
54
|
+
# @return [String]
|
|
55
|
+
attr_accessor :username
|
|
56
|
+
|
|
57
|
+
# Defines the password used with HTTP basic authentication.
|
|
58
|
+
#
|
|
59
|
+
# @return [String]
|
|
60
|
+
attr_accessor :password
|
|
61
|
+
|
|
62
|
+
# Defines the access token (Bearer) used with OAuth2.
|
|
63
|
+
attr_accessor :access_token
|
|
64
|
+
|
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
|
66
|
+
# Overrides the access_token if set
|
|
67
|
+
# @return [Proc]
|
|
68
|
+
attr_accessor :access_token_getter
|
|
69
|
+
|
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
|
72
|
+
# Default to false.
|
|
73
|
+
attr_accessor :return_binary_data
|
|
74
|
+
|
|
75
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
|
76
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
|
77
|
+
# Default to false.
|
|
78
|
+
#
|
|
79
|
+
# @return [true, false]
|
|
80
|
+
attr_accessor :debugging
|
|
81
|
+
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
|
86
|
+
# Default to false.
|
|
87
|
+
# @return [true, false]
|
|
88
|
+
attr_accessor :ignore_operation_servers
|
|
89
|
+
|
|
90
|
+
# Defines the logger used for debugging.
|
|
91
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
|
92
|
+
#
|
|
93
|
+
# @return [#debug]
|
|
94
|
+
attr_accessor :logger
|
|
95
|
+
|
|
96
|
+
# Defines the temporary folder to store downloaded files
|
|
97
|
+
# (for API endpoints that have file response).
|
|
98
|
+
# Default to use `Tempfile`.
|
|
99
|
+
#
|
|
100
|
+
# @return [String]
|
|
101
|
+
attr_accessor :temp_folder_path
|
|
102
|
+
|
|
103
|
+
# The time limit for HTTP request in seconds.
|
|
104
|
+
# Default to 0 (never times out).
|
|
105
|
+
attr_accessor :timeout
|
|
106
|
+
|
|
107
|
+
# Set this to false to skip client side validation in the operation.
|
|
108
|
+
# Default to true.
|
|
109
|
+
# @return [true, false]
|
|
110
|
+
attr_accessor :client_side_validation
|
|
111
|
+
|
|
112
|
+
### TLS/SSL setting
|
|
113
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
|
114
|
+
# Default to true.
|
|
115
|
+
#
|
|
116
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
|
117
|
+
#
|
|
118
|
+
# @return [true, false]
|
|
119
|
+
attr_accessor :verify_ssl
|
|
120
|
+
|
|
121
|
+
### TLS/SSL setting
|
|
122
|
+
# Set this to false to skip verifying SSL host name
|
|
123
|
+
# Default to true.
|
|
124
|
+
#
|
|
125
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
|
126
|
+
#
|
|
127
|
+
# @return [true, false]
|
|
128
|
+
attr_accessor :verify_ssl_host
|
|
129
|
+
|
|
130
|
+
### TLS/SSL setting
|
|
131
|
+
# Set this to customize the certificate file to verify the peer.
|
|
132
|
+
#
|
|
133
|
+
# @return [String] the path to the certificate file
|
|
134
|
+
#
|
|
135
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
|
136
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
|
137
|
+
attr_accessor :ssl_ca_cert
|
|
138
|
+
|
|
139
|
+
### TLS/SSL setting
|
|
140
|
+
# Client certificate file (for client certificate)
|
|
141
|
+
attr_accessor :cert_file
|
|
142
|
+
|
|
143
|
+
### TLS/SSL setting
|
|
144
|
+
# Client private key file (for client certificate)
|
|
145
|
+
attr_accessor :key_file
|
|
146
|
+
|
|
147
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
|
148
|
+
# Default to nil.
|
|
149
|
+
#
|
|
150
|
+
# @see The params_encoding option of Ethon. Related source code:
|
|
151
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
|
152
|
+
attr_accessor :params_encoding
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
attr_accessor :inject_format
|
|
156
|
+
|
|
157
|
+
attr_accessor :force_ending_format
|
|
158
|
+
|
|
159
|
+
def initialize
|
|
160
|
+
@scheme = 'https'
|
|
161
|
+
@host = 'api.example.com'
|
|
162
|
+
@base_path = ''
|
|
163
|
+
@server_index = nil
|
|
164
|
+
@server_operation_index = {}
|
|
165
|
+
@server_variables = {}
|
|
166
|
+
@server_operation_variables = {}
|
|
167
|
+
@api_key = {}
|
|
168
|
+
@api_key_prefix = {}
|
|
169
|
+
@client_side_validation = true
|
|
170
|
+
@verify_ssl = true
|
|
171
|
+
@verify_ssl_host = true
|
|
172
|
+
@cert_file = nil
|
|
173
|
+
@key_file = nil
|
|
174
|
+
@timeout = 0
|
|
175
|
+
@params_encoding = nil
|
|
176
|
+
@debugging = false
|
|
177
|
+
@ignore_operation_servers = false
|
|
178
|
+
@inject_format = false
|
|
179
|
+
@force_ending_format = false
|
|
180
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
|
181
|
+
|
|
182
|
+
yield(self) if block_given?
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# The default Configuration object.
|
|
186
|
+
def self.default
|
|
187
|
+
@@default ||= Configuration.new
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def configure
|
|
191
|
+
yield(self) if block_given?
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def scheme=(scheme)
|
|
195
|
+
# remove :// from scheme
|
|
196
|
+
@scheme = scheme.sub(/:\/\//, '')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def host=(host)
|
|
200
|
+
# remove http(s):// and anything after a slash
|
|
201
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def base_path=(base_path)
|
|
205
|
+
# Add leading and trailing slashes to base_path
|
|
206
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
|
207
|
+
@base_path = '' if @base_path == '/'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Returns base URL for specified operation based on server settings
|
|
211
|
+
def base_url(operation = nil)
|
|
212
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
|
213
|
+
if operation_server_settings.key?(operation) then
|
|
214
|
+
index = server_operation_index.fetch(operation, server_index)
|
|
215
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
|
216
|
+
else
|
|
217
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Gets API key (with prefix if set).
|
|
222
|
+
# @param [String] param_name the parameter name of API key auth
|
|
223
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
|
224
|
+
key = @api_key[param_name]
|
|
225
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
|
226
|
+
if @api_key_prefix[param_name]
|
|
227
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
|
228
|
+
else
|
|
229
|
+
key
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
|
234
|
+
def access_token_with_refresh
|
|
235
|
+
return access_token if access_token_getter.nil?
|
|
236
|
+
access_token_getter.call
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Gets Basic Auth token string
|
|
240
|
+
def basic_auth_token
|
|
241
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Returns Auth Settings hash for api client.
|
|
245
|
+
def auth_settings
|
|
246
|
+
{
|
|
247
|
+
'BearerToken' =>
|
|
248
|
+
{
|
|
249
|
+
type: 'bearer',
|
|
250
|
+
in: 'header',
|
|
251
|
+
key: 'Authorization',
|
|
252
|
+
value: "Bearer #{access_token_with_refresh}"
|
|
253
|
+
},
|
|
254
|
+
'ApiKey' =>
|
|
255
|
+
{
|
|
256
|
+
type: 'api_key',
|
|
257
|
+
in: 'header',
|
|
258
|
+
key: 'X-API-Key',
|
|
259
|
+
value: api_key_with_prefix('X-API-Key')
|
|
260
|
+
},
|
|
261
|
+
'Timestamp' =>
|
|
262
|
+
{
|
|
263
|
+
type: 'api_key',
|
|
264
|
+
in: 'header',
|
|
265
|
+
key: 'X-Timestamp',
|
|
266
|
+
value: api_key_with_prefix('X-Timestamp')
|
|
267
|
+
},
|
|
268
|
+
'Signature' =>
|
|
269
|
+
{
|
|
270
|
+
type: 'api_key',
|
|
271
|
+
in: 'header',
|
|
272
|
+
key: 'X-Signature',
|
|
273
|
+
value: api_key_with_prefix('X-Signature')
|
|
274
|
+
},
|
|
275
|
+
}
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Returns an array of Server setting
|
|
279
|
+
def server_settings
|
|
280
|
+
[
|
|
281
|
+
{
|
|
282
|
+
url: "https://api.example.com",
|
|
283
|
+
description: "Replace with your Tactic Chain API base URL",
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
def operation_server_settings
|
|
289
|
+
{
|
|
290
|
+
}
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Returns URL based on server settings
|
|
294
|
+
#
|
|
295
|
+
# @param index array index of the server settings
|
|
296
|
+
# @param variables hash of variable and the corresponding value
|
|
297
|
+
def server_url(index, variables = {}, servers = nil)
|
|
298
|
+
servers = server_settings if servers == nil
|
|
299
|
+
|
|
300
|
+
# check array index out of bound
|
|
301
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
|
302
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
server = servers[index]
|
|
306
|
+
url = server[:url]
|
|
307
|
+
|
|
308
|
+
return url unless server.key? :variables
|
|
309
|
+
|
|
310
|
+
# go through variable and assign a value
|
|
311
|
+
server[:variables].each do |name, variable|
|
|
312
|
+
if variables.key?(name)
|
|
313
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
|
314
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
|
315
|
+
else
|
|
316
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
|
317
|
+
end
|
|
318
|
+
else
|
|
319
|
+
# use default value
|
|
320
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
url
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
end
|
|
329
|
+
end
|
|
@@ -0,0 +1,341 @@
|
|
|
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 ApiDeclarationDeleteRequest < ApiModelBase
|
|
19
|
+
# 单个附件申报记录 ID。
|
|
20
|
+
attr_accessor :attachment_id
|
|
21
|
+
|
|
22
|
+
# 批量附件申报记录 ID。
|
|
23
|
+
attr_accessor :attachment_ids
|
|
24
|
+
|
|
25
|
+
# 单个表单申报记录 ID。
|
|
26
|
+
attr_accessor :form_data_id
|
|
27
|
+
|
|
28
|
+
# 批量表单申报记录 ID。
|
|
29
|
+
attr_accessor :form_data_ids
|
|
30
|
+
|
|
31
|
+
# 申报阶段 ID。按业务键删除申报资料时用于判断 ExtendNumber 属于哪类单据。
|
|
32
|
+
attr_accessor :stage_id
|
|
33
|
+
|
|
34
|
+
# 业务扩展 ID,例如订单 ID、生产单 ID、发货单 ID。
|
|
35
|
+
attr_accessor :extend_id
|
|
36
|
+
|
|
37
|
+
# 业务单号。可配合 ExtendDate、ExtendLineNumber、ProductCode 等字段解析 ExtendId。
|
|
38
|
+
attr_accessor :extend_number
|
|
39
|
+
|
|
40
|
+
# 业务单日期。订单阶段按订单号定位时使用。
|
|
41
|
+
attr_accessor :extend_date
|
|
42
|
+
|
|
43
|
+
# 订单行号。订单阶段按订单行定位时使用。
|
|
44
|
+
attr_accessor :extend_line_number
|
|
45
|
+
|
|
46
|
+
# 订单侧别,常用 PO 或 SO。
|
|
47
|
+
attr_accessor :order_side
|
|
48
|
+
|
|
49
|
+
# 产品编码。生产/入库阶段按生产单号删除申报资料时参与定位生产单。
|
|
50
|
+
attr_accessor :product_code
|
|
51
|
+
|
|
52
|
+
# 生产类型。生产/入库阶段按生产单号定位时参与唯一性判断。
|
|
53
|
+
attr_accessor :production_type
|
|
54
|
+
|
|
55
|
+
# 发货单号。发货阶段按单号删除申报资料时用于定位 ExtendId。
|
|
56
|
+
attr_accessor :delivery_number
|
|
57
|
+
|
|
58
|
+
# 资料类型 ID。按业务键删除时和 StageId、ExtendId 一起定位申报记录。
|
|
59
|
+
attr_accessor :document_type_id
|
|
60
|
+
|
|
61
|
+
# 资料类型编码。外部不知道 DocumentTypeId 时可传该字段。
|
|
62
|
+
attr_accessor :document_type_code
|
|
63
|
+
|
|
64
|
+
# 附件申报的单据编号;同一资料类型存在多条附件申报时用于进一步过滤。
|
|
65
|
+
attr_accessor :document_number
|
|
66
|
+
|
|
67
|
+
# 是否删除附件申报;默认 true。
|
|
68
|
+
attr_accessor :delete_attachments
|
|
69
|
+
|
|
70
|
+
# 是否删除表单申报;默认 true。
|
|
71
|
+
attr_accessor :delete_forms
|
|
72
|
+
|
|
73
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
74
|
+
def self.attribute_map
|
|
75
|
+
{
|
|
76
|
+
:'attachment_id' => :'attachmentId',
|
|
77
|
+
:'attachment_ids' => :'attachmentIds',
|
|
78
|
+
:'form_data_id' => :'formDataId',
|
|
79
|
+
:'form_data_ids' => :'formDataIds',
|
|
80
|
+
:'stage_id' => :'stageId',
|
|
81
|
+
:'extend_id' => :'extendId',
|
|
82
|
+
:'extend_number' => :'extendNumber',
|
|
83
|
+
:'extend_date' => :'extendDate',
|
|
84
|
+
:'extend_line_number' => :'extendLineNumber',
|
|
85
|
+
:'order_side' => :'orderSide',
|
|
86
|
+
:'product_code' => :'productCode',
|
|
87
|
+
:'production_type' => :'productionType',
|
|
88
|
+
:'delivery_number' => :'deliveryNumber',
|
|
89
|
+
:'document_type_id' => :'documentTypeId',
|
|
90
|
+
:'document_type_code' => :'documentTypeCode',
|
|
91
|
+
:'document_number' => :'documentNumber',
|
|
92
|
+
:'delete_attachments' => :'deleteAttachments',
|
|
93
|
+
:'delete_forms' => :'deleteForms'
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Returns attribute mapping this model knows about
|
|
98
|
+
def self.acceptable_attribute_map
|
|
99
|
+
attribute_map
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Returns all the JSON keys this model knows about
|
|
103
|
+
def self.acceptable_attributes
|
|
104
|
+
acceptable_attribute_map.values
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Attribute type mapping.
|
|
108
|
+
def self.openapi_types
|
|
109
|
+
{
|
|
110
|
+
:'attachment_id' => :'String',
|
|
111
|
+
:'attachment_ids' => :'Array<String>',
|
|
112
|
+
:'form_data_id' => :'String',
|
|
113
|
+
:'form_data_ids' => :'Array<String>',
|
|
114
|
+
:'stage_id' => :'String',
|
|
115
|
+
:'extend_id' => :'String',
|
|
116
|
+
:'extend_number' => :'String',
|
|
117
|
+
:'extend_date' => :'Time',
|
|
118
|
+
:'extend_line_number' => :'String',
|
|
119
|
+
:'order_side' => :'String',
|
|
120
|
+
:'product_code' => :'String',
|
|
121
|
+
:'production_type' => :'Integer',
|
|
122
|
+
:'delivery_number' => :'String',
|
|
123
|
+
:'document_type_id' => :'String',
|
|
124
|
+
:'document_type_code' => :'String',
|
|
125
|
+
:'document_number' => :'String',
|
|
126
|
+
:'delete_attachments' => :'Boolean',
|
|
127
|
+
:'delete_forms' => :'Boolean'
|
|
128
|
+
}
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# List of attributes with nullable: true
|
|
132
|
+
def self.openapi_nullable
|
|
133
|
+
Set.new([
|
|
134
|
+
:'attachment_id',
|
|
135
|
+
:'attachment_ids',
|
|
136
|
+
:'form_data_id',
|
|
137
|
+
:'form_data_ids',
|
|
138
|
+
:'stage_id',
|
|
139
|
+
:'extend_id',
|
|
140
|
+
:'extend_number',
|
|
141
|
+
:'extend_date',
|
|
142
|
+
:'extend_line_number',
|
|
143
|
+
:'order_side',
|
|
144
|
+
:'product_code',
|
|
145
|
+
:'production_type',
|
|
146
|
+
:'delivery_number',
|
|
147
|
+
:'document_type_id',
|
|
148
|
+
:'document_type_code',
|
|
149
|
+
:'document_number',
|
|
150
|
+
:'delete_attachments',
|
|
151
|
+
:'delete_forms'
|
|
152
|
+
])
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Initializes the object
|
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
157
|
+
def initialize(attributes = {})
|
|
158
|
+
if (!attributes.is_a?(Hash))
|
|
159
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiDeclarationDeleteRequest` initialize method"
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
163
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
164
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
165
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
166
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiDeclarationDeleteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
167
|
+
end
|
|
168
|
+
h[k.to_sym] = v
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'attachment_id')
|
|
172
|
+
self.attachment_id = attributes[:'attachment_id']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'attachment_ids')
|
|
176
|
+
if (value = attributes[:'attachment_ids']).is_a?(Array)
|
|
177
|
+
self.attachment_ids = value
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'form_data_id')
|
|
182
|
+
self.form_data_id = attributes[:'form_data_id']
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'form_data_ids')
|
|
186
|
+
if (value = attributes[:'form_data_ids']).is_a?(Array)
|
|
187
|
+
self.form_data_ids = value
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'stage_id')
|
|
192
|
+
self.stage_id = attributes[:'stage_id']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'extend_id')
|
|
196
|
+
self.extend_id = attributes[:'extend_id']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'extend_number')
|
|
200
|
+
self.extend_number = attributes[:'extend_number']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'extend_date')
|
|
204
|
+
self.extend_date = attributes[:'extend_date']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'extend_line_number')
|
|
208
|
+
self.extend_line_number = attributes[:'extend_line_number']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'order_side')
|
|
212
|
+
self.order_side = attributes[:'order_side']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'product_code')
|
|
216
|
+
self.product_code = attributes[:'product_code']
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if attributes.key?(:'production_type')
|
|
220
|
+
self.production_type = attributes[:'production_type']
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if attributes.key?(:'delivery_number')
|
|
224
|
+
self.delivery_number = attributes[:'delivery_number']
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if attributes.key?(:'document_type_id')
|
|
228
|
+
self.document_type_id = attributes[:'document_type_id']
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if attributes.key?(:'document_type_code')
|
|
232
|
+
self.document_type_code = attributes[:'document_type_code']
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if attributes.key?(:'document_number')
|
|
236
|
+
self.document_number = attributes[:'document_number']
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if attributes.key?(:'delete_attachments')
|
|
240
|
+
self.delete_attachments = attributes[:'delete_attachments']
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if attributes.key?(:'delete_forms')
|
|
244
|
+
self.delete_forms = attributes[:'delete_forms']
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
249
|
+
# @return Array for valid properties with the reasons
|
|
250
|
+
def list_invalid_properties
|
|
251
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
252
|
+
invalid_properties = Array.new
|
|
253
|
+
invalid_properties
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Check to see if the all the properties in the model are valid
|
|
257
|
+
# @return true if the model is valid
|
|
258
|
+
def valid?
|
|
259
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
260
|
+
true
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Checks equality by comparing each attribute.
|
|
264
|
+
# @param [Object] Object to be compared
|
|
265
|
+
def ==(o)
|
|
266
|
+
return true if self.equal?(o)
|
|
267
|
+
self.class == o.class &&
|
|
268
|
+
attachment_id == o.attachment_id &&
|
|
269
|
+
attachment_ids == o.attachment_ids &&
|
|
270
|
+
form_data_id == o.form_data_id &&
|
|
271
|
+
form_data_ids == o.form_data_ids &&
|
|
272
|
+
stage_id == o.stage_id &&
|
|
273
|
+
extend_id == o.extend_id &&
|
|
274
|
+
extend_number == o.extend_number &&
|
|
275
|
+
extend_date == o.extend_date &&
|
|
276
|
+
extend_line_number == o.extend_line_number &&
|
|
277
|
+
order_side == o.order_side &&
|
|
278
|
+
product_code == o.product_code &&
|
|
279
|
+
production_type == o.production_type &&
|
|
280
|
+
delivery_number == o.delivery_number &&
|
|
281
|
+
document_type_id == o.document_type_id &&
|
|
282
|
+
document_type_code == o.document_type_code &&
|
|
283
|
+
document_number == o.document_number &&
|
|
284
|
+
delete_attachments == o.delete_attachments &&
|
|
285
|
+
delete_forms == o.delete_forms
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# @see the `==` method
|
|
289
|
+
# @param [Object] Object to be compared
|
|
290
|
+
def eql?(o)
|
|
291
|
+
self == o
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Calculates hash code according to all attributes.
|
|
295
|
+
# @return [Integer] Hash code
|
|
296
|
+
def hash
|
|
297
|
+
[attachment_id, attachment_ids, form_data_id, form_data_ids, stage_id, extend_id, extend_number, extend_date, extend_line_number, order_side, product_code, production_type, delivery_number, document_type_id, document_type_code, document_number, delete_attachments, delete_forms].hash
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Builds the object from hash
|
|
301
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
302
|
+
# @return [Object] Returns the model itself
|
|
303
|
+
def self.build_from_hash(attributes)
|
|
304
|
+
return nil unless attributes.is_a?(Hash)
|
|
305
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
306
|
+
transformed_hash = {}
|
|
307
|
+
openapi_types.each_pair do |key, type|
|
|
308
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
309
|
+
transformed_hash["#{key}"] = nil
|
|
310
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
311
|
+
# check to ensure the input is an array given that the attribute
|
|
312
|
+
# is documented as an array but the input is not
|
|
313
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
314
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
315
|
+
end
|
|
316
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
317
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
new(transformed_hash)
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Returns the object in the form of hash
|
|
324
|
+
# @return [Hash] Returns the object in the form of hash
|
|
325
|
+
def to_hash
|
|
326
|
+
hash = {}
|
|
327
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
328
|
+
value = self.send(attr)
|
|
329
|
+
if value.nil?
|
|
330
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
331
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
hash[param] = _to_hash(value)
|
|
335
|
+
end
|
|
336
|
+
hash
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
end
|