Class: HubSpotSDK::Resources::Crm::Imports

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Imports

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

Parameters:



128
129
130
# File 'lib/hubspot_sdk/resources/crm/imports.rb', line 128

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel(import_id, request_options: {}) ⇒ HubSpotSDK::Models::ActionResponse

Parameters:

Returns:

See Also:



63
64
65
66
67
68
69
70
# File 'lib/hubspot_sdk/resources/crm/imports.rb', line 63

def cancel(import_id, params = {})
  @client.request(
    method: :post,
    path: ["crm/imports/2026-03/%1$s/cancel", import_id],
    model: HubSpotSDK::ActionResponse,
    options: params[:request_options]
  )
end

#create(files: nil, import_request: nil, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PublicImportResponse

Parameters:

Returns:

See Also:



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/hubspot_sdk/resources/crm/imports.rb', line 16

def create(params = {})
  parsed, options = HubSpotSDK::Crm::ImportCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "crm/imports/2026-03",
    headers: {"content-type" => "multipart/form-data"},
    body: parsed,
    model: HubSpotSDK::Crm::PublicImportResponse,
    options: options
  )
end

#get(import_id, request_options: {}) ⇒ HubSpotSDK::Models::Crm::PublicImportResponse

Parameters:

Returns:

See Also:



80
81
82
83
84
85
86
87
# File 'lib/hubspot_sdk/resources/crm/imports.rb', line 80

def get(import_id, params = {})
  @client.request(
    method: :get,
    path: ["crm/imports/2026-03/%1$s", import_id],
    model: HubSpotSDK::Crm::PublicImportResponse,
    options: params[:request_options]
  )
end

#list(after: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::PublicImportResponse>

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

Parameters:

  • after (String)

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

  • limit (Integer)

    The maximum number of results to display per page.

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

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/hubspot_sdk/resources/crm/imports.rb', line 42

def list(params = {})
  parsed, options = HubSpotSDK::Crm::ImportListParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "crm/imports/2026-03",
    query: query,
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Crm::PublicImportResponse,
    options: options
  )
end

#list_errors(import_id, after: nil, include_error_message: nil, include_row_data: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Crm::PublicImportError>

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

Parameters:

  • import_id (Integer)
  • after (String)

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

  • include_error_message (Boolean)
  • include_row_data (Boolean)
  • limit (Integer)

    The maximum number of results to display per page.

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

Returns:

See Also:



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/hubspot_sdk/resources/crm/imports.rb', line 109

def list_errors(import_id, params = {})
  parsed, options = HubSpotSDK::Crm::ImportListErrorsParams.dump_request(params)
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["crm/imports/2026-03/%1$s/errors", import_id],
    query: query.transform_keys(
      include_error_message: "includeErrorMessage",
      include_row_data: "includeRowData"
    ),
    page: HubSpotSDK::Internal::Page,
    model: HubSpotSDK::Crm::PublicImportError,
    options: options
  )
end