//
// Created by the DataSnap proxy generator.
// 2012/03/14 13:58:34
// 

unit ClientClassesUnit1;

interface

uses Datasnap.DSProxyRest, Datasnap.DSClientRest, Data.DBXCommon, Data.DBXClient, Data.DBXDataSnap, Data.DBXJSON, Datasnap.DSProxy, System.Classes, System.SysUtils, Data.DB, Data.SqlExpr, Data.DBXDBReaders, Data.DBXJSONReflect;

type
  TMyServerMethodsClient = class(TDSAdminRestClient)
  private
    FEchoStringCommand: TDSRestCommand;
    FReverseStringCommand: TDSRestCommand;
    FServerTimeCommand: TDSRestCommand;
    FAdd33Command: TDSRestCommand;
  public
    constructor Create(ARestConnection: TDSRestConnection); overload;
    constructor Create(ARestConnection: TDSRestConnection; AInstanceOwner: Boolean); overload;
    destructor Destroy; override;
    function EchoString(Value: string; const ARequestFilter: string = ''): string;
    function ReverseString(Value: string; const ARequestFilter: string = ''): string;
    function ServerTime(const ARequestFilter: string = ''): TDateTime;
    function Add33(X1: Integer; X2: Integer; X3: Integer; X4: Integer; X5: Integer; X6: Integer; X7: Integer; X8: Integer; X9: Integer; X10: Integer; X11: Integer; X12: Integer; X13: Integer; X14: Integer; X15: Integer; X16: Integer; X17: Integer; X18: Integer; X19: Integer; X20: Integer; X21: Integer; X22: Integer; X23: Integer; X24: Integer; X25: Integer; X26: Integer; X27: Integer; X28: Integer; X29: Integer; X30: Integer; X31: Integer; X32: Integer; X33: Integer; const ARequestFilter: string = ''): Integer;
  end;

const
  TMyServerMethods_EchoString: array [0..1] of TDSRestParameterMetaData =
  (
    (Name: 'Value'; Direction: 1; DBXType: 26; TypeName: 'string'),
    (Name: ''; Direction: 4; DBXType: 26; TypeName: 'string')
  );

  TMyServerMethods_ReverseString: array [0..1] of TDSRestParameterMetaData =
  (
    (Name: 'Value'; Direction: 1; DBXType: 26; TypeName: 'string'),
    (Name: ''; Direction: 4; DBXType: 26; TypeName: 'string')
  );

  TMyServerMethods_ServerTime: array [0..0] of TDSRestParameterMetaData =
  (
    (Name: ''; Direction: 4; DBXType: 11; TypeName: 'TDateTime')
  );

  TMyServerMethods_Add33: array [0..33] of TDSRestParameterMetaData =
  (
    (Name: 'X1'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X2'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X3'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X4'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X5'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X6'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X7'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X8'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X9'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X10'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X11'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X12'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X13'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X14'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X15'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X16'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X17'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X18'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X19'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X20'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X21'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X22'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X23'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X24'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X25'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X26'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X27'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X28'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X29'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X30'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X31'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X32'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: 'X33'; Direction: 1; DBXType: 6; TypeName: 'Integer'),
    (Name: ''; Direction: 4; DBXType: 6; TypeName: 'Integer')
  );

implementation

function TMyServerMethodsClient.EchoString(Value: string; const ARequestFilter: string): string;
begin
  if FEchoStringCommand = nil then
  begin
    FEchoStringCommand := FConnection.CreateCommand;
    FEchoStringCommand.RequestType := 'GET';
    FEchoStringCommand.Text := 'TMyServerMethods.EchoString';
    FEchoStringCommand.Prepare(TMyServerMethods_EchoString);
  end;
  FEchoStringCommand.Parameters[0].Value.SetWideString(Value);
  FEchoStringCommand.Execute(ARequestFilter);
  Result := FEchoStringCommand.Parameters[1].Value.GetWideString;
end;

function TMyServerMethodsClient.ReverseString(Value: string; const ARequestFilter: string): string;
begin
  if FReverseStringCommand = nil then
  begin
    FReverseStringCommand := FConnection.CreateCommand;
    FReverseStringCommand.RequestType := 'GET';
    FReverseStringCommand.Text := 'TMyServerMethods.ReverseString';
    FReverseStringCommand.Prepare(TMyServerMethods_ReverseString);
  end;
  FReverseStringCommand.Parameters[0].Value.SetWideString(Value);
  FReverseStringCommand.Execute(ARequestFilter);
  Result := FReverseStringCommand.Parameters[1].Value.GetWideString;
end;

function TMyServerMethodsClient.ServerTime(const ARequestFilter: string): TDateTime;
begin
  if FServerTimeCommand = nil then
  begin
    FServerTimeCommand := FConnection.CreateCommand;
    FServerTimeCommand.RequestType := 'GET';
    FServerTimeCommand.Text := 'TMyServerMethods.ServerTime';
    FServerTimeCommand.Prepare(TMyServerMethods_ServerTime);
  end;
  FServerTimeCommand.Execute(ARequestFilter);
  Result := FServerTimeCommand.Parameters[0].Value.AsDateTime;
end;

function TMyServerMethodsClient.Add33(X1: Integer; X2: Integer; X3: Integer; X4: Integer; X5: Integer; X6: Integer; X7: Integer; X8: Integer; X9: Integer; X10: Integer; X11: Integer; X12: Integer; X13: Integer; X14: Integer; X15: Integer; X16: Integer; X17: Integer; X18: Integer; X19: Integer; X20: Integer; X21: Integer; X22: Integer; X23: Integer; X24: Integer; X25: Integer; X26: Integer; X27: Integer; X28: Integer; X29: Integer; X30: Integer; X31: Integer; X32: Integer; X33: Integer; const ARequestFilter: string): Integer;
begin
  if FAdd33Command = nil then
  begin
    FAdd33Command := FConnection.CreateCommand;
    FAdd33Command.RequestType := 'GET';
    FAdd33Command.Text := 'TMyServerMethods.Add33';
    FAdd33Command.Prepare(TMyServerMethods_Add33);
  end;
  FAdd33Command.Parameters[0].Value.SetInt32(X1);
  FAdd33Command.Parameters[1].Value.SetInt32(X2);
  FAdd33Command.Parameters[2].Value.SetInt32(X3);
  FAdd33Command.Parameters[3].Value.SetInt32(X4);
  FAdd33Command.Parameters[4].Value.SetInt32(X5);
  FAdd33Command.Parameters[5].Value.SetInt32(X6);
  FAdd33Command.Parameters[6].Value.SetInt32(X7);
  FAdd33Command.Parameters[7].Value.SetInt32(X8);
  FAdd33Command.Parameters[8].Value.SetInt32(X9);
  FAdd33Command.Parameters[9].Value.SetInt32(X10);
  FAdd33Command.Parameters[10].Value.SetInt32(X11);
  FAdd33Command.Parameters[11].Value.SetInt32(X12);
  FAdd33Command.Parameters[12].Value.SetInt32(X13);
  FAdd33Command.Parameters[13].Value.SetInt32(X14);
  FAdd33Command.Parameters[14].Value.SetInt32(X15);
  FAdd33Command.Parameters[15].Value.SetInt32(X16);
  FAdd33Command.Parameters[16].Value.SetInt32(X17);
  FAdd33Command.Parameters[17].Value.SetInt32(X18);
  FAdd33Command.Parameters[18].Value.SetInt32(X19);
  FAdd33Command.Parameters[19].Value.SetInt32(X20);
  FAdd33Command.Parameters[20].Value.SetInt32(X21);
  FAdd33Command.Parameters[21].Value.SetInt32(X22);
  FAdd33Command.Parameters[22].Value.SetInt32(X23);
  FAdd33Command.Parameters[23].Value.SetInt32(X24);
  FAdd33Command.Parameters[24].Value.SetInt32(X25);
  FAdd33Command.Parameters[25].Value.SetInt32(X26);
  FAdd33Command.Parameters[26].Value.SetInt32(X27);
  FAdd33Command.Parameters[27].Value.SetInt32(X28);
  FAdd33Command.Parameters[28].Value.SetInt32(X29);
  FAdd33Command.Parameters[29].Value.SetInt32(X30);
  FAdd33Command.Parameters[30].Value.SetInt32(X31);
  FAdd33Command.Parameters[31].Value.SetInt32(X32);
  FAdd33Command.Parameters[32].Value.SetInt32(X33);
  FAdd33Command.Execute(ARequestFilter);
  Result := FAdd33Command.Parameters[33].Value.GetInt32;
end;

constructor TMyServerMethodsClient.Create(ARestConnection: TDSRestConnection);
begin
  inherited Create(ARestConnection);
end;

constructor TMyServerMethodsClient.Create(ARestConnection: TDSRestConnection; AInstanceOwner: Boolean);
begin
  inherited Create(ARestConnection, AInstanceOwner);
end;

destructor TMyServerMethodsClient.Destroy;
begin
  FreeAndNil(FEchoStringCommand);
  FreeAndNil(FReverseStringCommand);
  FreeAndNil(FServerTimeCommand);
  FreeAndNil(FAdd33Command);
  inherited;
end;

end.
