Class: GroupDocsAnnotationCloud::AnnotateApi
- Inherits:
-
Object
- Object
- GroupDocsAnnotationCloud::AnnotateApi
- Defined in:
- lib/groupdocs_annotation_cloud/api/annotate_api.rb
Overview
GroupDocs.Annotation Cloud API
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
-
.from_config(config) ⇒ AnnotateApi
Initializes new instance of AnnotateApi.
-
.from_keys(app_sid, app_key) ⇒ AnnotateApi
Initializes new instance of AnnotateApi.
Instance Method Summary collapse
-
#annotate(request) ⇒ AnnotationApiLink
Adds annotations to document and saves output file into cloud storage.
-
#annotate_direct(request) ⇒ File
Adds annotations to document and returns output file.
-
#annotate_direct_with_http_info(request) ⇒ Array<(File, Fixnum, Hash)>
Adds annotations to document and returns output file.
-
#annotate_with_http_info(request) ⇒ Array<(AnnotationApiLink, Fixnum, Hash)>
Adds annotations to document and saves output file into cloud storage.
-
#extract(request) ⇒ Array<AnnotationInfo>
Extracts annotations from document.
-
#extract_with_http_info(request) ⇒ Array<(Array<AnnotationInfo>, Fixnum, Hash)>
Extracts annotations from document.
-
#initialize(config) ⇒ AnnotateApi
constructor
Initializes new instance of AnnotateApi.
-
#remove_annotations(request) ⇒ AnnotationApiLink
Removes annotations from document.
-
#remove_annotations_with_http_info(request) ⇒ Array<(AnnotationApiLink, Fixnum, Hash)>
Removes annotations from document.
Constructor Details
#initialize(config) ⇒ AnnotateApi
Initializes new instance of AnnotateApi
43 44 45 46 47 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 43 def initialize(config) @config = config @api_client = ApiClient.new(config) @access_token = nil end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
34 35 36 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 34 def config @config end |
Class Method Details
.from_config(config) ⇒ AnnotateApi
Initializes new instance of AnnotateApi
63 64 65 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 63 def self.from_config(config) return new(config) end |
.from_keys(app_sid, app_key) ⇒ AnnotateApi
Initializes new instance of AnnotateApi
54 55 56 57 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 54 def self.from_keys(app_sid, app_key) config = Configuration.new(app_sid, app_key) return new(config) end |
Instance Method Details
#annotate(request) ⇒ AnnotationApiLink
Adds annotations to document and saves output file into cloud storage
71 72 73 74 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 71 def annotate(request) data, _status_code, _headers = annotate_with_http_info(request) data end |
#annotate_direct(request) ⇒ File
Adds annotations to document and returns output file
123 124 125 126 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 123 def annotate_direct(request) data, _status_code, _headers = annotate_direct_with_http_info(request) data end |
#annotate_direct_with_http_info(request) ⇒ Array<(File, Fixnum, Hash)>
Adds annotations to document and returns output file
File data, response status code and response headers
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 133 def annotate_direct_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? AnnotateDirectRequest @api_client.config.logger.debug 'Calling API: AnnotateApi.annotate_direct ...' if @api_client.config.debugging # verify the required parameter 'options' is set raise ArgumentError, 'Missing the required parameter options when calling AnnotateApi.annotate_direct' if @api_client.config.client_side_validation && request..nil? # resource path local_var_path = '/annotation/add' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request.) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnnotateApi#annotate_direct\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#annotate_with_http_info(request) ⇒ Array<(AnnotationApiLink, Fixnum, Hash)>
Adds annotations to document and saves output file into cloud storage
AnnotationApiLink data, response status code and response headers
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 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 81 def annotate_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? AnnotateRequest @api_client.config.logger.debug 'Calling API: AnnotateApi.annotate ...' if @api_client.config.debugging # verify the required parameter 'options' is set raise ArgumentError, 'Missing the required parameter options when calling AnnotateApi.annotate' if @api_client.config.client_side_validation && request..nil? # resource path local_var_path = '/annotation/add' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request.) data, status_code, headers = @api_client.call_api(:POST, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'AnnotationApiLink') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnnotateApi#annotate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#extract(request) ⇒ Array<AnnotationInfo>
Extracts annotations from document
175 176 177 178 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 175 def extract(request) data, _status_code, _headers = extract_with_http_info(request) data end |
#extract_with_http_info(request) ⇒ Array<(Array<AnnotationInfo>, Fixnum, Hash)>
Extracts annotations from document
Array<AnnotationInfo> data, response status code and response headers
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 185 def extract_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? ExtractRequest @api_client.config.logger.debug 'Calling API: AnnotateApi.extract ...' if @api_client.config.debugging # verify the required parameter 'file_info' is set raise ArgumentError, 'Missing the required parameter file_info when calling AnnotateApi.extract' if @api_client.config.client_side_validation && request.file_info.nil? # resource path local_var_path = '/annotation/extract' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request.file_info) data, status_code, headers = @api_client.call_api(:POST, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'Array<AnnotationInfo>') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnnotateApi#extract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#remove_annotations(request) ⇒ AnnotationApiLink
Removes annotations from document
227 228 229 230 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 227 def remove_annotations(request) data, _status_code, _headers = remove_annotations_with_http_info(request) data end |
#remove_annotations_with_http_info(request) ⇒ Array<(AnnotationApiLink, Fixnum, Hash)>
Removes annotations from document
AnnotationApiLink data, response status code and response headers
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/groupdocs_annotation_cloud/api/annotate_api.rb', line 237 def remove_annotations_with_http_info(request) raise ArgumentError, 'Incorrect request type' unless request.is_a? RemoveAnnotationsRequest @api_client.config.logger.debug 'Calling API: AnnotateApi.remove_annotations ...' if @api_client.config.debugging # verify the required parameter 'options' is set raise ArgumentError, 'Missing the required parameter options when calling AnnotateApi.remove_annotations' if @api_client.config.client_side_validation && request..nil? # resource path local_var_path = '/annotation/remove' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request.) data, status_code, headers = @api_client.call_api(:POST, local_var_path, header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, access_token: get_access_token, return_type: 'AnnotationApiLink') if @api_client.config.debugging @api_client.config.logger.debug "API called: AnnotateApi#remove_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |