Class: SparteraApiSdk::FavoritesApi
- Inherits:
-
Object
- Object
- SparteraApiSdk::FavoritesApi
- Defined in:
- lib/spartera_api_sdk/api/favorites_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_favorites(company_id, user_id, favorites_input, opts = {}) ⇒ CreateFavorites200Response
POST /companies/company_id/users/user_id/favorites.
-
#create_favorites_with_http_info(company_id, user_id, favorites_input, opts = {}) ⇒ Array<(CreateFavorites200Response, Integer, Hash)>
POST /companies/company_id/users/user_id/favorites.
-
#delete_favorites(company_id, user_id, favorite_id, opts = {}) ⇒ DeleteFavorites200Response
Delete single favorite by ID (unfavorite an asset).
-
#delete_favorites_with_http_info(company_id, user_id, favorite_id, opts = {}) ⇒ Array<(DeleteFavorites200Response, Integer, Hash)>
Delete single favorite by ID (unfavorite an asset).
-
#get_favorites_by_id(company_id, user_id, opts = {}) ⇒ GetFavoritesById200Response
Get a list of all favorites for a specific user.
-
#get_favorites_by_id_users(company_id, user_id, favorite_id, opts = {}) ⇒ GetFavoritesById200Response
Get single favorite by ID.
-
#get_favorites_by_id_users_category(company_id, user_id, category, opts = {}) ⇒ GetFavoritesById200Response
Get all favorites for the specified user in a specific category.
-
#get_favorites_by_id_users_category_with_http_info(company_id, user_id, category, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get all favorites for the specified user in a specific category.
-
#get_favorites_by_id_users_check(company_id, user_id, asset_id, opts = {}) ⇒ GetFavoritesById200Response
Check if the specified user has favorited a specific asset.
-
#get_favorites_by_id_users_check_with_http_info(company_id, user_id, asset_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Check if the specified user has favorited a specific asset.
-
#get_favorites_by_id_users_uncategorized(company_id, user_id, opts = {}) ⇒ GetFavoritesById200Response
Get all favorites for the specified user that don’t have a category.
-
#get_favorites_by_id_users_uncategorized_with_http_info(company_id, user_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get all favorites for the specified user that don't have a category.
-
#get_favorites_by_id_users_with_http_info(company_id, user_id, favorite_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get single favorite by ID.
-
#get_favorites_by_id_with_http_info(company_id, user_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get a list of all favorites for a specific user.
-
#initialize(api_client = ApiClient.default) ⇒ FavoritesApi
constructor
A new instance of FavoritesApi.
-
#update_favorites(company_id, user_id, favorite_id, favorites_update, opts = {}) ⇒ UpdateFavorites200Response
Update an existing favorite by ID.
-
#update_favorites_with_http_info(company_id, user_id, favorite_id, favorites_update, opts = {}) ⇒ Array<(UpdateFavorites200Response, Integer, Hash)>
Update an existing favorite by ID.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ FavoritesApi
Returns a new instance of FavoritesApi.
19 20 21 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_favorites(company_id, user_id, favorites_input, opts = {}) ⇒ CreateFavorites200Response
POST /companies/company_id/users/user_id/favorites
28 29 30 31 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 28 def create_favorites(company_id, user_id, favorites_input, opts = {}) data, _status_code, _headers = create_favorites_with_http_info(company_id, user_id, favorites_input, opts) data end |
#create_favorites_with_http_info(company_id, user_id, favorites_input, opts = {}) ⇒ Array<(CreateFavorites200Response, Integer, Hash)>
POST /companies/company_id/users/user_id/favorites
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 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 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 39 def create_favorites_with_http_info(company_id, user_id, favorites_input, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.create_favorites ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.create_favorites" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.create_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.create_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.create_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.create_favorites" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.create_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.create_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.create_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'favorites_input' is set if @api_client.config.client_side_validation && favorites_input.nil? fail ArgumentError, "Missing the required parameter 'favorites_input' when calling FavoritesApi.create_favorites" end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(favorites_input) # return_type return_type = opts[:debug_return_type] || 'CreateFavorites200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.create_favorites", :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: FavoritesApi#create_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_favorites(company_id, user_id, favorite_id, opts = {}) ⇒ DeleteFavorites200Response
Delete single favorite by ID (unfavorite an asset)
132 133 134 135 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 132 def delete_favorites(company_id, user_id, favorite_id, opts = {}) data, _status_code, _headers = delete_favorites_with_http_info(company_id, user_id, favorite_id, opts) data end |
#delete_favorites_with_http_info(company_id, user_id, favorite_id, opts = {}) ⇒ Array<(DeleteFavorites200Response, Integer, Hash)>
Delete single favorite by ID (unfavorite an asset)
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 170 171 172 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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 143 def delete_favorites_with_http_info(company_id, user_id, favorite_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.delete_favorites ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.delete_favorites" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.delete_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.delete_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.delete_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.delete_favorites" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.delete_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.delete_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.delete_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'favorite_id' is set if @api_client.config.client_side_validation && favorite_id.nil? fail ArgumentError, "Missing the required parameter 'favorite_id' when calling FavoritesApi.delete_favorites" end if @api_client.config.client_side_validation && favorite_id.to_s.length > 255 fail ArgumentError, 'invalid value for "favorite_id" when calling FavoritesApi.delete_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && favorite_id.to_s.length < 1 fail ArgumentError, 'invalid value for "favorite_id" when calling FavoritesApi.delete_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && favorite_id !~ pattern fail ArgumentError, "invalid value for 'favorite_id' when calling FavoritesApi.delete_favorites, must conform to the pattern #{pattern}." end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites/{favorite_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'favorite_id' + '}', CGI.escape(favorite_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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteFavorites200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.delete_favorites", :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: FavoritesApi#delete_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_favorites_by_id(company_id, user_id, opts = {}) ⇒ GetFavoritesById200Response
Get a list of all favorites for a specific user
243 244 245 246 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 243 def get_favorites_by_id(company_id, user_id, opts = {}) data, _status_code, _headers = get_favorites_by_id_with_http_info(company_id, user_id, opts) data end |
#get_favorites_by_id_users(company_id, user_id, favorite_id, opts = {}) ⇒ GetFavoritesById200Response
Get single favorite by ID
337 338 339 340 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 337 def get_favorites_by_id_users(company_id, user_id, favorite_id, opts = {}) data, _status_code, _headers = get_favorites_by_id_users_with_http_info(company_id, user_id, favorite_id, opts) data end |
#get_favorites_by_id_users_category(company_id, user_id, category, opts = {}) ⇒ GetFavoritesById200Response
Get all favorites for the specified user in a specific category
449 450 451 452 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 449 def get_favorites_by_id_users_category(company_id, user_id, category, opts = {}) data, _status_code, _headers = get_favorites_by_id_users_category_with_http_info(company_id, user_id, category, opts) data end |
#get_favorites_by_id_users_category_with_http_info(company_id, user_id, category, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get all favorites for the specified user in a specific category
460 461 462 463 464 465 466 467 468 469 470 471 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 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 460 def get_favorites_by_id_users_category_with_http_info(company_id, user_id, category, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.get_favorites_by_id_users_category ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.get_favorites_by_id_users_category" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users_category, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users_category, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.get_favorites_by_id_users_category, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.get_favorites_by_id_users_category" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users_category, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users_category, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.get_favorites_by_id_users_category, must conform to the pattern #{pattern}." end # verify the required parameter 'category' is set if @api_client.config.client_side_validation && category.nil? fail ArgumentError, "Missing the required parameter 'category' when calling FavoritesApi.get_favorites_by_id_users_category" end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites/category/{category}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'category' + '}', CGI.escape(category.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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFavoritesById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.get_favorites_by_id_users_category", :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: FavoritesApi#get_favorites_by_id_users_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_favorites_by_id_users_check(company_id, user_id, asset_id, opts = {}) ⇒ GetFavoritesById200Response
Check if the specified user has favorited a specific asset
548 549 550 551 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 548 def get_favorites_by_id_users_check(company_id, user_id, asset_id, opts = {}) data, _status_code, _headers = get_favorites_by_id_users_check_with_http_info(company_id, user_id, asset_id, opts) data end |
#get_favorites_by_id_users_check_with_http_info(company_id, user_id, asset_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Check if the specified user has favorited a specific asset
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 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 559 def get_favorites_by_id_users_check_with_http_info(company_id, user_id, asset_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.get_favorites_by_id_users_check ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.get_favorites_by_id_users_check" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users_check, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users_check, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.get_favorites_by_id_users_check, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.get_favorites_by_id_users_check" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users_check, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users_check, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.get_favorites_by_id_users_check, must conform to the pattern #{pattern}." end # verify the required parameter 'asset_id' is set if @api_client.config.client_side_validation && asset_id.nil? fail ArgumentError, "Missing the required parameter 'asset_id' when calling FavoritesApi.get_favorites_by_id_users_check" end if @api_client.config.client_side_validation && asset_id.to_s.length > 255 fail ArgumentError, 'invalid value for "asset_id" when calling FavoritesApi.get_favorites_by_id_users_check, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && asset_id.to_s.length < 1 fail ArgumentError, 'invalid value for "asset_id" when calling FavoritesApi.get_favorites_by_id_users_check, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && asset_id !~ pattern fail ArgumentError, "invalid value for 'asset_id' when calling FavoritesApi.get_favorites_by_id_users_check, must conform to the pattern #{pattern}." end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites/check/{asset_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFavoritesById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.get_favorites_by_id_users_check", :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: FavoritesApi#get_favorites_by_id_users_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_favorites_by_id_users_uncategorized(company_id, user_id, opts = {}) ⇒ GetFavoritesById200Response
Get all favorites for the specified user that don’t have a category
659 660 661 662 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 659 def get_favorites_by_id_users_uncategorized(company_id, user_id, opts = {}) data, _status_code, _headers = get_favorites_by_id_users_uncategorized_with_http_info(company_id, user_id, opts) data end |
#get_favorites_by_id_users_uncategorized_with_http_info(company_id, user_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get all favorites for the specified user that don't have a category
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 669 def get_favorites_by_id_users_uncategorized_with_http_info(company_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.get_favorites_by_id_users_uncategorized ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.get_favorites_by_id_users_uncategorized" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users_uncategorized, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users_uncategorized, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.get_favorites_by_id_users_uncategorized, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.get_favorites_by_id_users_uncategorized" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users_uncategorized, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users_uncategorized, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.get_favorites_by_id_users_uncategorized, must conform to the pattern #{pattern}." end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites/uncategorized'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFavoritesById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.get_favorites_by_id_users_uncategorized", :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: FavoritesApi#get_favorites_by_id_users_uncategorized\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_favorites_by_id_users_with_http_info(company_id, user_id, favorite_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get single favorite by ID
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 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 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 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 348 def get_favorites_by_id_users_with_http_info(company_id, user_id, favorite_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.get_favorites_by_id_users ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.get_favorites_by_id_users" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id_users, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.get_favorites_by_id_users, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.get_favorites_by_id_users" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id_users, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.get_favorites_by_id_users, must conform to the pattern #{pattern}." end # verify the required parameter 'favorite_id' is set if @api_client.config.client_side_validation && favorite_id.nil? fail ArgumentError, "Missing the required parameter 'favorite_id' when calling FavoritesApi.get_favorites_by_id_users" end if @api_client.config.client_side_validation && favorite_id.to_s.length > 255 fail ArgumentError, 'invalid value for "favorite_id" when calling FavoritesApi.get_favorites_by_id_users, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && favorite_id.to_s.length < 1 fail ArgumentError, 'invalid value for "favorite_id" when calling FavoritesApi.get_favorites_by_id_users, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && favorite_id !~ pattern fail ArgumentError, "invalid value for 'favorite_id' when calling FavoritesApi.get_favorites_by_id_users, must conform to the pattern #{pattern}." end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites/{favorite_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'favorite_id' + '}', CGI.escape(favorite_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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFavoritesById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.get_favorites_by_id_users", :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: FavoritesApi#get_favorites_by_id_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_favorites_by_id_with_http_info(company_id, user_id, opts = {}) ⇒ Array<(GetFavoritesById200Response, Integer, Hash)>
Get a list of all favorites for a specific user
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 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 253 def get_favorites_by_id_with_http_info(company_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.get_favorites_by_id ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.get_favorites_by_id" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.get_favorites_by_id, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.get_favorites_by_id, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.get_favorites_by_id" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.get_favorites_by_id, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.get_favorites_by_id, must conform to the pattern #{pattern}." end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFavoritesById200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.get_favorites_by_id", :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: FavoritesApi#get_favorites_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_favorites(company_id, user_id, favorite_id, favorites_update, opts = {}) ⇒ UpdateFavorites200Response
Update an existing favorite by ID
754 755 756 757 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 754 def update_favorites(company_id, user_id, favorite_id, favorites_update, opts = {}) data, _status_code, _headers = update_favorites_with_http_info(company_id, user_id, favorite_id, favorites_update, opts) data end |
#update_favorites_with_http_info(company_id, user_id, favorite_id, favorites_update, opts = {}) ⇒ Array<(UpdateFavorites200Response, Integer, Hash)>
Update an existing favorite by ID
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/spartera_api_sdk/api/favorites_api.rb', line 766 def update_favorites_with_http_info(company_id, user_id, favorite_id, favorites_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FavoritesApi.update_favorites ...' end # verify the required parameter 'company_id' is set if @api_client.config.client_side_validation && company_id.nil? fail ArgumentError, "Missing the required parameter 'company_id' when calling FavoritesApi.update_favorites" end if @api_client.config.client_side_validation && company_id.to_s.length > 255 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.update_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && company_id.to_s.length < 1 fail ArgumentError, 'invalid value for "company_id" when calling FavoritesApi.update_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && company_id !~ pattern fail ArgumentError, "invalid value for 'company_id' when calling FavoritesApi.update_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling FavoritesApi.update_favorites" end if @api_client.config.client_side_validation && user_id.to_s.length > 255 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.update_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "user_id" when calling FavoritesApi.update_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && user_id !~ pattern fail ArgumentError, "invalid value for 'user_id' when calling FavoritesApi.update_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'favorite_id' is set if @api_client.config.client_side_validation && favorite_id.nil? fail ArgumentError, "Missing the required parameter 'favorite_id' when calling FavoritesApi.update_favorites" end if @api_client.config.client_side_validation && favorite_id.to_s.length > 255 fail ArgumentError, 'invalid value for "favorite_id" when calling FavoritesApi.update_favorites, the character length must be smaller than or equal to 255.' end if @api_client.config.client_side_validation && favorite_id.to_s.length < 1 fail ArgumentError, 'invalid value for "favorite_id" when calling FavoritesApi.update_favorites, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/) if @api_client.config.client_side_validation && favorite_id !~ pattern fail ArgumentError, "invalid value for 'favorite_id' when calling FavoritesApi.update_favorites, must conform to the pattern #{pattern}." end # verify the required parameter 'favorites_update' is set if @api_client.config.client_side_validation && favorites_update.nil? fail ArgumentError, "Missing the required parameter 'favorites_update' when calling FavoritesApi.update_favorites" end # resource path local_var_path = '/companies/{company_id}/users/{user_id}/favorites/{favorite_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'favorite_id' + '}', CGI.escape(favorite_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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(favorites_update) # return_type return_type = opts[:debug_return_type] || 'UpdateFavorites200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"FavoritesApi.update_favorites", :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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FavoritesApi#update_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |