#ifndef EPP_DOMAIN_IDL
#define EPP_DOMAIN_IDL

#include "epp.idl"

/*
** EPP-RTK IDL
**
** Authors: 
**      Daniel Manley (Tucows Inc)
**      Asbjorn Steira Mikkelsen (The Global Name Registry, Limited)
**      Frank Thompson (Tucows Inc)
**
** $Header: /cvsroot/epp-rtk/epp-rtk/idl/0503/epp_domain.idl,v 1.1 2003/03/21 16:57:14 tubadanm Exp $
** $Revision: 1.1 $
** $Date: 2003/03/21 16:57:14 $
*/

module domain
{
    ///////////////////////////
    //  common enumerations  //
    ///////////////////////////
    enum epp_DomainStatusType
    { 
        CLIENT_DELETE_PROHIBITED,
        CLIENT_HOLD,
        CLIENT_RENEW_PROHIBITED,
        CLIENT_TRANSFER_PROHIBITED,
        CLIENT_UPDATE_PROHIBITED,
        INACTIVE,
        OK,
        PENDING_DELETE,
        PENDING_TRANSFER,
        PENDING_VERIFICATION,
        SERVER_DELETE_PROHIBITED,
        SERVER_HOLD,
        SERVER_RENEW_PROHIBITED,
        SERVER_TRANSFER_PROHIBITED,
        SERVER_UPDATE_PROHIBITED
    };

    struct epp_DomainStatus
    {
        epp_DomainStatusType m_type;
        epp::epp_string m_lang;
        epp::epp_string m_value;
    };
    
    typedef sequence<epp_DomainStatus> epp_domain_status_seq;

    enum epp_DomainPeriodUnitType
    { 
        YEAR,
        MONTH
    };

    enum epp_DomainContactType
    {
        ADMIN,
        BILLING,
        TECH
    };

    enum epp_DomainHostsType
    {
        ALL,
        DEL,
        NONE,
        SUB
    };

    /////////////////////////////////////
    //  common domain data structures  //
    /////////////////////////////////////
    struct epp_DomainPeriod
    {
        epp_DomainPeriodUnitType m_unit;
        epp::epp_short m_value;
    };

    struct epp_DomainContact
    {
        epp_DomainContactType m_type;
        epp::epp_string m_id;
    };

    typedef sequence<epp_DomainContact> epp_domain_contact_seq;

    ///////////////////
    //  domain:info  //
    ///////////////////
    struct epp_DomainInfoReq
    {
        epp::epp_Command m_cmd;
        epp::epp_string m_name;
        epp_DomainHostsType m_hosts_type;
    };

    struct epp_DomainInfoRsp
    {
        epp::epp_Response m_rsp;
        epp::epp_string m_name;
        epp::epp_roid m_roid;
        epp_domain_status_seq m_status;
        epp::epp_string m_registrant;
        epp_domain_contact_seq m_contacts;
        epp::epp_string_seq m_name_servers;
        epp::epp_string_seq m_hosts;
        epp::epp_string m_client_id;
        epp::epp_string m_created_by;
        epp::epp_datetime m_created_date;
        epp::epp_string m_updated_by;
        epp::epp_datetime m_updated_date;
        epp::epp_datetime m_expiration_date;
        epp::epp_datetime m_transfer_date;
        epp::epp_AuthInfo m_auth_info;
    };

    interface epp_DomainInfo : epp::epp_Action
    {
        void setRequestData(in epp_DomainInfoReq parms);
        epp_DomainInfoRsp getResponseData();
    };

    ////////////////////
    //  domain:check  //
    ////////////////////
    struct epp_DomainCheckReq
    {
        epp::epp_Command m_cmd;
        epp::epp_string_seq m_names;
    };

    struct epp_DomainCheckRsp
    {
        epp::epp_Response m_rsp;
        epp::epp_check_result_seq m_results;
    };

    interface epp_DomainCheck : epp::epp_Action
    {
        void setRequestData(in epp_DomainCheckReq parms);
        epp_DomainCheckRsp getResponseData();
    };

    /////////////////////
    //  domain:create  // 
    /////////////////////
    struct epp_DomainCreateReq
    {
        epp::epp_Command m_cmd;
        epp::epp_string m_name;
        epp_DomainPeriod m_period;
        epp::epp_string_seq m_name_servers;
        epp::epp_string m_registrant;
        epp_domain_contact_seq m_contacts;
        epp::epp_AuthInfo m_auth_info;
    };

    struct epp_DomainCreateRsp
    {
        epp::epp_Response m_rsp;
        epp::epp_string m_name;
        epp::epp_datetime m_creation_date;
        epp::epp_datetime m_expiration_date;
    };

    interface epp_DomainCreate : epp::epp_Action
    {
        void setRequestData(in epp_DomainCreateReq parms);
        epp_DomainCreateRsp getResponseData();
    };

    ////////////////////
    // domain:delete  //
    ////////////////////
    struct epp_DomainDeleteReq
    {
        epp::epp_Command m_cmd;
        epp::epp_string m_name;
    };

    struct epp_DomainDeleteRsp
    {
        epp::epp_Response m_rsp;
    };

    interface epp_DomainDelete : epp::epp_Action
    {
        void setRequestData(in epp_DomainDeleteReq parms);
        epp_DomainDeleteRsp getResponseData();
    };

    ////////////////////
    //  domain:renew  //
    ////////////////////
    struct epp_DomainRenewReq
    {
        epp::epp_Command m_cmd;
        epp::epp_string m_name;
        epp::epp_date m_current_expiration_date;
        epp_DomainPeriod m_period;
    };

    struct epp_DomainRenewRsp
    {
        epp::epp_Response m_rsp;
        epp::epp_string m_name;
        epp::epp_datetime m_expiration_date;
    };

    interface epp_DomainRenew : epp::epp_Action
    {
        void setRequestData(in epp_DomainRenewReq parms);
        epp_DomainRenewRsp getResponseData();
    };

    ///////////////////////
    //  domain:transfer  //
    ///////////////////////
    struct epp_DomainTransferReq
    {
        epp::epp_Command m_cmd;
        epp::epp_TransferRequest m_trans;
        epp::epp_string m_name;
        epp_DomainPeriod m_period;
    };

    // dual purpose struct and interface.
    // when used as the response to a transfer 
    // command, it's a plain struct/classs.  When 
    // used in the response to the poll command, then the 
    // symantic usage of the class is as an interface...
    // The value from getType() in the superinterface
    // tell the RTK user what type of poll response this
    // is so that the proper data is extracted.
    interface epp_DomainTrnData : epp::epp_PollResData
    {
        // The value of this const is to be returned in
        // the call to getType() defined in epp_PollResData
        const epp::epp_string m_type = "domain:trnData";
        
        attribute epp::epp_string m_name;
        attribute epp::epp_TransferStatusType m_transfer_status;
        attribute epp::epp_string m_request_client_id;
        attribute epp::epp_string m_action_client_id;
        attribute epp::epp_datetime m_request_date;
        attribute epp::epp_datetime m_action_date;
        attribute epp::epp_datetime m_expiration_date;
    }; 

    struct epp_DomainTransferRsp
    {
        epp::epp_Response m_rsp;
        epp_DomainTrnData m_trn_data;
    };

    interface epp_DomainTransfer : epp::epp_Action
    {
        void setRequestData(in epp_DomainTransferReq parms);
        epp_DomainTransferRsp getResponseData();
    };

    /////////////////////
    //  domain:update  //
    /////////////////////
    struct epp_DomainUpdateAddRemove
    {
        epp::epp_string_seq m_name_servers;
        epp_domain_contact_seq m_contacts;
        epp_domain_status_seq m_status;
    };

    struct epp_DomainUpdateChange
    {
        epp::epp_string m_registrant;
        epp::epp_AuthInfo m_auth_info;
    };

    struct epp_DomainUpdateReq
    {
        epp::epp_Command m_cmd;
        epp::epp_string m_name;
        epp_DomainUpdateAddRemove m_add;
        epp_DomainUpdateChange m_change;
        epp_DomainUpdateAddRemove m_remove;
    };

    struct epp_DomainUpdateRsp
    {
        epp::epp_Response m_rsp;
    };

    interface epp_DomainUpdate : epp::epp_Action
    {
        void setRequestData(in epp_DomainUpdateReq parms);
        epp_DomainUpdateRsp getResponseData();
    };
};

#endif
