aspose_pdf_cloud 18.7.0 → 18.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/aspose_pdf_cloud.gemspec +53 -49
- data/lib/aspose_pdf_cloud.rb +150 -145
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +12907 -11705
- data/lib/aspose_pdf_cloud/api_client.rb +2 -2
- data/lib/aspose_pdf_cloud/api_error.rb +47 -47
- data/lib/aspose_pdf_cloud/configuration.rb +175 -185
- data/lib/aspose_pdf_cloud/models/annotation.rb +332 -260
- data/lib/aspose_pdf_cloud/models/annotation_flags.rb +52 -0
- data/lib/aspose_pdf_cloud/models/annotation_info.rb +342 -0
- data/lib/aspose_pdf_cloud/models/annotation_state.rb +49 -0
- data/lib/aspose_pdf_cloud/models/annotation_type.rb +69 -0
- data/lib/aspose_pdf_cloud/models/{annotations.rb → annotations_info.rb} +211 -211
- data/lib/aspose_pdf_cloud/models/{annotations_response.rb → annotations_info_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/append_document.rb +233 -228
- data/lib/aspose_pdf_cloud/models/{saa_spose_response.rb → aspose_response.rb} +213 -213
- data/lib/aspose_pdf_cloud/models/attachment.rb +270 -270
- data/lib/aspose_pdf_cloud/models/attachment_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/attachments.rb +211 -211
- data/lib/aspose_pdf_cloud/models/attachments_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/color.rb +244 -244
- data/lib/aspose_pdf_cloud/models/color_depth.rb +45 -45
- data/lib/aspose_pdf_cloud/models/compression_type.rb +46 -46
- data/lib/aspose_pdf_cloud/models/doc_format.rb +43 -43
- data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +43 -43
- data/lib/aspose_pdf_cloud/models/document.rb +220 -220
- data/lib/aspose_pdf_cloud/models/{text_item_response.rb → document_page_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/document_pages_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_privilege.rb +298 -298
- data/lib/aspose_pdf_cloud/models/document_properties.rb +211 -211
- data/lib/aspose_pdf_cloud/models/document_properties_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_property.rb +227 -227
- data/lib/aspose_pdf_cloud/models/document_property_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_response.rb +233 -233
- data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +44 -44
- data/lib/aspose_pdf_cloud/models/field.rb +254 -254
- data/lib/aspose_pdf_cloud/models/field_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/field_type.rb +45 -44
- data/lib/aspose_pdf_cloud/models/fields.rb +211 -211
- data/lib/aspose_pdf_cloud/models/fields_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +43 -43
- data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +45 -45
- data/lib/aspose_pdf_cloud/models/font_styles.rb +45 -43
- data/lib/aspose_pdf_cloud/models/free_text_annotation.rb +382 -0
- data/lib/aspose_pdf_cloud/models/{annotation_response.rb → free_text_annotation_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/{text_items.rb → free_text_annotations.rb} +211 -211
- data/lib/aspose_pdf_cloud/models/{text_items_response.rb → free_text_annotations_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/free_text_intent.rb +44 -0
- data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +45 -44
- data/lib/aspose_pdf_cloud/models/html_document_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +43 -43
- data/lib/aspose_pdf_cloud/models/image.rb +250 -220
- data/lib/aspose_pdf_cloud/models/image_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/image_src_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/image_template.rb +281 -281
- data/lib/aspose_pdf_cloud/models/image_templates_request.rb +230 -230
- data/lib/aspose_pdf_cloud/models/images.rb +211 -211
- data/lib/aspose_pdf_cloud/models/images_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/justification.rb +44 -0
- data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +43 -43
- data/lib/aspose_pdf_cloud/models/line_spacing.rb +43 -43
- data/lib/aspose_pdf_cloud/models/link.rb +228 -228
- data/lib/aspose_pdf_cloud/models/link_action_type.rb +47 -46
- data/lib/aspose_pdf_cloud/models/link_annotation.rb +254 -236
- data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/link_annotations.rb +211 -211
- data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/link_element.rb +200 -200
- data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +46 -45
- data/lib/aspose_pdf_cloud/models/margin_info.rb +244 -244
- data/lib/aspose_pdf_cloud/models/markup_annotation.rb +342 -0
- data/lib/aspose_pdf_cloud/models/merge_documents.rb +205 -200
- data/lib/aspose_pdf_cloud/models/optimize_options.rb +293 -293
- data/lib/aspose_pdf_cloud/models/page.rb +228 -228
- data/lib/aspose_pdf_cloud/models/page_word_count.rb +218 -218
- data/lib/aspose_pdf_cloud/models/pages.rb +211 -211
- data/lib/aspose_pdf_cloud/models/paragraph.rb +303 -303
- data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +44 -44
- data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +44 -44
- data/lib/aspose_pdf_cloud/models/{document_text_replace_response.rb → rectangle_pdf.rb} +244 -231
- data/lib/aspose_pdf_cloud/models/rotation.rb +45 -44
- data/lib/aspose_pdf_cloud/models/segment.rb +211 -206
- data/lib/aspose_pdf_cloud/models/shape_type.rb +44 -44
- data/lib/aspose_pdf_cloud/models/signature.rb +338 -333
- data/lib/aspose_pdf_cloud/models/signature_type.rb +44 -42
- data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/split_result.rb +200 -200
- data/lib/aspose_pdf_cloud/models/split_result_document.rb +238 -238
- data/lib/aspose_pdf_cloud/models/split_result_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/stamp.rb +413 -413
- data/lib/aspose_pdf_cloud/models/stamp_type.rb +45 -44
- data/lib/aspose_pdf_cloud/models/{tiff_export_options.rb → text_annotation.rb} +382 -348
- data/lib/aspose_pdf_cloud/models/text_annotation_response.rb +222 -0
- data/lib/aspose_pdf_cloud/models/{text_item.rb → text_annotations.rb} +211 -218
- data/lib/aspose_pdf_cloud/models/text_annotations_response.rb +222 -0
- data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +47 -47
- data/lib/aspose_pdf_cloud/models/text_icon.rb +52 -0
- data/lib/aspose_pdf_cloud/models/text_line.rb +215 -210
- data/lib/aspose_pdf_cloud/models/text_rect.rb +220 -220
- data/lib/aspose_pdf_cloud/models/text_rects.rb +199 -199
- data/lib/aspose_pdf_cloud/models/text_rects_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_replace.rb +253 -253
- data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +232 -232
- data/lib/aspose_pdf_cloud/models/text_replace_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_state.rb +248 -248
- data/lib/aspose_pdf_cloud/models/{text_format.rb → text_style.rb} +233 -227
- data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +45 -45
- data/lib/aspose_pdf_cloud/models/word_count.rb +199 -199
- data/lib/aspose_pdf_cloud/models/word_count_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/wrap_mode.rb +44 -44
- data/lib/aspose_pdf_cloud/version.rb +24 -24
- data/test/pdf_tests.rb +1496 -1325
- data/test_data/TexExample.tex +304 -304
- metadata +24 -21
- data/.gitignore +0 -46
- data/.swagger-codegen-ignore +0 -58
- data/lib/aspose_pdf_cloud/models/http_status_code.rb +0 -87
- data/lib/aspose_pdf_cloud/models/images_list_request.rb +0 -205
- data/lib/aspose_pdf_cloud/models/page_text_replace_response.rb +0 -231
- data/lib/aspose_pdf_cloud/models/rectangle.rb +0 -244
- data/lib/aspose_pdf_cloud/models/text_format_response.rb +0 -222
- data/lib/aspose_pdf_cloud/models/text_replace_request.rb +0 -262
@@ -419,7 +419,7 @@ module AsposePdfCloud
|
|
419
419
|
|
420
420
|
# resource path
|
421
421
|
local_var_path = "/oauth2/token"
|
422
|
-
url = build_request_url(local_var_path).gsub(
|
422
|
+
url = build_request_url(local_var_path).gsub('/v2.0', '')
|
423
423
|
|
424
424
|
# header parameters
|
425
425
|
header_params = {}
|
@@ -471,7 +471,7 @@ module AsposePdfCloud
|
|
471
471
|
def refresh_token
|
472
472
|
# resource path
|
473
473
|
local_var_path = "/oauth2/token"
|
474
|
-
url = build_request_url(local_var_path).gsub(
|
474
|
+
url = build_request_url(local_var_path).gsub('/v2.0', '')
|
475
475
|
|
476
476
|
# header parameters
|
477
477
|
header_params = {}
|
@@ -1,47 +1,47 @@
|
|
1
|
-
=begin
|
2
|
-
--------------------------------------------------------------------------------------------------------------------
|
3
|
-
Copyright (c) 2018 Aspose.PDF Cloud
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
6
|
-
in the Software without restriction, including without limitation the rights
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
9
|
-
furnished to do so, subject to the following conditions:
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
11
|
-
copies or substantial portions of the Software.
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
-
SOFTWARE.
|
19
|
-
--------------------------------------------------------------------------------------------------------------------
|
20
|
-
=end
|
21
|
-
|
22
|
-
module AsposePdfCloud
|
23
|
-
class ApiError < StandardError
|
24
|
-
attr_reader :code, :response_headers, :response_body
|
25
|
-
|
26
|
-
# Usage examples:
|
27
|
-
# ApiError.new
|
28
|
-
# ApiError.new("message")
|
29
|
-
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
30
|
-
# ApiError.new(:code => 404, :message => "Not Found")
|
31
|
-
def initialize(arg = nil)
|
32
|
-
if arg.is_a? Hash
|
33
|
-
if arg.key?(:message) || arg.key?('message')
|
34
|
-
super(arg[:message] || arg['message'])
|
35
|
-
else
|
36
|
-
super arg
|
37
|
-
end
|
38
|
-
|
39
|
-
arg.each do |k, v|
|
40
|
-
instance_variable_set "@#{k}", v
|
41
|
-
end
|
42
|
-
else
|
43
|
-
super arg
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.PDF Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
module AsposePdfCloud
|
23
|
+
class ApiError < StandardError
|
24
|
+
attr_reader :code, :response_headers, :response_body
|
25
|
+
|
26
|
+
# Usage examples:
|
27
|
+
# ApiError.new
|
28
|
+
# ApiError.new("message")
|
29
|
+
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
30
|
+
# ApiError.new(:code => 404, :message => "Not Found")
|
31
|
+
def initialize(arg = nil)
|
32
|
+
if arg.is_a? Hash
|
33
|
+
if arg.key?(:message) || arg.key?('message')
|
34
|
+
super(arg[:message] || arg['message'])
|
35
|
+
else
|
36
|
+
super arg
|
37
|
+
end
|
38
|
+
|
39
|
+
arg.each do |k, v|
|
40
|
+
instance_variable_set "@#{k}", v
|
41
|
+
end
|
42
|
+
else
|
43
|
+
super arg
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -1,185 +1,175 @@
|
|
1
|
-
=begin
|
2
|
-
--------------------------------------------------------------------------------------------------------------------
|
3
|
-
Copyright (c) 2018 Aspose.PDF Cloud
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
6
|
-
in the Software without restriction, including without limitation the rights
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
9
|
-
furnished to do so, subject to the following conditions:
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
11
|
-
copies or substantial portions of the Software.
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
-
SOFTWARE.
|
19
|
-
--------------------------------------------------------------------------------------------------------------------
|
20
|
-
=end
|
21
|
-
|
22
|
-
require 'uri'
|
23
|
-
|
24
|
-
module AsposePdfCloud
|
25
|
-
class Configuration
|
26
|
-
|
27
|
-
# App Key
|
28
|
-
attr_accessor :app_key
|
29
|
-
|
30
|
-
# App SID
|
31
|
-
attr_accessor :app_sid
|
32
|
-
|
33
|
-
# Defines url scheme
|
34
|
-
attr_accessor :scheme
|
35
|
-
|
36
|
-
# Defines url host
|
37
|
-
attr_accessor :host
|
38
|
-
|
39
|
-
# Defines
|
40
|
-
attr_accessor :
|
41
|
-
|
42
|
-
# Defines the
|
43
|
-
attr_accessor :
|
44
|
-
|
45
|
-
#
|
46
|
-
|
47
|
-
|
48
|
-
#
|
49
|
-
#
|
50
|
-
|
51
|
-
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
#
|
56
|
-
|
57
|
-
|
58
|
-
#
|
59
|
-
|
60
|
-
|
61
|
-
#
|
62
|
-
#
|
63
|
-
|
64
|
-
|
65
|
-
#
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
#
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
#
|
110
|
-
|
111
|
-
|
112
|
-
#
|
113
|
-
#
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
@
|
125
|
-
@
|
126
|
-
@
|
127
|
-
@
|
128
|
-
@
|
129
|
-
@
|
130
|
-
@
|
131
|
-
@
|
132
|
-
@
|
133
|
-
@
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
def
|
144
|
-
|
145
|
-
end
|
146
|
-
|
147
|
-
def
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
{
|
177
|
-
type: 'oauth2',
|
178
|
-
in: 'header',
|
179
|
-
key: 'Authorization',
|
180
|
-
value: "Bearer #{access_token}"
|
181
|
-
},
|
182
|
-
}
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 Aspose.PDF Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'uri'
|
23
|
+
|
24
|
+
module AsposePdfCloud
|
25
|
+
class Configuration
|
26
|
+
|
27
|
+
# App Key
|
28
|
+
attr_accessor :app_key
|
29
|
+
|
30
|
+
# App SID
|
31
|
+
attr_accessor :app_sid
|
32
|
+
|
33
|
+
# Defines url scheme
|
34
|
+
attr_accessor :scheme
|
35
|
+
|
36
|
+
# Defines url host
|
37
|
+
attr_accessor :host
|
38
|
+
|
39
|
+
# Defines the access token (Bearer) used with OAuth2.
|
40
|
+
attr_accessor :access_token
|
41
|
+
|
42
|
+
# Defines the refresh token (Bearer) used with OAuth2.
|
43
|
+
attr_accessor :refresh_token
|
44
|
+
|
45
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
46
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
47
|
+
# Default to false.
|
48
|
+
#
|
49
|
+
# @return [true, false]
|
50
|
+
attr_accessor :debugging
|
51
|
+
|
52
|
+
# Defines the logger used for debugging.
|
53
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
54
|
+
#
|
55
|
+
# @return [#debug]
|
56
|
+
attr_accessor :logger
|
57
|
+
|
58
|
+
# Defines the temporary folder to store downloaded files
|
59
|
+
# (for API endpoints that have file response).
|
60
|
+
# Default to use `Tempfile`.
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
attr_accessor :temp_folder_path
|
64
|
+
|
65
|
+
# The time limit for HTTP request in seconds.
|
66
|
+
# Default to 0 (never times out).
|
67
|
+
attr_accessor :timeout
|
68
|
+
|
69
|
+
# Set this to false to skip client side validation in the operation.
|
70
|
+
# Default to true.
|
71
|
+
# @return [true, false]
|
72
|
+
attr_accessor :client_side_validation
|
73
|
+
|
74
|
+
### TLS/SSL setting
|
75
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
76
|
+
# Default to true.
|
77
|
+
#
|
78
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
79
|
+
#
|
80
|
+
# @return [true, false]
|
81
|
+
attr_accessor :verify_ssl
|
82
|
+
|
83
|
+
### TLS/SSL setting
|
84
|
+
# Set this to false to skip verifying SSL host name
|
85
|
+
# Default to true.
|
86
|
+
#
|
87
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
88
|
+
#
|
89
|
+
# @return [true, false]
|
90
|
+
attr_accessor :verify_ssl_host
|
91
|
+
|
92
|
+
### TLS/SSL setting
|
93
|
+
# Set this to customize the certificate file to verify the peer.
|
94
|
+
#
|
95
|
+
# @return [String] the path to the certificate file
|
96
|
+
#
|
97
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
98
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
99
|
+
attr_accessor :ssl_ca_cert
|
100
|
+
|
101
|
+
### TLS/SSL setting
|
102
|
+
# Client certificate file (for client certificate)
|
103
|
+
attr_accessor :cert_file
|
104
|
+
|
105
|
+
### TLS/SSL setting
|
106
|
+
# Client private key file (for client certificate)
|
107
|
+
attr_accessor :key_file
|
108
|
+
|
109
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
110
|
+
# Default to nil.
|
111
|
+
#
|
112
|
+
# @see The params_encoding option of Ethon. Related source code:
|
113
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
114
|
+
attr_accessor :params_encoding
|
115
|
+
|
116
|
+
attr_accessor :inject_format
|
117
|
+
|
118
|
+
attr_accessor :force_ending_format
|
119
|
+
|
120
|
+
def initialize
|
121
|
+
@scheme = 'https'
|
122
|
+
@host = 'api.aspose.cloud'
|
123
|
+
@timeout = 5 * 60
|
124
|
+
@client_side_validation = true
|
125
|
+
@verify_ssl = true
|
126
|
+
@verify_ssl_host = true
|
127
|
+
@params_encoding = nil
|
128
|
+
@cert_file = nil
|
129
|
+
@key_file = nil
|
130
|
+
@debugging = false
|
131
|
+
@inject_format = false
|
132
|
+
@force_ending_format = false
|
133
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
134
|
+
|
135
|
+
yield(self) if block_given?
|
136
|
+
end
|
137
|
+
|
138
|
+
# The default Configuration object.
|
139
|
+
def self.default
|
140
|
+
@@default ||= Configuration.new
|
141
|
+
end
|
142
|
+
|
143
|
+
def configure
|
144
|
+
yield(self) if block_given?
|
145
|
+
end
|
146
|
+
|
147
|
+
def scheme=(scheme)
|
148
|
+
# remove :// from scheme
|
149
|
+
@scheme = scheme.sub(/:\/\//, '')
|
150
|
+
end
|
151
|
+
|
152
|
+
def host=(host)
|
153
|
+
# remove http(s):// and anything after a slash
|
154
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
155
|
+
end
|
156
|
+
|
157
|
+
def base_url
|
158
|
+
url = "#{scheme}://#{[host, '/v2.0'].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
159
|
+
URI.encode(url)
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns Auth Settings hash for api client.
|
163
|
+
def auth_settings
|
164
|
+
{
|
165
|
+
'oauth' =>
|
166
|
+
{
|
167
|
+
type: 'oauth2',
|
168
|
+
in: 'header',
|
169
|
+
key: 'Authorization',
|
170
|
+
value: "Bearer #{access_token}"
|
171
|
+
},
|
172
|
+
}
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|