Skip to content

Commit b4ae109

Browse files
committed
TASK: Updating RAML types, Postman and OAS definition
1 parent 8483987 commit b4ae109

File tree

3 files changed

+351
-111
lines changed

3 files changed

+351
-111
lines changed

bruno/import/Project/Import-containers/ByProjectKeyImportContainersPost.bru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
meta {
2-
name: Create a new Import Container.
2+
name: Creates an Import Container in the Project.
33
type: http
44
seq: 3
55
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
meta {
2+
name: Import import-container
3+
type: http
4+
seq: 25
5+
}
6+
7+
post {
8+
url: {{apiUrl}}/{{project-key}}/product-selections/import-containers/{{import-container-key}}
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"type" : "product-selection",
16+
"resources" : [ {
17+
"key" : "selection-001",
18+
"name" : {
19+
"en" : "Featured Products",
20+
"de" : "Empfohlene Produkte"
21+
},
22+
"mode" : "Individual",
23+
"assignments" : [ {
24+
"product" : {
25+
"key" : "product-123",
26+
"typeId" : "product"
27+
},
28+
"variantSelection" : {
29+
"type" : "includeOnly",
30+
"skus" : [ "SKU-1", "SKU-2" ]
31+
}
32+
} ]
33+
} ]
34+
}
35+
}
36+
37+
query {
38+
}
39+
40+
script:post-response {
41+
var data = res.body;
42+
if(res.status == 200 || res.status == 201) {
43+
if(data.results && data.results[0] && data.results[0].id && data.results[0].version){
44+
bru.setEnvVar("import-container-id", data.results[0].id);
45+
bru.setEnvVar("import-container-version", data.results[0].version);
46+
}
47+
if(data.results && data.results[0] && data.results[0].key){
48+
bru.setEnvVar("import-container-key", data.results[0].key);
49+
}
50+
if(data.version){
51+
bru.setEnvVar("import-container-version", data.version);
52+
}
53+
if(data.id){
54+
bru.setEnvVar("import-container-id", data.id);
55+
}
56+
if(data.key){
57+
bru.setEnvVar("import-container-key", data.key);
58+
}
59+
60+
}
61+
}
62+
63+
assert {
64+
res.status: in [200, 201]
65+
}

0 commit comments

Comments
 (0)