import { createReducer, isDocumentAction } from "document-model";
import { vetraCloudEnvironmentDataManagementOperations } from "../src/reducers/data-management.js";
import { vetraCloudEnvironmentPackagesOperations } from "../src/reducers/packages.js";
import { vetraCloudEnvironmentServicesOperations } from "../src/reducers/services.js";
import { vetraCloudEnvironmentStatusTransitionsOperations } from "../src/reducers/status-transitions.js";
import { AddPackageInputSchema, ApproveChangesInputSchema, ArchiveInputSchema, DisableServiceInputSchema, EnableServiceInputSchema, InitializeInputSchema, MarkChangesPushedInputSchema, MarkDeploymentStartedInputSchema, MarkDestroyedInputSchema, RemovePackageInputSchema, ReportDeploymentFailedInputSchema, ReportDeploymentSucceededInputSchema, SetApexServiceInputSchema, SetAutoUpdateChannelInputSchema, SetCustomDomainInputSchema, SetDefaultPackageRegistryInputSchema, SetDnsRecordsInputSchema, SetGenericSubdomainInputSchema, SetLabelInputSchema, SetOwnerInputSchema, SetPackageVersionInputSchema, SetRuntimeConfigInputSchema, SetServiceConfigInputSchema, SetServiceSizeInputSchema, SetServiceStatusInputSchema, SetServiceVersionInputSchema, SleepEnvironmentInputSchema, TerminateEnvironmentInputSchema, ToggleServiceInputSchema, UnarchiveInputSchema, UpdateServicePrefixInputSchema, WakeEnvironmentInputSchema, } from "./schema/zod.js";
const stateReducer = (state, action, dispatch) => {
    if (isDocumentAction(action)) {
        return state;
    }
    switch (action.type) {
        case "SET_OWNER": {
            SetOwnerInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setOwnerOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_LABEL": {
            SetLabelInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setLabelOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_GENERIC_SUBDOMAIN": {
            SetGenericSubdomainInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setGenericSubdomainOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_CUSTOM_DOMAIN": {
            SetCustomDomainInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setCustomDomainOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_DEFAULT_PACKAGE_REGISTRY": {
            SetDefaultPackageRegistryInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setDefaultPackageRegistryOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_DNS_RECORDS": {
            SetDnsRecordsInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setDnsRecordsOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_APEX_SERVICE": {
            SetApexServiceInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setApexServiceOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_AUTO_UPDATE_CHANNEL": {
            SetAutoUpdateChannelInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setAutoUpdateChannelOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_RUNTIME_CONFIG": {
            SetRuntimeConfigInputSchema().parse(action.input);
            vetraCloudEnvironmentDataManagementOperations.setRuntimeConfigOperation(state[action.scope], action, dispatch);
            break;
        }
        case "ENABLE_SERVICE": {
            EnableServiceInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.enableServiceOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_SERVICE_CONFIG": {
            SetServiceConfigInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.setServiceConfigOperation(state[action.scope], action, dispatch);
            break;
        }
        case "DISABLE_SERVICE": {
            DisableServiceInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.disableServiceOperation(state[action.scope], action, dispatch);
            break;
        }
        case "TOGGLE_SERVICE": {
            ToggleServiceInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.toggleServiceOperation(state[action.scope], action, dispatch);
            break;
        }
        case "UPDATE_SERVICE_PREFIX": {
            UpdateServicePrefixInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.updateServicePrefixOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_SERVICE_STATUS": {
            SetServiceStatusInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.setServiceStatusOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_SERVICE_VERSION": {
            SetServiceVersionInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.setServiceVersionOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_SERVICE_SIZE": {
            SetServiceSizeInputSchema().parse(action.input);
            vetraCloudEnvironmentServicesOperations.setServiceSizeOperation(state[action.scope], action, dispatch);
            break;
        }
        case "ADD_PACKAGE": {
            AddPackageInputSchema().parse(action.input);
            vetraCloudEnvironmentPackagesOperations.addPackageOperation(state[action.scope], action, dispatch);
            break;
        }
        case "REMOVE_PACKAGE": {
            RemovePackageInputSchema().parse(action.input);
            vetraCloudEnvironmentPackagesOperations.removePackageOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SET_PACKAGE_VERSION": {
            SetPackageVersionInputSchema().parse(action.input);
            vetraCloudEnvironmentPackagesOperations.setPackageVersionOperation(state[action.scope], action, dispatch);
            break;
        }
        case "INITIALIZE": {
            InitializeInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.initializeOperation(state[action.scope], action, dispatch);
            break;
        }
        case "MARK_CHANGES_PUSHED": {
            MarkChangesPushedInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.markChangesPushedOperation(state[action.scope], action, dispatch);
            break;
        }
        case "MARK_DEPLOYMENT_STARTED": {
            MarkDeploymentStartedInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.markDeploymentStartedOperation(state[action.scope], action, dispatch);
            break;
        }
        case "REPORT_DEPLOYMENT_SUCCEEDED": {
            ReportDeploymentSucceededInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.reportDeploymentSucceededOperation(state[action.scope], action, dispatch);
            break;
        }
        case "REPORT_DEPLOYMENT_FAILED": {
            ReportDeploymentFailedInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.reportDeploymentFailedOperation(state[action.scope], action, dispatch);
            break;
        }
        case "APPROVE_CHANGES": {
            ApproveChangesInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.approveChangesOperation(state[action.scope], action, dispatch);
            break;
        }
        case "TERMINATE_ENVIRONMENT": {
            TerminateEnvironmentInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.terminateEnvironmentOperation(state[action.scope], action, dispatch);
            break;
        }
        case "MARK_DESTROYED": {
            MarkDestroyedInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.markDestroyedOperation(state[action.scope], action, dispatch);
            break;
        }
        case "ARCHIVE": {
            ArchiveInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.archiveOperation(state[action.scope], action, dispatch);
            break;
        }
        case "UNARCHIVE": {
            UnarchiveInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.unarchiveOperation(state[action.scope], action, dispatch);
            break;
        }
        case "SLEEP_ENVIRONMENT": {
            SleepEnvironmentInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.sleepEnvironmentOperation(state[action.scope], action, dispatch);
            break;
        }
        case "WAKE_ENVIRONMENT": {
            WakeEnvironmentInputSchema().parse(action.input);
            vetraCloudEnvironmentStatusTransitionsOperations.wakeEnvironmentOperation(state[action.scope], action, dispatch);
            break;
        }
        default:
            return state;
    }
};
export const reducer = createReducer(stateReducer);
