Class: HubSpotSDK::Resources::Crm::FeatureFlags::Batch

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/crm/feature_flags/batch.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Batch

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

Parameters:



73
74
75
# File 'lib/hubspot_sdk/resources/crm/feature_flags/batch.rb', line 73

def initialize(client:)
  @client = client
end

Instance Method Details

#delete(flag_name, app_id:, portal_ids:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PortalFlagStateBatchResponse

Delete an account-level flag state for multiple HubSpot accounts at once. Use this endpoint to manage flag exposure for groups of HubSpot accounts.

Parameters:

  • flag_name (String)

    Path param

  • app_id (Integer)

    Path param

  • portal_ids (Array<Integer>)

    Body param

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/hubspot_sdk/resources/crm/feature_flags/batch.rb', line 24

def delete(flag_name, params)
  parsed, options = HubSpotSDK::Crm::FeatureFlags::BatchDeleteParams.dump_request(params)
  app_id =
    parsed.delete(:app_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["feature-flags/2026-03/%1$s/flags/%2$s/portals/batch/delete", app_id, flag_name],
    body: parsed,
    model: HubSpotSDK::Crm::PortalFlagStateBatchResponse,
    options: options
  )
end

#upsert(flag_name, app_id:, portal_states:, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PortalFlagStateBatchResponse

Set the portal flag state for multiple HubSpot accounts at once. Use this endpoint to manage flag exposure for groups of HubSpot accounts.

Parameters:

Returns:

See Also:



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/hubspot_sdk/resources/crm/feature_flags/batch.rb', line 55

def upsert(flag_name, params)
  parsed, options = HubSpotSDK::Crm::FeatureFlags::BatchUpsertParams.dump_request(params)
  app_id =
    parsed.delete(:app_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["feature-flags/2026-03/%1$s/flags/%2$s/portals/batch/upsert", app_id, flag_name],
    body: parsed,
    model: HubSpotSDK::Crm::PortalFlagStateBatchResponse,
    options: options
  )
end