Skip to content

Commit c481186

Browse files
committed
Improve API method formatting
1 parent a9c7592 commit c481186

47 files changed

Lines changed: 391 additions & 617 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

resources/schemas/us/mp/items.json

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -490,54 +490,37 @@
490490
}
491491
},
492492
"examples": {
493-
"V4.7 MP_ITEM": {
493+
"V4.8 MP_ITEM": {
494494
"value": {
495495
"MPItemFeedHeader": {
496496
"sellingChannel": "marketplace",
497497
"processMode": "REPLACE",
498498
"subset": "EXTERNAL",
499499
"locale": "en",
500-
"version": "4.7",
501-
"subCategory": "art_and_craft_other"
500+
"version": "4.8",
501+
"subCategory": "home_other"
502502
},
503503
"MPItem": [
504504
{
505505
"Orderable": {
506-
"sku": "0652383xxxxxxx",
506+
"sku": "testCardSku",
507507
"productIdentifiers": {
508508
"productIdType": "GTIN",
509-
"productId": "00466260xxxxxx"
509+
"productId": "06146190200012"
510510
},
511-
"productName": "Bright Sign Unfinished Wood Cutout Home Decor DIY Option 2- 30\" Wide \/ 1\/2\"",
512-
"brand": "24 Hour Crafts",
511+
"productName": "Ying Yang Apron, Abstract Graphic Design Yin Yang Circle Black and White Dots Pattern Cosmos and Energy, Unisex Kitchen Bib with Adjustable Neck for Cooking Gardening, Adult Size, Red, by Ambesonne",
512+
"brand": "davidson",
513513
"price": 1,
514514
"ShippingWeight": 1,
515-
"shipsInOriginalPackaging": "No",
516515
"MustShipAlone": "No"
517516
},
518517
"Visible": {
519-
"Art & Craft": {
520-
"shortDescription": "Welcome to 24 Hour Crafts! This unfinished wood product comes as sanded natural wood with lightly burned edges from laser cutting. The Shapes are available from 5 inches up to 24 inches. Shipped in under 24 hours or it's free! These are cut from 1\/8 or 1\/4 inch cabinet grade birch plywood. If you're interested in another thickness please message us! WHY BUY FROM US? We make all our products by hand in the suburbs of Pittsburgh. We operate this small business with an attention to detail that can be seen in the quality of our finished products. QUESTIONS? If you have any questions about this product, please click the 'Message Seller' button, and we will be happy to assist you! THANK YOU for shopping with 24 Hour Crafts!",
521-
"mainImageUrl": "https:\/\/i5-qa.walmartimages.com\/asr\/81bcc57c-9142-4ab6-a3ba-0b7306fc23f7.d0ae842831d3a85870b62ab1381675e5.jpeg",
522-
"productSecondaryImageURL": [
523-
"https:\/\/i5-qa.walmartimages.com\/asr\/08a3c783-16e7-4ae9-a48d-5b4b9c2f3d7e.2bbca27014bf466c457c8937493c4bfb.jpeg",
524-
"https:\/\/i5-qa.walmartimages.com\/asr\/1f0cace9-9724-4bc4-884c-d2f972659e8e.492c06869e1cdf04da60d983f8aac511.jpeg"
525-
],
518+
"Home Decor, Kitchen, & Other": {
519+
"shortDescription": "shelf",
520+
"mainImageUrl": "https:\/\/i5-qa.walmartimages.com\/asr\/9e9d04d1-6520-448e-b336-f40b7fb98707.c4c99539377709c2a9e332558177be8b.jpeg",
526521
"keyFeatures": [
527-
"<ul><li>Made in the USA<\/li><li>Ships in 24 Hours<\/li><li>Made from Cabinet grade baltic birch plywood.<\/li><\/ul>"
528-
],
529-
"manufacturer": "24 Hour Crafts",
530-
"color": [
531-
"Natural Wood"
532-
],
533-
"colorCategory": [
534-
"Brown"
535-
],
536-
"material": [
537-
"1\/2\" Thick Wood"
538-
],
539-
"size": "30\"",
540-
"gender": "Unisex"
522+
"@generated"
523+
]
541524
}
542525
}
543526
}
@@ -760,41 +743,40 @@
760743
]
761744
}
762745
},
763-
"V4.7 MP_MAINTENANCE": {
746+
"V4.8 MP_MAINTENANCE": {
764747
"value": {
765748
"MPItemFeedHeader": {
766749
"sellingChannel": "mpmaintenance",
767750
"processMode": "REPLACE",
768751
"subset": "EXTERNAL",
769752
"locale": "en",
770-
"version": "4.7",
771-
"subCategory": "animal_health_and_grooming"
753+
"version": "4.8",
754+
"subCategory": "computers"
772755
},
773756
"MPItem": [
774757
{
775758
"Orderable": {
776-
"sku": "5r8kUFnD7Rxxxxx",
759+
"sku": "skum1_may23_fail01_test",
777760
"productIdentifiers": {
778761
"productIdType": "GTIN",
779-
"productId": "062609119xxxxx"
762+
"productId": "06848390988881"
780763
},
781-
"productName": "Mucxxx",
782-
"brand": "Mucinex",
783-
"price": 49.5,
784-
"startDate": "2021-07-12T07:00:00Z",
764+
"productName": "iPhone 14 pro max",
765+
"brand": "Apple",
766+
"price": 299.99,
767+
"startDate": "2023-05-23T07:00:00Z",
785768
"endDate": "2049-12-31T08:00:00Z",
769+
"shipsInOriginalPackaging": "No",
786770
"MustShipAlone": "No",
787-
"ShippingWeight": 0
771+
"ShippingWeight": 4
788772
},
789773
"Visible": {
790-
"Animal Health & Grooming": {
791-
"shortDescription": "Mucxxx",
792-
"mainImageUrl": "https:\/\/i5-qa.walmartimages.com\/asr\/c6xxx.jpeg",
774+
"Computers": {
775+
"shortDescription": "test Desc fold",
776+
"mainImageUrl": "https:\/\/i5-qa.walmartimages.com\/asr\/7bec61bc-ec33-4334-8131-ecb8305e1e19.62d73c2f61f929ef580fe375e3597c13.jpeg",
793777
"keyFeatures": [
794778
"@generated"
795-
],
796-
"manufacturer": "Mucxxx",
797-
"manufacturerPartNumber": "MFMxxxxx"
779+
]
798780
}
799781
}
800782
}

resources/templates/api.hbs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class {{classname}} extends BaseApi
109109
array $associative_array{{else}}{{#each allParams}}
110110
{{#unless required}}?{{/unless}}{{dataType}} ${{paramName}}{{#unless required}} = {{#if defaultValue}}{{{defaultValue}}}{{else}}null{{/if}}{{/unless}},
111111
{{/each}}{{/if}}): {{#if returnType}}{{#if responses.0.dataType}}{{responses.0.dataType}}{{else}}void{{/if}}{{else}}void{{/if}} {
112-
$request = $this->{{operationId}}Request({{#if vendorExtensions.x-group-parameters}}$associative_array{{else}}{{#allParams}}${{paramName}}, {{/allParams}}{{/if}});
112+
$request = $this->{{operationId}}Request({{#if vendorExtensions.x-group-parameters}}$associative_array{{else}}{{#allParams}}${{paramName}}{{#unless @last}}, {{/unless}}{{/allParams}}{{/if}});
113113
$this->writeDebug($request);
114114
$this->writeDebug((string) $request->getBody());
115115

@@ -258,7 +258,6 @@ class {{classname}} extends BaseApi
258258

259259
/**
260260
* Operation {{{operationId}}}AsyncWithHttpInfo
261-
*
262261
*{{#if summary}}
263262
* {{summary}}
264263
*{{~/if}}
@@ -286,7 +285,7 @@ class {{classname}} extends BaseApi
286285
{{#unless required}}?{{/unless}}{{dataType}} ${{paramName}}{{#unless required}} = {{#if defaultValue}}{{{defaultValue}}}{{else}}null{{/if}}{{/unless}},
287286
{{/each}}{{/if}}): PromiseInterface {
288287
$returnType = '{{{returnType}}}';
289-
$request = $this->{{operationId}}Request({{#if vendorExtensions.x-group-parameters}}$associative_array{{else}}{{#allParams}}${{paramName}}, {{/allParams}}{{/if}});
288+
$request = $this->{{operationId}}Request({{#if vendorExtensions.x-group-parameters}}$associative_array{{else}}{{#allParams}}${{paramName}}{{#unless @last}}, {{/unless}}{{/allParams}}{{/if}});
290289
$this->writeDebug($request);
291290
$this->writeDebug((string) $request->getBody());
292291

src/Apis/CP/US/FeedsApi.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function contentProductFeedWithHttpInfo(
8686
string $feedType,
8787
\SplFileObject $file,
8888
): \Walmart\Models\CP\US\Feeds\FeedId {
89-
$request = $this->contentProductFeedRequest($feedType, $file, );
89+
$request = $this->contentProductFeedRequest($feedType, $file);
9090
$this->writeDebug($request);
9191
$this->writeDebug((string) $request->getBody());
9292

@@ -201,7 +201,6 @@ function ($response) {
201201
/**
202202
* Operation contentProductFeedAsyncWithHttpInfo
203203
*
204-
*
205204
* Content feeds
206205
*
207206
* @param string $feedType The feed Type (required)
@@ -215,7 +214,7 @@ protected function contentProductFeedAsyncWithHttpInfo(
215214
\SplFileObject $file,
216215
): PromiseInterface {
217216
$returnType = '\Walmart\Models\CP\US\Feeds\FeedId';
218-
$request = $this->contentProductFeedRequest($feedType, $file, );
217+
$request = $this->contentProductFeedRequest($feedType, $file);
219218
$this->writeDebug($request);
220219
$this->writeDebug((string) $request->getBody());
221220

@@ -424,7 +423,7 @@ protected function getAllFeedStatusesWithHttpInfo(
424423
?string $offset = '0',
425424
?string $limit = '20',
426425
): \Walmart\Models\CP\US\Feeds\FeedRecordResponse {
427-
$request = $this->getAllFeedStatusesRequest($feedId, $offset, $limit, );
426+
$request = $this->getAllFeedStatusesRequest($feedId, $offset, $limit);
428427
$this->writeDebug($request);
429428
$this->writeDebug((string) $request->getBody());
430429

@@ -541,7 +540,6 @@ function ($response) {
541540
/**
542541
* Operation getAllFeedStatusesAsyncWithHttpInfo
543542
*
544-
*
545543
* Feed status
546544
*
547545
* @param string $feedId A unique ID returned from the Bulk Upload API, used for tracking the Feed File. Special characters must be escaped (e.g., feedId: '...3456@789...' must be entered in the URL as '...3456%40789). (required)
@@ -557,7 +555,7 @@ protected function getAllFeedStatusesAsyncWithHttpInfo(
557555
?string $limit = '20',
558556
): PromiseInterface {
559557
$returnType = '\Walmart\Models\CP\US\Feeds\FeedRecordResponse';
560-
$request = $this->getAllFeedStatusesRequest($feedId, $offset, $limit, );
558+
$request = $this->getAllFeedStatusesRequest($feedId, $offset, $limit);
561559
$this->writeDebug($request);
562560
$this->writeDebug((string) $request->getBody());
563561

@@ -769,7 +767,7 @@ protected function getFeedItemStatusWithHttpInfo(
769767
?string $offset = '0',
770768
?string $limit = '20',
771769
): \Walmart\Models\CP\US\Feeds\PartnerFeedResponse {
772-
$request = $this->getFeedItemStatusRequest($feedId, $includeDetails, $offset, $limit, );
770+
$request = $this->getFeedItemStatusRequest($feedId, $includeDetails, $offset, $limit);
773771
$this->writeDebug($request);
774772
$this->writeDebug((string) $request->getBody());
775773

@@ -888,7 +886,6 @@ function ($response) {
888886
/**
889887
* Operation getFeedItemStatusAsyncWithHttpInfo
890888
*
891-
*
892889
* Feed item status
893890
*
894891
* @param string $feedId A unique ID returned from the Bulk Upload API, used for tracking the Feed File. Special characters must be escaped (e.g., feedId: '...3456@789...' must be entered in the URL as '...3456%40789). (required)
@@ -906,7 +903,7 @@ protected function getFeedItemStatusAsyncWithHttpInfo(
906903
?string $limit = '20',
907904
): PromiseInterface {
908905
$returnType = '\Walmart\Models\CP\US\Feeds\PartnerFeedResponse';
909-
$request = $this->getFeedItemStatusRequest($feedId, $includeDetails, $offset, $limit, );
906+
$request = $this->getFeedItemStatusRequest($feedId, $includeDetails, $offset, $limit);
910907
$this->writeDebug($request);
911908
$this->writeDebug((string) $request->getBody());
912909

@@ -1121,7 +1118,7 @@ protected function updateRichMediaWithHttpInfo(
11211118
string $feedType,
11221119
string $body,
11231120
): \Walmart\Models\CP\US\Feeds\FeedId {
1124-
$request = $this->updateRichMediaRequest($feedType, $body, );
1121+
$request = $this->updateRichMediaRequest($feedType, $body);
11251122
$this->writeDebug($request);
11261123
$this->writeDebug((string) $request->getBody());
11271124

@@ -1236,7 +1233,6 @@ function ($response) {
12361233
/**
12371234
* Operation updateRichMediaAsyncWithHttpInfo
12381235
*
1239-
*
12401236
* Rich Media
12411237
*
12421238
* @param string $feedType The feed Type (required)
@@ -1250,7 +1246,7 @@ protected function updateRichMediaAsyncWithHttpInfo(
12501246
string $body,
12511247
): PromiseInterface {
12521248
$returnType = '\Walmart\Models\CP\US\Feeds\FeedId';
1253-
$request = $this->updateRichMediaRequest($feedType, $body, );
1249+
$request = $this->updateRichMediaRequest($feedType, $body);
12541250
$this->writeDebug($request);
12551251
$this->writeDebug((string) $request->getBody());
12561252

src/Apis/DSV/US/CostApi.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function updateBulkCostWithHttpInfo(
8383
string $feedType,
8484
\Walmart\Models\DSV\US\Cost\DsvCostUpdateRequest $dsvCostUpdateRequest,
8585
): \Walmart\Models\DSV\US\Cost\DsvCostUpdateResponse {
86-
$request = $this->updateBulkCostRequest($feedType, $dsvCostUpdateRequest, );
86+
$request = $this->updateBulkCostRequest($feedType, $dsvCostUpdateRequest);
8787
$this->writeDebug($request);
8888
$this->writeDebug((string) $request->getBody());
8989

@@ -198,7 +198,6 @@ function ($response) {
198198
/**
199199
* Operation updateBulkCostAsyncWithHttpInfo
200200
*
201-
*
202201
* This API allows DSV to update cost for items in bulk.
203202
*
204203
* @param string $feedType Includes details of each entity in the feed. Do not set this parameter to true. (required)
@@ -212,7 +211,7 @@ protected function updateBulkCostAsyncWithHttpInfo(
212211
\Walmart\Models\DSV\US\Cost\DsvCostUpdateRequest $dsvCostUpdateRequest,
213212
): PromiseInterface {
214213
$returnType = '\Walmart\Models\DSV\US\Cost\DsvCostUpdateResponse';
215-
$request = $this->updateBulkCostRequest($feedType, $dsvCostUpdateRequest, );
214+
$request = $this->updateBulkCostRequest($feedType, $dsvCostUpdateRequest);
216215
$this->writeDebug($request);
217216
$this->writeDebug((string) $request->getBody());
218217

0 commit comments

Comments
 (0)