Class: HubSpotSDK::Resources::Crm::Objects::Contracts

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

Defined Under Namespace

Classes: Batch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Contracts

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

Parameters:



94
95
96
97
# File 'lib/hubspot_sdk/resources/crm/objects/contracts.rb', line 94

def initialize(client:)
  @client = client
  @batch = HubSpotSDK::Resources::Crm::Objects::Contracts::Batch.new(client: client)
end

Instance Attribute Details

#batchHubSpotSDK::Resources::Crm::Objects::Contracts::Batch (readonly)



9
10
11
# File 'lib/hubspot_sdk/resources/crm/objects/contracts.rb', line 9

def batch
  @batch
end

Instance Method Details

#get(contract_id, archived: nil, associations: nil, id_property: nil, properties: nil, properties_with_history: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::SimplePublicObjectWithAssociations

Some parameter documentations has been truncated, see Models::Crm::Objects::ContractGetParams for more details.

Read an Object identified by ‘contractId`. `contractId` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.

Parameters:

  • contract_id (String)
  • archived (Boolean)

    Whether to return only results that have been archived.

  • associations (Array<String>)

    A comma separated list of object types to retrieve associated IDs for. If any of

  • id_property (String)

    The name of a property whose values are unique for this object type

  • properties (Array<String>)

    A comma separated list of the properties to be returned in the response. If any

  • properties_with_history (Array<String>)

    A comma separated list of the properties to be returned along with their history

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

Returns:

See Also:



76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/hubspot_sdk/resources/crm/objects/contracts.rb', line 76

def get(contract_id, params = {})
  parsed, options = HubSpotSDK::Crm::Objects::ContractGetParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["crm/objects/2026-03/contracts/%1$s", contract_id],
    query: query.transform_keys(
      id_property: "idProperty",
      properties_with_history: "propertiesWithHistory"
    ),
    model: HubSpotSDK::Crm::SimplePublicObjectWithAssociations,
    options: options
  )
end

#list(after: nil, archived: nil, associations: nil, limit: nil, properties: nil, properties_with_history: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::SimplePublicObjectWithAssociations>

Some parameter documentations has been truncated, see Models::Crm::Objects::ContractListParams for more details.

Read a page of contracts. Control what is returned via the ‘properties` query param.

Parameters:

  • after (String)

    The paging cursor token of the last successfully read resource will be returned

  • archived (Boolean)

    Whether to return only results that have been archived.

  • associations (Array<String>)

    A comma separated list of object types to retrieve associated IDs for. If any of

  • limit (Integer)

    The maximum number of results to display per page.

  • properties (Array<String>)

    A comma separated list of the properties to be returned in the response. If any

  • properties_with_history (Array<String>)

    A comma separated list of the properties to be returned along with their history

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

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/hubspot_sdk/resources/crm/objects/contracts.rb', line 36

def list(params = {})
  parsed, options = HubSpotSDK::Crm::Objects::ContractListParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "crm/objects/2026-03/contracts",
    query: query.transform_keys(properties_with_history: "propertiesWithHistory"),
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Crm::SimplePublicObjectWithAssociations,
    options: options
  )
end