UNPKG

umbraco-management-api-client

Version:

TypeScript client for the Umbraco Management API (auto-generated by OpenAPI Generator)

93 lines (92 loc) 4.51 kB
"use strict"; /* 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.instanceOfCreateUserGroupRequestModel = instanceOfCreateUserGroupRequestModel; exports.CreateUserGroupRequestModelFromJSON = CreateUserGroupRequestModelFromJSON; exports.CreateUserGroupRequestModelFromJSONTyped = CreateUserGroupRequestModelFromJSONTyped; exports.CreateUserGroupRequestModelToJSON = CreateUserGroupRequestModelToJSON; exports.CreateUserGroupRequestModelToJSONTyped = CreateUserGroupRequestModelToJSONTyped; const CreateUserGroupRequestModelPermissionsInner_1 = require("./CreateUserGroupRequestModelPermissionsInner"); const ReferenceByIdModel_1 = require("./ReferenceByIdModel"); /** * Check if a given object implements the CreateUserGroupRequestModel interface. */ function instanceOfCreateUserGroupRequestModel(value) { if (!('name' in value) || value['name'] === undefined) return false; if (!('alias' in value) || value['alias'] === undefined) return false; if (!('sections' in value) || value['sections'] === undefined) return false; if (!('languages' in value) || value['languages'] === undefined) return false; if (!('hasAccessToAllLanguages' in value) || value['hasAccessToAllLanguages'] === undefined) return false; if (!('documentRootAccess' in value) || value['documentRootAccess'] === undefined) return false; if (!('mediaRootAccess' in value) || value['mediaRootAccess'] === undefined) return false; if (!('fallbackPermissions' in value) || value['fallbackPermissions'] === undefined) return false; if (!('permissions' in value) || value['permissions'] === undefined) return false; return true; } function CreateUserGroupRequestModelFromJSON(json) { return CreateUserGroupRequestModelFromJSONTyped(json, false); } function CreateUserGroupRequestModelFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'name': json['name'], 'alias': json['alias'], 'icon': json['icon'] == null ? undefined : json['icon'], 'sections': json['sections'], 'languages': json['languages'], 'hasAccessToAllLanguages': json['hasAccessToAllLanguages'], 'documentStartNode': json['documentStartNode'] == null ? undefined : (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['documentStartNode']), 'documentRootAccess': json['documentRootAccess'], 'mediaStartNode': json['mediaStartNode'] == null ? undefined : (0, ReferenceByIdModel_1.ReferenceByIdModelFromJSON)(json['mediaStartNode']), 'mediaRootAccess': json['mediaRootAccess'], 'fallbackPermissions': new Set(json['fallbackPermissions']), 'permissions': (new Set(json['permissions'].map(CreateUserGroupRequestModelPermissionsInner_1.CreateUserGroupRequestModelPermissionsInnerFromJSON))), 'id': json['id'] == null ? undefined : json['id'], }; } function CreateUserGroupRequestModelToJSON(json) { return CreateUserGroupRequestModelToJSONTyped(json, false); } function CreateUserGroupRequestModelToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'name': value['name'], 'alias': value['alias'], 'icon': value['icon'], 'sections': value['sections'], 'languages': value['languages'], 'hasAccessToAllLanguages': value['hasAccessToAllLanguages'], 'documentStartNode': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['documentStartNode']), 'documentRootAccess': value['documentRootAccess'], 'mediaStartNode': (0, ReferenceByIdModel_1.ReferenceByIdModelToJSON)(value['mediaStartNode']), 'mediaRootAccess': value['mediaRootAccess'], 'fallbackPermissions': Array.from(value['fallbackPermissions']), 'permissions': (Array.from(value['permissions']).map(CreateUserGroupRequestModelPermissionsInner_1.CreateUserGroupRequestModelPermissionsInnerToJSON)), 'id': value['id'], }; }