Class: WalmartApIs::ListingsItemsApi

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

Overview

ListingsItemsApi

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

#delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: 'en_US') ⇒ ApiResponse

TODO: type endpoint description here listing type description here

Parameters:

  • seller_id (String)

    Required parameter: Seller identifier

  • sku (String)

    Required parameter: Seller SKU identifying the

  • marketplace_ids (Array[MarketplaceId])

    Required parameter: TODO:

  • issue_locale (String) (defaults to: 'en_US')

    Optional parameter: Example:en_US

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/walmart_ap_is/apis/listings_items_api.rb', line 180

def delete_listings_item(seller_id,
                         sku,
                         marketplace_ids,
                         issue_locale: 'en_US')
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/listings/v4/items/{sellerId}/{sku}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(seller_id, key: 'sellerId')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(sku, key: 'sku')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .query_param(new_parameter(issue_locale, key: 'issueLocale'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ListingsItemSubmissionResponse.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_listings_item(seller_id, sku, marketplace_ids, issue_locale: 'en_US', included_data: nil) ⇒ ApiResponse

TODO: type endpoint description here listing type description here (e.g. en_US) type description here

Parameters:

  • seller_id (String)

    Required parameter: Seller identifier

  • sku (String)

    Required parameter: Seller SKU identifying the

  • marketplace_ids (Array[MarketplaceId])

    Required parameter: TODO:

  • issue_locale (String) (defaults to: 'en_US')

    Optional parameter: Locale for issue messages

  • included_data (Array[IncludedDatum1]) (defaults to: nil)

    Optional parameter: TODO:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



20
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
55
56
57
58
59
60
61
# File 'lib/walmart_ap_is/apis/listings_items_api.rb', line 20

def get_listings_item(seller_id,
                      sku,
                      marketplace_ids,
                      issue_locale: 'en_US',
                      included_data: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/listings/v4/items/{sellerId}/{sku}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(seller_id, key: 'sellerId')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(sku, key: 'sku')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .query_param(new_parameter(issue_locale, key: 'issueLocale'))
               .query_param(new_parameter(included_data, key: 'includedData'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Item1.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

#patch_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: 'en_US') ⇒ ApiResponse

TODO: type endpoint description here listing type description here description here

Parameters:

  • seller_id (String)

    Required parameter: Seller identifier

  • sku (String)

    Required parameter: Seller SKU identifying the

  • marketplace_ids (Array[MarketplaceId])

    Required parameter: TODO:

  • body (ListingsItemPatchRequest)

    Required parameter: TODO: type

  • issue_locale (String) (defaults to: 'en_US')

    Optional parameter: Example:en_US

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



126
127
128
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
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/walmart_ap_is/apis/listings_items_api.rb', line 126

def patch_listings_item(seller_id,
                        sku,
                        marketplace_ids,
                        body,
                        issue_locale: 'en_US')
  @api_call
    .request(new_request_builder(HttpMethodEnum::PATCH,
                                 '/listings/v4/items/{sellerId}/{sku}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(seller_id, key: 'sellerId')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(sku, key: 'sku')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .query_param(new_parameter(issue_locale, key: 'issueLocale'))
               .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(ListingsItemSubmissionResponse.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

#put_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: 'en_US') ⇒ ApiResponse

TODO: type endpoint description here listing type description here description here

Parameters:

  • seller_id (String)

    Required parameter: Seller identifier

  • sku (String)

    Required parameter: Seller SKU identifying the

  • marketplace_ids (Array[MarketplaceId])

    Required parameter: TODO:

  • body (ListingsItemPutRequest)

    Required parameter: TODO: type

  • issue_locale (String) (defaults to: 'en_US')

    Optional parameter: Example:en_US

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/walmart_ap_is/apis/listings_items_api.rb', line 73

def put_listings_item(seller_id,
                      sku,
                      marketplace_ids,
                      body,
                      issue_locale: 'en_US')
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/listings/v4/items/{sellerId}/{sku}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(seller_id, key: 'sellerId')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(sku, key: 'sku')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .query_param(new_parameter(issue_locale, key: 'issueLocale'))
               .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(ListingsItemSubmissionResponse.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