aspose_cad_cloud 24.5 → 24.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose_cad_cloud/api/cad_api.rb +37 -19
- data/lib/aspose_cad_cloud/api_client.rb +97 -1
- data/lib/aspose_cad_cloud/configuration.rb +1 -1
- data/lib/aspose_cad_cloud/models/cad_rasterization_options_dto.rb +2 -12
- data/lib/aspose_cad_cloud/models/color_dto.rb +242 -0
- data/lib/aspose_cad_cloud/models/{error_model.rb → error.rb} +2 -2
- data/lib/aspose_cad_cloud/models/files_upload_result.rb +1 -1
- data/lib/aspose_cad_cloud/models/requests/ConvertRequest.rb +5 -5
- data/lib/aspose_cad_cloud/models/requests/EditMetadataRequest.rb +5 -5
- data/lib/aspose_cad_cloud/models/requests/ExtractMetadataRequest.rb +5 -5
- data/lib/aspose_cad_cloud/models/requests/ExtractTextRequest.rb +5 -5
- data/lib/aspose_cad_cloud/models/requests/PaperToCadRequest.rb +5 -5
- data/lib/aspose_cad_cloud/models/requests/PutEditMetadataRequest.rb +7 -7
- data/lib/aspose_cad_cloud/models/requests/WatermarkRequest.rb +9 -9
- data/lib/aspose_cad_cloud/models/vector_rasterization_options_dto.rb +2 -12
- data/lib/aspose_cad_cloud/models/{color.rb → watermark_rgb.rb} +19 -71
- data/lib/aspose_cad_cloud/version.rb +1 -1
- data/lib/aspose_cad_cloud.rb +3 -2
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f847dd73704de8186efc699a8b28135ce9d078f533b512b15af8316d6ff8e73f
|
4
|
+
data.tar.gz: 7c5539341d0cb1580cdfdf5df4af5475a8cc805072d00b1be617c11016d23e50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1ea4d5b4026392ce4bab2d3363436b8e65e12998b953cb7916d2ed67fca3b1641915e824e02655832fd1780aed77171699b6589deb6fcf074fb44f9484d1c91
|
7
|
+
data.tar.gz: 623a7a9190957c58d01dcad88f20d8b164261e2d6ec364af5e8ffc76887c5011982696e18a271382bf0513396e0d3d5a05fee7d5c76a43ef6722f2ea84411bce
|
@@ -38,7 +38,7 @@ module AsposeCadCloud
|
|
38
38
|
request_token
|
39
39
|
end
|
40
40
|
|
41
|
-
# Convert CAD drawing to DXF, DWG, DGN, DWF, DWFX,
|
41
|
+
# Convert CAD drawing to DXF, DWG, DGN, DRC, DWF, DWFX, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, PDF, SVG format.
|
42
42
|
#
|
43
43
|
# @param request ConvertRequest
|
44
44
|
# @return [File]
|
@@ -48,7 +48,7 @@ module AsposeCadCloud
|
|
48
48
|
data
|
49
49
|
end
|
50
50
|
|
51
|
-
# Convert CAD drawing to DXF, DWG, DGN, DWF, DWFX,
|
51
|
+
# Convert CAD drawing to DXF, DWG, DGN, DRC, DWF, DWFX, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, PDF, SVG format.
|
52
52
|
#
|
53
53
|
# @param request ConvertRequest
|
54
54
|
# @return [Array<(File, Fixnum, Hash)>]
|
@@ -57,6 +57,8 @@ module AsposeCadCloud
|
|
57
57
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? ConvertRequest
|
58
58
|
|
59
59
|
@api_client.config.logger.debug 'Calling API: CadApi.convert ...' if @api_client.config.debugging
|
60
|
+
# verify the required parameter 'drawing_data' is set
|
61
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.convert' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
60
62
|
# verify the required parameter 'output_format' is set
|
61
63
|
raise ArgumentError, 'Missing the required parameter output_format when calling CadApi.convert' if @api_client.config.client_side_validation && request.output_format.nil?
|
62
64
|
# resource path
|
@@ -77,11 +79,11 @@ module AsposeCadCloud
|
|
77
79
|
# HTTP header 'Accept' (if needed)
|
78
80
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
79
81
|
# HTTP header 'Content-Type'
|
80
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
82
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
81
83
|
|
82
84
|
# form parameters
|
83
85
|
form_params = {}
|
84
|
-
form_params[downcase_first_letter('
|
86
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
85
87
|
|
86
88
|
if not form_params.empty?
|
87
89
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -540,6 +542,8 @@ module AsposeCadCloud
|
|
540
542
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? EditMetadataRequest
|
541
543
|
|
542
544
|
@api_client.config.logger.debug 'Calling API: CadApi.edit_metadata ...' if @api_client.config.debugging
|
545
|
+
# verify the required parameter 'drawing_data' is set
|
546
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.edit_metadata' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
543
547
|
# resource path
|
544
548
|
local_var_path = '/cad/EditMetadata'
|
545
549
|
|
@@ -551,11 +555,11 @@ module AsposeCadCloud
|
|
551
555
|
# HTTP header 'Accept' (if needed)
|
552
556
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
553
557
|
# HTTP header 'Content-Type'
|
554
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
558
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
555
559
|
|
556
560
|
# form parameters
|
557
561
|
form_params = {}
|
558
|
-
form_params[downcase_first_letter('
|
562
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
559
563
|
|
560
564
|
if not form_params.empty?
|
561
565
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -597,6 +601,8 @@ module AsposeCadCloud
|
|
597
601
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? ExtractMetadataRequest
|
598
602
|
|
599
603
|
@api_client.config.logger.debug 'Calling API: CadApi.extract_metadata ...' if @api_client.config.debugging
|
604
|
+
# verify the required parameter 'drawing_data' is set
|
605
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.extract_metadata' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
600
606
|
# verify the required parameter 'output_format' is set
|
601
607
|
raise ArgumentError, 'Missing the required parameter output_format when calling CadApi.extract_metadata' if @api_client.config.client_side_validation && request.output_format.nil?
|
602
608
|
# resource path
|
@@ -612,11 +618,11 @@ module AsposeCadCloud
|
|
612
618
|
# HTTP header 'Accept' (if needed)
|
613
619
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
614
620
|
# HTTP header 'Content-Type'
|
615
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
621
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
616
622
|
|
617
623
|
# form parameters
|
618
624
|
form_params = {}
|
619
|
-
form_params[downcase_first_letter('
|
625
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
620
626
|
|
621
627
|
if not form_params.empty?
|
622
628
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -658,6 +664,8 @@ module AsposeCadCloud
|
|
658
664
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? ExtractTextRequest
|
659
665
|
|
660
666
|
@api_client.config.logger.debug 'Calling API: CadApi.extract_text ...' if @api_client.config.debugging
|
667
|
+
# verify the required parameter 'drawing_data' is set
|
668
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.extract_text' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
661
669
|
# resource path
|
662
670
|
local_var_path = '/cad/ExtractText'
|
663
671
|
|
@@ -669,11 +677,11 @@ module AsposeCadCloud
|
|
669
677
|
# HTTP header 'Accept' (if needed)
|
670
678
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
671
679
|
# HTTP header 'Content-Type'
|
672
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
680
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
673
681
|
|
674
682
|
# form parameters
|
675
683
|
form_params = {}
|
676
|
-
form_params[downcase_first_letter('
|
684
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
677
685
|
|
678
686
|
if not form_params.empty?
|
679
687
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -1438,6 +1446,8 @@ module AsposeCadCloud
|
|
1438
1446
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? PaperToCadRequest
|
1439
1447
|
|
1440
1448
|
@api_client.config.logger.debug 'Calling API: CadApi.paper_to_cad ...' if @api_client.config.debugging
|
1449
|
+
# verify the required parameter 'drawing_data' is set
|
1450
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.paper_to_cad' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
1441
1451
|
# verify the required parameter 'output_format' is set
|
1442
1452
|
raise ArgumentError, 'Missing the required parameter output_format when calling CadApi.paper_to_cad' if @api_client.config.client_side_validation && request.output_format.nil?
|
1443
1453
|
# resource path
|
@@ -1453,11 +1463,11 @@ module AsposeCadCloud
|
|
1453
1463
|
# HTTP header 'Accept' (if needed)
|
1454
1464
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1455
1465
|
# HTTP header 'Content-Type'
|
1456
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
1466
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
1457
1467
|
|
1458
1468
|
# form parameters
|
1459
1469
|
form_params = {}
|
1460
|
-
form_params[downcase_first_letter('
|
1470
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
1461
1471
|
|
1462
1472
|
if not form_params.empty?
|
1463
1473
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -5148,6 +5158,10 @@ module AsposeCadCloud
|
|
5148
5158
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? PutEditMetadataRequest
|
5149
5159
|
|
5150
5160
|
@api_client.config.logger.debug 'Calling API: CadApi.put_edit_metadata ...' if @api_client.config.debugging
|
5161
|
+
# verify the required parameter 'drawing_data' is set
|
5162
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.put_edit_metadata' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
5163
|
+
# verify the required parameter 'metadata_component' is set
|
5164
|
+
raise ArgumentError, 'Missing the required parameter metadata_component when calling CadApi.put_edit_metadata' if @api_client.config.client_side_validation && request.metadata_component.nil?
|
5151
5165
|
# resource path
|
5152
5166
|
local_var_path = '/cad/EditMetadata'
|
5153
5167
|
|
@@ -5159,12 +5173,12 @@ module AsposeCadCloud
|
|
5159
5173
|
# HTTP header 'Accept' (if needed)
|
5160
5174
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
5161
5175
|
# HTTP header 'Content-Type'
|
5162
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
5176
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
5163
5177
|
|
5164
5178
|
# form parameters
|
5165
5179
|
form_params = {}
|
5166
|
-
form_params[downcase_first_letter('
|
5167
|
-
form_params[downcase_first_letter('metadataComponent')] = request.metadata_component
|
5180
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
5181
|
+
form_params[downcase_first_letter('metadataComponent')] = request.metadata_component
|
5168
5182
|
|
5169
5183
|
if not form_params.empty?
|
5170
5184
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -5393,8 +5407,12 @@ module AsposeCadCloud
|
|
5393
5407
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? WatermarkRequest
|
5394
5408
|
|
5395
5409
|
@api_client.config.logger.debug 'Calling API: CadApi.watermark ...' if @api_client.config.debugging
|
5410
|
+
# verify the required parameter 'drawing_data' is set
|
5411
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.watermark' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
5396
5412
|
# verify the required parameter 'output_format' is set
|
5397
5413
|
raise ArgumentError, 'Missing the required parameter output_format when calling CadApi.watermark' if @api_client.config.client_side_validation && request.output_format.nil?
|
5414
|
+
# verify the required parameter 'watermark' is set
|
5415
|
+
raise ArgumentError, 'Missing the required parameter watermark when calling CadApi.watermark' if @api_client.config.client_side_validation && request.watermark.nil?
|
5398
5416
|
# resource path
|
5399
5417
|
local_var_path = '/cad/Watermark'
|
5400
5418
|
|
@@ -5413,12 +5431,12 @@ module AsposeCadCloud
|
|
5413
5431
|
# HTTP header 'Accept' (if needed)
|
5414
5432
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
5415
5433
|
# HTTP header 'Content-Type'
|
5416
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
5434
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream', 'multipart/form-data'])
|
5417
5435
|
|
5418
5436
|
# form parameters
|
5419
5437
|
form_params = {}
|
5420
|
-
form_params[downcase_first_letter('
|
5421
|
-
form_params[downcase_first_letter('
|
5438
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
5439
|
+
form_params[downcase_first_letter('watermark')] = request.watermark
|
5422
5440
|
|
5423
5441
|
if not form_params.empty?
|
5424
5442
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -5458,7 +5476,7 @@ module AsposeCadCloud
|
|
5458
5476
|
config.api_version = ''
|
5459
5477
|
request_url = "/connect/token"
|
5460
5478
|
post_data = "grant_type=client_credentials" + "&client_id=" + config.api_key['app_sid'] + "&client_secret=" + config.api_key['api_key']
|
5461
|
-
data, status_code, header = @api_client.
|
5479
|
+
data, status_code, header = @api_client.call_token_api(:POST, request_url, :body => post_data, :header_params => { "Content-Type": "application/x-www-form-urlencoded" }, :return_type => 'Object')
|
5462
5480
|
@api_client.config.access_token = data[:access_token]
|
5463
5481
|
@api_client.config.api_version = api_version
|
5464
5482
|
end
|
@@ -90,6 +90,35 @@ module AsposeCadCloud
|
|
90
90
|
[data, response.status, response.headers]
|
91
91
|
end
|
92
92
|
|
93
|
+
# Call an API token.
|
94
|
+
#
|
95
|
+
# @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
|
96
|
+
# the data deserialized from response body (could be nil), response status code and response headers.
|
97
|
+
def call_token_api(http_method, path, opts = {})
|
98
|
+
response = build_access_token_request(http_method, path, opts)
|
99
|
+
download_file response if opts[:return_type] == 'File'
|
100
|
+
if @config.debugging
|
101
|
+
@config.logger.debug "'HTTP' response body '~BEGIN~'\n #{response.body}\n'~END~'\n"
|
102
|
+
end
|
103
|
+
|
104
|
+
unless response.success?
|
105
|
+
if response.status == 0
|
106
|
+
# Errors from libcurl will be made visible here
|
107
|
+
raise ApiError.new(:code => 0,
|
108
|
+
:message => response.reason_phrase)
|
109
|
+
else
|
110
|
+
raise ApiError.new(:code => response.status,
|
111
|
+
:response_headers => response.headers,
|
112
|
+
:response_body => response.body),
|
113
|
+
response.reason_phrase
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
data = deserialize(response, opts[:return_type]) if opts[:return_type]
|
119
|
+
[data, response.status, response.headers]
|
120
|
+
end
|
121
|
+
|
93
122
|
# Builds the HTTP request
|
94
123
|
#
|
95
124
|
# @param [String] http_method HTTP method/verb (e.g. POST)
|
@@ -145,6 +174,58 @@ module AsposeCadCloud
|
|
145
174
|
end
|
146
175
|
end
|
147
176
|
|
177
|
+
|
178
|
+
# Builds the HTTP request for access token
|
179
|
+
#
|
180
|
+
# @param [String] http_method HTTP method/verb (e.g. POST)
|
181
|
+
# @param [String] path URL path (e.g. /account/new)
|
182
|
+
# @option opts [Hash] :header_params Header parameters
|
183
|
+
# @option opts [Hash] :query_params Query parameters
|
184
|
+
# @option opts [Hash] :form_params Query parameters
|
185
|
+
# @option opts [Object] :body HTTP body (JSON/XML)
|
186
|
+
# @return [Faraday::Response] A Faraday Response
|
187
|
+
def build_access_token_request(http_method, path, opts = {})
|
188
|
+
url = build_request_token_url(path)
|
189
|
+
http_method = http_method.to_sym.downcase
|
190
|
+
|
191
|
+
header_params = @default_headers.merge(opts[:header_params] || {})
|
192
|
+
query_params = opts[:query_params] || {}
|
193
|
+
form_params = opts[:form_params] || {}
|
194
|
+
body = opts[:body] if opts[:body] || nil?
|
195
|
+
|
196
|
+
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
197
|
+
|
198
|
+
req_opts = {
|
199
|
+
:method => http_method,
|
200
|
+
:headers => header_params,
|
201
|
+
:params => query_params,
|
202
|
+
:body => body
|
203
|
+
}
|
204
|
+
|
205
|
+
if [:post].include?(http_method)
|
206
|
+
req_body = build_request_body(header_params, form_params, opts[:body])
|
207
|
+
req_opts.update :body => req_body
|
208
|
+
if @config.debugging
|
209
|
+
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
conn = Faraday.new url, { :params => query_params, :headers => header_params } do |f|
|
214
|
+
f.request :multipart
|
215
|
+
f.request :url_encoded
|
216
|
+
f.adapter Faraday.default_adapter
|
217
|
+
end
|
218
|
+
|
219
|
+
case http_method
|
220
|
+
when :post
|
221
|
+
return conn.post url, req_opts[:body]
|
222
|
+
else
|
223
|
+
return conn.delete url do |c|
|
224
|
+
c.body = req_opts[:body]
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
148
229
|
# Check if the given MIME is a JSON MIME.
|
149
230
|
# JSON MIME examples:
|
150
231
|
# application/json
|
@@ -252,7 +333,7 @@ module AsposeCadCloud
|
|
252
333
|
end
|
253
334
|
prefix += '-' unless prefix.end_with?('-')
|
254
335
|
encoding = response.body.encoding
|
255
|
-
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
336
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, binmode: true, encoding: encoding)
|
256
337
|
@tempfile = tempfile
|
257
338
|
tempfile.write(response.body)
|
258
339
|
response.on_complete do |resp|
|
@@ -280,6 +361,21 @@ module AsposeCadCloud
|
|
280
361
|
return req
|
281
362
|
end
|
282
363
|
|
364
|
+
def build_request_token_url(path)
|
365
|
+
# Add leading and trailing slashes to path
|
366
|
+
path = "/#{path}".gsub(/\/+/, '/')
|
367
|
+
req = URI::Parser.new.escape auth_token(@config.base_url) + path
|
368
|
+
return req
|
369
|
+
end
|
370
|
+
|
371
|
+
def auth_token(path)
|
372
|
+
pattern = /api(-qa)?/
|
373
|
+
replacement = 'id\1'
|
374
|
+
|
375
|
+
return path.gsub(pattern, replacement)
|
376
|
+
end
|
377
|
+
|
378
|
+
|
283
379
|
# Builds the HTTP request body
|
284
380
|
#
|
285
381
|
# @param [Hash] header_params Header parameters
|
@@ -129,8 +129,8 @@ module AsposeCadCloud
|
|
129
129
|
:'border_y' => :'Float',
|
130
130
|
:'page_height' => :'Float',
|
131
131
|
:'page_width' => :'Float',
|
132
|
-
:'background_color' => :'
|
133
|
-
:'draw_color' => :'
|
132
|
+
:'background_color' => :'ColorDTO',
|
133
|
+
:'draw_color' => :'ColorDTO',
|
134
134
|
:'unit_type' => :'String',
|
135
135
|
:'content_as_bitmap' => :'BOOLEAN',
|
136
136
|
:'graphics_options' => :'GraphicsOptions',
|
@@ -242,14 +242,6 @@ module AsposeCadCloud
|
|
242
242
|
invalid_properties.push("invalid value for 'page_width', page_width cannot be nil.")
|
243
243
|
end
|
244
244
|
|
245
|
-
if @background_color.nil?
|
246
|
-
invalid_properties.push("invalid value for 'background_color', background_color cannot be nil.")
|
247
|
-
end
|
248
|
-
|
249
|
-
if @draw_color.nil?
|
250
|
-
invalid_properties.push("invalid value for 'draw_color', draw_color cannot be nil.")
|
251
|
-
end
|
252
|
-
|
253
245
|
if @unit_type.nil?
|
254
246
|
invalid_properties.push("invalid value for 'unit_type', unit_type cannot be nil.")
|
255
247
|
end
|
@@ -284,8 +276,6 @@ module AsposeCadCloud
|
|
284
276
|
return false if @border_y.nil?
|
285
277
|
return false if @page_height.nil?
|
286
278
|
return false if @page_width.nil?
|
287
|
-
return false if @background_color.nil?
|
288
|
-
return false if @draw_color.nil?
|
289
279
|
return false if @unit_type.nil?
|
290
280
|
unit_type_validator = EnumAttributeValidator.new('String', ["Kilometer", "Meter", "Centimenter", "Millimeter", "Micrometer", "Nanometer", "Angstrom", "Decimeter", "Decameter", "Hectometer", "Gigameter", "AstronomicalUnit", "LightYear", "Parsec", "Mile", "Yard", "Foot", "Inch", "Mil", "MicroInch", "Custom", "Unitless"])
|
291
281
|
return false unless unit_type_validator.valid?(@unit_type)
|
@@ -0,0 +1,242 @@
|
|
1
|
+
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
module AsposeCadCloud
|
5
|
+
#
|
6
|
+
# --------------------------------------------------------------------------------------------------------------------
|
7
|
+
# <copyright company="Aspose" file="ColorDTO.rb">
|
8
|
+
# Copyright (c) 2017 Aspose.CAD Cloud
|
9
|
+
# </copyright>
|
10
|
+
# <summary>
|
11
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
|
+
# of this software and associated documentation files (the "Software"), to deal
|
13
|
+
# in the Software without restriction, including without limitation the rights
|
14
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
# copies of the Software, and to permit persons to whom the Software is
|
16
|
+
# furnished to do so, subject to the following conditions:
|
17
|
+
#
|
18
|
+
# The above copyright notice and this permission notice shall be included in all
|
19
|
+
# copies or substantial portions of the Software.
|
20
|
+
#
|
21
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
# SOFTWARE.
|
28
|
+
# </summary>
|
29
|
+
# --------------------------------------------------------------------------------------------------------------------
|
30
|
+
#
|
31
|
+
|
32
|
+
# RGB color values
|
33
|
+
class ColorDTO
|
34
|
+
# Red light(0-255).
|
35
|
+
attr_accessor :r
|
36
|
+
|
37
|
+
# Green light(0-255).
|
38
|
+
attr_accessor :g
|
39
|
+
|
40
|
+
# Blue light(0-255).
|
41
|
+
attr_accessor :b
|
42
|
+
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'r' => :'R',
|
48
|
+
:'g' => :'G',
|
49
|
+
:'b' => :'B'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.swagger_types
|
55
|
+
{
|
56
|
+
:'r' => :'Integer',
|
57
|
+
:'g' => :'Integer',
|
58
|
+
:'b' => :'Integer'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
return unless attributes.is_a?(Hash)
|
66
|
+
|
67
|
+
# convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
69
|
+
|
70
|
+
if attributes.key?(:'R')
|
71
|
+
self.r = attributes[:'R']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'G')
|
75
|
+
self.g = attributes[:'G']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'B')
|
79
|
+
self.b = attributes[:'B']
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properies with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
invalid_properties = []
|
88
|
+
if @r.nil?
|
89
|
+
invalid_properties.push("invalid value for 'r', r cannot be nil.")
|
90
|
+
end
|
91
|
+
|
92
|
+
if @g.nil?
|
93
|
+
invalid_properties.push("invalid value for 'g', g cannot be nil.")
|
94
|
+
end
|
95
|
+
|
96
|
+
if @b.nil?
|
97
|
+
invalid_properties.push("invalid value for 'b', b cannot be nil.")
|
98
|
+
end
|
99
|
+
|
100
|
+
return invalid_properties
|
101
|
+
end
|
102
|
+
|
103
|
+
# Check to see if the all the properties in the model are valid
|
104
|
+
# @return true if the model is valid
|
105
|
+
def valid?
|
106
|
+
return false if @r.nil?
|
107
|
+
return false if @g.nil?
|
108
|
+
return false if @b.nil?
|
109
|
+
return true
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def ==(other)
|
115
|
+
return true if self.equal?(other)
|
116
|
+
self.class == other.class &&
|
117
|
+
r == other.r &&
|
118
|
+
g == other.g &&
|
119
|
+
b == other.b
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(other)
|
125
|
+
self == other
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Fixnum] Hash code
|
130
|
+
def hash
|
131
|
+
[r, g, b].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
self.class.swagger_types.each_pair do |key, type|
|
140
|
+
if type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end
|
149
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def _deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :DateTime
|
162
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
163
|
+
when :Date
|
164
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :BOOLEAN
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else
|
192
|
+
# model
|
193
|
+
temp_model = AsposeCadCloud.const_get(type).new
|
194
|
+
temp_model.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
next if value.nil?
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Outputs non-array value in the form of hash
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
224
|
+
# @param [Object] value Any valid value
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
226
|
+
def _to_hash(value)
|
227
|
+
if value.is_a?(Array)
|
228
|
+
value.compact.map { |v| _to_hash(v) }
|
229
|
+
elsif value.is_a?(Hash)
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
232
|
+
end
|
233
|
+
elsif value.respond_to? :to_hash
|
234
|
+
value.to_hash
|
235
|
+
else
|
236
|
+
value
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
242
|
+
end
|
@@ -4,7 +4,7 @@ require 'date'
|
|
4
4
|
module AsposeCadCloud
|
5
5
|
#
|
6
6
|
# --------------------------------------------------------------------------------------------------------------------
|
7
|
-
# <copyright company="Aspose" file="
|
7
|
+
# <copyright company="Aspose" file="Error.rb">
|
8
8
|
# Copyright (c) 2017 Aspose.CAD Cloud
|
9
9
|
# </copyright>
|
10
10
|
# <summary>
|
@@ -30,7 +30,7 @@ module AsposeCadCloud
|
|
30
30
|
#
|
31
31
|
|
32
32
|
# Error
|
33
|
-
class
|
33
|
+
class Error
|
34
34
|
# Code
|
35
35
|
attr_accessor :code
|
36
36
|
|
@@ -32,21 +32,21 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class ConvertRequest
|
34
34
|
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
35
37
|
# Output DXF, DWG, DGN, DWF, DWFX, DRC, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, PDF, SVG, PNG, BMP, DIB, TIFF, TIF, JPEG, GIF, PSD, JPG, JPE, JIF, JFIF, PSD, WEBP, DCM, DICOM, JP2, J2K, JPF, JPM, JPG2, J2C, JPC, JPX, MJ2 , DJVU file format.
|
36
38
|
attr_accessor :output_format
|
37
|
-
# Form-data file
|
38
|
-
attr_accessor :drawing
|
39
39
|
# For output pdf format: PDF_15, PDFa_1a OR PDFa_1b. Null for another format
|
40
40
|
attr_accessor :output_type_ext
|
41
41
|
|
42
42
|
#
|
43
43
|
# Initializes a new instance.
|
44
|
+
# @param drawing_data Input drawing
|
44
45
|
# @param output_format Output DXF, DWG, DGN, DWF, DWFX, DRC, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, PDF, SVG, PNG, BMP, DIB, TIFF, TIF, JPEG, GIF, PSD, JPG, JPE, JIF, JFIF, PSD, WEBP, DCM, DICOM, JP2, J2K, JPF, JPM, JPG2, J2C, JPC, JPX, MJ2 , DJVU file format.
|
45
|
-
# @param drawing Form-data file
|
46
46
|
# @param output_type_ext For output pdf format: PDF_15, PDFa_1a OR PDFa_1b. Null for another format
|
47
|
-
def initialize(
|
47
|
+
def initialize(drawing_data, output_format, output_type_ext = nil)
|
48
|
+
self.drawing_data = drawing_data
|
48
49
|
self.output_format = output_format
|
49
|
-
self.drawing = drawing
|
50
50
|
self.output_type_ext = output_type_ext
|
51
51
|
end
|
52
52
|
end
|
@@ -32,14 +32,14 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class EditMetadataRequest
|
34
34
|
|
35
|
-
#
|
36
|
-
attr_accessor :
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
37
37
|
|
38
38
|
#
|
39
39
|
# Initializes a new instance.
|
40
|
-
# @param drawing
|
41
|
-
def initialize(
|
42
|
-
self.
|
40
|
+
# @param drawing_data Input drawing
|
41
|
+
def initialize(drawing_data)
|
42
|
+
self.drawing_data = drawing_data
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -32,18 +32,18 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class ExtractMetadataRequest
|
34
34
|
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
35
37
|
# Output TXT, XML or JSON file format.
|
36
38
|
attr_accessor :output_format
|
37
|
-
# Form-data file
|
38
|
-
attr_accessor :drawing
|
39
39
|
|
40
40
|
#
|
41
41
|
# Initializes a new instance.
|
42
|
+
# @param drawing_data Input drawing
|
42
43
|
# @param output_format Output TXT, XML or JSON file format.
|
43
|
-
|
44
|
-
|
44
|
+
def initialize(drawing_data, output_format)
|
45
|
+
self.drawing_data = drawing_data
|
45
46
|
self.output_format = output_format
|
46
|
-
self.drawing = drawing
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -32,14 +32,14 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class ExtractTextRequest
|
34
34
|
|
35
|
-
#
|
36
|
-
attr_accessor :
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
37
37
|
|
38
38
|
#
|
39
39
|
# Initializes a new instance.
|
40
|
-
# @param drawing
|
41
|
-
def initialize(
|
42
|
-
self.
|
40
|
+
# @param drawing_data Input drawing
|
41
|
+
def initialize(drawing_data)
|
42
|
+
self.drawing_data = drawing_data
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -32,18 +32,18 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class PaperToCadRequest
|
34
34
|
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
35
37
|
# Output DXF, DWG, DGN, DWF, DWFX, DRC, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, SVG file format.
|
36
38
|
attr_accessor :output_format
|
37
|
-
# Form-data file
|
38
|
-
attr_accessor :drawing
|
39
39
|
|
40
40
|
#
|
41
41
|
# Initializes a new instance.
|
42
|
+
# @param drawing_data Input drawing
|
42
43
|
# @param output_format Output DXF, DWG, DGN, DWF, DWFX, DRC, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, SVG file format.
|
43
|
-
|
44
|
-
|
44
|
+
def initialize(drawing_data, output_format)
|
45
|
+
self.drawing_data = drawing_data
|
45
46
|
self.output_format = output_format
|
46
|
-
self.drawing = drawing
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -32,17 +32,17 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class PutEditMetadataRequest
|
34
34
|
|
35
|
-
#
|
36
|
-
attr_accessor :
|
37
|
-
#
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
37
|
+
# Metadata string json from POST/EditMetadata
|
38
38
|
attr_accessor :metadata_component
|
39
39
|
|
40
40
|
#
|
41
41
|
# Initializes a new instance.
|
42
|
-
# @param drawing
|
43
|
-
# @param metadata_component
|
44
|
-
def initialize(
|
45
|
-
self.
|
42
|
+
# @param drawing_data Input drawing
|
43
|
+
# @param metadata_component Metadata string json from POST/EditMetadata
|
44
|
+
def initialize(drawing_data, metadata_component)
|
45
|
+
self.drawing_data = drawing_data
|
46
46
|
self.metadata_component = metadata_component
|
47
47
|
end
|
48
48
|
end
|
@@ -32,25 +32,25 @@ module AsposeCadCloud
|
|
32
32
|
#
|
33
33
|
class WatermarkRequest
|
34
34
|
|
35
|
+
# Input drawing
|
36
|
+
attr_accessor :drawing_data
|
35
37
|
# Gets or sets output_format
|
36
38
|
attr_accessor :output_format
|
37
|
-
#
|
38
|
-
attr_accessor :
|
39
|
-
# Gets or sets watermark_rgb
|
40
|
-
attr_accessor :watermark_rgb
|
39
|
+
# JSON-serialized export options passed as zero-indexed multipart/form-data. Follow #/definitions/WatermarkRGB model definition.
|
40
|
+
attr_accessor :watermark
|
41
41
|
# Gets or sets output_type_ext
|
42
42
|
attr_accessor :output_type_ext
|
43
43
|
|
44
44
|
#
|
45
45
|
# Initializes a new instance.
|
46
|
+
# @param drawing_data Input drawing
|
46
47
|
# @param output_format
|
47
|
-
# @param
|
48
|
-
# @param watermark_rgb
|
48
|
+
# @param watermark JSON-serialized export options passed as zero-indexed multipart/form-data. Follow #/definitions/WatermarkRGB model definition.
|
49
49
|
# @param output_type_ext
|
50
|
-
def initialize(
|
50
|
+
def initialize(drawing_data, output_format, watermark, output_type_ext = nil)
|
51
|
+
self.drawing_data = drawing_data
|
51
52
|
self.output_format = output_format
|
52
|
-
self.
|
53
|
-
self.watermark_rgb = watermark_rgb
|
53
|
+
self.watermark = watermark
|
54
54
|
self.output_type_ext = output_type_ext
|
55
55
|
end
|
56
56
|
end
|
@@ -101,8 +101,8 @@ module AsposeCadCloud
|
|
101
101
|
:'border_y' => :'Float',
|
102
102
|
:'page_height' => :'Float',
|
103
103
|
:'page_width' => :'Float',
|
104
|
-
:'background_color' => :'
|
105
|
-
:'draw_color' => :'
|
104
|
+
:'background_color' => :'ColorDTO',
|
105
|
+
:'draw_color' => :'ColorDTO',
|
106
106
|
:'unit_type' => :'String',
|
107
107
|
:'content_as_bitmap' => :'BOOLEAN',
|
108
108
|
:'graphics_options' => :'GraphicsOptions'
|
@@ -175,14 +175,6 @@ module AsposeCadCloud
|
|
175
175
|
invalid_properties.push("invalid value for 'page_width', page_width cannot be nil.")
|
176
176
|
end
|
177
177
|
|
178
|
-
if @background_color.nil?
|
179
|
-
invalid_properties.push("invalid value for 'background_color', background_color cannot be nil.")
|
180
|
-
end
|
181
|
-
|
182
|
-
if @draw_color.nil?
|
183
|
-
invalid_properties.push("invalid value for 'draw_color', draw_color cannot be nil.")
|
184
|
-
end
|
185
|
-
|
186
178
|
if @unit_type.nil?
|
187
179
|
invalid_properties.push("invalid value for 'unit_type', unit_type cannot be nil.")
|
188
180
|
end
|
@@ -201,8 +193,6 @@ module AsposeCadCloud
|
|
201
193
|
return false if @border_y.nil?
|
202
194
|
return false if @page_height.nil?
|
203
195
|
return false if @page_width.nil?
|
204
|
-
return false if @background_color.nil?
|
205
|
-
return false if @draw_color.nil?
|
206
196
|
return false if @unit_type.nil?
|
207
197
|
unit_type_validator = EnumAttributeValidator.new('String', ["Kilometer", "Meter", "Centimenter", "Millimeter", "Micrometer", "Nanometer", "Angstrom", "Decimeter", "Decameter", "Hectometer", "Gigameter", "AstronomicalUnit", "LightYear", "Parsec", "Mile", "Yard", "Foot", "Inch", "Mil", "MicroInch", "Custom", "Unitless"])
|
208
198
|
return false unless unit_type_validator.valid?(@unit_type)
|
@@ -4,7 +4,7 @@ require 'date'
|
|
4
4
|
module AsposeCadCloud
|
5
5
|
#
|
6
6
|
# --------------------------------------------------------------------------------------------------------------------
|
7
|
-
# <copyright company="Aspose" file="
|
7
|
+
# <copyright company="Aspose" file="WatermarkRGB.rb">
|
8
8
|
# Copyright (c) 2017 Aspose.CAD Cloud
|
9
9
|
# </copyright>
|
10
10
|
# <summary>
|
@@ -29,50 +29,38 @@ module AsposeCadCloud
|
|
29
29
|
# --------------------------------------------------------------------------------------------------------------------
|
30
30
|
#
|
31
31
|
|
32
|
+
# Watermark text with RGB values
|
33
|
+
class WatermarkRGB
|
34
|
+
# Watermark text.
|
35
|
+
attr_accessor :text
|
32
36
|
|
33
|
-
|
37
|
+
# Red light(0-255).
|
34
38
|
attr_accessor :r
|
35
39
|
|
40
|
+
# Green light(0-255).
|
36
41
|
attr_accessor :g
|
37
42
|
|
43
|
+
# Blue light(0-255).
|
38
44
|
attr_accessor :b
|
39
45
|
|
40
|
-
attr_accessor :a
|
41
|
-
|
42
|
-
attr_accessor :is_known_color
|
43
|
-
|
44
|
-
attr_accessor :is_empty
|
45
|
-
|
46
|
-
attr_accessor :is_named_color
|
47
|
-
|
48
|
-
attr_accessor :name
|
49
|
-
|
50
46
|
|
51
47
|
# Attribute mapping from ruby-style variable name to JSON key.
|
52
48
|
def self.attribute_map
|
53
49
|
{
|
50
|
+
:'text' => :'Text',
|
54
51
|
:'r' => :'R',
|
55
52
|
:'g' => :'G',
|
56
|
-
:'b' => :'B'
|
57
|
-
:'a' => :'A',
|
58
|
-
:'is_known_color' => :'IsKnownColor',
|
59
|
-
:'is_empty' => :'IsEmpty',
|
60
|
-
:'is_named_color' => :'IsNamedColor',
|
61
|
-
:'name' => :'Name'
|
53
|
+
:'b' => :'B'
|
62
54
|
}
|
63
55
|
end
|
64
56
|
|
65
57
|
# Attribute type mapping.
|
66
58
|
def self.swagger_types
|
67
59
|
{
|
60
|
+
:'text' => :'String',
|
68
61
|
:'r' => :'Integer',
|
69
62
|
:'g' => :'Integer',
|
70
|
-
:'b' => :'Integer'
|
71
|
-
:'a' => :'Integer',
|
72
|
-
:'is_known_color' => :'BOOLEAN',
|
73
|
-
:'is_empty' => :'BOOLEAN',
|
74
|
-
:'is_named_color' => :'BOOLEAN',
|
75
|
-
:'name' => :'String'
|
63
|
+
:'b' => :'Integer'
|
76
64
|
}
|
77
65
|
end
|
78
66
|
|
@@ -84,6 +72,10 @@ module AsposeCadCloud
|
|
84
72
|
# convert string to symbol for hash key
|
85
73
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
86
74
|
|
75
|
+
if attributes.key?(:'Text')
|
76
|
+
self.text = attributes[:'Text']
|
77
|
+
end
|
78
|
+
|
87
79
|
if attributes.key?(:'R')
|
88
80
|
self.r = attributes[:'R']
|
89
81
|
end
|
@@ -96,26 +88,6 @@ module AsposeCadCloud
|
|
96
88
|
self.b = attributes[:'B']
|
97
89
|
end
|
98
90
|
|
99
|
-
if attributes.key?(:'A')
|
100
|
-
self.a = attributes[:'A']
|
101
|
-
end
|
102
|
-
|
103
|
-
if attributes.key?(:'IsKnownColor')
|
104
|
-
self.is_known_color = attributes[:'IsKnownColor']
|
105
|
-
end
|
106
|
-
|
107
|
-
if attributes.key?(:'IsEmpty')
|
108
|
-
self.is_empty = attributes[:'IsEmpty']
|
109
|
-
end
|
110
|
-
|
111
|
-
if attributes.key?(:'IsNamedColor')
|
112
|
-
self.is_named_color = attributes[:'IsNamedColor']
|
113
|
-
end
|
114
|
-
|
115
|
-
if attributes.key?(:'Name')
|
116
|
-
self.name = attributes[:'Name']
|
117
|
-
end
|
118
|
-
|
119
91
|
end
|
120
92
|
|
121
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -134,22 +106,6 @@ module AsposeCadCloud
|
|
134
106
|
invalid_properties.push("invalid value for 'b', b cannot be nil.")
|
135
107
|
end
|
136
108
|
|
137
|
-
if @a.nil?
|
138
|
-
invalid_properties.push("invalid value for 'a', a cannot be nil.")
|
139
|
-
end
|
140
|
-
|
141
|
-
if @is_known_color.nil?
|
142
|
-
invalid_properties.push("invalid value for 'is_known_color', is_known_color cannot be nil.")
|
143
|
-
end
|
144
|
-
|
145
|
-
if @is_empty.nil?
|
146
|
-
invalid_properties.push("invalid value for 'is_empty', is_empty cannot be nil.")
|
147
|
-
end
|
148
|
-
|
149
|
-
if @is_named_color.nil?
|
150
|
-
invalid_properties.push("invalid value for 'is_named_color', is_named_color cannot be nil.")
|
151
|
-
end
|
152
|
-
|
153
109
|
return invalid_properties
|
154
110
|
end
|
155
111
|
|
@@ -159,10 +115,6 @@ module AsposeCadCloud
|
|
159
115
|
return false if @r.nil?
|
160
116
|
return false if @g.nil?
|
161
117
|
return false if @b.nil?
|
162
|
-
return false if @a.nil?
|
163
|
-
return false if @is_known_color.nil?
|
164
|
-
return false if @is_empty.nil?
|
165
|
-
return false if @is_named_color.nil?
|
166
118
|
return true
|
167
119
|
end
|
168
120
|
|
@@ -171,14 +123,10 @@ module AsposeCadCloud
|
|
171
123
|
def ==(other)
|
172
124
|
return true if self.equal?(other)
|
173
125
|
self.class == other.class &&
|
126
|
+
text == other.text &&
|
174
127
|
r == other.r &&
|
175
128
|
g == other.g &&
|
176
|
-
b == other.b
|
177
|
-
a == other.a &&
|
178
|
-
is_known_color == other.is_known_color &&
|
179
|
-
is_empty == other.is_empty &&
|
180
|
-
is_named_color == other.is_named_color &&
|
181
|
-
name == other.name
|
129
|
+
b == other.b
|
182
130
|
end
|
183
131
|
|
184
132
|
# @see the `==` method
|
@@ -190,7 +138,7 @@ module AsposeCadCloud
|
|
190
138
|
# Calculates hash code according to all attributes.
|
191
139
|
# @return [Fixnum] Hash code
|
192
140
|
def hash
|
193
|
-
[r, g, b
|
141
|
+
[text, r, g, b].hash
|
194
142
|
end
|
195
143
|
|
196
144
|
# Builds the object from hash
|
data/lib/aspose_cad_cloud.rb
CHANGED
@@ -34,7 +34,7 @@ require_relative 'aspose_cad_cloud/models/bitmap_compression'
|
|
34
34
|
require_relative 'aspose_cad_cloud/models/cad_draw_type_mode'
|
35
35
|
require_relative 'aspose_cad_cloud/models/cad_response'
|
36
36
|
require_relative 'aspose_cad_cloud/models/cf2_properties'
|
37
|
-
require_relative 'aspose_cad_cloud/models/
|
37
|
+
require_relative 'aspose_cad_cloud/models/color_dto'
|
38
38
|
require_relative 'aspose_cad_cloud/models/color_modes'
|
39
39
|
require_relative 'aspose_cad_cloud/models/compression_method'
|
40
40
|
require_relative 'aspose_cad_cloud/models/dgn_properties'
|
@@ -43,8 +43,8 @@ require_relative 'aspose_cad_cloud/models/drawing_options_base_dto'
|
|
43
43
|
require_relative 'aspose_cad_cloud/models/dwf_properties'
|
44
44
|
require_relative 'aspose_cad_cloud/models/dwg_properties'
|
45
45
|
require_relative 'aspose_cad_cloud/models/dxf_properties'
|
46
|
+
require_relative 'aspose_cad_cloud/models/error'
|
46
47
|
require_relative 'aspose_cad_cloud/models/error_details'
|
47
|
-
require_relative 'aspose_cad_cloud/models/error_model'
|
48
48
|
require_relative 'aspose_cad_cloud/models/fbx_properties'
|
49
49
|
require_relative 'aspose_cad_cloud/models/file_versions'
|
50
50
|
require_relative 'aspose_cad_cloud/models/files_list'
|
@@ -84,6 +84,7 @@ require_relative 'aspose_cad_cloud/models/tiff_expected_format'
|
|
84
84
|
require_relative 'aspose_cad_cloud/models/tiff_photometrics'
|
85
85
|
require_relative 'aspose_cad_cloud/models/unit_type'
|
86
86
|
require_relative 'aspose_cad_cloud/models/vector_rasterization_options_dto'
|
87
|
+
require_relative 'aspose_cad_cloud/models/watermark_rgb'
|
87
88
|
require_relative 'aspose_cad_cloud/models/bmp_options_dto'
|
88
89
|
require_relative 'aspose_cad_cloud/models/cad_rasterization_options_dto'
|
89
90
|
require_relative 'aspose_cad_cloud/models/cgm_options_dto'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_cad_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 24.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aspose
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -95,7 +95,7 @@ files:
|
|
95
95
|
- lib/aspose_cad_cloud/models/cad_response.rb
|
96
96
|
- lib/aspose_cad_cloud/models/cf2_properties.rb
|
97
97
|
- lib/aspose_cad_cloud/models/cgm_options_dto.rb
|
98
|
-
- lib/aspose_cad_cloud/models/
|
98
|
+
- lib/aspose_cad_cloud/models/color_dto.rb
|
99
99
|
- lib/aspose_cad_cloud/models/color_modes.rb
|
100
100
|
- lib/aspose_cad_cloud/models/compression_method.rb
|
101
101
|
- lib/aspose_cad_cloud/models/dgn_properties.rb
|
@@ -108,8 +108,8 @@ files:
|
|
108
108
|
- lib/aspose_cad_cloud/models/dwg_properties.rb
|
109
109
|
- lib/aspose_cad_cloud/models/dxf_options_dto.rb
|
110
110
|
- lib/aspose_cad_cloud/models/dxf_properties.rb
|
111
|
+
- lib/aspose_cad_cloud/models/error.rb
|
111
112
|
- lib/aspose_cad_cloud/models/error_details.rb
|
112
|
-
- lib/aspose_cad_cloud/models/error_model.rb
|
113
113
|
- lib/aspose_cad_cloud/models/fbx_options_dto.rb
|
114
114
|
- lib/aspose_cad_cloud/models/fbx_properties.rb
|
115
115
|
- lib/aspose_cad_cloud/models/file_version.rb
|
@@ -241,6 +241,7 @@ files:
|
|
241
241
|
- lib/aspose_cad_cloud/models/u3d_options_dto.rb
|
242
242
|
- lib/aspose_cad_cloud/models/unit_type.rb
|
243
243
|
- lib/aspose_cad_cloud/models/vector_rasterization_options_dto.rb
|
244
|
+
- lib/aspose_cad_cloud/models/watermark_rgb.rb
|
244
245
|
- lib/aspose_cad_cloud/models/webp_options_dto.rb
|
245
246
|
- lib/aspose_cad_cloud/models/wmf_options_dto.rb
|
246
247
|
- lib/aspose_cad_cloud/version.rb
|
@@ -248,7 +249,7 @@ homepage: https://github.com/aspose-cad-cloud/aspose-cad-cloud-ruby
|
|
248
249
|
licenses:
|
249
250
|
- MIT
|
250
251
|
metadata: {}
|
251
|
-
post_install_message:
|
252
|
+
post_install_message:
|
252
253
|
rdoc_options: []
|
253
254
|
require_paths:
|
254
255
|
- lib
|
@@ -263,8 +264,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
264
|
- !ruby/object:Gem::Version
|
264
265
|
version: '0'
|
265
266
|
requirements: []
|
266
|
-
rubygems_version: 3.5
|
267
|
-
signing_key:
|
267
|
+
rubygems_version: 3.2.5
|
268
|
+
signing_key:
|
268
269
|
specification_version: 4
|
269
270
|
summary: SDK for operating with Aspose.CAD Cloud API to manipulate with CAD and BIM
|
270
271
|
drawings
|