Class: HubSpotSDK::Resources::WebhooksJournal::Subscriptions::Filters

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Filters

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 Filters.

Parameters:



113
114
115
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb', line 113

def initialize(client:)
  @client = client
end

Instance Method Details

#create(filter:, subscription_id:, request_options: {}) ⇒ HubSpotSDK::Models::FilterCreateResponse

Some parameter documentations has been truncated, see Models::WebhooksJournal::Subscriptions::FilterCreateParams for more details.

Create a new filter for a specific webhook subscription in the HubSpot account. This endpoint allows you to define conditions that determine when a webhook should be triggered. The filter is associated with a subscription identified by its ID, and the request must include the filter details.

Parameters:

  • filter (HubSpotSDK::Models::Filter)

    Defines a single condition for searching CRM objects, specifying the property to

  • subscription_id (Integer)

    The unique identifier of the subscription to which the filter will be applied. I

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb', line 28

def create(params)
  parsed, options = HubSpotSDK::WebhooksJournal::Subscriptions::FilterCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "webhooks-journal/subscriptions/2026-03/filters",
    body: parsed,
    model: HubSpotSDK::FilterCreateResponse,
    options: options
  )
end

#delete(filter_id, request_options: {}) ⇒ nil

Remove a specific filter from the webhooks journal subscriptions. This operation is useful for managing and cleaning up filters that are no longer needed. Once deleted, the filter cannot be recovered.

Parameters:

  • filter_id (Integer)

    The unique identifier of the filter to delete.

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

Returns:

  • (nil)

See Also:



78
79
80
81
82
83
84
85
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb', line 78

def delete(filter_id, params = {})
  @client.request(
    method: :delete,
    path: ["webhooks-journal/subscriptions/2026-03/filters/%1$s", filter_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#get(filter_id, request_options: {}) ⇒ HubSpotSDK::Models::FilterResponse

Retrieve a specific filter associated with a webhook journal subscription. This endpoint allows you to access the details of the filter identified by the filterId, which is useful for managing and understanding the conditions applied to webhook events.

Parameters:

  • filter_id (Integer)

    The unique identifier of the filter to retrieve. It is an integer value.

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

Returns:

See Also:



101
102
103
104
105
106
107
108
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb', line 101

def get(filter_id, params = {})
  @client.request(
    method: :get,
    path: ["webhooks-journal/subscriptions/2026-03/filters/%1$s", filter_id],
    model: HubSpotSDK::FilterResponse,
    options: params[:request_options]
  )
end

#list(subscription_id, request_options: {}) ⇒ Array<HubSpotSDK::Models::FilterResponse>

Some parameter documentations has been truncated, see Models::WebhooksJournal::Subscriptions::FilterListParams for more details.

Retrieve the filters associated with a specific webhook subscription. This endpoint allows you to view the filters applied to a subscription, which can help in managing and understanding the conditions set for webhook events.

Parameters:

  • subscription_id (Integer)

    The unique identifier of the subscription for which to retrieve filters. This is

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

Returns:

See Also:



56
57
58
59
60
61
62
63
# File 'lib/hubspot_sdk/resources/webhooks_journal/subscriptions/filters.rb', line 56

def list(subscription_id, params = {})
  @client.request(
    method: :get,
    path: ["webhooks-journal/subscriptions/2026-03/filters/subscription/%1$s", subscription_id],
    model: HubSpotSDK::Internal::Type::ArrayOf[HubSpotSDK::FilterResponse],
    options: params[:request_options]
  )
end