umbraco-management-api-client
Version:
TypeScript client for the Umbraco Management API (auto-generated by OpenAPI Generator)
116 lines (115 loc) • 6.93 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.instanceOfCreateDocumentTypeRequestModel = instanceOfCreateDocumentTypeRequestModel;
exports.CreateDocumentTypeRequestModelFromJSON = CreateDocumentTypeRequestModelFromJSON;
exports.CreateDocumentTypeRequestModelFromJSONTyped = CreateDocumentTypeRequestModelFromJSONTyped;
exports.CreateDocumentTypeRequestModelToJSON = CreateDocumentTypeRequestModelToJSON;
exports.CreateDocumentTypeRequestModelToJSONTyped = CreateDocumentTypeRequestModelToJSONTyped;
const DocumentTypeCleanupModel_1 = require("./DocumentTypeCleanupModel");
const PostUserGroupByIdUsersRequestInner_1 = require("./PostUserGroupByIdUsersRequestInner");
const CreateDocumentTypeRequestModelPropertiesInner_1 = require("./CreateDocumentTypeRequestModelPropertiesInner");
const CreateDocumentTypeRequestModelContainersInner_1 = require("./CreateDocumentTypeRequestModelContainersInner");
const ReferenceByIdModel_1 = require("./ReferenceByIdModel");
const CreateDocumentTypeRequestModelAllowedDocumentTypesInner_1 = require("./CreateDocumentTypeRequestModelAllowedDocumentTypesInner");
const CreateDocumentTypeRequestModelCompositionsInner_1 = require("./CreateDocumentTypeRequestModelCompositionsInner");
/**
* Check if a given object implements the CreateDocumentTypeRequestModel interface.
*/
function instanceOfCreateDocumentTypeRequestModel(value) {
if (!('alias' in value) || value['alias'] === undefined)
return false;
if (!('name' in value) || value['name'] === undefined)
return false;
if (!('icon' in value) || value['icon'] === undefined)
return false;
if (!('allowedAsRoot' in value) || value['allowedAsRoot'] === undefined)
return false;
if (!('variesByCulture' in value) || value['variesByCulture'] === undefined)
return false;
if (!('variesBySegment' in value) || value['variesBySegment'] === undefined)
return false;
if (!('isElement' in value) || value['isElement'] === undefined)
return false;
if (!('properties' in value) || value['properties'] === undefined)
return false;
if (!('containers' in value) || value['containers'] === undefined)
return false;
if (!('allowedTemplates' in value) || value['allowedTemplates'] === undefined)
return false;
if (!('cleanup' in value) || value['cleanup'] === undefined)
return false;
if (!('allowedDocumentTypes' in value) || value['allowedDocumentTypes'] === undefined)
return false;
if (!('compositions' in value) || value['compositions'] === undefined)
return false;
return true;
}
function CreateDocumentTypeRequestModelFromJSON(json) {
return CreateDocumentTypeRequestModelFromJSONTyped(json, false);
}
function CreateDocumentTypeRequestModelFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'alias': json['alias'],
'name': json['name'],
'description': json['description'] == null ? undefined : json['description'],
'icon': json['icon'],
'allowedAsRoot': json['allowedAsRoot'],
'variesByCulture': json['variesByCulture'],
'variesBySegment': json['variesBySegment'],
'collection': json['collection'] == null ? undefined : (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['collection']),
'isElement': json['isElement'],
'properties': (json['properties'].map(CreateDocumentTypeRequestModelPropertiesInner_1.CreateDocumentTypeRequestModelPropertiesInnerFromJSON)),
'containers': (json['containers'].map(CreateDocumentTypeRequestModelContainersInner_1.CreateDocumentTypeRequestModelContainersInnerFromJSON)),
'id': json['id'] == null ? undefined : json['id'],
'parent': json['parent'] == null ? undefined : (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['parent']),
'allowedTemplates': (json['allowedTemplates'].map(PostUserGroupByIdUsersRequestInner_1.PostUserGroupByIdUsersRequestInnerFromJSON)),
'defaultTemplate': json['defaultTemplate'] == null ? undefined : (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['defaultTemplate']),
'cleanup': (0, DocumentTypeCleanupModel_1.DocumentTypeCleanupModelFromJSON)(json['cleanup']),
'allowedDocumentTypes': (json['allowedDocumentTypes'].map(CreateDocumentTypeRequestModelAllowedDocumentTypesInner_1.CreateDocumentTypeRequestModelAllowedDocumentTypesInnerFromJSON)),
'compositions': (json['compositions'].map(CreateDocumentTypeRequestModelCompositionsInner_1.CreateDocumentTypeRequestModelCompositionsInnerFromJSON)),
};
}
function CreateDocumentTypeRequestModelToJSON(json) {
return CreateDocumentTypeRequestModelToJSONTyped(json, false);
}
function CreateDocumentTypeRequestModelToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'alias': value['alias'],
'name': value['name'],
'description': value['description'],
'icon': value['icon'],
'allowedAsRoot': value['allowedAsRoot'],
'variesByCulture': value['variesByCulture'],
'variesBySegment': value['variesBySegment'],
'collection': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['collection']),
'isElement': value['isElement'],
'properties': (value['properties'].map(CreateDocumentTypeRequestModelPropertiesInner_1.CreateDocumentTypeRequestModelPropertiesInnerToJSON)),
'containers': (value['containers'].map(CreateDocumentTypeRequestModelContainersInner_1.CreateDocumentTypeRequestModelContainersInnerToJSON)),
'id': value['id'],
'parent': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['parent']),
'allowedTemplates': (value['allowedTemplates'].map(PostUserGroupByIdUsersRequestInner_1.PostUserGroupByIdUsersRequestInnerToJSON)),
'defaultTemplate': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['defaultTemplate']),
'cleanup': (0, DocumentTypeCleanupModel_1.DocumentTypeCleanupModelToJSON)(value['cleanup']),
'allowedDocumentTypes': (value['allowedDocumentTypes'].map(CreateDocumentTypeRequestModelAllowedDocumentTypesInner_1.CreateDocumentTypeRequestModelAllowedDocumentTypesInnerToJSON)),
'compositions': (value['compositions'].map(CreateDocumentTypeRequestModelCompositionsInner_1.CreateDocumentTypeRequestModelCompositionsInnerToJSON)),
};
}