-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into use_crm_associations_endpoints
- Loading branch information
Showing
23 changed files
with
3,503 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'hubspot/utils' | ||
|
||
module Hubspot | ||
# | ||
# HubSpot Events HTTP API | ||
# | ||
# {https://developers.hubspot.com/docs/methods/enterprise_events/http_api} | ||
# | ||
class Event | ||
POST_EVENT_PATH = '/v1/event' | ||
|
||
class << self | ||
def trigger(event_id, email, options = {}) | ||
default_params = { _n: event_id, _a: Hubspot::Config.portal_id, email: email } | ||
options[:params] = default_params.merge(options[:params] || {}) | ||
|
||
Hubspot::EventConnection.trigger(POST_EVENT_PATH, options).success? | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'hubspot/utils' | ||
require 'base64' | ||
require 'pp' | ||
|
||
module Hubspot | ||
# | ||
# HubSpot Files API | ||
# | ||
# {https://developers.hubspot.com/docs/methods/files/post_files} | ||
# | ||
class File | ||
GET_FILE_PATH = "/filemanager/api/v2/files/:file_id" | ||
DELETE_FILE_PATH = "/filemanager/api/v2/files/:file_id/full-delete" | ||
LIST_FILE_PATH = "/filemanager/api/v2/files" | ||
|
||
attr_reader :id | ||
attr_reader :properties | ||
|
||
def initialize(response_hash) | ||
@id = response_hash["id"] | ||
@properties = response_hash | ||
end | ||
|
||
class << self | ||
def find_by_id(file_id) | ||
response = Hubspot::Connection.get_json(GET_FILE_PATH, { file_id: file_id }) | ||
new(response) | ||
end | ||
end | ||
|
||
# Permanently delete a file and all related data and thumbnails from file manager. | ||
# {https://developers.hubspot.com/docs/methods/files/hard_delete_file_and_associated_objects} | ||
def destroy! | ||
Hubspot::Connection.post_json(DELETE_FILE_PATH, params: {file_id: id}) | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.