Class: Zavudev::Resources::Exports

Inherits:
Object
  • Object
show all
Defined in:
lib/zavudev/resources/exports.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Exports

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

Parameters:



84
85
86
# File 'lib/zavudev/resources/exports.rb', line 84

def initialize(client:)
  @client = client
end

Instance Method Details

#create(data_types:, date_from: nil, date_to: nil, request_options: {}) ⇒ Zavudev::Models::ExportCreateResponse

Create a new data export job. The export will be processed asynchronously and the download URL will be available when status is ‘completed’. Export links expire after 24 hours.

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
# File 'lib/zavudev/resources/exports.rb', line 23

def create(params)
  parsed, options = Zavudev::ExportCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/exports",
    body: parsed,
    model: Zavudev::Models::ExportCreateResponse,
    options: options
  )
end

#list(cursor: nil, limit: nil, status: nil, request_options: {}) ⇒ Zavudev::Internal::Cursor<Zavudev::Models::DataExport>

List data exports for this project.

Parameters:

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/zavudev/resources/exports.rb', line 68

def list(params = {})
  parsed, options = Zavudev::ExportListParams.dump_request(params)
  query = Zavudev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/exports",
    query: query,
    page: Zavudev::Internal::Cursor,
    model: Zavudev::DataExport,
    options: options
  )
end

#retrieve(export_id, request_options: {}) ⇒ Zavudev::Models::ExportRetrieveResponse

Get details of a specific data export, including download URL when completed.

Parameters:

Returns:

See Also:



44
45
46
47
48
49
50
51
# File 'lib/zavudev/resources/exports.rb', line 44

def retrieve(export_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/exports/%1$s", export_id],
    model: Zavudev::Models::ExportRetrieveResponse,
    options: params[:request_options]
  )
end