import { PluginContainerData } from "./common.js";
import { CollapsibleListData_InitialExpandedItems, CollapsibleListData_Direction } from "./plugin_collapsible_list.enums.js";
function collapsibleListData_InitialExpandedItemsFromJSON(object) {
  switch (object) {
    case 0:
    case "FIRST":
      return CollapsibleListData_InitialExpandedItems.FIRST;
    case 1:
    case "ALL":
      return CollapsibleListData_InitialExpandedItems.ALL;
    case 2:
    case "NONE":
      return CollapsibleListData_InitialExpandedItems.NONE;
    case -1:
    case "UNRECOGNIZED":
    default:
      return CollapsibleListData_InitialExpandedItems.UNRECOGNIZED;
  }
}
function collapsibleListData_InitialExpandedItemsToJSON(object) {
  switch (object) {
    case CollapsibleListData_InitialExpandedItems.FIRST:
      return "FIRST";
    case CollapsibleListData_InitialExpandedItems.ALL:
      return "ALL";
    case CollapsibleListData_InitialExpandedItems.NONE:
      return "NONE";
    default:
      return "UNKNOWN";
  }
}
function collapsibleListData_DirectionFromJSON(object) {
  switch (object) {
    case 0:
    case "LTR":
      return CollapsibleListData_Direction.LTR;
    case 1:
    case "RTL":
      return CollapsibleListData_Direction.RTL;
    case -1:
    case "UNRECOGNIZED":
    default:
      return CollapsibleListData_Direction.UNRECOGNIZED;
  }
}
function collapsibleListData_DirectionToJSON(object) {
  switch (object) {
    case CollapsibleListData_Direction.LTR:
      return "LTR";
    case CollapsibleListData_Direction.RTL:
      return "RTL";
    default:
      return "UNKNOWN";
  }
}
const baseCollapsibleListData = {
  initialExpandedItems: CollapsibleListData_InitialExpandedItems.FIRST,
  direction: CollapsibleListData_Direction.LTR
};
const CollapsibleListData = {
  fromJSON(object) {
    const message = { ...baseCollapsibleListData };
    message.containerData = object.containerData !== void 0 && object.containerData !== null ? PluginContainerData.fromJSON(object.containerData) : void 0;
    message.expandOnlyOne = object.expandOnlyOne !== void 0 && object.expandOnlyOne !== null ? Boolean(object.expandOnlyOne) : void 0;
    message.initialExpandedItems = object.initialExpandedItems !== void 0 && object.initialExpandedItems !== null ? collapsibleListData_InitialExpandedItemsFromJSON(
      object.initialExpandedItems
    ) : CollapsibleListData_InitialExpandedItems.FIRST;
    message.direction = object.direction !== void 0 && object.direction !== null ? collapsibleListData_DirectionFromJSON(object.direction) : CollapsibleListData_Direction.LTR;
    message.isQapageData = object.isQapageData !== void 0 && object.isQapageData !== null ? Boolean(object.isQapageData) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.containerData !== void 0 && (obj.containerData = message.containerData ? PluginContainerData.toJSON(message.containerData) : void 0);
    message.expandOnlyOne !== void 0 && (obj.expandOnlyOne = message.expandOnlyOne);
    message.initialExpandedItems !== void 0 && (obj.initialExpandedItems = collapsibleListData_InitialExpandedItemsToJSON(
      message.initialExpandedItems
    ));
    message.direction !== void 0 && (obj.direction = collapsibleListData_DirectionToJSON(message.direction));
    message.isQapageData !== void 0 && (obj.isQapageData = message.isQapageData);
    return obj;
  }
};
export {
  CollapsibleListData,
  collapsibleListData_DirectionFromJSON,
  collapsibleListData_DirectionToJSON,
  collapsibleListData_InitialExpandedItemsFromJSON,
  collapsibleListData_InitialExpandedItemsToJSON
};
//# sourceMappingURL=plugin_collapsible_list.js.map
