Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## To be released
- Add relevant properties to `VariationAttributeValue` model and some others. [#15](https://github.com/mobify/commercecloud-ocapi-client/pull/15)

## v0.1.6 (October 16, 2018)
- Fix `overrideHttpPut` logic invocation

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions src/models/ProductRef.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Copyright (c) 2017 Mobify Research & Development Inc. All rights reserved. */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * */

/* eslint-disable dot-notation */
/**
* Shop API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 17.8
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient'

/**
* The ProductRef model module.
* @module models/ProductRef
* @version 17.8
*/
export default class ProductRef {
/**
* Constructs a new <code>ProductRef</code>.
* Document representing a product reference.
* @alias module:models/ProductRef
* @class
* @param id {String} The ID of the product reference.
*/
constructor(id) {
/**
* The ID of the product reference.
* @member {String} id
*/
this.id = id

/**
* The link to the product reference.
* @member {String} link
*/
this.link = undefined
}

/**
* Constructs a <code>ProductRef</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:models/ProductRef} obj Optional instance to populate.
* @return {module:models/ProductRef} The populated <code>ProductRef</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new ProductRef()

if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String')
}
if (data.hasOwnProperty('link')) {
obj['link'] = ApiClient.convertToType(data['link'], 'String')
}
}

return obj
}
}
19 changes: 19 additions & 0 deletions src/models/ProductSearchHit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import ApiClient from '../ApiClient'
import Image from './Image'
import ProductType from './ProductType'
import ProductRef from './ProductRef'
import VariationAttribute from './VariationAttribute'

/**
Expand Down Expand Up @@ -93,6 +94,18 @@ export default class ProductSearchHit {
*/
this.product_type = undefined

/**
* The first represented product.
* @member {module:models/ProductRef} represented_product
*/
this.represented_product = undefined

/**
* All the represented products.
* @member {Array.<module:models/ProductRef>} represented_products
*/
this.represented_products = undefined

/**
* The array of represented variation attributes (for the master product only). This array can be empty.
* @member {Array.<module:models/VariationAttribute>} variation_attributes
Expand Down Expand Up @@ -141,6 +154,12 @@ export default class ProductSearchHit {
if (data.hasOwnProperty('product_type')) {
obj['product_type'] = ProductType.constructFromObject(data['product_type'])
}
if (data.hasOwnProperty('represented_product')) {
obj['represented_product'] = ProductType.constructFromObject(data['represented_product'])
}
if (data.hasOwnProperty('represented_products')) {
obj['represented_products'] = ApiClient.convertToType(data['represented_products'], [ProductRef])
}
if (data.hasOwnProperty('variation_attributes')) {
obj['variation_attributes'] = ApiClient.convertToType(data['variation_attributes'], [VariationAttribute])
}
Expand Down
17 changes: 17 additions & 0 deletions src/models/VariationAttributeValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*
*/
import ApiClient from '../ApiClient'
import Image from './Image'

/**
* The VariationAttributeValue model module.
Expand All @@ -35,6 +36,16 @@ export default class VariationAttributeValue {
*/
this.description = undefined

/**
* @member {module:models/Image} image
*/
this.image = undefined

/**
* @member {module:models/Image} image_swatch
*/
this.image_swatch = undefined

/**
* @member {String} name
*/
Expand Down Expand Up @@ -65,6 +76,12 @@ export default class VariationAttributeValue {
if (data.hasOwnProperty('description')) {
obj['description'] = ApiClient.convertToType(data['description'], 'String')
}
if (data.hasOwnProperty('image')) {
obj['image'] = Image.constructFromObject(data['image'])
}
if (data.hasOwnProperty('image_swatch')) {
obj['image_swatch'] = Image.constructFromObject(data['image_swatch'])
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String')
}
Expand Down