hubspot-api-client 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +68 -0
- data/README.md +109 -0
- data/Rakefile +8 -0
- data/git_push.sh +55 -0
- data/hubspot-api-client.gemspec +31 -0
- data/lib/hubspot-api-client.rb +49 -0
- data/lib/hubspot/codegen/crm/associations/api/batch_api.rb +246 -0
- data/lib/hubspot/codegen/crm/associations/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/associations/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/associations/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/associations/models/batch_input_public_association.rb +221 -0
- data/lib/hubspot/codegen/crm/associations/models/batch_input_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association.rb +331 -0
- data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association_multi.rb +331 -0
- data/lib/hubspot/codegen/crm/associations/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/associations/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/associations/models/public_association.rb +233 -0
- data/lib/hubspot/codegen/crm/associations/models/public_association_multi.rb +236 -0
- data/lib/hubspot/codegen/crm/associations/models/public_object_id.rb +220 -0
- data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/companies/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/companies/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/companies/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/companies/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/companies/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/companies/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/companies/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/companies/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/companies/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/companies/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/companies/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/companies/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/companies/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/companies/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/companies/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/companies/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/companies/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/contacts/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/contacts/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/contacts/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/contacts/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/contacts/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/contacts/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/contacts/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/contacts/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/contacts/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/contacts/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/contacts/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/contacts/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/contacts/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/contacts/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/contacts/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/contacts/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/deals/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/deals/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/deals/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/deals/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/deals/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/deals/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/deals/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/deals/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/deals/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/deals/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/deals/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/deals/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/deals/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/deals/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/deals/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/deals/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/deals/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/deals/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/extensions/cards/api/cards_api.rb +338 -0
- data/lib/hubspot/codegen/crm/extensions/cards/api/default_api.rb +318 -0
- data/lib/hubspot/codegen/crm/extensions/cards/api_client.rb +425 -0
- data/lib/hubspot/codegen/crm/extensions/cards/api_error.rb +65 -0
- data/lib/hubspot/codegen/crm/extensions/cards/configuration.rb +262 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_actions.rb +223 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_create_request.rb +263 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_body.rb +223 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_property.rb +299 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body.rb +237 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body_patch.rb +232 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_list_response.rb +223 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_object_type_body.rb +271 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_patch_request.rb +243 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/card_response.rb +295 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/display_option.rb +283 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/error.rb +288 -0
- data/lib/hubspot/codegen/crm/extensions/cards/models/error_detail.rb +244 -0
- data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/line_items/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/line_items/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/line_items/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/line_items/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/line_items/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/line_items/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/line_items/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/line_items/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/line_items/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/line_items/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/line_items/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/line_items/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/line_items/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/line_items/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/line_items/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/line_items/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/line_items/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +258 -0
- data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +390 -0
- data/lib/hubspot/codegen/crm/objects/api/batch_api.rb +297 -0
- data/lib/hubspot/codegen/crm/objects/api/search_api.rb +96 -0
- data/lib/hubspot/codegen/crm/objects/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/objects/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/objects/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/objects/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/objects/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/objects/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/objects/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/objects/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/objects/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/objects/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/objects/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/objects/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/objects/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/objects/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/objects/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/objects/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/owners/api/default_api.rb +160 -0
- data/lib/hubspot/codegen/crm/owners/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/owners/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/owners/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/owners/models/collection_response_public_owner.rb +230 -0
- data/lib/hubspot/codegen/crm/owners/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/owners/models/error_detail.rb +242 -0
- data/lib/hubspot/codegen/crm/owners/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/owners/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/owners/models/public_owner.rb +313 -0
- data/lib/hubspot/codegen/crm/owners/models/public_team.rb +276 -0
- data/lib/hubspot/codegen/crm/pipelines/api/pipeline_stages_api.rb +483 -0
- data/lib/hubspot/codegen/crm/pipelines/api/pipelines_api.rb +447 -0
- data/lib/hubspot/codegen/crm/pipelines/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/pipelines/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/pipelines/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/pipelines/models/collection_response_pipeline.rb +230 -0
- data/lib/hubspot/codegen/crm/pipelines/models/collection_response_pipeline_stage.rb +230 -0
- data/lib/hubspot/codegen/crm/pipelines/models/error.rb +307 -0
- data/lib/hubspot/codegen/crm/pipelines/models/error_detail.rb +242 -0
- data/lib/hubspot/codegen/crm/pipelines/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/pipelines/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/pipelines/models/pipeline.rb +323 -0
- data/lib/hubspot/codegen/crm/pipelines/models/pipeline_input.rb +253 -0
- data/lib/hubspot/codegen/crm/pipelines/models/pipeline_patch_input.rb +236 -0
- data/lib/hubspot/codegen/crm/pipelines/models/pipeline_stage.rb +323 -0
- data/lib/hubspot/codegen/crm/pipelines/models/pipeline_stage_input.rb +253 -0
- data/lib/hubspot/codegen/crm/pipelines/models/pipeline_stage_patch_input.rb +253 -0
- data/lib/hubspot/codegen/crm/products/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/products/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/products/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/products/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/products/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/products/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/products/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/products/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/products/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/products/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/products/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/products/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/products/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/products/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/products/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/products/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/products/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/products/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/products/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/products/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/products/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/properties/api/batch_api.rb +228 -0
- data/lib/hubspot/codegen/crm/properties/api/core_api.rb +372 -0
- data/lib/hubspot/codegen/crm/properties/api/groups_api.rb +366 -0
- data/lib/hubspot/codegen/crm/properties/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/properties/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/properties/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/properties/models/batch_input_property_create.rb +221 -0
- data/lib/hubspot/codegen/crm/properties/models/batch_input_property_name.rb +221 -0
- data/lib/hubspot/codegen/crm/properties/models/batch_read_input_property_name.rb +235 -0
- data/lib/hubspot/codegen/crm/properties/models/batch_response_property.rb +331 -0
- data/lib/hubspot/codegen/crm/properties/models/collection_response_property.rb +230 -0
- data/lib/hubspot/codegen/crm/properties/models/collection_response_property_group.rb +230 -0
- data/lib/hubspot/codegen/crm/properties/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/properties/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/properties/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/properties/models/option.rb +270 -0
- data/lib/hubspot/codegen/crm/properties/models/option_input.rb +270 -0
- data/lib/hubspot/codegen/crm/properties/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/properties/models/property.rb +469 -0
- data/lib/hubspot/codegen/crm/properties/models/property_create.rb +378 -0
- data/lib/hubspot/codegen/crm/properties/models/property_group.rb +265 -0
- data/lib/hubspot/codegen/crm/properties/models/property_group_create.rb +245 -0
- data/lib/hubspot/codegen/crm/properties/models/property_group_update.rb +225 -0
- data/lib/hubspot/codegen/crm/properties/models/property_modification_metadata.rb +256 -0
- data/lib/hubspot/codegen/crm/properties/models/property_name.rb +220 -0
- data/lib/hubspot/codegen/crm/properties/models/property_update.rb +333 -0
- data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/quotes/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/quotes/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/quotes/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/quotes/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/quotes/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/quotes/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/quotes/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/quotes/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/quotes/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/quotes/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/quotes/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/quotes/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/quotes/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/quotes/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/quotes/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/quotes/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/quotes/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +240 -0
- data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +360 -0
- data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +273 -0
- data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +90 -0
- data/lib/hubspot/codegen/crm/tickets/api_client.rb +423 -0
- data/lib/hubspot/codegen/crm/tickets/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/tickets/configuration.rb +260 -0
- data/lib/hubspot/codegen/crm/tickets/models/batch_input_simple_public_object_batch_input.rb +221 -0
- data/lib/hubspot/codegen/crm/tickets/models/batch_input_simple_public_object_id.rb +221 -0
- data/lib/hubspot/codegen/crm/tickets/models/batch_input_simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +237 -0
- data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object.rb +331 -0
- data/lib/hubspot/codegen/crm/tickets/models/collection_response_simple_public_object.rb +230 -0
- data/lib/hubspot/codegen/crm/tickets/models/collection_response_simple_public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/tickets/models/collection_response_with_total_simple_public_object.rb +245 -0
- data/lib/hubspot/codegen/crm/tickets/models/error.rb +286 -0
- data/lib/hubspot/codegen/crm/tickets/models/error_detail.rb +265 -0
- data/lib/hubspot/codegen/crm/tickets/models/filter.rb +276 -0
- data/lib/hubspot/codegen/crm/tickets/models/filter_group.rb +221 -0
- data/lib/hubspot/codegen/crm/tickets/models/next_page.rb +228 -0
- data/lib/hubspot/codegen/crm/tickets/models/paging.rb +214 -0
- data/lib/hubspot/codegen/crm/tickets/models/public_object_search_request.rb +290 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +302 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input.rb +235 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_id.rb +219 -0
- data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_input.rb +221 -0
- data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +88 -0
- data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +340 -0
- data/lib/hubspot/codegen/oauth/api/tokens_api.rb +102 -0
- data/lib/hubspot/codegen/oauth/api_client.rb +423 -0
- data/lib/hubspot/codegen/oauth/api_error.rb +61 -0
- data/lib/hubspot/codegen/oauth/configuration.rb +258 -0
- data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +321 -0
- data/lib/hubspot/codegen/oauth/models/error.rb +305 -0
- data/lib/hubspot/codegen/oauth/models/error_detail.rb +240 -0
- data/lib/hubspot/codegen/oauth/models/json_node.rb +426 -0
- data/lib/hubspot/codegen/oauth/models/refresh_token.rb +259 -0
- data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +307 -0
- data/lib/hubspot/configuration.rb +207 -0
- data/lib/hubspot/exceptions.rb +3 -0
- data/lib/hubspot/oauth.rb +17 -0
- data/lib/hubspot/version.rb +3 -0
- data/sample-apps/companies-app/.env.template +2 -0
- data/sample-apps/companies-app/.env.test.template +3 -0
- data/sample-apps/companies-app/.gitignore +35 -0
- data/sample-apps/companies-app/.rspec +1 -0
- data/sample-apps/companies-app/.ruby-version +1 -0
- data/sample-apps/companies-app/Dockerfile +22 -0
- data/sample-apps/companies-app/Gemfile +33 -0
- data/sample-apps/companies-app/Gemfile.lock +270 -0
- data/sample-apps/companies-app/README.md +31 -0
- data/sample-apps/companies-app/Rakefile +6 -0
- data/sample-apps/companies-app/app/assets/config/manifest.js +3 -0
- data/sample-apps/companies-app/app/assets/images/.keep +0 -0
- data/sample-apps/companies-app/app/assets/javascripts/application.js +15 -0
- data/sample-apps/companies-app/app/assets/javascripts/cable.js +13 -0
- data/sample-apps/companies-app/app/assets/javascripts/channels/.keep +0 -0
- data/sample-apps/companies-app/app/assets/stylesheets/application.css +117 -0
- data/sample-apps/companies-app/app/controllers/application_controller.rb +12 -0
- data/sample-apps/companies-app/app/controllers/companies_controller.rb +67 -0
- data/sample-apps/companies-app/app/controllers/concerns/.keep +0 -0
- data/sample-apps/companies-app/app/controllers/concerns/exception_handler.rb +12 -0
- data/sample-apps/companies-app/app/controllers/contacts_controller.rb +28 -0
- data/sample-apps/companies-app/app/controllers/oauth/authorization_controller.rb +19 -0
- data/sample-apps/companies-app/app/helpers/application_helper.rb +2 -0
- data/sample-apps/companies-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
- data/sample-apps/companies-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
- data/sample-apps/companies-app/app/lib/services/authorization/tokens/base.rb +19 -0
- data/sample-apps/companies-app/app/lib/services/authorization/tokens/generate.rb +26 -0
- data/sample-apps/companies-app/app/lib/services/authorization/tokens/refresh.rb +33 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/associations/create.rb +38 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/associations/delete.rb +38 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/associations/get_by_id.rb +39 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/create.rb +24 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/destroy.rb +16 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/export.rb +48 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/get_all.rb +16 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/get_by_id.rb +16 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/search.rb +28 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/companies/update.rb +26 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/contacts/get_all.rb +26 -0
- data/sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb +28 -0
- data/sample-apps/companies-app/app/models/application_record.rb +3 -0
- data/sample-apps/companies-app/app/models/concerns/.keep +0 -0
- data/sample-apps/companies-app/app/views/companies/index.html.erb +74 -0
- data/sample-apps/companies-app/app/views/companies/new.html.erb +24 -0
- data/sample-apps/companies-app/app/views/companies/show.html.erb +50 -0
- data/sample-apps/companies-app/app/views/contacts/index.html.erb +49 -0
- data/sample-apps/companies-app/app/views/layouts/application.html.erb +23 -0
- data/sample-apps/companies-app/app/views/oauth/authorization/login.html.erb +15 -0
- data/sample-apps/companies-app/app/views/shared/_header.html.erb +15 -0
- data/sample-apps/companies-app/bin/bundle +3 -0
- data/sample-apps/companies-app/bin/rails +9 -0
- data/sample-apps/companies-app/bin/rake +9 -0
- data/sample-apps/companies-app/bin/setup +36 -0
- data/sample-apps/companies-app/bin/spring +17 -0
- data/sample-apps/companies-app/bin/update +31 -0
- data/sample-apps/companies-app/bin/yarn +11 -0
- data/sample-apps/companies-app/config.ru +5 -0
- data/sample-apps/companies-app/config/application.rb +19 -0
- data/sample-apps/companies-app/config/boot.rb +3 -0
- data/sample-apps/companies-app/config/cable.yml +10 -0
- data/sample-apps/companies-app/config/database.yml +25 -0
- data/sample-apps/companies-app/config/environment.rb +5 -0
- data/sample-apps/companies-app/config/environments/development.rb +61 -0
- data/sample-apps/companies-app/config/environments/production.rb +94 -0
- data/sample-apps/companies-app/config/environments/test.rb +46 -0
- data/sample-apps/companies-app/config/initializers/assets.rb +14 -0
- data/sample-apps/companies-app/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample-apps/companies-app/config/initializers/hubspot-api-client.rb +3 -0
- data/sample-apps/companies-app/config/initializers/mime_types.rb +1 -0
- data/sample-apps/companies-app/config/initializers/wrap_parameters.rb +14 -0
- data/sample-apps/companies-app/config/locales/en.yml +33 -0
- data/sample-apps/companies-app/config/puma.rb +34 -0
- data/sample-apps/companies-app/config/routes.rb +17 -0
- data/sample-apps/companies-app/config/spring.rb +6 -0
- data/sample-apps/companies-app/db/seeds.rb +7 -0
- data/sample-apps/companies-app/docker-compose.yml +11 -0
- data/sample-apps/companies-app/docker-entrypoint.sh +8 -0
- data/sample-apps/companies-app/lib/assets/.keep +0 -0
- data/sample-apps/companies-app/lib/tasks/.keep +0 -0
- data/sample-apps/companies-app/log/.keep +0 -0
- data/sample-apps/companies-app/package.json +5 -0
- data/sample-apps/companies-app/public/404.html +67 -0
- data/sample-apps/companies-app/public/422.html +67 -0
- data/sample-apps/companies-app/public/500.html +66 -0
- data/sample-apps/companies-app/public/apple-touch-icon-precomposed.png +0 -0
- data/sample-apps/companies-app/public/apple-touch-icon.png +0 -0
- data/sample-apps/companies-app/public/favicon.ico +0 -0
- data/sample-apps/companies-app/public/robots.txt +1 -0
- data/sample-apps/companies-app/tmp/.keep +0 -0
- data/sample-apps/contacts-app/.env.template +2 -0
- data/sample-apps/contacts-app/.env.test.template +3 -0
- data/sample-apps/contacts-app/.gitignore +35 -0
- data/sample-apps/contacts-app/.rspec +1 -0
- data/sample-apps/contacts-app/.ruby-version +1 -0
- data/sample-apps/contacts-app/Dockerfile +22 -0
- data/sample-apps/contacts-app/Gemfile +33 -0
- data/sample-apps/contacts-app/Gemfile.lock +270 -0
- data/sample-apps/contacts-app/README.md +41 -0
- data/sample-apps/contacts-app/Rakefile +6 -0
- data/sample-apps/contacts-app/app/assets/config/manifest.js +3 -0
- data/sample-apps/contacts-app/app/assets/images/.keep +0 -0
- data/sample-apps/contacts-app/app/assets/javascripts/application.js +15 -0
- data/sample-apps/contacts-app/app/assets/javascripts/cable.js +13 -0
- data/sample-apps/contacts-app/app/assets/javascripts/channels/.keep +0 -0
- data/sample-apps/contacts-app/app/assets/stylesheets/application.css +117 -0
- data/sample-apps/contacts-app/app/controllers/application_controller.rb +12 -0
- data/sample-apps/contacts-app/app/controllers/concerns/.keep +0 -0
- data/sample-apps/contacts-app/app/controllers/concerns/exception_handler.rb +12 -0
- data/sample-apps/contacts-app/app/controllers/contacts_controller.rb +68 -0
- data/sample-apps/contacts-app/app/controllers/oauth/authorization_controller.rb +19 -0
- data/sample-apps/contacts-app/app/controllers/properties_controller.rb +52 -0
- data/sample-apps/contacts-app/app/helpers/application_helper.rb +2 -0
- data/sample-apps/contacts-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
- data/sample-apps/contacts-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
- data/sample-apps/contacts-app/app/lib/services/authorization/tokens/base.rb +19 -0
- data/sample-apps/contacts-app/app/lib/services/authorization/tokens/generate.rb +26 -0
- data/sample-apps/contacts-app/app/lib/services/authorization/tokens/refresh.rb +33 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/create.rb +22 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/destroy.rb +16 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/export.rb +48 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_all.rb +26 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb +28 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/search.rb +37 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/update.rb +24 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/owners/get_all.rb +12 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/properties/create.rb +23 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/properties/destroy.rb +16 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/properties/get_all.rb +12 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/properties/get_by_name.rb +20 -0
- data/sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb +27 -0
- data/sample-apps/contacts-app/app/models/application_record.rb +3 -0
- data/sample-apps/contacts-app/app/models/concerns/.keep +0 -0
- data/sample-apps/contacts-app/app/views/contacts/index.html.erb +78 -0
- data/sample-apps/contacts-app/app/views/contacts/new.html.erb +18 -0
- data/sample-apps/contacts-app/app/views/contacts/show.html.erb +38 -0
- data/sample-apps/contacts-app/app/views/layouts/application.html.erb +23 -0
- data/sample-apps/contacts-app/app/views/oauth/authorization/login.html.erb +15 -0
- data/sample-apps/contacts-app/app/views/properties/index.html.erb +68 -0
- data/sample-apps/contacts-app/app/views/properties/new.html.erb +29 -0
- data/sample-apps/contacts-app/app/views/properties/show.html.erb +29 -0
- data/sample-apps/contacts-app/app/views/shared/_header.html.erb +18 -0
- data/sample-apps/contacts-app/bin/bundle +3 -0
- data/sample-apps/contacts-app/bin/rails +9 -0
- data/sample-apps/contacts-app/bin/rake +9 -0
- data/sample-apps/contacts-app/bin/setup +36 -0
- data/sample-apps/contacts-app/bin/spring +17 -0
- data/sample-apps/contacts-app/bin/update +31 -0
- data/sample-apps/contacts-app/bin/yarn +11 -0
- data/sample-apps/contacts-app/config.ru +5 -0
- data/sample-apps/contacts-app/config/application.rb +19 -0
- data/sample-apps/contacts-app/config/boot.rb +3 -0
- data/sample-apps/contacts-app/config/cable.yml +10 -0
- data/sample-apps/contacts-app/config/database.yml +25 -0
- data/sample-apps/contacts-app/config/environment.rb +5 -0
- data/sample-apps/contacts-app/config/environments/development.rb +61 -0
- data/sample-apps/contacts-app/config/environments/production.rb +94 -0
- data/sample-apps/contacts-app/config/environments/test.rb +46 -0
- data/sample-apps/contacts-app/config/initializers/assets.rb +14 -0
- data/sample-apps/contacts-app/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample-apps/contacts-app/config/initializers/hubspot-api-client.rb +3 -0
- data/sample-apps/contacts-app/config/initializers/mime_types.rb +1 -0
- data/sample-apps/contacts-app/config/initializers/wrap_parameters.rb +14 -0
- data/sample-apps/contacts-app/config/locales/en.yml +33 -0
- data/sample-apps/contacts-app/config/puma.rb +34 -0
- data/sample-apps/contacts-app/config/routes.rb +14 -0
- data/sample-apps/contacts-app/config/spring.rb +6 -0
- data/sample-apps/contacts-app/db/seeds.rb +7 -0
- data/sample-apps/contacts-app/docker-compose.yml +11 -0
- data/sample-apps/contacts-app/docker-entrypoint.sh +8 -0
- data/sample-apps/contacts-app/lib/assets/.keep +0 -0
- data/sample-apps/contacts-app/lib/tasks/.keep +0 -0
- data/sample-apps/contacts-app/log/.keep +0 -0
- data/sample-apps/contacts-app/package.json +5 -0
- data/sample-apps/contacts-app/public/404.html +67 -0
- data/sample-apps/contacts-app/public/422.html +67 -0
- data/sample-apps/contacts-app/public/500.html +66 -0
- data/sample-apps/contacts-app/public/apple-touch-icon-precomposed.png +0 -0
- data/sample-apps/contacts-app/public/apple-touch-icon.png +0 -0
- data/sample-apps/contacts-app/public/favicon.ico +0 -0
- data/sample-apps/contacts-app/public/robots.txt +1 -0
- data/sample-apps/contacts-app/spec/features/visitor_creates_new_contact_spec.rb +27 -0
- data/sample-apps/contacts-app/spec/features/visitor_deletes_contact_spec.rb +18 -0
- data/sample-apps/contacts-app/spec/features/visitor_downloads_contacts_spec.rb +21 -0
- data/sample-apps/contacts-app/spec/features/visitor_edits_contact_spec.rb +35 -0
- data/sample-apps/contacts-app/spec/features/visitor_lists_contacts_spec.rb +10 -0
- data/sample-apps/contacts-app/spec/features/visitor_logs_in_spec.rb +22 -0
- data/sample-apps/contacts-app/spec/features/visitor_searches_contacts_spec.rb +33 -0
- data/sample-apps/contacts-app/spec/rails_helper.rb +42 -0
- data/sample-apps/contacts-app/spec/spec_helper.rb +11 -0
- data/sample-apps/contacts-app/spec/support/application_helper.rb +29 -0
- data/sample-apps/contacts-app/spec/support/download_helper.rb +37 -0
- data/sample-apps/contacts-app/tmp/.keep +0 -0
- data/sample-apps/oauth-app/.env.template +2 -0
- data/sample-apps/oauth-app/.env.test.template +3 -0
- data/sample-apps/oauth-app/.gitignore +35 -0
- data/sample-apps/oauth-app/.rspec +1 -0
- data/sample-apps/oauth-app/.ruby-version +1 -0
- data/sample-apps/oauth-app/Dockerfile +22 -0
- data/sample-apps/oauth-app/Gemfile +33 -0
- data/sample-apps/oauth-app/Gemfile.lock +270 -0
- data/sample-apps/oauth-app/README.md +33 -0
- data/sample-apps/oauth-app/Rakefile +6 -0
- data/sample-apps/oauth-app/app/assets/config/manifest.js +3 -0
- data/sample-apps/oauth-app/app/assets/images/.keep +0 -0
- data/sample-apps/oauth-app/app/assets/javascripts/application.js +15 -0
- data/sample-apps/oauth-app/app/assets/javascripts/cable.js +13 -0
- data/sample-apps/oauth-app/app/assets/javascripts/channels/.keep +0 -0
- data/sample-apps/oauth-app/app/assets/stylesheets/application.css +117 -0
- data/sample-apps/oauth-app/app/controllers/application_controller.rb +12 -0
- data/sample-apps/oauth-app/app/controllers/concerns/.keep +0 -0
- data/sample-apps/oauth-app/app/controllers/concerns/exception_handler.rb +12 -0
- data/sample-apps/oauth-app/app/controllers/contacts_controller.rb +67 -0
- data/sample-apps/oauth-app/app/controllers/oauth/authorization_controller.rb +19 -0
- data/sample-apps/oauth-app/app/helpers/application_helper.rb +2 -0
- data/sample-apps/oauth-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
- data/sample-apps/oauth-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
- data/sample-apps/oauth-app/app/lib/services/authorization/tokens/base.rb +19 -0
- data/sample-apps/oauth-app/app/lib/services/authorization/tokens/generate.rb +26 -0
- data/sample-apps/oauth-app/app/lib/services/authorization/tokens/refresh.rb +33 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/create.rb +22 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/destroy.rb +16 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/export.rb +48 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/get_all.rb +26 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/get_by_id.rb +20 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/search.rb +37 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/update.rb +24 -0
- data/sample-apps/oauth-app/app/lib/services/hubspot/owners/get_all.rb +12 -0
- data/sample-apps/oauth-app/app/models/application_record.rb +3 -0
- data/sample-apps/oauth-app/app/models/concerns/.keep +0 -0
- data/sample-apps/oauth-app/app/views/contacts/index.html.erb +78 -0
- data/sample-apps/oauth-app/app/views/contacts/new.html.erb +18 -0
- data/sample-apps/oauth-app/app/views/contacts/show.html.erb +38 -0
- data/sample-apps/oauth-app/app/views/layouts/application.html.erb +23 -0
- data/sample-apps/oauth-app/app/views/oauth/authorization/login.html.erb +15 -0
- data/sample-apps/oauth-app/app/views/shared/_header.html.erb +15 -0
- data/sample-apps/oauth-app/bin/bundle +3 -0
- data/sample-apps/oauth-app/bin/rails +9 -0
- data/sample-apps/oauth-app/bin/rake +9 -0
- data/sample-apps/oauth-app/bin/setup +36 -0
- data/sample-apps/oauth-app/bin/spring +17 -0
- data/sample-apps/oauth-app/bin/update +31 -0
- data/sample-apps/oauth-app/bin/yarn +11 -0
- data/sample-apps/oauth-app/config.ru +5 -0
- data/sample-apps/oauth-app/config/application.rb +19 -0
- data/sample-apps/oauth-app/config/boot.rb +3 -0
- data/sample-apps/oauth-app/config/cable.yml +10 -0
- data/sample-apps/oauth-app/config/database.yml +25 -0
- data/sample-apps/oauth-app/config/environment.rb +5 -0
- data/sample-apps/oauth-app/config/environments/development.rb +61 -0
- data/sample-apps/oauth-app/config/environments/production.rb +94 -0
- data/sample-apps/oauth-app/config/environments/test.rb +46 -0
- data/sample-apps/oauth-app/config/initializers/assets.rb +14 -0
- data/sample-apps/oauth-app/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample-apps/oauth-app/config/initializers/hubspot-api-client.rb +3 -0
- data/sample-apps/oauth-app/config/initializers/mime_types.rb +1 -0
- data/sample-apps/oauth-app/config/initializers/wrap_parameters.rb +14 -0
- data/sample-apps/oauth-app/config/locales/en.yml +33 -0
- data/sample-apps/oauth-app/config/puma.rb +34 -0
- data/sample-apps/oauth-app/config/routes.rb +14 -0
- data/sample-apps/oauth-app/config/spring.rb +6 -0
- data/sample-apps/oauth-app/db/seeds.rb +7 -0
- data/sample-apps/oauth-app/docker-compose.yml +11 -0
- data/sample-apps/oauth-app/docker-entrypoint.sh +8 -0
- data/sample-apps/oauth-app/lib/assets/.keep +0 -0
- data/sample-apps/oauth-app/lib/tasks/.keep +0 -0
- data/sample-apps/oauth-app/log/.keep +0 -0
- data/sample-apps/oauth-app/package.json +5 -0
- data/sample-apps/oauth-app/public/404.html +67 -0
- data/sample-apps/oauth-app/public/422.html +67 -0
- data/sample-apps/oauth-app/public/500.html +66 -0
- data/sample-apps/oauth-app/public/apple-touch-icon-precomposed.png +0 -0
- data/sample-apps/oauth-app/public/apple-touch-icon.png +0 -0
- data/sample-apps/oauth-app/public/favicon.ico +0 -0
- data/sample-apps/oauth-app/public/robots.txt +1 -0
- data/sample-apps/oauth-app/spec/features/visitor_creates_new_contact_spec.rb +27 -0
- data/sample-apps/oauth-app/spec/features/visitor_deletes_contact_spec.rb +18 -0
- data/sample-apps/oauth-app/spec/features/visitor_downloads_contacts_spec.rb +21 -0
- data/sample-apps/oauth-app/spec/features/visitor_edits_contact_spec.rb +35 -0
- data/sample-apps/oauth-app/spec/features/visitor_lists_contacts_spec.rb +10 -0
- data/sample-apps/oauth-app/spec/features/visitor_logs_in_spec.rb +22 -0
- data/sample-apps/oauth-app/spec/features/visitor_searches_contacts_spec.rb +33 -0
- data/sample-apps/oauth-app/spec/rails_helper.rb +42 -0
- data/sample-apps/oauth-app/spec/spec_helper.rb +11 -0
- data/sample-apps/oauth-app/spec/support/application_helper.rb +29 -0
- data/sample-apps/oauth-app/spec/support/download_helper.rb +37 -0
- data/sample-apps/oauth-app/tmp/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/.env.template +2 -0
- data/sample-apps/retry-middleware-sample-app/.gitignore +35 -0
- data/sample-apps/retry-middleware-sample-app/.ruby-version +1 -0
- data/sample-apps/retry-middleware-sample-app/Dockerfile +22 -0
- data/sample-apps/retry-middleware-sample-app/Gemfile +37 -0
- data/sample-apps/retry-middleware-sample-app/Gemfile.lock +282 -0
- data/sample-apps/retry-middleware-sample-app/README.md +33 -0
- data/sample-apps/retry-middleware-sample-app/Rakefile +6 -0
- data/sample-apps/retry-middleware-sample-app/app/assets/config/manifest.js +3 -0
- data/sample-apps/retry-middleware-sample-app/app/assets/images/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/app/assets/javascripts/application.js +25 -0
- data/sample-apps/retry-middleware-sample-app/app/assets/javascripts/cable.js +13 -0
- data/sample-apps/retry-middleware-sample-app/app/assets/javascripts/channels/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/app/assets/stylesheets/application.css +90 -0
- data/sample-apps/retry-middleware-sample-app/app/controllers/application_controller.rb +12 -0
- data/sample-apps/retry-middleware-sample-app/app/controllers/concerns/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/app/controllers/concerns/exception_handler.rb +12 -0
- data/sample-apps/retry-middleware-sample-app/app/controllers/home_controller.rb +15 -0
- data/sample-apps/retry-middleware-sample-app/app/controllers/oauth/authorization_controller.rb +19 -0
- data/sample-apps/retry-middleware-sample-app/app/helpers/application_helper.rb +2 -0
- data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
- data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
- data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/base.rb +19 -0
- data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/generate.rb +26 -0
- data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/refresh.rb +33 -0
- data/sample-apps/retry-middleware-sample-app/app/models/application_record.rb +3 -0
- data/sample-apps/retry-middleware-sample-app/app/models/concerns/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/app/views/home/index.html.erb +13 -0
- data/sample-apps/retry-middleware-sample-app/app/views/layouts/application.html.erb +23 -0
- data/sample-apps/retry-middleware-sample-app/app/views/oauth/authorization/login.html.erb +15 -0
- data/sample-apps/retry-middleware-sample-app/app/views/shared/_header.html.erb +12 -0
- data/sample-apps/retry-middleware-sample-app/bin/bundle +3 -0
- data/sample-apps/retry-middleware-sample-app/bin/rails +9 -0
- data/sample-apps/retry-middleware-sample-app/bin/rake +9 -0
- data/sample-apps/retry-middleware-sample-app/bin/setup +36 -0
- data/sample-apps/retry-middleware-sample-app/bin/spring +17 -0
- data/sample-apps/retry-middleware-sample-app/bin/update +31 -0
- data/sample-apps/retry-middleware-sample-app/bin/yarn +11 -0
- data/sample-apps/retry-middleware-sample-app/config.ru +5 -0
- data/sample-apps/retry-middleware-sample-app/config/application.rb +19 -0
- data/sample-apps/retry-middleware-sample-app/config/boot.rb +3 -0
- data/sample-apps/retry-middleware-sample-app/config/cable.yml +10 -0
- data/sample-apps/retry-middleware-sample-app/config/database.yml +25 -0
- data/sample-apps/retry-middleware-sample-app/config/environment.rb +5 -0
- data/sample-apps/retry-middleware-sample-app/config/environments/development.rb +61 -0
- data/sample-apps/retry-middleware-sample-app/config/environments/production.rb +94 -0
- data/sample-apps/retry-middleware-sample-app/config/environments/test.rb +46 -0
- data/sample-apps/retry-middleware-sample-app/config/initializers/assets.rb +14 -0
- data/sample-apps/retry-middleware-sample-app/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample-apps/retry-middleware-sample-app/config/initializers/hubspot-api-client.rb +3 -0
- data/sample-apps/retry-middleware-sample-app/config/initializers/mime_types.rb +1 -0
- data/sample-apps/retry-middleware-sample-app/config/initializers/wrap_parameters.rb +14 -0
- data/sample-apps/retry-middleware-sample-app/config/locales/en.yml +33 -0
- data/sample-apps/retry-middleware-sample-app/config/puma.rb +34 -0
- data/sample-apps/retry-middleware-sample-app/config/routes.rb +6 -0
- data/sample-apps/retry-middleware-sample-app/config/spring.rb +6 -0
- data/sample-apps/retry-middleware-sample-app/db/seeds.rb +7 -0
- data/sample-apps/retry-middleware-sample-app/docker-compose.yml +11 -0
- data/sample-apps/retry-middleware-sample-app/docker-entrypoint.sh +8 -0
- data/sample-apps/retry-middleware-sample-app/lib/assets/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/lib/tasks/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/lib/tasks/retry_middleware.rake +37 -0
- data/sample-apps/retry-middleware-sample-app/log/.keep +0 -0
- data/sample-apps/retry-middleware-sample-app/package.json +5 -0
- data/sample-apps/retry-middleware-sample-app/public/404.html +67 -0
- data/sample-apps/retry-middleware-sample-app/public/422.html +67 -0
- data/sample-apps/retry-middleware-sample-app/public/500.html +66 -0
- data/sample-apps/retry-middleware-sample-app/public/apple-touch-icon-precomposed.png +0 -0
- data/sample-apps/retry-middleware-sample-app/public/apple-touch-icon.png +0 -0
- data/sample-apps/retry-middleware-sample-app/public/favicon.ico +0 -0
- data/sample-apps/retry-middleware-sample-app/public/robots.txt +1 -0
- data/sample-apps/retry-middleware-sample-app/tmp/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/.env.template +2 -0
- data/sample-apps/webhooks-contacts-app/.gitignore +35 -0
- data/sample-apps/webhooks-contacts-app/.ruby-version +1 -0
- data/sample-apps/webhooks-contacts-app/Dockerfile +21 -0
- data/sample-apps/webhooks-contacts-app/Gemfile +37 -0
- data/sample-apps/webhooks-contacts-app/Gemfile.lock +280 -0
- data/sample-apps/webhooks-contacts-app/README.md +51 -0
- data/sample-apps/webhooks-contacts-app/Rakefile +6 -0
- data/sample-apps/webhooks-contacts-app/app/assets/config/manifest.js +3 -0
- data/sample-apps/webhooks-contacts-app/app/assets/images/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/app/assets/javascripts/application.js +46 -0
- data/sample-apps/webhooks-contacts-app/app/assets/javascripts/cable.js +13 -0
- data/sample-apps/webhooks-contacts-app/app/assets/javascripts/channels/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/app/assets/stylesheets/application.css +140 -0
- data/sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb +18 -0
- data/sample-apps/webhooks-contacts-app/app/controllers/concerns/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/app/controllers/concerns/exception_handler.rb +12 -0
- data/sample-apps/webhooks-contacts-app/app/controllers/events_controller.rb +33 -0
- data/sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb +19 -0
- data/sample-apps/webhooks-contacts-app/app/controllers/webhooks_controller.rb +9 -0
- data/sample-apps/webhooks-contacts-app/app/helpers/application_helper.rb +2 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/tokens/base.rb +19 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/tokens/generate.rb +26 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/tokens/refresh.rb +34 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/hubspot/contacts/get_batch.rb +39 -0
- data/sample-apps/webhooks-contacts-app/app/lib/services/hubspot/webhooks/handle.rb +34 -0
- data/sample-apps/webhooks-contacts-app/app/models/application_record.rb +3 -0
- data/sample-apps/webhooks-contacts-app/app/models/concerns/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/app/models/event.rb +2 -0
- data/sample-apps/webhooks-contacts-app/app/models/token.rb +15 -0
- data/sample-apps/webhooks-contacts-app/app/views/events/index.html.erb +41 -0
- data/sample-apps/webhooks-contacts-app/app/views/layouts/application.html.erb +21 -0
- data/sample-apps/webhooks-contacts-app/app/views/oauth/authorization/login.html.erb +15 -0
- data/sample-apps/webhooks-contacts-app/app/views/shared/_header.html.erb +15 -0
- data/sample-apps/webhooks-contacts-app/bin/bundle +3 -0
- data/sample-apps/webhooks-contacts-app/bin/rails +9 -0
- data/sample-apps/webhooks-contacts-app/bin/rake +9 -0
- data/sample-apps/webhooks-contacts-app/bin/setup +36 -0
- data/sample-apps/webhooks-contacts-app/bin/spring +17 -0
- data/sample-apps/webhooks-contacts-app/bin/update +31 -0
- data/sample-apps/webhooks-contacts-app/bin/yarn +11 -0
- data/sample-apps/webhooks-contacts-app/config.ru +5 -0
- data/sample-apps/webhooks-contacts-app/config/application.rb +19 -0
- data/sample-apps/webhooks-contacts-app/config/boot.rb +3 -0
- data/sample-apps/webhooks-contacts-app/config/cable.yml +10 -0
- data/sample-apps/webhooks-contacts-app/config/database.yml +15 -0
- data/sample-apps/webhooks-contacts-app/config/environment.rb +5 -0
- data/sample-apps/webhooks-contacts-app/config/environments/development.rb +61 -0
- data/sample-apps/webhooks-contacts-app/config/environments/production.rb +94 -0
- data/sample-apps/webhooks-contacts-app/config/environments/test.rb +47 -0
- data/sample-apps/webhooks-contacts-app/config/initializers/assets.rb +14 -0
- data/sample-apps/webhooks-contacts-app/config/initializers/filter_parameter_logging.rb +4 -0
- data/sample-apps/webhooks-contacts-app/config/initializers/wrap_parameters.rb +14 -0
- data/sample-apps/webhooks-contacts-app/config/locales/en.yml +33 -0
- data/sample-apps/webhooks-contacts-app/config/puma.rb +34 -0
- data/sample-apps/webhooks-contacts-app/config/routes.rb +10 -0
- data/sample-apps/webhooks-contacts-app/config/spring.rb +6 -0
- data/sample-apps/webhooks-contacts-app/db/migrate/20191202170347_create_tokens.rb +10 -0
- data/sample-apps/webhooks-contacts-app/db/migrate/20200130113853_create_events.rb +14 -0
- data/sample-apps/webhooks-contacts-app/db/schema.rb +36 -0
- data/sample-apps/webhooks-contacts-app/docker-compose.yml +38 -0
- data/sample-apps/webhooks-contacts-app/docker-entrypoint.sh +8 -0
- data/sample-apps/webhooks-contacts-app/lib/assets/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/lib/tasks/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/log/.keep +0 -0
- data/sample-apps/webhooks-contacts-app/package.json +5 -0
- data/sample-apps/webhooks-contacts-app/public/404.html +67 -0
- data/sample-apps/webhooks-contacts-app/public/422.html +67 -0
- data/sample-apps/webhooks-contacts-app/public/500.html +66 -0
- data/sample-apps/webhooks-contacts-app/public/apple-touch-icon-precomposed.png +0 -0
- data/sample-apps/webhooks-contacts-app/public/apple-touch-icon.png +0 -0
- data/sample-apps/webhooks-contacts-app/public/favicon.ico +0 -0
- data/sample-apps/webhooks-contacts-app/public/robots.txt +1 -0
- data/sample-apps/webhooks-contacts-app/public/sample.png +0 -0
- data/sample-apps/webhooks-contacts-app/tmp/.keep +0 -0
- data/spec/oauth/api/access_tokens_api_spec.rb +46 -0
- data/spec/oauth/api/refresh_tokens_api_spec.rb +92 -0
- data/spec/oauth/api/tokens_api_spec.rb +51 -0
- data/spec/oauth/api_client_spec.rb +226 -0
- data/spec/oauth/configuration_spec.rb +42 -0
- data/spec/oauth/models/access_token_info_response_spec.rb +89 -0
- data/spec/oauth/models/error_detail_spec.rb +53 -0
- data/spec/oauth/models/error_spec.rb +71 -0
- data/spec/oauth/models/json_node_spec.rb +165 -0
- data/spec/oauth/models/refresh_token_info_response_spec.rb +83 -0
- data/spec/oauth/models/refresh_token_spec.rb +59 -0
- data/spec/objects/api/associations_api_spec.rb +76 -0
- data/spec/objects/api/basic_api_spec.rb +108 -0
- data/spec/objects/api/batch_api_spec.rb +88 -0
- data/spec/objects/api/search_api_spec.rb +48 -0
- data/spec/objects/api_client_spec.rb +226 -0
- data/spec/objects/configuration_spec.rb +42 -0
- data/spec/objects/models/batch_input_simple_public_object_batch_input_spec.rb +41 -0
- data/spec/objects/models/batch_input_simple_public_object_id_spec.rb +41 -0
- data/spec/objects/models/batch_input_simple_public_object_input_spec.rb +41 -0
- data/spec/objects/models/batch_read_input_simple_public_object_id_spec.rb +47 -0
- data/spec/objects/models/batch_response_simple_public_object_spec.rb +81 -0
- data/spec/objects/models/collection_response_simple_public_object_id_spec.rb +47 -0
- data/spec/objects/models/collection_response_simple_public_object_spec.rb +47 -0
- data/spec/objects/models/collection_response_with_total_simple_public_object_spec.rb +53 -0
- data/spec/objects/models/error_detail_spec.rb +65 -0
- data/spec/objects/models/error_spec.rb +71 -0
- data/spec/objects/models/filter_group_spec.rb +41 -0
- data/spec/objects/models/filter_spec.rb +57 -0
- data/spec/objects/models/next_page_spec.rb +47 -0
- data/spec/objects/models/paging_spec.rb +41 -0
- data/spec/objects/models/public_object_search_request_spec.rb +71 -0
- data/spec/objects/models/simple_public_object_batch_input_spec.rb +47 -0
- data/spec/objects/models/simple_public_object_id_spec.rb +41 -0
- data/spec/objects/models/simple_public_object_input_spec.rb +41 -0
- data/spec/objects/models/simple_public_object_spec.rb +77 -0
- data/spec/owners/api/default_api_spec.rb +60 -0
- data/spec/owners/api_client_spec.rb +226 -0
- data/spec/owners/configuration_spec.rb +42 -0
- data/spec/owners/models/collection_response_public_owner_spec.rb +47 -0
- data/spec/owners/models/error_detail_spec.rb +53 -0
- data/spec/owners/models/error_spec.rb +71 -0
- data/spec/owners/models/next_page_spec.rb +47 -0
- data/spec/owners/models/paging_spec.rb +41 -0
- data/spec/owners/models/public_owner_spec.rb +89 -0
- data/spec/owners/models/public_team_spec.rb +57 -0
- data/spec/pipelines/api/pipeline_stages_api_spec.rb +123 -0
- data/spec/pipelines/api/pipelines_api_spec.rb +117 -0
- data/spec/pipelines/api_client_spec.rb +226 -0
- data/spec/pipelines/configuration_spec.rb +42 -0
- data/spec/pipelines/models/collection_response_pipeline_spec.rb +47 -0
- data/spec/pipelines/models/collection_response_pipeline_stage_spec.rb +47 -0
- data/spec/pipelines/models/error_detail_spec.rb +53 -0
- data/spec/pipelines/models/error_spec.rb +71 -0
- data/spec/pipelines/models/next_page_spec.rb +47 -0
- data/spec/pipelines/models/paging_spec.rb +41 -0
- data/spec/pipelines/models/pipeline_input_spec.rb +53 -0
- data/spec/pipelines/models/pipeline_patch_input_spec.rb +53 -0
- data/spec/pipelines/models/pipeline_spec.rb +83 -0
- data/spec/pipelines/models/pipeline_stage_input_spec.rb +53 -0
- data/spec/pipelines/models/pipeline_stage_patch_input_spec.rb +59 -0
- data/spec/pipelines/models/pipeline_stage_spec.rb +83 -0
- data/spec/properties/api/batch_api_spec.rb +74 -0
- data/spec/properties/api/core_api_spec.rb +102 -0
- data/spec/properties/api/groups_api_spec.rb +100 -0
- data/spec/properties/api_client_spec.rb +226 -0
- data/spec/properties/configuration_spec.rb +42 -0
- data/spec/properties/models/batch_input_property_create_spec.rb +41 -0
- data/spec/properties/models/batch_input_property_name_spec.rb +41 -0
- data/spec/properties/models/batch_read_input_property_name_spec.rb +47 -0
- data/spec/properties/models/batch_response_property_spec.rb +81 -0
- data/spec/properties/models/collection_response_property_group_spec.rb +47 -0
- data/spec/properties/models/collection_response_property_spec.rb +47 -0
- data/spec/properties/models/error_detail_spec.rb +65 -0
- data/spec/properties/models/error_spec.rb +71 -0
- data/spec/properties/models/next_page_spec.rb +47 -0
- data/spec/properties/models/option_input_spec.rb +65 -0
- data/spec/properties/models/option_spec.rb +65 -0
- data/spec/properties/models/paging_spec.rb +41 -0
- data/spec/properties/models/property_create_spec.rb +103 -0
- data/spec/properties/models/property_group_create_spec.rb +53 -0
- data/spec/properties/models/property_group_spec.rb +59 -0
- data/spec/properties/models/property_group_update_spec.rb +47 -0
- data/spec/properties/models/property_modification_metadata_spec.rb +59 -0
- data/spec/properties/models/property_name_spec.rb +41 -0
- data/spec/properties/models/property_spec.rb +177 -0
- data/spec/properties/models/property_update_spec.rb +91 -0
- data/spec/spec_helper.rb +111 -0
- metadata +1145 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
=begin
|
2
|
+
#Tickets
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Hubspot
|
16
|
+
module Client
|
17
|
+
module Crm
|
18
|
+
module Tickets
|
19
|
+
module Api
|
20
|
+
class SearchApi
|
21
|
+
attr_accessor :api_client
|
22
|
+
|
23
|
+
def initialize(api_client = ApiClient.default)
|
24
|
+
@api_client = api_client
|
25
|
+
end
|
26
|
+
# Filter, Sort, and Search CRM Objects
|
27
|
+
# # Filter, Sort, and Search CRM Objects The CRM Search API is a powerful API that allows developers to filter, sort, and search across all ticket types, including contacts, deals, companies and tickets. Using this API, developers can more efficiently retrieve a subset of data they are looking for to better suit their business needs. Common use cases this API allows for include, but are not limited to the following: <ul> <li>Getting a list of contacts for a specific account</li> <li>Retrieving a list of all open deals</li> <li>Searching for contacts by custom properties</li> <li>& more</li> </ul> Prerequisite for using this API: To use the CRM Search API with an OAuth token, your app must request and be granted access to the contacts scope. <br /> `engagements` including `tasks`, `calls`, `emails`, and `notes` are not supported. <br /> ## Filter Use `filterGroups` in the request body to limit results to specific CRM tickets. *Example*: Find all contacts with a first name of \"Alice\" ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filterGroups\":[ { \"filters\":[ { \"propertyName\": \"firstname\", \"operator\": \"EQ\", \"value\": \"Alice\" } ] }] }' ``` When multiple `filters` are provided within a `filterGroup`, they will be combined using a logical `AND` operator. When multiple `filterGroup`s are provided, they will be combined using a logical `OR` operator. The system supports a maximum of three `filterGroups` with up to three `filters` per `filterGroup`. *Example*: Find all contacts with (a first name of \"Alice\" `AND` a last name that is not \"Smith\") OR has the property \"enum1\" ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filterGroups\":[ { \"filters\": [ { \"propertyName\": \"firstname\", \"operator\": \"EQ\", \"value\": \"Alice\" }, { \"propertyName\": \"lastname\", \"operator\": \"NEQ\", \"value\": \"Smith\" } ] }, { \"filters\": [ { \"property\": \"enum1\", \"operator\": \"HAS_PROPERTY\" } ] }] }' ``` <br /> ### Operators Supported operators include: |Operator|Description| |--|--| |`EQ`| equal to | |`NEQ`| not equal to | |`LT`| less than | |`LTE`| less than or equal to | |`GT`| greater than | |`GTE`| greater than or equal to | |`HAS_PROPERTY`| has the property | |`NOT_HAS_PROPERTY`| does not have the property | |`CONTAINS_TOKEN`| contains token, strings only | |`NOT_CONTAINS_TOKEN`| not contains token, strings only | <br /> ### Associations You can find tickets associated with a different object type by ID using the `associations.tickets` psuedo-property. Support for this is limited to `deals` and `tickets`. Supported association filters: |Object Type |Filter `propertyName` | |--|--| | `deals` | `associations.company`, `associations.contact`, `associations.ticket` | | `tickets` | `associations.company`, `associations.contact`, `associations.deal` | *Example*: Find all tickets associated with the contact using ID \"123\" ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/tickets/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filters\": [ { \"propertyName\": \"associations.contact\", \"operator\": \"EQ\", \"value\": \"123\" } ] }' ``` <br /> ## Sort Use `sorts`, which contain a property name and a direction, to sort the returned collection. *Example*: List all contacts with most recently created first ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"sorts\": [ { \"propertyName\": \"createdate\", \"direction\": \"DESCENDING\" } ] }' ``` The system supports a single sort. <br /> ## Search Perform a text search against all property values for a ticket type. By default, the results will be returned in order of object creation (oldest first) but this can be overridden using `sorts`. *Example*: Find all contacts with a property value containing the letter `x` ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"query\": \"x\" }' ``` <br /> ## Controlling returned properties Each object type is returned with a default set of properties. You can override this by providing an array of property names in the `properties` property of the request body. *Example*: Return all contacts and include their email and mailing address state ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"properties\": [ \"email\", \"state\" ] }' ``` <br /> ## Paging through results By default, the Search API returns results containing 10 tickets per page. The system supports a maximum of 100 results per page. *Example*: Get pages of size 20 ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"limit\": 20 } ``` In order to access the next page of results, you must pass the `after` parameter that was provided in the previous response in the `paging.next.after` property. If no `paging.next.after` property is provided, no additional results will be shown. Note that the after parameter is expected to be a string. *Example*: Get the next page of results ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"after\": \"20\" }' ``` <br /> ## Sample Response (Success) ``` { \"results\": [ { \"id\": \"174\", \"properties\": { \"firstname\": \"Brantley\", \"lastname\": \"Forrest\", \"email\": \"bforrest8@acme.com\" }, \"createdAt\":\"2019-10-30T03:30:17.883Z\", \"updatedAt\": \"1569516907T16:50:06.678Z\", \"archived\": false }, ... ], \"paging\": { \"next\": { \"after\": \"10\" } } } ``` <br /> ## Limitations 1. It can take a few moments between creating or updating a ticket in HubSpot and seeing it in CRM Search API results. 2. CRM tickets in an archived state will not be available in the Search API. 3. The Search API is rate limited to 1 request per second per authentication token, which is more stringent than our general rate limits. The `X-HubSpot-RateLimit-*` headers will not reflect this during the beta period. Read more about [rate limits](https://developers.hubspot.com/docs/faq/working-within-the-hubspot-api-rate-limits). <br /> ## Error Handling Read our [error documentation](https://developers.hubspot.com/docs/faq/api-error-responses).
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @option opts [PublicObjectSearchRequest] :public_object_search_request
|
30
|
+
# @return [CollectionResponseWithTotalSimplePublicObject]
|
31
|
+
def do_search(opts = {})
|
32
|
+
data, _status_code, _headers = do_search_with_http_info(opts)
|
33
|
+
data
|
34
|
+
end
|
35
|
+
|
36
|
+
# Filter, Sort, and Search CRM Objects
|
37
|
+
# # Filter, Sort, and Search CRM Objects The CRM Search API is a powerful API that allows developers to filter, sort, and search across all ticket types, including contacts, deals, companies and tickets. Using this API, developers can more efficiently retrieve a subset of data they are looking for to better suit their business needs. Common use cases this API allows for include, but are not limited to the following: <ul> <li>Getting a list of contacts for a specific account</li> <li>Retrieving a list of all open deals</li> <li>Searching for contacts by custom properties</li> <li>& more</li> </ul> Prerequisite for using this API: To use the CRM Search API with an OAuth token, your app must request and be granted access to the contacts scope. <br /> `engagements` including `tasks`, `calls`, `emails`, and `notes` are not supported. <br /> ## Filter Use `filterGroups` in the request body to limit results to specific CRM tickets. *Example*: Find all contacts with a first name of \"Alice\" ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filterGroups\":[ { \"filters\":[ { \"propertyName\": \"firstname\", \"operator\": \"EQ\", \"value\": \"Alice\" } ] }] }' ``` When multiple `filters` are provided within a `filterGroup`, they will be combined using a logical `AND` operator. When multiple `filterGroup`s are provided, they will be combined using a logical `OR` operator. The system supports a maximum of three `filterGroups` with up to three `filters` per `filterGroup`. *Example*: Find all contacts with (a first name of \"Alice\" `AND` a last name that is not \"Smith\") OR has the property \"enum1\" ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filterGroups\":[ { \"filters\": [ { \"propertyName\": \"firstname\", \"operator\": \"EQ\", \"value\": \"Alice\" }, { \"propertyName\": \"lastname\", \"operator\": \"NEQ\", \"value\": \"Smith\" } ] }, { \"filters\": [ { \"property\": \"enum1\", \"operator\": \"HAS_PROPERTY\" } ] }] }' ``` <br /> ### Operators Supported operators include: |Operator|Description| |--|--| |`EQ`| equal to | |`NEQ`| not equal to | |`LT`| less than | |`LTE`| less than or equal to | |`GT`| greater than | |`GTE`| greater than or equal to | |`HAS_PROPERTY`| has the property | |`NOT_HAS_PROPERTY`| does not have the property | |`CONTAINS_TOKEN`| contains token, strings only | |`NOT_CONTAINS_TOKEN`| not contains token, strings only | <br /> ### Associations You can find tickets associated with a different object type by ID using the `associations.tickets` psuedo-property. Support for this is limited to `deals` and `tickets`. Supported association filters: |Object Type |Filter `propertyName` | |--|--| | `deals` | `associations.company`, `associations.contact`, `associations.ticket` | | `tickets` | `associations.company`, `associations.contact`, `associations.deal` | *Example*: Find all tickets associated with the contact using ID \"123\" ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/tickets/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filters\": [ { \"propertyName\": \"associations.contact\", \"operator\": \"EQ\", \"value\": \"123\" } ] }' ``` <br /> ## Sort Use `sorts`, which contain a property name and a direction, to sort the returned collection. *Example*: List all contacts with most recently created first ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"sorts\": [ { \"propertyName\": \"createdate\", \"direction\": \"DESCENDING\" } ] }' ``` The system supports a single sort. <br /> ## Search Perform a text search against all property values for a ticket type. By default, the results will be returned in order of object creation (oldest first) but this can be overridden using `sorts`. *Example*: Find all contacts with a property value containing the letter `x` ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"query\": \"x\" }' ``` <br /> ## Controlling returned properties Each object type is returned with a default set of properties. You can override this by providing an array of property names in the `properties` property of the request body. *Example*: Return all contacts and include their email and mailing address state ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"properties\": [ \"email\", \"state\" ] }' ``` <br /> ## Paging through results By default, the Search API returns results containing 10 tickets per page. The system supports a maximum of 100 results per page. *Example*: Get pages of size 20 ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"limit\": 20 } ``` In order to access the next page of results, you must pass the `after` parameter that was provided in the previous response in the `paging.next.after` property. If no `paging.next.after` property is provided, no additional results will be shown. Note that the after parameter is expected to be a string. *Example*: Get the next page of results ``` curl --request POST https://api.hubapi.com/crm/v3/tickets/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"after\": \"20\" }' ``` <br /> ## Sample Response (Success) ``` { \"results\": [ { \"id\": \"174\", \"properties\": { \"firstname\": \"Brantley\", \"lastname\": \"Forrest\", \"email\": \"bforrest8@acme.com\" }, \"createdAt\":\"2019-10-30T03:30:17.883Z\", \"updatedAt\": \"1569516907T16:50:06.678Z\", \"archived\": false }, ... ], \"paging\": { \"next\": { \"after\": \"10\" } } } ``` <br /> ## Limitations 1. It can take a few moments between creating or updating a ticket in HubSpot and seeing it in CRM Search API results. 2. CRM tickets in an archived state will not be available in the Search API. 3. The Search API is rate limited to 1 request per second per authentication token, which is more stringent than our general rate limits. The `X-HubSpot-RateLimit-*` headers will not reflect this during the beta period. Read more about [rate limits](https://developers.hubspot.com/docs/faq/working-within-the-hubspot-api-rate-limits). <br /> ## Error Handling Read our [error documentation](https://developers.hubspot.com/docs/faq/api-error-responses).
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [PublicObjectSearchRequest] :public_object_search_request
|
40
|
+
# @return [Array<(CollectionResponseWithTotalSimplePublicObject, Integer, Hash)>] CollectionResponseWithTotalSimplePublicObject data, response status code and response headers
|
41
|
+
def do_search_with_http_info(opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: SearchApi.do_search ...'
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/tickets/search'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = opts[:form_params] || {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'public_object_search_request'])
|
63
|
+
|
64
|
+
# return_type
|
65
|
+
return_type = opts[:return_type] || 'CollectionResponseWithTotalSimplePublicObject'
|
66
|
+
|
67
|
+
# auth_names
|
68
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
69
|
+
|
70
|
+
new_options = opts.merge(
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: SearchApi#do_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,423 @@
|
|
1
|
+
=begin
|
2
|
+
#Tickets
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'json'
|
15
|
+
require 'logger'
|
16
|
+
require 'tempfile'
|
17
|
+
require 'faraday'
|
18
|
+
|
19
|
+
module Hubspot
|
20
|
+
module Client
|
21
|
+
module Crm
|
22
|
+
module Tickets
|
23
|
+
class ApiClient
|
24
|
+
# The Configuration object holding settings to be used in the API client.
|
25
|
+
attr_accessor :config
|
26
|
+
|
27
|
+
# Defines the headers to be used in HTTP requests of all API calls by default.
|
28
|
+
#
|
29
|
+
# @return [Hash]
|
30
|
+
attr_accessor :default_headers
|
31
|
+
|
32
|
+
# Initializes the ApiClient
|
33
|
+
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
34
|
+
def initialize(config = Configuration.default)
|
35
|
+
@config = config
|
36
|
+
@user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
|
37
|
+
@default_headers = {
|
38
|
+
'Content-Type' => 'application/json',
|
39
|
+
'User-Agent' => @user_agent
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.default
|
44
|
+
@@default ||= ApiClient.new
|
45
|
+
end
|
46
|
+
|
47
|
+
# Call an API with given options.
|
48
|
+
#
|
49
|
+
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
50
|
+
# the data deserialized from response body (could be nil), response status code and response headers.
|
51
|
+
def call_api(http_method, path, opts = {})
|
52
|
+
ssl_options = {
|
53
|
+
:ca_file => @config.ssl_ca_file,
|
54
|
+
:verify => @config.ssl_verify,
|
55
|
+
:verify_mode => @config.ssl_verify_mode,
|
56
|
+
:client_cert => @config.ssl_client_cert,
|
57
|
+
:client_key => @config.ssl_client_key
|
58
|
+
}
|
59
|
+
|
60
|
+
connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
|
61
|
+
conn.basic_auth(config.username, config.password)
|
62
|
+
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
63
|
+
conn.request :multipart
|
64
|
+
conn.request :url_encoded
|
65
|
+
end
|
66
|
+
conn.adapter(Faraday.default_adapter)
|
67
|
+
|
68
|
+
# Errors handler settings
|
69
|
+
if !config.error_handler.empty?
|
70
|
+
config.error_handler.each do |statuses, opts|
|
71
|
+
statuses = statuses.is_a?(Integer) ? [statuses] : statuses
|
72
|
+
retry_options = {
|
73
|
+
max: opts[:max_retries],
|
74
|
+
interval: opts[:seconds_delay],
|
75
|
+
retry_statuses: statuses,
|
76
|
+
methods: %i[post delete get head options put],
|
77
|
+
retry_block: -> (env, options, retries, exc) { opts[:retry_block].call }
|
78
|
+
}
|
79
|
+
conn.request :retry, retry_options
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
begin
|
85
|
+
response = connection.public_send(http_method.to_sym.downcase) do |req|
|
86
|
+
build_request(http_method, path, req, opts)
|
87
|
+
end
|
88
|
+
|
89
|
+
if @config.debugging
|
90
|
+
@config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
|
91
|
+
end
|
92
|
+
|
93
|
+
unless response.success?
|
94
|
+
if response.status == 0
|
95
|
+
# Errors from libcurl will be made visible here
|
96
|
+
fail ApiError.new(:code => 0,
|
97
|
+
:message => response.return_message)
|
98
|
+
else
|
99
|
+
fail ApiError.new(:code => response.status,
|
100
|
+
:response_headers => response.headers,
|
101
|
+
:response_body => response.body),
|
102
|
+
response.reason_phrase
|
103
|
+
end
|
104
|
+
end
|
105
|
+
rescue Faraday::TimeoutError
|
106
|
+
fail ApiError.new('Connection timed out')
|
107
|
+
end
|
108
|
+
|
109
|
+
if opts[:return_type]
|
110
|
+
data = deserialize(response, opts[:return_type])
|
111
|
+
else
|
112
|
+
data = nil
|
113
|
+
end
|
114
|
+
return data, response.status, response.headers
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the HTTP request
|
118
|
+
#
|
119
|
+
# @param [String] http_method HTTP method/verb (e.g. POST)
|
120
|
+
# @param [String] path URL path (e.g. /account/new)
|
121
|
+
# @option opts [Hash] :header_params Header parameters
|
122
|
+
# @option opts [Hash] :query_params Query parameters
|
123
|
+
# @option opts [Hash] :form_params Query parameters
|
124
|
+
# @option opts [Object] :body HTTP body (JSON/XML)
|
125
|
+
# @return [Typhoeus::Request] A Typhoeus Request
|
126
|
+
def build_request(http_method, path, request, opts = {})
|
127
|
+
url = build_request_url(path)
|
128
|
+
http_method = http_method.to_sym.downcase
|
129
|
+
|
130
|
+
header_params = @default_headers.merge(opts[:header_params] || {})
|
131
|
+
query_params = opts[:query_params] || {}
|
132
|
+
form_params = opts[:form_params] || {}
|
133
|
+
|
134
|
+
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
135
|
+
|
136
|
+
req_opts = {
|
137
|
+
:method => http_method,
|
138
|
+
:headers => header_params,
|
139
|
+
:params => query_params,
|
140
|
+
:params_encoding => @config.params_encoding,
|
141
|
+
:timeout => @config.timeout,
|
142
|
+
:verbose => @config.debugging
|
143
|
+
}
|
144
|
+
|
145
|
+
if [:post, :patch, :put, :delete].include?(http_method)
|
146
|
+
req_body = build_request_body(header_params, form_params, opts[:body])
|
147
|
+
req_opts.update :body => req_body
|
148
|
+
if @config.debugging
|
149
|
+
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
|
150
|
+
end
|
151
|
+
end
|
152
|
+
request.headers = header_params
|
153
|
+
request.body = req_body
|
154
|
+
request.url url
|
155
|
+
request.params = query_params
|
156
|
+
download_file(request) if opts[:return_type] == 'File'
|
157
|
+
request
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the HTTP request body
|
161
|
+
#
|
162
|
+
# @param [Hash] header_params Header parameters
|
163
|
+
# @param [Hash] form_params Query parameters
|
164
|
+
# @param [Object] body HTTP body (JSON/XML)
|
165
|
+
# @return [String] HTTP body data in the form of string
|
166
|
+
def build_request_body(header_params, form_params, body)
|
167
|
+
# http form
|
168
|
+
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
|
169
|
+
data = URI.encode_www_form(form_params)
|
170
|
+
elsif header_params['Content-Type'] == 'multipart/form-data'
|
171
|
+
data = {}
|
172
|
+
form_params.each do |key, value|
|
173
|
+
case value
|
174
|
+
when ::File, ::Tempfile
|
175
|
+
# TODO hardcode to application/octet-stream, need better way to detect content type
|
176
|
+
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
177
|
+
when ::Array, nil
|
178
|
+
# let Faraday handle Array and nil parameters
|
179
|
+
data[key] = value
|
180
|
+
else
|
181
|
+
data[key] = value.to_s
|
182
|
+
end
|
183
|
+
end
|
184
|
+
elsif body
|
185
|
+
data = body.is_a?(String) ? body : body.to_json
|
186
|
+
else
|
187
|
+
data = nil
|
188
|
+
end
|
189
|
+
data
|
190
|
+
end
|
191
|
+
|
192
|
+
# Check if the given MIME is a JSON MIME.
|
193
|
+
# JSON MIME examples:
|
194
|
+
# application/json
|
195
|
+
# application/json; charset=UTF8
|
196
|
+
# APPLICATION/JSON
|
197
|
+
# */*
|
198
|
+
# @param [String] mime MIME
|
199
|
+
# @return [Boolean] True if the MIME is application/json
|
200
|
+
def json_mime?(mime)
|
201
|
+
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
202
|
+
end
|
203
|
+
|
204
|
+
# Deserialize the response to the given return type.
|
205
|
+
#
|
206
|
+
# @param [Response] response HTTP response
|
207
|
+
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
208
|
+
def deserialize(response, return_type)
|
209
|
+
body = response.body
|
210
|
+
|
211
|
+
# handle file downloading - return the File instance processed in request callbacks
|
212
|
+
# note that response body is empty when the file is written in chunks in request on_body callback
|
213
|
+
return @tempfile if return_type == 'File'
|
214
|
+
|
215
|
+
return nil if body.nil? || body.empty?
|
216
|
+
|
217
|
+
# return response body directly for String return type
|
218
|
+
return body if return_type == 'String'
|
219
|
+
|
220
|
+
# ensuring a default content type
|
221
|
+
content_type = response.headers['Content-Type'] || 'application/json'
|
222
|
+
|
223
|
+
fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
|
224
|
+
|
225
|
+
begin
|
226
|
+
data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
|
227
|
+
rescue JSON::ParserError => e
|
228
|
+
if %w(String Date DateTime).include?(return_type)
|
229
|
+
data = body
|
230
|
+
else
|
231
|
+
raise e
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
convert_to_type data, return_type
|
236
|
+
end
|
237
|
+
|
238
|
+
# Convert data to the given return type.
|
239
|
+
# @param [Object] data Data to be converted
|
240
|
+
# @param [String] return_type Return type
|
241
|
+
# @return [Mixed] Data in a particular type
|
242
|
+
def convert_to_type(data, return_type)
|
243
|
+
return nil if data.nil?
|
244
|
+
case return_type
|
245
|
+
when 'String'
|
246
|
+
data.to_s
|
247
|
+
when 'Integer'
|
248
|
+
data.to_i
|
249
|
+
when 'Float'
|
250
|
+
data.to_f
|
251
|
+
when 'Boolean'
|
252
|
+
data == true
|
253
|
+
when 'DateTime'
|
254
|
+
# parse date time (expecting ISO 8601 format)
|
255
|
+
DateTime.parse data
|
256
|
+
when 'Date'
|
257
|
+
# parse date time (expecting ISO 8601 format)
|
258
|
+
Date.parse data
|
259
|
+
when 'Object'
|
260
|
+
# generic object (usually a Hash), return directly
|
261
|
+
data
|
262
|
+
when /\AArray<(.+)>\z/
|
263
|
+
# e.g. Array<Pet>
|
264
|
+
sub_type = $1
|
265
|
+
data.map { |item| convert_to_type(item, sub_type) }
|
266
|
+
when /\AHash\<String, (.+)\>\z/
|
267
|
+
# e.g. Hash<String, Integer>
|
268
|
+
sub_type = $1
|
269
|
+
{}.tap do |hash|
|
270
|
+
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
271
|
+
end
|
272
|
+
else
|
273
|
+
# models, e.g. Pet
|
274
|
+
Hubspot::Client::Crm::Tickets::Models.const_get(return_type).build_from_hash(data)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
# Save response body into a file in (the defined) temporary folder, using the filename
|
279
|
+
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
280
|
+
# The response body is written to the file in chunks in order to handle files which
|
281
|
+
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
282
|
+
# process can use.
|
283
|
+
#
|
284
|
+
# @see Configuration#temp_folder_path
|
285
|
+
def download_file(request)
|
286
|
+
tempfile = nil
|
287
|
+
encoding = nil
|
288
|
+
request.on_headers do |response|
|
289
|
+
content_disposition = response.headers['Content-Disposition']
|
290
|
+
if content_disposition && content_disposition =~ /filename=/i
|
291
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
292
|
+
prefix = sanitize_filename(filename)
|
293
|
+
else
|
294
|
+
prefix = 'download-'
|
295
|
+
end
|
296
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
297
|
+
encoding = response.body.encoding
|
298
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
299
|
+
@tempfile = tempfile
|
300
|
+
end
|
301
|
+
request.on_body do |chunk|
|
302
|
+
chunk.force_encoding(encoding)
|
303
|
+
tempfile.write(chunk)
|
304
|
+
end
|
305
|
+
request.on_complete do |response|
|
306
|
+
tempfile.close if tempfile
|
307
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
308
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
309
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
310
|
+
"explicitly with `tempfile.delete`"
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
# Sanitize filename by removing path.
|
315
|
+
# e.g. ../../sun.gif becomes sun.gif
|
316
|
+
#
|
317
|
+
# @param [String] filename the filename to be sanitized
|
318
|
+
# @return [String] the sanitized filename
|
319
|
+
def sanitize_filename(filename)
|
320
|
+
filename.gsub(/.*[\/\\]/, '')
|
321
|
+
end
|
322
|
+
|
323
|
+
def build_request_url(path)
|
324
|
+
# Add leading and trailing slashes to path
|
325
|
+
path = "/#{path}".gsub(/\/+/, '/')
|
326
|
+
@config.base_url + path
|
327
|
+
end
|
328
|
+
|
329
|
+
# Update hearder and query params based on authentication settings.
|
330
|
+
#
|
331
|
+
# @param [Hash] header_params Header parameters
|
332
|
+
# @param [Hash] query_params Query parameters
|
333
|
+
# @param [String] auth_names Authentication scheme name
|
334
|
+
def update_params_for_auth!(header_params, query_params, auth_names)
|
335
|
+
Array(auth_names).each do |auth_name|
|
336
|
+
auth_setting = @config.auth_settings[auth_name]
|
337
|
+
next unless auth_setting
|
338
|
+
case auth_setting[:in]
|
339
|
+
when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
|
340
|
+
when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
|
341
|
+
else fail ArgumentError, 'Authentication token must be in `query` of `header`'
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
# Sets user agent in HTTP header
|
347
|
+
#
|
348
|
+
# @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
|
349
|
+
def user_agent=(user_agent)
|
350
|
+
@user_agent = user_agent
|
351
|
+
@default_headers['User-Agent'] = @user_agent
|
352
|
+
end
|
353
|
+
|
354
|
+
# Return Accept header based on an array of accepts provided.
|
355
|
+
# @param [Array] accepts array for Accept
|
356
|
+
# @return [String] the Accept header (e.g. application/json)
|
357
|
+
def select_header_accept(accepts)
|
358
|
+
return nil if accepts.nil? || accepts.empty?
|
359
|
+
# use JSON when present, otherwise use all of the provided
|
360
|
+
json_accept = accepts.find { |s| json_mime?(s) }
|
361
|
+
json_accept || accepts.join(',')
|
362
|
+
end
|
363
|
+
|
364
|
+
# Return Content-Type header based on an array of content types provided.
|
365
|
+
# @param [Array] content_types array for Content-Type
|
366
|
+
# @return [String] the Content-Type header (e.g. application/json)
|
367
|
+
def select_header_content_type(content_types)
|
368
|
+
# use application/json by default
|
369
|
+
return 'application/json' if content_types.nil? || content_types.empty?
|
370
|
+
# use JSON when present, otherwise use the first one
|
371
|
+
json_content_type = content_types.find { |s| json_mime?(s) }
|
372
|
+
json_content_type || content_types.first
|
373
|
+
end
|
374
|
+
|
375
|
+
# Convert object (array, hash, object, etc) to JSON string.
|
376
|
+
# @param [Object] model object to be converted into JSON string
|
377
|
+
# @return [String] JSON string representation of the object
|
378
|
+
def object_to_http_body(model)
|
379
|
+
return model if model.nil? || model.is_a?(String)
|
380
|
+
local_body = nil
|
381
|
+
if model.is_a?(Array)
|
382
|
+
local_body = model.map { |m| object_to_hash(m) }
|
383
|
+
else
|
384
|
+
local_body = object_to_hash(model)
|
385
|
+
end
|
386
|
+
local_body.to_json
|
387
|
+
end
|
388
|
+
|
389
|
+
# Convert object(non-array) to hash.
|
390
|
+
# @param [Object] obj object to be converted into JSON string
|
391
|
+
# @return [String] JSON string representation of the object
|
392
|
+
def object_to_hash(obj)
|
393
|
+
if obj.respond_to?(:to_hash)
|
394
|
+
obj.to_hash
|
395
|
+
else
|
396
|
+
obj
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
# Build parameter value according to the given collection format.
|
401
|
+
# @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
|
402
|
+
def build_collection_param(param, collection_format)
|
403
|
+
case collection_format
|
404
|
+
when :csv
|
405
|
+
param.join(',')
|
406
|
+
when :ssv
|
407
|
+
param.join(' ')
|
408
|
+
when :tsv
|
409
|
+
param.join("\t")
|
410
|
+
when :pipes
|
411
|
+
param.join('|')
|
412
|
+
when :multi
|
413
|
+
# return the array directly as typhoeus will handle it as expected
|
414
|
+
param
|
415
|
+
else
|
416
|
+
fail "unknown collection format: #{collection_format.inspect}"
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|