Class: NewStoreApi::InsightsController

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

Overview

InsightsController

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

#create_insights_token(body) ⇒ ExternalTokenResponse

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
Get login token to authenticate against ThoughtSpot

Parameters:

  • body (TokenRequest)

    Required parameter: Bearer internal token

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/new_store_api/controllers/insights_controller.rb', line 69

def create_insights_token(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/insights/token',
                                 Server::API)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ExternalTokenResponse.method(:from_hash)))
    .execute
end

#show_insights_activities_schemaInsightsActivitiesSchemaResponse

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
Get schema for TS Activities worksheet

Returns:



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

def show_insights_activities_schema
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/insights/activities-schema',
                                 Server::API)
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InsightsActivitiesSchemaResponse.method(:from_hash)))
    .execute
end

#show_insights_tokenTokenResponse

🚧 BETA: This endpoint is in beta and may change.
See API Lifecycle Documentation for details.
Get login token to authenticate against ThoughtSpot

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/new_store_api/controllers/insights_controller.rb', line 44

def show_insights_token
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/insights/token',
                                 Server::API)
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(TokenResponse.method(:from_hash)))
    .execute
end