Class: HubSpotSDK::Resources::Crm::Properties::Groups

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/crm/properties/groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Groups

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

Parameters:



148
149
150
# File 'lib/hubspot_sdk/resources/crm/properties/groups.rb', line 148

def initialize(client:)
  @client = client
end

Instance Method Details

#create(object_type, label:, name:, display_order: nil, request_options: {}) ⇒ HubSpotSDK::Models::PropertyGroup

Create and return a copy of a new property group.

Parameters:

  • object_type (String)
  • label (String)
  • name (String)
  • display_order (Integer)
  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/hubspot_sdk/resources/crm/properties/groups.rb', line 21

def create(object_type, params)
  parsed, options = HubSpotSDK::Crm::Properties::GroupCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["crm/properties/2026-03/%1$s/groups", object_type],
    body: parsed,
    model: HubSpotSDK::PropertyGroup,
    options: options
  )
end

#delete(group_name, object_type:, request_options: {}) ⇒ nil

Move a property group identified by groupName to the recycling bin.

Parameters:

Returns:

  • (nil)

See Also:



100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/hubspot_sdk/resources/crm/properties/groups.rb', line 100

def delete(group_name, params)
  parsed, options = HubSpotSDK::Crm::Properties::GroupDeleteParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["crm/properties/2026-03/%1$s/groups/%2$s", object_type, group_name],
    model: NilClass,
    options: options
  )
end

#get(group_name, object_type:, locale: nil, request_options: {}) ⇒ HubSpotSDK::Models::PropertyGroup

Read a property group identified by groupName.

Parameters:

  • group_name (String)

    Path param

  • object_type (String)

    Path param

  • locale (String)

    Query param

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

Returns:

See Also:



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/hubspot_sdk/resources/crm/properties/groups.rb', line 129

def get(group_name, params)
  parsed, options = HubSpotSDK::Crm::Properties::GroupGetParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["crm/properties/2026-03/%1$s/groups/%2$s", object_type, group_name],
    query: query,
    model: HubSpotSDK::PropertyGroup,
    options: options
  )
end

#list(object_type, locale: nil, request_options: {}) ⇒ HubSpotSDK::Models::CollectionResponsePropertyGroupNoPaging

Read all existing property groups for the specified object type and HubSpot account.

Parameters:

Returns:

See Also:



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/hubspot_sdk/resources/crm/properties/groups.rb', line 77

def list(object_type, params = {})
  parsed, options = HubSpotSDK::Crm::Properties::GroupListParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["crm/properties/2026-03/%1$s/groups", object_type],
    query: query,
    model: HubSpotSDK::CollectionResponsePropertyGroupNoPaging,
    options: options
  )
end

#update(group_name, object_type:, display_order: nil, label: nil, request_options: {}) ⇒ HubSpotSDK::Models::PropertyGroup

Perform a partial update of a property group identified by groupName. Provided fields will be overwritten.

Parameters:

  • group_name (String)

    Path param

  • object_type (String)

    Path param

  • display_order (Integer)

    Body param

  • label (String)

    Body param

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

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/hubspot_sdk/resources/crm/properties/groups.rb', line 50

def update(group_name, params)
  parsed, options = HubSpotSDK::Crm::Properties::GroupUpdateParams.dump_request(params)
  object_type =
    parsed.delete(:object_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["crm/properties/2026-03/%1$s/groups/%2$s", object_type, group_name],
    body: parsed,
    model: HubSpotSDK::PropertyGroup,
    options: options
  )
end