Class: Hubspot::Files::Files::FoldersApi
- Inherits:
-
Object
- Object
- Hubspot::Files::Files::FoldersApi
- Defined in:
- lib/hubspot/codegen/files/files/api/folders_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#archive(folder_id, opts = {}) ⇒ nil
Delete folder.
-
#archive_by_path(folder_path, opts = {}) ⇒ nil
Delete folder.
-
#archive_by_path_with_http_info(folder_path, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete folder.
-
#archive_with_http_info(folder_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete folder.
-
#check_update_status(task_id, opts = {}) ⇒ FolderActionResponse
Check folder update status.
-
#check_update_status_with_http_info(task_id, opts = {}) ⇒ Array<(FolderActionResponse, Integer, Hash)>
Check folder update status.
-
#create(folder_input, opts = {}) ⇒ Folder
Create folder.
-
#create_with_http_info(folder_input, opts = {}) ⇒ Array<(Folder, Integer, Hash)>
Create folder.
-
#do_search(opts = {}) ⇒ CollectionResponseFolder
Search folders Search for folders.
-
#do_search_with_http_info(opts = {}) ⇒ Array<(CollectionResponseFolder, Integer, Hash)>
Search folders Search for folders.
-
#get_by_id(folder_id, opts = {}) ⇒ Folder
Get folder Get folder by ID.
-
#get_by_id_with_http_info(folder_id, opts = {}) ⇒ Array<(Folder, Integer, Hash)>
Get folder Get folder by ID.
-
#get_by_path(folder_path, opts = {}) ⇒ Folder
Get folder.
-
#get_by_path_with_http_info(folder_path, opts = {}) ⇒ Array<(Folder, Integer, Hash)>
Get folder.
-
#initialize(api_client = ApiClient.default) ⇒ FoldersApi
constructor
A new instance of FoldersApi.
-
#update_properties(folder_update_input, opts = {}) ⇒ FolderUpdateTaskLocator
Update folder properties Update properties of folder by given ID.
-
#update_properties_with_http_info(folder_update_input, opts = {}) ⇒ Array<(FolderUpdateTaskLocator, Integer, Hash)>
Update folder properties Update properties of folder by given ID.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ FoldersApi
Returns a new instance of FoldersApi.
21 22 23 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 21 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
19 20 21 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 19 def api_client @api_client end |
Instance Method Details
#archive(folder_id, opts = {}) ⇒ nil
Delete folder. Delete folder by ID.
29 30 31 32 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 29 def archive(folder_id, opts = {}) archive_with_http_info(folder_id, opts) nil end |
#archive_by_path(folder_path, opts = {}) ⇒ nil
Delete folder. Delete folder by path.
96 97 98 99 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 96 def archive_by_path(folder_path, opts = {}) archive_by_path_with_http_info(folder_path, opts) nil end |
#archive_by_path_with_http_info(folder_path, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete folder. Delete folder by path.
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 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 106 def archive_by_path_with_http_info(folder_path, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.archive_by_path ...' end # verify the required parameter 'folder_path' is set if @api_client.config.client_side_validation && folder_path.nil? fail ArgumentError, "Missing the required parameter 'folder_path' when calling FoldersApi.archive_by_path" end pattern = Regexp.new(/.+/) if @api_client.config.client_side_validation && folder_path !~ pattern fail ArgumentError, "invalid value for 'folder_path' when calling FoldersApi.archive_by_path, must conform to the pattern #{pattern}." end # resource path local_var_path = '/files/v3/folders/{folderPath}'.sub('{' + 'folderPath' + '}', CGI.escape(folder_path.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#archive_by_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#archive_with_http_info(folder_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete folder. Delete folder by ID.
39 40 41 42 43 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 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 39 def archive_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.archive ...' end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.archive" end pattern = Regexp.new(/\d+/) if @api_client.config.client_side_validation && folder_id !~ pattern fail ArgumentError, "invalid value for 'folder_id' when calling FoldersApi.archive, must conform to the pattern #{pattern}." end # resource path local_var_path = '/files/v3/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#check_update_status(task_id, opts = {}) ⇒ FolderActionResponse
Check folder update status. Check status of folder update. Folder updates happen asynchronously.
163 164 165 166 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 163 def check_update_status(task_id, opts = {}) data, _status_code, _headers = check_update_status_with_http_info(task_id, opts) data end |
#check_update_status_with_http_info(task_id, opts = {}) ⇒ Array<(FolderActionResponse, Integer, Hash)>
Check folder update status. Check status of folder update. Folder updates happen asynchronously.
173 174 175 176 177 178 179 180 181 182 183 184 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 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 173 def check_update_status_with_http_info(task_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.check_update_status ...' end # verify the required parameter 'task_id' is set if @api_client.config.client_side_validation && task_id.nil? fail ArgumentError, "Missing the required parameter 'task_id' when calling FoldersApi.check_update_status" end # resource path local_var_path = '/files/v3/folders/update/async/tasks/{taskId}/status'.sub('{' + 'taskId' + '}', CGI.escape(task_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'FolderActionResponse' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#check_update_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create(folder_input, opts = {}) ⇒ Folder
Create folder. Creates a folder.
225 226 227 228 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 225 def create(folder_input, opts = {}) data, _status_code, _headers = create_with_http_info(folder_input, opts) data end |
#create_with_http_info(folder_input, opts = {}) ⇒ Array<(Folder, Integer, Hash)>
Create folder. Creates a folder.
235 236 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 274 275 276 277 278 279 280 281 282 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 235 def create_with_http_info(folder_input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.create ...' end # verify the required parameter 'folder_input' is set if @api_client.config.client_side_validation && folder_input.nil? fail ArgumentError, "Missing the required parameter 'folder_input' when calling FoldersApi.create" end # resource path local_var_path = '/files/v3/folders' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(folder_input) # return_type return_type = opts[:return_type] || 'Folder' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#do_search(opts = {}) ⇒ CollectionResponseFolder
Search folders Search for folders. Does not contain hidden or archived folders.
303 304 305 306 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 303 def do_search(opts = {}) data, _status_code, _headers = do_search_with_http_info(opts) data end |
#do_search_with_http_info(opts = {}) ⇒ Array<(CollectionResponseFolder, Integer, Hash)>
Search folders Search for folders. Does not contain hidden or archived folders.
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 327 def do_search_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.do_search ...' end # resource path local_var_path = '/files/v3/folders/search' # query parameters query_params = opts[:query_params] || {} query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :csv) if !opts[:'properties'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil? query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil? query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil? query_params[:'createdAtLte'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil? query_params[:'createdAtGte'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil? query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil? query_params[:'updatedAtLte'] = opts[:'updated_at_lte'] if !opts[:'updated_at_lte'].nil? query_params[:'updatedAtGte'] = opts[:'updated_at_gte'] if !opts[:'updated_at_gte'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? query_params[:'parentFolderId'] = opts[:'parent_folder_id'] if !opts[:'parent_folder_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'CollectionResponseFolder' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#do_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_by_id(folder_id, opts = {}) ⇒ Folder
Get folder Get folder by ID
391 392 393 394 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 391 def get_by_id(folder_id, opts = {}) data, _status_code, _headers = get_by_id_with_http_info(folder_id, opts) data end |
#get_by_id_with_http_info(folder_id, opts = {}) ⇒ Array<(Folder, Integer, Hash)>
Get folder Get folder by ID
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 402 def get_by_id_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.get_by_id ...' end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.get_by_id" end pattern = Regexp.new(/\d+/) if @api_client.config.client_side_validation && folder_id !~ pattern fail ArgumentError, "invalid value for 'folder_id' when calling FoldersApi.get_by_id, must conform to the pattern #{pattern}." end # resource path local_var_path = '/files/v3/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :csv) if !opts[:'properties'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Folder' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_by_path(folder_path, opts = {}) ⇒ Folder
Get folder. Get folder by path.
461 462 463 464 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 461 def get_by_path(folder_path, opts = {}) data, _status_code, _headers = get_by_path_with_http_info(folder_path, opts) data end |
#get_by_path_with_http_info(folder_path, opts = {}) ⇒ Array<(Folder, Integer, Hash)>
Get folder. Get folder by path.
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 472 def get_by_path_with_http_info(folder_path, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.get_by_path ...' end # verify the required parameter 'folder_path' is set if @api_client.config.client_side_validation && folder_path.nil? fail ArgumentError, "Missing the required parameter 'folder_path' when calling FoldersApi.get_by_path" end pattern = Regexp.new(/.+/) if @api_client.config.client_side_validation && folder_path !~ pattern fail ArgumentError, "invalid value for 'folder_path' when calling FoldersApi.get_by_path, must conform to the pattern #{pattern}." end # resource path local_var_path = '/files/v3/folders/{folderPath}'.sub('{' + 'folderPath' + '}', CGI.escape(folder_path.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :csv) if !opts[:'properties'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Folder' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#get_by_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_properties(folder_update_input, opts = {}) ⇒ FolderUpdateTaskLocator
Update folder properties Update properties of folder by given ID. This action happens asynchronously and will update all of the folder’s children as well.
530 531 532 533 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 530 def update_properties(folder_update_input, opts = {}) data, _status_code, _headers = update_properties_with_http_info(folder_update_input, opts) data end |
#update_properties_with_http_info(folder_update_input, opts = {}) ⇒ Array<(FolderUpdateTaskLocator, Integer, Hash)>
Update folder properties Update properties of folder by given ID. This action happens asynchronously and will update all of the folder's children as well.
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/hubspot/codegen/files/files/api/folders_api.rb', line 540 def update_properties_with_http_info(folder_update_input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.update_properties ...' end # verify the required parameter 'folder_update_input' is set if @api_client.config.client_side_validation && folder_update_input.nil? fail ArgumentError, "Missing the required parameter 'folder_update_input' when calling FoldersApi.update_properties" end # resource path local_var_path = '/files/v3/folders/update/async' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(folder_update_input) # return_type return_type = opts[:return_type] || 'FolderUpdateTaskLocator' # auth_names auth_names = opts[:auth_names] || ['hapikey', 'oauth2'] = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#update_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |