//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.296
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Pluto.Registration {
    using System;
    using RemObjects.SDK;
    using RemObjects.SDK.Types;
    using RemObjects.SDK.Server;
    
    [RemObjects.SDK.Server.Invoker()]
    [System.Reflection.ObfuscationAttribute(Exclude=true)]
    public class Registration_Invoker : RemObjects.SDK.Server.Invoker {
        public Registration_Invoker() : 
                base() {
        }
        public static void Invoke_GetApiHostMobile(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                string SystemApiKey = @__Message.ReadAnsiString("SystemApiKey");
                Host Host;
                Host = ((IRegistration)(@__Instance)).GetApiHostMobile(SystemApiKey);
                @__ObjectDisposer.Add(Host);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "GetApiHostMobileResponse");
                @__Message.Write("Host", Host, typeof(Host), RemObjects.SDK.StreamingFormat.Default);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_GetApiHostWifi(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                string SystemApiKey = @__Message.ReadAnsiString("SystemApiKey");
                Host host;
                host = ((IRegistration)(@__Instance)).GetApiHostWifi(SystemApiKey);
                @__ObjectDisposer.Add(host);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "GetApiHostWifiResponse");
                @__Message.Write("host", host, typeof(Host), RemObjects.SDK.StreamingFormat.Default);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_GetClients(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                bool @internal = @__Message.ReadBoolean("internal");
                Client[] Result;
                Result = ((IRegistration)(@__Instance)).GetClients(@internal);
                @__ObjectDisposer.Add(Result);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "GetClientsResponse");
                @__Message.Write("Result", Result, typeof(Client[]), RemObjects.SDK.StreamingFormat.Default);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_GetRegistrationServer(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                string SystemApiKey = @__Message.ReadAnsiString("SystemApiKey");
                Host Host;
                Host = ((IRegistration)(@__Instance)).GetRegistrationServer(SystemApiKey);
                @__ObjectDisposer.Add(Host);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "GetRegistrationServerResponse");
                @__Message.Write("Host", Host, typeof(Host), RemObjects.SDK.StreamingFormat.Default);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_RegisterNewServerPractice(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                string PracticeName = @__Message.ReadAnsiString("PracticeName");
                Server server = ((Server)(@__Message.Read("server", typeof(Server), RemObjects.SDK.StreamingFormat.Default)));
                string serverType = @__Message.ReadAnsiString("serverType");
                @__ObjectDisposer.Add(server);
                bool Result;
                string UserApiKey;
                string UserApiPin;
                Result = ((IRegistration)(@__Instance)).RegisterNewServerPractice(PracticeName, server, serverType, out UserApiKey, out UserApiPin);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "RegisterNewServerPracticeResponse");
                @__Message.WriteBoolean("Result", Result);
                @__Message.WriteAnsiString("UserApiKey", UserApiKey);
                @__Message.WriteAnsiString("UserApiPin", UserApiPin);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_RegisterNewClient(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string UserApiKey = @__Message.ReadAnsiString("UserApiKey");
            string UserApiPin = @__Message.ReadAnsiString("UserApiPin");
            string SystemApiKey;
            SystemApiKey = ((IRegistration)(@__Instance)).RegisterNewClient(UserApiKey, UserApiPin);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "RegisterNewClientResponse");
            @__Message.WriteAnsiString("SystemApiKey", SystemApiKey);
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
        }
        public static void Invoke_ServerHasBeenUpdated(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string HostGUID = @__Message.ReadAnsiString("HostGUID");
            string Version = @__Message.ReadAnsiString("Version");
            ((IRegistration)(@__Instance)).ServerHasBeenUpdated(HostGUID, Version);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "ServerHasBeenUpdatedResponse");
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roNoResponse;
        }
        public static void Invoke_RetrieveNewClientPin(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string UserApiKey = @__Message.ReadAnsiString("UserApiKey");
            string pin;
            pin = ((IRegistration)(@__Instance)).RetrieveNewClientPin(UserApiKey);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "RetrieveNewClientPinResponse");
            @__Message.WriteAnsiString("pin", pin);
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
        }
        public static void Invoke_UpdateServer(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                Server server = ((Server)(@__Message.Read("server", typeof(Server), RemObjects.SDK.StreamingFormat.Default)));
                @__ObjectDisposer.Add(server);
                bool Result;
                Result = ((IRegistration)(@__Instance)).UpdateServer(server);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "UpdateServerResponse");
                @__Message.WriteBoolean("Result", Result);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_UpdatePracticeName(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string UserApiKey = @__Message.ReadAnsiString("UserApiKey");
            string UserApiPin = @__Message.ReadAnsiString("UserApiPin");
            string PracticeName = @__Message.ReadAnsiString("PracticeName");
            bool Result;
            Result = ((IRegistration)(@__Instance)).UpdatePracticeName(UserApiKey, UserApiPin, PracticeName);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "UpdatePracticeNameResponse");
            @__Message.WriteBoolean("Result", Result);
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
        }
        public static void Invoke_UpdatePracticeName2(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string systemApiKey = @__Message.ReadAnsiString("systemApiKey");
            string PracticeName = @__Message.ReadAnsiString("PracticeName");
            bool Result;
            Result = ((IRegistration)(@__Instance)).UpdatePracticeName2(systemApiKey, PracticeName);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "UpdatePracticeName2Response");
            @__Message.WriteBoolean("Result", Result);
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
        }
        public static void Invoke_IsServerReachable(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                Server server = ((Server)(@__Message.Read("server", typeof(Server), RemObjects.SDK.StreamingFormat.Default)));
                @__ObjectDisposer.Add(server);
                bool Result;
                Result = ((IRegistration)(@__Instance)).IsServerReachable(server);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "IsServerReachableResponse");
                @__Message.WriteBoolean("Result", Result);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_IsClientReachable(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string systemApiKey = @__Message.ReadAnsiString("systemApiKey");
            bool Result;
            Result = ((IRegistration)(@__Instance)).IsClientReachable(systemApiKey);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "IsClientReachableResponse");
            @__Message.WriteBoolean("Result", Result);
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
        }
        public static void Invoke_RetrieveHostGUIDForServerFromInternet(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            RemObjects.SDK.ObjectDisposer @__ObjectDisposer = new RemObjects.SDK.ObjectDisposer(1);
            try {
                Server server = ((Server)(@__Message.Read("server", typeof(Server), RemObjects.SDK.StreamingFormat.Default)));
                @__ObjectDisposer.Add(server);
                string HostGUID;
                HostGUID = ((IRegistration)(@__Instance)).RetrieveHostGUIDForServerFromInternet(server);
                @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "RetrieveHostGUIDForServerFromInternetResponse");
                @__Message.WriteAnsiString("HostGUID", HostGUID);
                @__Message.FinalizeMessage();
                @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
            }
            finally {
                @__ObjectDisposer.Dispose();
            }
        }
        public static void Invoke_DoesServerHostGUIDExist(RemObjects.SDK.IROService @__Instance, RemObjects.SDK.IMessage @__Message, RemObjects.SDK.Server.IServerChannelInfo @__ServerChannelInfo, out RemObjects.SDK.Server.ResponseOptions @__oResponseOptions) {
            string HostGUID = @__Message.ReadAnsiString("HostGUID");
            bool Result;
            Result = ((IRegistration)(@__Instance)).DoesServerHostGUIDExist(HostGUID);
            @__Message.InitializeResponseMessage(@__ServerChannelInfo, "Registration", "Registration", "DoesServerHostGUIDExistResponse");
            @__Message.WriteBoolean("Result", Result);
            @__Message.FinalizeMessage();
            @__oResponseOptions = RemObjects.SDK.Server.ResponseOptions.roDefault;
        }
    }
    [RemObjects.SDK.Activator()]
    [System.Reflection.ObfuscationAttribute(Exclude=true, ApplyToMembers=false)]
    public class Registration_Activator : RemObjects.SDK.Server.ServiceActivator {
        public Registration_Activator() : 
                base() {
        }
        public override RemObjects.SDK.IROService CreateInstance() {
            return new Registration();
        }
    }
}
