// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as api$0 from "./internal/api/models.js";

/**
 * RenamePathRequest 重命名文件或目录请求结构体
 */
export class RenamePathRequest {
    "oldPath": string;
    "newPath": string;

    /** Creates a new RenamePathRequest instance. */
    constructor($$source: Partial<RenamePathRequest> = {}) {
        if (!("oldPath" in $$source)) {
            this["oldPath"] = "";
        }
        if (!("newPath" in $$source)) {
            this["newPath"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new RenamePathRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): RenamePathRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new RenamePathRequest($$parsedSource as Partial<RenamePathRequest>);
    }
}

/**
 * SaveAppConfigRequest 保存应用配置请求
 */
export class SaveAppConfigRequest {
    "tabs": api$0.AppTabDefinition[];
    "visibleTabs": string[];
    "defaultTab": string;

    /** Creates a new SaveAppConfigRequest instance. */
    constructor($$source: Partial<SaveAppConfigRequest> = {}) {
        if (!("tabs" in $$source)) {
            this["tabs"] = [];
        }
        if (!("visibleTabs" in $$source)) {
            this["visibleTabs"] = [];
        }
        if (!("defaultTab" in $$source)) {
            this["defaultTab"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new SaveAppConfigRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): SaveAppConfigRequest {
        const $$createField0_0 = $$createType1;
        const $$createField1_0 = $$createType2;
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        if ("tabs" in $$parsedSource) {
            $$parsedSource["tabs"] = $$createField0_0($$parsedSource["tabs"]);
        }
        if ("visibleTabs" in $$parsedSource) {
            $$parsedSource["visibleTabs"] = $$createField1_0($$parsedSource["visibleTabs"]);
        }
        return new SaveAppConfigRequest($$parsedSource as Partial<SaveAppConfigRequest>);
    }
}

/**
 * SaveBase64FileRequest 保存 Base64 编码的二进制文件
 */
export class SaveBase64FileRequest {
    "path": string;

    /**
     * base64 编码的文件内容
     */
    "content": string;

    /** Creates a new SaveBase64FileRequest instance. */
    constructor($$source: Partial<SaveBase64FileRequest> = {}) {
        if (!("path" in $$source)) {
            this["path"] = "";
        }
        if (!("content" in $$source)) {
            this["content"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new SaveBase64FileRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): SaveBase64FileRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new SaveBase64FileRequest($$parsedSource as Partial<SaveBase64FileRequest>);
    }
}

export class SaveProfileRequest {
    "id": number | null;
    "name": string;
    "host": string;
    "port": number;
    "username": string;
    "password": string;
    "key_path": string;
    "type": string;
    "token": string;
    "last_connected": number | null;

    /** Creates a new SaveProfileRequest instance. */
    constructor($$source: Partial<SaveProfileRequest> = {}) {
        if (!("id" in $$source)) {
            this["id"] = null;
        }
        if (!("name" in $$source)) {
            this["name"] = "";
        }
        if (!("host" in $$source)) {
            this["host"] = "";
        }
        if (!("port" in $$source)) {
            this["port"] = 0;
        }
        if (!("username" in $$source)) {
            this["username"] = "";
        }
        if (!("password" in $$source)) {
            this["password"] = "";
        }
        if (!("key_path" in $$source)) {
            this["key_path"] = "";
        }
        if (!("type" in $$source)) {
            this["type"] = "";
        }
        if (!("token" in $$source)) {
            this["token"] = "";
        }
        if (!("last_connected" in $$source)) {
            this["last_connected"] = null;
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new SaveProfileRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): SaveProfileRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new SaveProfileRequest($$parsedSource as Partial<SaveProfileRequest>);
    }
}

/**
 * SftpConnectRequest SFTP 连接请求
 */
export class SftpConnectRequest {
    "host": string;
    "port": number;
    "username": string;
    "password": string;
    "key_path": string;
    "key_passphrase": string;

    /** Creates a new SftpConnectRequest instance. */
    constructor($$source: Partial<SftpConnectRequest> = {}) {
        if (!("host" in $$source)) {
            this["host"] = "";
        }
        if (!("port" in $$source)) {
            this["port"] = 0;
        }
        if (!("username" in $$source)) {
            this["username"] = "";
        }
        if (!("password" in $$source)) {
            this["password"] = "";
        }
        if (!("key_path" in $$source)) {
            this["key_path"] = "";
        }
        if (!("key_passphrase" in $$source)) {
            this["key_passphrase"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new SftpConnectRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): SftpConnectRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new SftpConnectRequest($$parsedSource as Partial<SftpConnectRequest>);
    }
}

/**
 * SftpRenamePathRequest SFTP 重命名请求
 */
export class SftpRenamePathRequest {
    "session_id": string;
    "old_path": string;
    "new_path": string;

    /** Creates a new SftpRenamePathRequest instance. */
    constructor($$source: Partial<SftpRenamePathRequest> = {}) {
        if (!("session_id" in $$source)) {
            this["session_id"] = "";
        }
        if (!("old_path" in $$source)) {
            this["old_path"] = "";
        }
        if (!("new_path" in $$source)) {
            this["new_path"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new SftpRenamePathRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): SftpRenamePathRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new SftpRenamePathRequest($$parsedSource as Partial<SftpRenamePathRequest>);
    }
}

/**
 * SftpWriteFileRequest SFTP 写入请求
 */
export class SftpWriteFileRequest {
    "session_id": string;
    "path": string;
    "content": string;

    /** Creates a new SftpWriteFileRequest instance. */
    constructor($$source: Partial<SftpWriteFileRequest> = {}) {
        if (!("session_id" in $$source)) {
            this["session_id"] = "";
        }
        if (!("path" in $$source)) {
            this["path"] = "";
        }
        if (!("content" in $$source)) {
            this["content"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new SftpWriteFileRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): SftpWriteFileRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new SftpWriteFileRequest($$parsedSource as Partial<SftpWriteFileRequest>);
    }
}

/**
 * WriteFileRequest 写入文件请求结构体
 */
export class WriteFileRequest {
    "path": string;
    "content": string;

    /** Creates a new WriteFileRequest instance. */
    constructor($$source: Partial<WriteFileRequest> = {}) {
        if (!("path" in $$source)) {
            this["path"] = "";
        }
        if (!("content" in $$source)) {
            this["content"] = "";
        }

        Object.assign(this, $$source);
    }

    /**
     * Creates a new WriteFileRequest instance from a string or object.
     */
    static createFrom($$source: any = {}): WriteFileRequest {
        let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
        return new WriteFileRequest($$parsedSource as Partial<WriteFileRequest>);
    }
}

// Private type creation functions
const $$createType0 = api$0.AppTabDefinition.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = $Create.Array($Create.Any);
