/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; import type { MenuItemLinkResource } from './MenuItemLinkResource'; import { MenuItemLinkResourceFromJSON, MenuItemLinkResourceFromJSONTyped, MenuItemLinkResourceToJSON, MenuItemLinkResourceToJSONTyped, } from './MenuItemLinkResource'; /** * * @export * @interface MenuItemHierarchyResource */ export interface MenuItemHierarchyResource { /** * * @type {number} * @memberof MenuItemHierarchyResource */ id: number; /** * * @type {number} * @memberof MenuItemHierarchyResource */ menuId: number; /** * * @type {number} * @memberof MenuItemHierarchyResource */ parentId?: number | null; /** * * @type {string} * @memberof MenuItemHierarchyResource */ type: string; /** * * @type {string} * @memberof MenuItemHierarchyResource */ heading: string; /** * * @type {string} * @memberof MenuItemHierarchyResource */ subheading?: string | null; /** * * @type {number} * @memberof MenuItemHierarchyResource */ index: number; /** * * @type {Array} * @memberof MenuItemHierarchyResource */ children: Array | null; /** * * @type {MenuItemLinkResource} * @memberof MenuItemHierarchyResource */ menuItemLink: MenuItemLinkResource | null; } /** * Check if a given object implements the MenuItemHierarchyResource interface. */ export function instanceOfMenuItemHierarchyResource(value: object): value is MenuItemHierarchyResource { if (!('id' in value) || value['id'] === undefined) return false; if (!('menuId' in value) || value['menuId'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('heading' in value) || value['heading'] === undefined) return false; if (!('index' in value) || value['index'] === undefined) return false; if (!('children' in value) || value['children'] === undefined) return false; if (!('menuItemLink' in value) || value['menuItemLink'] === undefined) return false; return true; } export function MenuItemHierarchyResourceFromJSON(json: any): MenuItemHierarchyResource { return MenuItemHierarchyResourceFromJSONTyped(json, false); } export function MenuItemHierarchyResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): MenuItemHierarchyResource { if (json == null) { return json; } return { 'id': json['id'], 'menuId': json['menuId'], 'parentId': json['parentId'] == null ? undefined : json['parentId'], 'type': json['type'], 'heading': json['heading'], 'subheading': json['subheading'] == null ? undefined : json['subheading'], 'index': json['index'], 'children': (json['children'] == null ? null : (json['children'] as Array).map(MenuItemHierarchyResourceFromJSON)), 'menuItemLink': MenuItemLinkResourceFromJSON(json['menuItemLink']), }; } export function MenuItemHierarchyResourceToJSON(json: any): MenuItemHierarchyResource { return MenuItemHierarchyResourceToJSONTyped(json, false); } export function MenuItemHierarchyResourceToJSONTyped(value?: MenuItemHierarchyResource | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'menuId': value['menuId'], 'parentId': value['parentId'], 'type': value['type'], 'heading': value['heading'], 'subheading': value['subheading'], 'index': value['index'], 'children': (value['children'] == null ? null : (value['children'] as Array).map(MenuItemHierarchyResourceToJSON)), 'menuItemLink': MenuItemLinkResourceToJSON(value['menuItemLink']), }; }