aspose_cad_cloud 24.1 → 24.5.1
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 +189 -25
- 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/draco_options_dto.rb +281 -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 +7 -7
- 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 +7 -7
- data/lib/aspose_cad_cloud/models/requests/PostDrawingDracoRequest.rb +61 -0
- data/lib/aspose_cad_cloud/models/requests/PutDrawingDracoRequest.rb +57 -0
- 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 +4 -2
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecdab5a0cd30fddd4835cd12781e1665820ab9daa25bb0e26768d389b06e220a
|
4
|
+
data.tar.gz: 0a60969f42b4881136c27de0ee56daa5c167d33da69acc30ff5fb4e62371c116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85fc1ad6d3418c6757c6695acaaeed788a21f7df29d0105d5659101ed8dd5bd5193669ae23d81ffff3caede469e1d725706c420108c44dce571cfe7509b3dbc2
|
7
|
+
data.tar.gz: 202e74016f9a42db2f121cf02fbaab45d0615e399046aee020d252216672a202e0758c8db8595f24c256e0532173be5b2ef1b6080d98999574457bd11bc91353
|
@@ -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, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, PDF, SVG format.
|
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, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, PDF, SVG format.
|
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'
|
@@ -524,7 +526,7 @@ module AsposeCadCloud
|
|
524
526
|
# Get Metadata info
|
525
527
|
#
|
526
528
|
# @param request EditMetadataRequest
|
527
|
-
# @return [
|
529
|
+
# @return [File]
|
528
530
|
def edit_metadata(request)
|
529
531
|
data, _status_code, _headers = edit_metadata_with_http_info(request)
|
530
532
|
request_token if _status_code == 401
|
@@ -534,12 +536,14 @@ module AsposeCadCloud
|
|
534
536
|
# Get Metadata info
|
535
537
|
#
|
536
538
|
# @param request EditMetadataRequest
|
537
|
-
# @return [Array<(
|
538
|
-
#
|
539
|
+
# @return [Array<(File, Fixnum, Hash)>]
|
540
|
+
# File data, response status code and response headers
|
539
541
|
def edit_metadata_with_http_info(request)
|
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'
|
@@ -570,7 +574,7 @@ module AsposeCadCloud
|
|
570
574
|
form_params: form_params,
|
571
575
|
body: post_body,
|
572
576
|
auth_names: auth_names,
|
573
|
-
return_type: '
|
577
|
+
return_type: 'File')
|
574
578
|
if @api_client.config.debugging
|
575
579
|
@api_client.config.logger.debug "API called:
|
576
580
|
CadApi#edit_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
@@ -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'
|
@@ -1419,7 +1427,7 @@ module AsposeCadCloud
|
|
1419
1427
|
[data, status_code, headers]
|
1420
1428
|
end
|
1421
1429
|
|
1422
|
-
# Convert bitmap image to DXF, DWG, DGN, DWF, DWFX, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, SVG format.
|
1430
|
+
# Convert bitmap image to DXF, DWG, DGN, DWF, DWFX, DRC, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, SVG format.
|
1423
1431
|
#
|
1424
1432
|
# @param request PaperToCadRequest
|
1425
1433
|
# @return [File]
|
@@ -1429,7 +1437,7 @@ module AsposeCadCloud
|
|
1429
1437
|
data
|
1430
1438
|
end
|
1431
1439
|
|
1432
|
-
# Convert bitmap image to DXF, DWG, DGN, DWF, DWFX, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, SVG format.
|
1440
|
+
# Convert bitmap image to DXF, DWG, DGN, DWF, DWFX, DRC, IFC, STL, STP, STEP, CGM, GLB, GLTF, DWT, IGES, PLT, CF2, OBJ, HPGL, IGS, PCL, FBX, SVG format.
|
1433
1441
|
#
|
1434
1442
|
# @param request PaperToCadRequest
|
1435
1443
|
# @return [Array<(File, Fixnum, Hash)>]
|
@@ -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'
|
@@ -1708,6 +1718,82 @@ module AsposeCadCloud
|
|
1708
1718
|
[data, status_code, headers]
|
1709
1719
|
end
|
1710
1720
|
|
1721
|
+
# Export an existing drawing to Draco format with export settings specified.
|
1722
|
+
#
|
1723
|
+
# @param request PostDrawingDracoRequest
|
1724
|
+
# @return [File]
|
1725
|
+
def post_drawing_draco(request)
|
1726
|
+
data, _status_code, _headers = post_drawing_draco_with_http_info(request)
|
1727
|
+
request_token if _status_code == 401
|
1728
|
+
data
|
1729
|
+
end
|
1730
|
+
|
1731
|
+
# Export an existing drawing to Draco format with export settings specified.
|
1732
|
+
#
|
1733
|
+
# @param request PostDrawingDracoRequest
|
1734
|
+
# @return [Array<(File, Fixnum, Hash)>]
|
1735
|
+
# File data, response status code and response headers
|
1736
|
+
def post_drawing_draco_with_http_info(request)
|
1737
|
+
raise ArgumentError, 'Incorrect request type' unless request.is_a? PostDrawingDracoRequest
|
1738
|
+
|
1739
|
+
@api_client.config.logger.debug 'Calling API: CadApi.post_drawing_draco ...' if @api_client.config.debugging
|
1740
|
+
# verify the required parameter 'name' is set
|
1741
|
+
raise ArgumentError, 'Missing the required parameter name when calling CadApi.post_drawing_draco' if @api_client.config.client_side_validation && request.name.nil?
|
1742
|
+
# verify the required parameter 'options' is set
|
1743
|
+
raise ArgumentError, 'Missing the required parameter options when calling CadApi.post_drawing_draco' if @api_client.config.client_side_validation && request.options.nil?
|
1744
|
+
# resource path
|
1745
|
+
local_var_path = '/cad/{name}/drc'
|
1746
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('name') + '}', request.name.to_s)
|
1747
|
+
|
1748
|
+
# query parameters
|
1749
|
+
query_params = {}
|
1750
|
+
if local_var_path.include? downcase_first_letter('folder')
|
1751
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('folder') + '}', request.folder.to_s)
|
1752
|
+
else
|
1753
|
+
query_params[downcase_first_letter('folder')] = request.folder unless request.folder.nil?
|
1754
|
+
end
|
1755
|
+
if local_var_path.include? downcase_first_letter('outPath')
|
1756
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('outPath') + '}', request.out_path.to_s)
|
1757
|
+
else
|
1758
|
+
query_params[downcase_first_letter('outPath')] = request.out_path unless request.out_path.nil?
|
1759
|
+
end
|
1760
|
+
if local_var_path.include? downcase_first_letter('storage')
|
1761
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('storage') + '}', request.storage.to_s)
|
1762
|
+
else
|
1763
|
+
query_params[downcase_first_letter('storage')] = request.storage unless request.storage.nil?
|
1764
|
+
end
|
1765
|
+
|
1766
|
+
# header parameters
|
1767
|
+
header_params = {}
|
1768
|
+
# HTTP header 'Accept' (if needed)
|
1769
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1770
|
+
# HTTP header 'Content-Type'
|
1771
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1772
|
+
|
1773
|
+
# form parameters
|
1774
|
+
form_params = {}
|
1775
|
+
|
1776
|
+
if not form_params.empty?
|
1777
|
+
header_params['Content-Type'] = 'multipart/form-data'
|
1778
|
+
end
|
1779
|
+
|
1780
|
+
# http body (model)
|
1781
|
+
post_body = @api_client.object_to_http_body(request.options)
|
1782
|
+
auth_names = ['Bearer']
|
1783
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1784
|
+
header_params: header_params,
|
1785
|
+
query_params: query_params,
|
1786
|
+
form_params: form_params,
|
1787
|
+
body: post_body,
|
1788
|
+
auth_names: auth_names,
|
1789
|
+
return_type: 'File')
|
1790
|
+
if @api_client.config.debugging
|
1791
|
+
@api_client.config.logger.debug "API called:
|
1792
|
+
CadApi#post_drawing_draco\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1793
|
+
end
|
1794
|
+
[data, status_code, headers]
|
1795
|
+
end
|
1796
|
+
|
1711
1797
|
# Export an existing drawing to Dwf format with export settings specified.
|
1712
1798
|
#
|
1713
1799
|
# @param request PostDrawingDwfRequest
|
@@ -3653,6 +3739,76 @@ module AsposeCadCloud
|
|
3653
3739
|
[data, status_code, headers]
|
3654
3740
|
end
|
3655
3741
|
|
3742
|
+
# Export drawing to Draco format. Drawing data is passed as zero-indexed multipart/form-data as well as export Draco options serialized as JSON. Order of drawing data and Draco options could vary.
|
3743
|
+
#
|
3744
|
+
# @param request PutDrawingDracoRequest
|
3745
|
+
# @return [File]
|
3746
|
+
def put_drawing_draco(request)
|
3747
|
+
data, _status_code, _headers = put_drawing_draco_with_http_info(request)
|
3748
|
+
request_token if _status_code == 401
|
3749
|
+
data
|
3750
|
+
end
|
3751
|
+
|
3752
|
+
# Export drawing to Draco format. Drawing data is passed as zero-indexed multipart/form-data as well as export Draco options serialized as JSON. Order of drawing data and Draco options could vary.
|
3753
|
+
#
|
3754
|
+
# @param request PutDrawingDracoRequest
|
3755
|
+
# @return [Array<(File, Fixnum, Hash)>]
|
3756
|
+
# File data, response status code and response headers
|
3757
|
+
def put_drawing_draco_with_http_info(request)
|
3758
|
+
raise ArgumentError, 'Incorrect request type' unless request.is_a? PutDrawingDracoRequest
|
3759
|
+
|
3760
|
+
@api_client.config.logger.debug 'Calling API: CadApi.put_drawing_draco ...' if @api_client.config.debugging
|
3761
|
+
# verify the required parameter 'drawing_data' is set
|
3762
|
+
raise ArgumentError, 'Missing the required parameter drawing_data when calling CadApi.put_drawing_draco' if @api_client.config.client_side_validation && request.drawing_data.nil?
|
3763
|
+
# resource path
|
3764
|
+
local_var_path = '/cad/drc'
|
3765
|
+
|
3766
|
+
# query parameters
|
3767
|
+
query_params = {}
|
3768
|
+
if local_var_path.include? downcase_first_letter('outPath')
|
3769
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('outPath') + '}', request.out_path.to_s)
|
3770
|
+
else
|
3771
|
+
query_params[downcase_first_letter('outPath')] = request.out_path unless request.out_path.nil?
|
3772
|
+
end
|
3773
|
+
if local_var_path.include? downcase_first_letter('storage')
|
3774
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('storage') + '}', request.storage.to_s)
|
3775
|
+
else
|
3776
|
+
query_params[downcase_first_letter('storage')] = request.storage unless request.storage.nil?
|
3777
|
+
end
|
3778
|
+
|
3779
|
+
# header parameters
|
3780
|
+
header_params = {}
|
3781
|
+
# HTTP header 'Accept' (if needed)
|
3782
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
3783
|
+
# HTTP header 'Content-Type'
|
3784
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data', 'application/octet-stream'])
|
3785
|
+
|
3786
|
+
# form parameters
|
3787
|
+
form_params = {}
|
3788
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
3789
|
+
form_params[downcase_first_letter('exportOptions')] = request.export_options unless request.export_options.nil?
|
3790
|
+
|
3791
|
+
if not form_params.empty?
|
3792
|
+
header_params['Content-Type'] = 'multipart/form-data'
|
3793
|
+
end
|
3794
|
+
|
3795
|
+
# http body (model)
|
3796
|
+
post_body = nil
|
3797
|
+
auth_names = ['Bearer']
|
3798
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
3799
|
+
header_params: header_params,
|
3800
|
+
query_params: query_params,
|
3801
|
+
form_params: form_params,
|
3802
|
+
body: post_body,
|
3803
|
+
auth_names: auth_names,
|
3804
|
+
return_type: 'File')
|
3805
|
+
if @api_client.config.debugging
|
3806
|
+
@api_client.config.logger.debug "API called:
|
3807
|
+
CadApi#put_drawing_draco\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
3808
|
+
end
|
3809
|
+
[data, status_code, headers]
|
3810
|
+
end
|
3811
|
+
|
3656
3812
|
# Export drawing to Dwf format. Drawing data is passed as zero-indexed multipart/form-data as well as export Dwf options serialized as JSON. Order of drawing data and Dwf options could vary.
|
3657
3813
|
#
|
3658
3814
|
# @param request PutDrawingDwfRequest
|
@@ -5002,6 +5158,10 @@ module AsposeCadCloud
|
|
5002
5158
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? PutEditMetadataRequest
|
5003
5159
|
|
5004
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?
|
5005
5165
|
# resource path
|
5006
5166
|
local_var_path = '/cad/EditMetadata'
|
5007
5167
|
|
@@ -5013,12 +5173,12 @@ module AsposeCadCloud
|
|
5013
5173
|
# HTTP header 'Accept' (if needed)
|
5014
5174
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
5015
5175
|
# HTTP header 'Content-Type'
|
5016
|
-
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'])
|
5017
5177
|
|
5018
5178
|
# form parameters
|
5019
5179
|
form_params = {}
|
5020
|
-
form_params[downcase_first_letter('
|
5021
|
-
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
|
5022
5182
|
|
5023
5183
|
if not form_params.empty?
|
5024
5184
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -5247,8 +5407,12 @@ module AsposeCadCloud
|
|
5247
5407
|
raise ArgumentError, 'Incorrect request type' unless request.is_a? WatermarkRequest
|
5248
5408
|
|
5249
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?
|
5250
5412
|
# verify the required parameter 'output_format' is set
|
5251
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?
|
5252
5416
|
# resource path
|
5253
5417
|
local_var_path = '/cad/Watermark'
|
5254
5418
|
|
@@ -5267,12 +5431,12 @@ module AsposeCadCloud
|
|
5267
5431
|
# HTTP header 'Accept' (if needed)
|
5268
5432
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
5269
5433
|
# HTTP header 'Content-Type'
|
5270
|
-
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'])
|
5271
5435
|
|
5272
5436
|
# form parameters
|
5273
5437
|
form_params = {}
|
5274
|
-
form_params[downcase_first_letter('
|
5275
|
-
form_params[downcase_first_letter('
|
5438
|
+
form_params[downcase_first_letter('drawingData')] = request.drawing_data
|
5439
|
+
form_params[downcase_first_letter('watermark')] = request.watermark
|
5276
5440
|
|
5277
5441
|
if not form_params.empty?
|
5278
5442
|
header_params['Content-Type'] = 'multipart/form-data'
|
@@ -5312,7 +5476,7 @@ module AsposeCadCloud
|
|
5312
5476
|
config.api_version = ''
|
5313
5477
|
request_url = "/connect/token"
|
5314
5478
|
post_data = "grant_type=client_credentials" + "&client_id=" + config.api_key['app_sid'] + "&client_secret=" + config.api_key['api_key']
|
5315
|
-
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')
|
5316
5480
|
@api_client.config.access_token = data[:access_token]
|
5317
5481
|
@api_client.config.api_version = api_version
|
5318
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)
|