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,26 @@
|
|
1
|
+
module Services
|
2
|
+
module Authorization
|
3
|
+
module Tokens
|
4
|
+
class Generate < Tokens::Base
|
5
|
+
def initialize(code:, request:)
|
6
|
+
@code = code
|
7
|
+
@request = request
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
tokens_api = ::Hubspot::Client::OAuth::Api::TokensApi.new
|
12
|
+
tokens = tokens_api.post_oauth_v1_token(
|
13
|
+
grant_type: :authorization_code,
|
14
|
+
code: @code,
|
15
|
+
redirect_uri: redirect_uri,
|
16
|
+
client_id: ENV['HUBSPOT_CLIENT_ID'],
|
17
|
+
client_secret: ENV['HUBSPOT_CLIENT_SECRET'],
|
18
|
+
return_type: 'Object'
|
19
|
+
)
|
20
|
+
tokens[:expires_at] = expires_at(tokens[:expires_in])
|
21
|
+
tokens
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Services
|
2
|
+
module Authorization
|
3
|
+
module Tokens
|
4
|
+
class Refresh < Tokens::Base
|
5
|
+
def initialize(tokens:, request:)
|
6
|
+
@tokens = tokens
|
7
|
+
@request = request
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
@tokens = refresh_tokens if Time.current > @tokens[:expires_at]
|
12
|
+
@tokens
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def refresh_tokens
|
18
|
+
tokens_api = ::Hubspot::Client::OAuth::Api::TokensApi.new
|
19
|
+
tokens = tokens_api.post_oauth_v1_token(
|
20
|
+
grant_type: :refresh_token,
|
21
|
+
refresh_token: @tokens[:refresh_token],
|
22
|
+
redirect_uri: redirect_uri,
|
23
|
+
client_id: ENV['HUBSPOT_CLIENT_ID'],
|
24
|
+
client_secret: ENV['HUBSPOT_CLIENT_SECRET'],
|
25
|
+
return_type: 'Object'
|
26
|
+
)
|
27
|
+
tokens[:expires_at] = expires_at(tokens[:expires_in])
|
28
|
+
tokens
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class Create
|
5
|
+
def initialize(properties)
|
6
|
+
@properties = properties
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
create_api = ::Hubspot::Client::Crm::Contacts::Api::BasicApi.new
|
11
|
+
create_api.create(body: contact_input, auth_names: 'oauth2')
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def contact_input
|
17
|
+
@contact_input ||= ::Hubspot::Client::Crm::Objects::Models::SimplePublicObjectInput.new(properties: @properties)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class Destroy
|
5
|
+
def initialize(id)
|
6
|
+
@id = id
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
basic_api = ::Hubspot::Client::Crm::Objects::Api::BasicApi.new
|
11
|
+
basic_api.archive('contact', @id, auth_names: 'oauth2')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class Export
|
5
|
+
PROPERTIES_TO_EXPORT = %w[email firstname lastname].freeze
|
6
|
+
|
7
|
+
def initialize(max_pages: 10)
|
8
|
+
@max_pages = max_pages
|
9
|
+
end
|
10
|
+
|
11
|
+
def call
|
12
|
+
convert_to_csv(contacts)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def contacts
|
18
|
+
return @contacts if @contacts.present?
|
19
|
+
|
20
|
+
after = nil
|
21
|
+
@contacts = @max_pages.times.each_with_object([]) do |_, contacts|
|
22
|
+
params = { auth_names: 'oauth2', limit: 10, after: after }
|
23
|
+
contacts_page = basic_api.get_page('contact', params)
|
24
|
+
contacts.concat(contacts_page.results)
|
25
|
+
break contacts unless contacts_page.paging.present?
|
26
|
+
|
27
|
+
after = contacts_page.paging._next.after
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def basic_api
|
32
|
+
@basic_api ||= ::Hubspot::Client::Crm::Objects::Api::BasicApi.new
|
33
|
+
end
|
34
|
+
|
35
|
+
def convert_to_csv(contacts, properties: PROPERTIES_TO_EXPORT)
|
36
|
+
CSV.generate(headers: true) do |csv|
|
37
|
+
csv << [:id, *properties]
|
38
|
+
|
39
|
+
contacts.each do |contact|
|
40
|
+
csv << [contact.id, *properties.map { |property| contact.properties[property] }]
|
41
|
+
end
|
42
|
+
csv
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class GetAll
|
5
|
+
def initialize(limit: 10)
|
6
|
+
@limit = limit
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
basic_api = ::Hubspot::Client::Crm::Objects::Api::BasicApi.new
|
11
|
+
results = basic_api.get_page('contact', auth_names: 'oauth2', limit: @limit).results
|
12
|
+
results = add_fullnames(results)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def add_fullnames(contacts)
|
18
|
+
contacts.each do |contact|
|
19
|
+
fullname = [contact.properties['firstname'], contact.properties['lastname']].reject(&:empty?).join(' ')
|
20
|
+
contact.properties['fullname'] = fullname
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class GetById
|
5
|
+
def initialize(id)
|
6
|
+
@id = id
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
basic_api = ::Hubspot::Client::Crm::Objects::Api::BasicApi.new
|
11
|
+
basic_api.get_by_id(
|
12
|
+
'contact', @id,
|
13
|
+
auth_names: 'oauth2',
|
14
|
+
properties: properties_to_display
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def properties_to_display
|
21
|
+
properties = Services::Hubspot::Properties::GetAll.new.call
|
22
|
+
properties.filter! { |p| p.type == 'string' && !p.modification_metadata.read_only_value }
|
23
|
+
properties.map(&:name) + %w[hubspot_owner_id]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class Search
|
5
|
+
def initialize(email:)
|
6
|
+
@email = email
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
search_api = ::Hubspot::Client::Crm::Contacts::Api::SearchApi.new
|
11
|
+
results = search_api.do_search(body: search_request, auth_names: 'oauth2').results
|
12
|
+
results = add_fullnames(results)
|
13
|
+
results
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def search_request
|
19
|
+
filter = ::Hubspot::Client::Crm::Contacts::Models::Filter.new(
|
20
|
+
property_name: 'email',
|
21
|
+
operator: 'EQ',
|
22
|
+
value: @email
|
23
|
+
)
|
24
|
+
filter_group = ::Hubspot::Client::Crm::Contacts::Models::FilterGroup.new(filters: [filter])
|
25
|
+
::Hubspot::Client::Crm::Contacts::Models::PublicObjectSearchRequest.new(filter_groups: [filter_group])
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_fullnames(contacts)
|
29
|
+
contacts.each do |contact|
|
30
|
+
fullname = [contact.properties['firstname'], contact.properties['lastname']].reject(&:empty?).join(' ')
|
31
|
+
contact.properties['fullname'] = fullname
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Contacts
|
4
|
+
class Update
|
5
|
+
def initialize(id, properties)
|
6
|
+
@id = id
|
7
|
+
@properties = properties
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
basic_api = ::Hubspot::Client::Crm::Contacts::Api::BasicApi.new
|
12
|
+
params = { auth_names: 'oauth2', body: contact_input }
|
13
|
+
basic_api.update(@id, params)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def contact_input
|
19
|
+
@contact_input ||= ::Hubspot::Client::Crm::Objects::Models::SimplePublicObjectInput.new(properties: @properties)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Properties
|
4
|
+
class Create
|
5
|
+
def initialize(params)
|
6
|
+
@params = params
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
core_api = ::Hubspot::Client::Crm::Properties::Api::CoreApi.new
|
11
|
+
params = { auth_names: 'oauth2', body: property_create }
|
12
|
+
core_api.create('contact',params)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def property_create
|
18
|
+
@property_create ||= ::Hubspot::Client::Crm::Properties::Models::PropertyCreate.new(@params)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Properties
|
4
|
+
class Destroy
|
5
|
+
def initialize(name)
|
6
|
+
@name = name
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
core_api = ::Hubspot::Client::Crm::Properties::Api::CoreApi.new
|
11
|
+
core_api.archive('contact', @name, auth_names: 'oauth2')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Properties
|
4
|
+
class GetByName
|
5
|
+
def initialize(name)
|
6
|
+
@name = name
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
core_api = ::Hubspot::Client::Crm::Properties::Api::CoreApi.new
|
11
|
+
core_api.get_by_name(
|
12
|
+
'contacts',
|
13
|
+
@name,
|
14
|
+
auth_names: 'oauth2'
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Services
|
2
|
+
module Hubspot
|
3
|
+
module Properties
|
4
|
+
class Update
|
5
|
+
def initialize(name, params)
|
6
|
+
@name = name
|
7
|
+
@params = params
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
core_api = ::Hubspot::Client::Crm::Properties::Api::CoreApi.new
|
12
|
+
params = { auth_names: 'oauth2', body: property_update }
|
13
|
+
core_api.update('contact', @name, params)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def property_update
|
19
|
+
@params.filter! do |(key, value)|
|
20
|
+
::Hubspot::Client::Crm::Properties::Models::PropertyUpdate.attribute_map.keys.include?(key.to_sym)
|
21
|
+
end
|
22
|
+
@property_update ||= ::Hubspot::Client::Crm::Properties::Models::PropertyUpdate.new(@params)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<div class="container">
|
2
|
+
<% if @error.present? %>
|
3
|
+
<h3><%= @error.message %></h3>
|
4
|
+
<% else %>
|
5
|
+
<div class='contact-new-button'>
|
6
|
+
<pre>
|
7
|
+
<p>Create contact</p>
|
8
|
+
<p># app/lib/services/hubspot/contacts/create.rb</p>
|
9
|
+
|
10
|
+
<p>Export to CSV</p>
|
11
|
+
<p># app/lib/services/hubspot/contacts/export.rb</p>
|
12
|
+
</pre>
|
13
|
+
<%= link_to('New Contact', new_contact_path, class: 'button', id: 'new-contact') %>
|
14
|
+
<%= link_to('Export To CSV', export_contacts_path(format: :csv), class: 'button', id: 'export') %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<%= form_tag('/contacts', method: :get, class: 'contacts') do %>
|
18
|
+
<%= text_field_tag(:search, @search_q, placeholder: 'Search by email..', id: 'search') %>
|
19
|
+
<% end %>
|
20
|
+
<pre>
|
21
|
+
<p>Search</p>
|
22
|
+
<p># app/lib/services/hubspot/contacts/search.rb</p>
|
23
|
+
</pre>
|
24
|
+
|
25
|
+
<% if flash[:notice] %>
|
26
|
+
<div class="notice"><%= flash[:notice] %></div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<table class="contacts">
|
30
|
+
<thead>
|
31
|
+
<tr>
|
32
|
+
<th>ID</th>
|
33
|
+
<th>Email</th>
|
34
|
+
<th>Name</th>
|
35
|
+
<th></th>
|
36
|
+
</tr>
|
37
|
+
</thead>
|
38
|
+
<tbody>
|
39
|
+
<% @contacts.each do |contact| %>
|
40
|
+
<tr class="contact">
|
41
|
+
<td>
|
42
|
+
<a href="/contacts/<%= contact.id %>">
|
43
|
+
<div class="contact-info contact-id">
|
44
|
+
<%= contact.id %>
|
45
|
+
</div>
|
46
|
+
</a>
|
47
|
+
</td>
|
48
|
+
<td>
|
49
|
+
<a href="/contacts/<%= contact.id %>">
|
50
|
+
<div class="contact-info contact-email">
|
51
|
+
<%= contact.properties['email'] %>
|
52
|
+
</div>
|
53
|
+
</a>
|
54
|
+
</td>
|
55
|
+
<td>
|
56
|
+
<a href="/contacts/<%= contact.id %>">
|
57
|
+
<div class="contact-info contact-fullname">
|
58
|
+
<%= contact.properties['fullname'].present? ? contact.properties['fullname'] : contact.properties['email'] %>
|
59
|
+
</div>
|
60
|
+
</a>
|
61
|
+
</td>
|
62
|
+
<td>
|
63
|
+
<%= button_to "delete",
|
64
|
+
{ controller: :contacts, action: :destroy, id: contact.id },
|
65
|
+
method: :delete,
|
66
|
+
form_class: 'delete-button'
|
67
|
+
%>
|
68
|
+
</td>
|
69
|
+
</tr>
|
70
|
+
<% end %>
|
71
|
+
</tbody>
|
72
|
+
</table>
|
73
|
+
<% end %>
|
74
|
+
<pre>
|
75
|
+
<p>Delete</p>
|
76
|
+
<p># app/lib/services/hubspot/contacts/destroy.rb</p>
|
77
|
+
</pre>
|
78
|
+
</div>
|