Class: WalmartApIs::DataKioskApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/walmart_ap_is/apis/data_kiosk_api.rb

Overview

DataKioskApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

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

Constructor Details

This class inherits a constructor from WalmartApIs::BaseApi

Instance Method Details

#cancel_query(query_id) ⇒ ApiResponse

TODO: type endpoint description here

Parameters:

  • query_id (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/walmart_ap_is/apis/data_kiosk_api.rb', line 129

def cancel_query(query_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/data-kiosk/v4/queries/{queryId}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(query_id, key: 'queryId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CancelQueryResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#create_query(body) ⇒ ApiResponse

Submits a structured query for async processing. Query language TBD pending ADR (GraphQL vs REST hybrid — Pod 4). description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/walmart_ap_is/apis/data_kiosk_api.rb', line 61

def create_query(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/data-kiosk/v4/queries',
                                 Server::DEFAULT1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CreateQueryResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#get_document(document_id) ⇒ ApiResponse

Returns a pre-signed URL for downloading query result data. Do not log the pre-signed URL. here

Parameters:

  • document_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/walmart_ap_is/apis/data_kiosk_api.rb', line 166

def get_document(document_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-kiosk/v4/documents/{documentId}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(document_id, key: 'documentId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Document.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#get_queries(processing_statuses: nil, page_size: 10, created_since: nil, created_until: nil, pagination_token: nil) ⇒ ApiResponse

Returns a paginated list of Data Kiosk queries submitted by the seller, optionally filtered by processing status and creation date range. TODO: type description here here here description here

Parameters:

  • processing_statuses (Array[ProcessingStatus]) (defaults to: nil)

    Optional parameter:

  • page_size (Integer) (defaults to: 10)

    Optional parameter: Example:10

  • created_since (DateTime) (defaults to: nil)

    Optional parameter: TODO: type description

  • created_until (DateTime) (defaults to: nil)

    Optional parameter: TODO: type description

  • pagination_token (String) (defaults to: nil)

    Optional parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/walmart_ap_is/apis/data_kiosk_api.rb', line 21

def get_queries(processing_statuses: nil,
                page_size: 10,
                created_since: nil,
                created_until: nil,
                pagination_token: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-kiosk/v4/queries',
                                 Server::DEFAULT1)
               .query_param(new_parameter(processing_statuses, key: 'processingStatuses'))
               .query_param(new_parameter(page_size, key: 'pageSize'))
               .query_param(new_parameter(created_since, key: 'createdSince'))
               .query_param(new_parameter(created_until, key: 'createdUntil'))
               .query_param(new_parameter(pagination_token, key: 'paginationToken'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetQueriesResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#get_query(query_id) ⇒ ApiResponse

TODO: type endpoint description here

Parameters:

  • query_id (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/walmart_ap_is/apis/data_kiosk_api.rb', line 94

def get_query(query_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/data-kiosk/v4/queries/{queryId}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(query_id, key: 'queryId')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Query.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end