// Copyright 2020 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// (Re-)generated by schema tool
// >>>> DO NOT CHANGE THIS FILE! <<<<
// Change the json schema instead

#![allow(dead_code)]

use crate::coreroot::*;
use crate::*;

pub struct DeployContractCall {
	pub func: ScFunc,
	pub params: MutableDeployContractParams,
}

pub struct GrantDeployPermissionCall {
	pub func: ScFunc,
	pub params: MutableGrantDeployPermissionParams,
}

pub struct RequireDeployPermissionsCall {
	pub func: ScFunc,
	pub params: MutableRequireDeployPermissionsParams,
}

pub struct RevokeDeployPermissionCall {
	pub func: ScFunc,
	pub params: MutableRevokeDeployPermissionParams,
}

pub struct SubscribeBlockContextCall {
	pub func: ScFunc,
	pub params: MutableSubscribeBlockContextParams,
}

pub struct FindContractCall {
	pub func: ScView,
	pub params: MutableFindContractParams,
	pub results: ImmutableFindContractResults,
}

pub struct GetContractRecordsCall {
	pub func: ScView,
	pub results: ImmutableGetContractRecordsResults,
}

pub struct ScFuncs {
}

impl ScFuncs {
    pub fn deploy_contract(_ctx: &dyn ScFuncCallContext) -> DeployContractCall {
        let mut f = DeployContractCall {
            func: ScFunc::new(HSC_NAME, HFUNC_DEPLOY_CONTRACT),
            params: MutableDeployContractParams { proxy: Proxy::nil() },
        };
        ScFunc::link_params(&mut f.params.proxy, &f.func);
        f
    }

    pub fn grant_deploy_permission(_ctx: &dyn ScFuncCallContext) -> GrantDeployPermissionCall {
        let mut f = GrantDeployPermissionCall {
            func: ScFunc::new(HSC_NAME, HFUNC_GRANT_DEPLOY_PERMISSION),
            params: MutableGrantDeployPermissionParams { proxy: Proxy::nil() },
        };
        ScFunc::link_params(&mut f.params.proxy, &f.func);
        f
    }

    pub fn require_deploy_permissions(_ctx: &dyn ScFuncCallContext) -> RequireDeployPermissionsCall {
        let mut f = RequireDeployPermissionsCall {
            func: ScFunc::new(HSC_NAME, HFUNC_REQUIRE_DEPLOY_PERMISSIONS),
            params: MutableRequireDeployPermissionsParams { proxy: Proxy::nil() },
        };
        ScFunc::link_params(&mut f.params.proxy, &f.func);
        f
    }

    pub fn revoke_deploy_permission(_ctx: &dyn ScFuncCallContext) -> RevokeDeployPermissionCall {
        let mut f = RevokeDeployPermissionCall {
            func: ScFunc::new(HSC_NAME, HFUNC_REVOKE_DEPLOY_PERMISSION),
            params: MutableRevokeDeployPermissionParams { proxy: Proxy::nil() },
        };
        ScFunc::link_params(&mut f.params.proxy, &f.func);
        f
    }

    pub fn subscribe_block_context(_ctx: &dyn ScFuncCallContext) -> SubscribeBlockContextCall {
        let mut f = SubscribeBlockContextCall {
            func: ScFunc::new(HSC_NAME, HFUNC_SUBSCRIBE_BLOCK_CONTEXT),
            params: MutableSubscribeBlockContextParams { proxy: Proxy::nil() },
        };
        ScFunc::link_params(&mut f.params.proxy, &f.func);
        f
    }

    pub fn find_contract(_ctx: &dyn ScViewCallContext) -> FindContractCall {
        let mut f = FindContractCall {
            func: ScView::new(HSC_NAME, HVIEW_FIND_CONTRACT),
            params: MutableFindContractParams { proxy: Proxy::nil() },
            results: ImmutableFindContractResults { proxy: Proxy::nil() },
        };
        ScView::link_params(&mut f.params.proxy, &f.func);
        ScView::link_results(&mut f.results.proxy, &f.func);
        f
    }

    pub fn get_contract_records(_ctx: &dyn ScViewCallContext) -> GetContractRecordsCall {
        let mut f = GetContractRecordsCall {
            func: ScView::new(HSC_NAME, HVIEW_GET_CONTRACT_RECORDS),
            results: ImmutableGetContractRecordsResults { proxy: Proxy::nil() },
        };
        ScView::link_results(&mut f.results.proxy, &f.func);
        f
    }
}
