// Code generated by ndpgen. DO NOT EDIT.
//
// This file contains mock implementations for non-WASM builds.
// These mocks allow IDE support, compilation, and unit testing on non-WASM platforms.
// Plugin authors can use the exported PDKMock instance to set expectations in tests.
//
//go:build !wasip1

package pdk

import "github.com/stretchr/testify/mock"

// mockPDK is the mock implementation for testing PDK functions.
type mockPDK struct {
	mock.Mock
}

// PDKMock is the auto-instantiated mock instance for testing.
// Use this to set expectations: pdk.PDKMock.On("GetConfig", "key").Return("value", true)
var PDKMock = &mockPDK{}

// ResetMock resets the mock to its initial state.
// Call this in test setup/teardown to ensure clean state between tests.
func ResetMock() {
	PDKMock = &mockPDK{}
}

// Functions
func Allocate(length int) Memory {
	args := PDKMock.Called(length)
	return args.Get(0).(Memory)
}
func AllocateBytes(data []byte) Memory {
	args := PDKMock.Called(data)
	return args.Get(0).(Memory)
}

// AllocateJSON AllocateJSON allocates and saves the type `any` into Memory on the host.
func AllocateJSON(v any) (Memory, error) {
	args := PDKMock.Called(v)
	return args.Get(0).(Memory), args.Error(1)
}

// AllocateString AllocateString allocates and saves the UTF-8 string `data` into Memory on the host.
func AllocateString(data string) Memory {
	args := PDKMock.Called(data)
	return args.Get(0).(Memory)
}

// FindMemory FindMemory finds the host memory block at the given `offset`.
func FindMemory(offset uint64) Memory {
	args := PDKMock.Called(offset)
	return args.Get(0).(Memory)
}

// GetConfig GetConfig returns the config string associated with `key` (if any).
func GetConfig(key string) (string, bool) {
	args := PDKMock.Called(key)
	return args.String(0), args.Bool(1)
}

// GetVar GetVar returns the byte slice (if any) associated with `key`.
func GetVar(key string) []byte {
	args := PDKMock.Called(key)
	return args.Get(0).([]byte)
}

// GetVarInt GetVarInt returns the int associated with `key` (or 0 if none).
func GetVarInt(key string) int {
	args := PDKMock.Called(key)
	return args.Int(0)
}

// Input Input returns a slice of bytes from the host.
func Input() []byte {
	args := PDKMock.Called()
	return args.Get(0).([]byte)
}

// InputJSON InputJSON returns unmartialed JSON data from the host "input".
func InputJSON(v any) error {
	args := PDKMock.Called(v)
	return args.Error(0)
}

// InputString InputString returns the input data from the host as a UTF-8 string.
func InputString() string {
	args := PDKMock.Called()
	return args.String(0)
}

// JSONFrom JSONFrom unmarshals a `Memory` block located at `offset` from the host into the provided data `v`.
func JSONFrom(offset uint64, v any) error {
	args := PDKMock.Called(offset, v)
	return args.Error(0)
}

// Log Log logs the provided UTF-8 string `s` on the host using the provided log `level`.
func Log(level LogLevel, s string) {
	PDKMock.Called(level, s)
}

// LogMemory LogMemory logs the `memory` block on the host using the provided log `level`.
func LogMemory(level LogLevel, m Memory) {
	PDKMock.Called(level, m)
}

// NewHTTPRequest NewHTTPRequest returns a new `HTTPRequest`.
func NewHTTPRequest(method HTTPMethod, url string) *HTTPRequest {
	args := PDKMock.Called(method, url)
	return args.Get(0).(*HTTPRequest)
}
func NewMemory(offset uint64, length uint64) Memory {
	args := PDKMock.Called(offset, length)
	return args.Get(0).(Memory)
}

// Output Output sends the `data` slice of bytes to the host output.
func Output(data []byte) {
	PDKMock.Called(data)
}

// OutputJSON OutputJSON marshals the provided data `v` as output to the host.
func OutputJSON(v any) error {
	args := PDKMock.Called(v)
	return args.Error(0)
}

// OutputMemory OutputMemory sends the `mem` Memory to the host output.
func OutputMemory(mem Memory) {
	PDKMock.Called(mem)
}

// OutputString OutputString sends the UTF-8 string `s` to the host output.
func OutputString(s string) {
	PDKMock.Called(s)
}

// ParamBytes ParamBytes returns bytes from Extism host memory given an offset.
func ParamBytes(offset uint64) []byte {
	args := PDKMock.Called(offset)
	return args.Get(0).([]byte)
}

// ParamString ParamString returns UTF-8 string data from Extism host memory given an offset.
func ParamString(offset uint64) string {
	args := PDKMock.Called(offset)
	return args.String(0)
}

// ParamU32 ParamU32 returns a uint32 from Extism host memory given an offset.
func ParamU32(offset uint64) uint32 {
	args := PDKMock.Called(offset)
	return args.Get(0).(uint32)
}

// ParamU64 ParamU64 returns a uint64 from Extism host memory given an offset.
func ParamU64(offset uint64) uint64 {
	args := PDKMock.Called(offset)
	return args.Get(0).(uint64)
}

// RemoveVar RemoveVar removes (and frees) the host variable associated with `key`.
func RemoveVar(key string) {
	PDKMock.Called(key)
}

// ResultBytes ResultBytes allocates bytes and returns the offset in Extism host memory.
func ResultBytes(d []byte) uint64 {
	args := PDKMock.Called(d)
	return args.Get(0).(uint64)
}

// ResultString ResultString allocates a UTF-8 string and returns the offset in Extism host memory.
func ResultString(s string) uint64 {
	args := PDKMock.Called(s)
	return args.Get(0).(uint64)
}

// ResultU32 ResultU32 allocates a uint32 and returns the offset in Extism host memory.
func ResultU32(d uint32) uint64 {
	args := PDKMock.Called(d)
	return args.Get(0).(uint64)
}

// ResultU64 ResultU64 allocates a uint64 and returns the offset in Extism host memory.
func ResultU64(d uint64) uint64 {
	args := PDKMock.Called(d)
	return args.Get(0).(uint64)
}

// SetError SetError sets the host error string from `err`.
func SetError(err error) {
	PDKMock.Called(err)
}

// SetErrorString SetErrorString sets the host error string from `err`.
func SetErrorString(err string) {
	PDKMock.Called(err)
}

// SetVar SetVar sets the host variable associated with `key` to the `value` byte slice.
func SetVar(key string, value []byte) {
	PDKMock.Called(key, value)
}

// SetVarInt SetVarInt sets the host variable associated with `key` to the `value` int.
func SetVarInt(key string, value int) {
	PDKMock.Called(key, value)
}
