Class: HubSpotSDK::Resources::Cms::SourceCode

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/cms/source_code.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SourceCode

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

Parameters:



53
54
55
# File 'lib/hubspot_sdk/resources/cms/source_code.rb', line 53

def initialize(client:)
  @client = client
end

Instance Method Details

#extract_async(path:, request_options: {}) ⇒ HubSpotSDK::Models::TaskLocator

Extract a zip file in the developer file system. Extraction status can be checked with the ‘/extract/async/tasks/taskId/status` endpoint below.

Parameters:

  • path (String)

    The file system location where the zip file is to be extracted.

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

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/hubspot_sdk/resources/cms/source_code.rb', line 19

def extract_async(params)
  parsed, options = HubSpotSDK::Cms::SourceCodeExtractAsyncParams.dump_request(params)
  @client.request(
    method: :post,
    path: "cms/source-code/2026-03/extract/async",
    body: parsed,
    model: HubSpotSDK::TaskLocator,
    options: options
  )
end

#get_extraction_status(task_id, request_options: {}) ⇒ HubSpotSDK::Models::ActionResponse

Get the status of an extraction by the ‘taskId` returned from the initial `extract/async` request.

Parameters:

Returns:

See Also:



41
42
43
44
45
46
47
48
# File 'lib/hubspot_sdk/resources/cms/source_code.rb', line 41

def get_extraction_status(task_id, params = {})
  @client.request(
    method: :get,
    path: ["cms/source-code/2026-03/extract/async/tasks/%1$s/status", task_id],
    model: HubSpotSDK::ActionResponse,
    options: params[:request_options]
  )
end