Class: NewStoreApi::DatasetsController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/datasets_controller.rb

Overview

DatasetsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from NewStoreApi::BaseController

Instance Method Details

#list_datasets(x_new_store_tenant) ⇒ Object

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
List all available datasets

Parameters:

  • x_new_store_tenant (String)

    Required parameter: Tenant identifier

Returns:

  • (Object)

    Response from the API call.



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/new_store_api/controllers/datasets_controller.rb', line 21

def list_datasets(x_new_store_tenant)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-exports/datasets',
                                 Server::API)
               .header_param(new_parameter(x_new_store_tenant, key: 'X-NewStore-Tenant'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize)))
    .execute
end

#show_dataset(dataset_id, x_new_store_tenant) ⇒ Object

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
Get details of a specific dataset the dataset

Parameters:

  • dataset_id (String)

    Required parameter: The unique identifier of

  • x_new_store_tenant (String)

    Required parameter: Tenant identifier

Returns:

  • (Object)

    Response from the API call.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/new_store_api/controllers/datasets_controller.rb', line 48

def show_dataset(dataset_id,
                 x_new_store_tenant)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-exports/datasets/{dataset_id}',
                                 Server::API)
               .template_param(new_parameter(dataset_id, key: 'dataset_id')
                                .should_encode(true))
               .header_param(new_parameter(x_new_store_tenant, key: 'X-NewStore-Tenant'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize)))
    .execute
end