Class: HubSpotSDK::Resources::Marketing::MarketingEvents::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/marketing/marketing_events/events.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Events

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Events.

Parameters:



67
68
69
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/events.rb', line 67

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel_by_external_event_id(external_event_id, external_account_id:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventDefaultResponse

Mark a marketing event as cancelled.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/events.rb', line 19

def cancel_by_external_event_id(external_event_id, params)
  parsed, options =
    HubSpotSDK::Marketing::MarketingEvents::EventCancelByExternalEventIDParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :post,
    path: ["marketing/marketing-events/2026-03/events/%1$s/cancel", external_event_id],
    query: query.transform_keys(external_account_id: "externalAccountId"),
    model: HubSpotSDK::Marketing::MarketingEventDefaultResponse,
    options: options
  )
end

#complete_by_external_event_id(external_event_id, external_account_id:, end_date_time:, start_date_time:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventDefaultResponse

Mark a marketing event as completed

Parameters:

  • external_event_id (String)

    Path param

  • external_account_id (String)

    Query param

  • end_date_time (Time)

    Body param: The end date and time of the marketing event in ISO 8601 format

  • start_date_time (Time)

    Body param: The start date and time of the marketing event in ISO 8601 format

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/events.rb', line 49

def complete_by_external_event_id(external_event_id, params)
  query_params = [:external_account_id]
  parsed, options =
    HubSpotSDK::Marketing::MarketingEvents::EventCompleteByExternalEventIDParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :post,
    path: ["marketing/marketing-events/2026-03/events/%1$s/complete", external_event_id],
    query: query.transform_keys(external_account_id: "externalAccountId"),
    body: parsed.except(*query_params),
    model: HubSpotSDK::Marketing::MarketingEventDefaultResponse,
    options: options
  )
end