// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package tsptest.flatten.implementation;

import tsptest.flatten.models.TodoItemPatch;
import tsptest.flatten.models.UpdatePatchRequest;

/**
 * This is the Helper class to enable json merge patch serialization for a model.
 */
public class JsonMergePatchHelper {
    private static UpdatePatchRequestAccessor updatePatchRequestAccessor;

    public interface UpdatePatchRequestAccessor {
        UpdatePatchRequest prepareModelForJsonMergePatch(UpdatePatchRequest updatePatchRequest,
            boolean jsonMergePatchEnabled);

        boolean isJsonMergePatch(UpdatePatchRequest updatePatchRequest);
    }

    public static void setUpdatePatchRequestAccessor(UpdatePatchRequestAccessor accessor) {
        updatePatchRequestAccessor = accessor;
    }

    public static UpdatePatchRequestAccessor getUpdatePatchRequestAccessor() {
        return updatePatchRequestAccessor;
    }

    private static TodoItemPatchAccessor todoItemPatchAccessor;

    public interface TodoItemPatchAccessor {
        TodoItemPatch prepareModelForJsonMergePatch(TodoItemPatch todoItemPatch, boolean jsonMergePatchEnabled);

        boolean isJsonMergePatch(TodoItemPatch todoItemPatch);
    }

    public static void setTodoItemPatchAccessor(TodoItemPatchAccessor accessor) {
        todoItemPatchAccessor = accessor;
    }

    public static TodoItemPatchAccessor getTodoItemPatchAccessor() {
        return todoItemPatchAccessor;
    }
}
