Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit f58e446

Browse files
authored
Merge pull request #15 from mobify/add-props
Add/Update Models
2 parents feb9c7f + f70efe9 commit f58e446

File tree

5 files changed

+108
-1
lines changed

5 files changed

+108
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## To be released
2+
- Add relevant properties to `VariationAttributeValue` model and some others. [#15](https://github.com/mobify/commercecloud-ocapi-client/pull/15)
3+
14
## v0.1.6 (October 16, 2018)
25
- Fix `overrideHttpPut` logic invocation
36

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/models/ProductRef.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
2+
/* Copyright (c) 2017 Mobify Research & Development Inc. All rights reserved. */
3+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
4+
5+
/* eslint-disable dot-notation */
6+
/**
7+
* Shop API
8+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
9+
*
10+
* OpenAPI spec version: 17.8
11+
*
12+
*
13+
* NOTE: This class is auto generated by the swagger code generator program.
14+
* https://github.com/swagger-api/swagger-codegen.git
15+
* Do not edit the class manually.
16+
*
17+
*/
18+
import ApiClient from '../ApiClient'
19+
20+
/**
21+
* The ProductRef model module.
22+
* @module models/ProductRef
23+
* @version 17.8
24+
*/
25+
export default class ProductRef {
26+
/**
27+
* Constructs a new <code>ProductRef</code>.
28+
* Document representing a product reference.
29+
* @alias module:models/ProductRef
30+
* @class
31+
* @param id {String} The ID of the product reference.
32+
*/
33+
constructor(id) {
34+
/**
35+
* The ID of the product reference.
36+
* @member {String} id
37+
*/
38+
this.id = id
39+
40+
/**
41+
* The link to the product reference.
42+
* @member {String} link
43+
*/
44+
this.link = undefined
45+
}
46+
47+
/**
48+
* Constructs a <code>ProductRef</code> from a plain JavaScript object, optionally creating a new instance.
49+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
50+
* @param {Object} data The plain JavaScript object bearing properties of interest.
51+
* @param {module:models/ProductRef} obj Optional instance to populate.
52+
* @return {module:models/ProductRef} The populated <code>ProductRef</code> instance.
53+
*/
54+
static constructFromObject(data, obj) {
55+
if (data) {
56+
obj = obj || new ProductRef()
57+
58+
if (data.hasOwnProperty('id')) {
59+
obj['id'] = ApiClient.convertToType(data['id'], 'String')
60+
}
61+
if (data.hasOwnProperty('link')) {
62+
obj['link'] = ApiClient.convertToType(data['link'], 'String')
63+
}
64+
}
65+
66+
return obj
67+
}
68+
}

src/models/ProductSearchHit.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import ApiClient from '../ApiClient'
1919
import Image from './Image'
2020
import ProductType from './ProductType'
21+
import ProductRef from './ProductRef'
2122
import VariationAttribute from './VariationAttribute'
2223

2324
/**
@@ -93,6 +94,18 @@ export default class ProductSearchHit {
9394
*/
9495
this.product_type = undefined
9596

97+
/**
98+
* The first represented product.
99+
* @member {module:models/ProductRef} represented_product
100+
*/
101+
this.represented_product = undefined
102+
103+
/**
104+
* All the represented products.
105+
* @member {Array.<module:models/ProductRef>} represented_products
106+
*/
107+
this.represented_products = undefined
108+
96109
/**
97110
* The array of represented variation attributes (for the master product only). This array can be empty.
98111
* @member {Array.<module:models/VariationAttribute>} variation_attributes
@@ -141,6 +154,12 @@ export default class ProductSearchHit {
141154
if (data.hasOwnProperty('product_type')) {
142155
obj['product_type'] = ProductType.constructFromObject(data['product_type'])
143156
}
157+
if (data.hasOwnProperty('represented_product')) {
158+
obj['represented_product'] = ProductType.constructFromObject(data['represented_product'])
159+
}
160+
if (data.hasOwnProperty('represented_products')) {
161+
obj['represented_products'] = ApiClient.convertToType(data['represented_products'], [ProductRef])
162+
}
144163
if (data.hasOwnProperty('variation_attributes')) {
145164
obj['variation_attributes'] = ApiClient.convertToType(data['variation_attributes'], [VariationAttribute])
146165
}

src/models/VariationAttributeValue.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*
1717
*/
1818
import ApiClient from '../ApiClient'
19+
import Image from './Image'
1920

2021
/**
2122
* The VariationAttributeValue model module.
@@ -35,6 +36,16 @@ export default class VariationAttributeValue {
3536
*/
3637
this.description = undefined
3738

39+
/**
40+
* @member {module:models/Image} image
41+
*/
42+
this.image = undefined
43+
44+
/**
45+
* @member {module:models/Image} image_swatch
46+
*/
47+
this.image_swatch = undefined
48+
3849
/**
3950
* @member {String} name
4051
*/
@@ -65,6 +76,12 @@ export default class VariationAttributeValue {
6576
if (data.hasOwnProperty('description')) {
6677
obj['description'] = ApiClient.convertToType(data['description'], 'String')
6778
}
79+
if (data.hasOwnProperty('image')) {
80+
obj['image'] = Image.constructFromObject(data['image'])
81+
}
82+
if (data.hasOwnProperty('image_swatch')) {
83+
obj['image_swatch'] = Image.constructFromObject(data['image_swatch'])
84+
}
6885
if (data.hasOwnProperty('name')) {
6986
obj['name'] = ApiClient.convertToType(data['name'], 'String')
7087
}

0 commit comments

Comments
 (0)