umbraco-management-api-client
Version:
TypeScript client for the Umbraco Management API (auto-generated by OpenAPI Generator)
70 lines (69 loc) • 3.57 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Umbraco Management API
* This shows all APIs available in this version of Umbraco - including all the legacy apis that are available for backward compatibility
*
* The version of the OpenAPI document: Latest
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfCreateDocumentRequestModel = instanceOfCreateDocumentRequestModel;
exports.CreateDocumentRequestModelFromJSON = CreateDocumentRequestModelFromJSON;
exports.CreateDocumentRequestModelFromJSONTyped = CreateDocumentRequestModelFromJSONTyped;
exports.CreateDocumentRequestModelToJSON = CreateDocumentRequestModelToJSON;
exports.CreateDocumentRequestModelToJSONTyped = CreateDocumentRequestModelToJSONTyped;
const CreateDocumentBlueprintRequestModelVariantsInner_1 = require("./CreateDocumentBlueprintRequestModelVariantsInner");
const CreateDocumentBlueprintRequestModelValuesInner_1 = require("./CreateDocumentBlueprintRequestModelValuesInner");
const ReferenceByIdModel_1 = require("./ReferenceByIdModel");
/**
* Check if a given object implements the CreateDocumentRequestModel interface.
*/
function instanceOfCreateDocumentRequestModel(value) {
if (!('values' in value) || value['values'] === undefined)
return false;
if (!('variants' in value) || value['variants'] === undefined)
return false;
if (!('documentType' in value) || value['documentType'] === undefined)
return false;
if (!('template' in value) || value['template'] === undefined)
return false;
return true;
}
function CreateDocumentRequestModelFromJSON(json) {
return CreateDocumentRequestModelFromJSONTyped(json, false);
}
function CreateDocumentRequestModelFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'values': (json['values'].map(CreateDocumentBlueprintRequestModelValuesInner_1.CreateDocumentBlueprintRequestModelValuesInnerFromJSON)),
'variants': (json['variants'].map(CreateDocumentBlueprintRequestModelVariantsInner_1.CreateDocumentBlueprintRequestModelVariantsInnerFromJSON)),
'id': json['id'] == null ? undefined : json['id'],
'parent': json['parent'] == null ? undefined : (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['parent']),
'documentType': (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['documentType']),
'template': (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['template']),
};
}
function CreateDocumentRequestModelToJSON(json) {
return CreateDocumentRequestModelToJSONTyped(json, false);
}
function CreateDocumentRequestModelToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'values': (value['values'].map(CreateDocumentBlueprintRequestModelValuesInner_1.CreateDocumentBlueprintRequestModelValuesInnerToJSON)),
'variants': (value['variants'].map(CreateDocumentBlueprintRequestModelVariantsInner_1.CreateDocumentBlueprintRequestModelVariantsInnerToJSON)),
'id': value['id'],
'parent': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['parent']),
'documentType': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['documentType']),
'template': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['template']),
};
}