unit Chilkat.AuthAws;

{
  Pascal wrapper for Chilkat AuthAws.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TAuthAws wraps CkAuthAws via the C bridge layer. }
  TAuthAws = class(TChilkatBase)
  private
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetAccessKey: string;
    procedure SetAccessKey(AValue: string);
    function  GetCanonicalizedResourceV2: string;
    procedure SetCanonicalizedResourceV2(AValue: string);
    function  GetPrecomputedMd5: string;
    procedure SetPrecomputedMd5(AValue: string);
    function  GetPrecomputedSha256: string;
    procedure SetPrecomputedSha256(AValue: string);
    function  GetRegion: string;
    procedure SetRegion(AValue: string);
    function  GetSecretKey: string;
    procedure SetSecretKey(AValue: string);
    function  GetServiceName: string;
    procedure SetServiceName(AValue: string);
    function  GetSignatureVersion: Integer;
    procedure SetSignatureVersion(AValue: Integer);
    function  GetEnableSecrets: Boolean;
    procedure SetEnableSecrets(AValue: Boolean);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property AccessKey: string read GetAccessKey write SetAccessKey;
    property CanonicalizedResourceV2: string read GetCanonicalizedResourceV2 write SetCanonicalizedResourceV2;
    property PrecomputedMd5: string read GetPrecomputedMd5 write SetPrecomputedMd5;
    property PrecomputedSha256: string read GetPrecomputedSha256 write SetPrecomputedSha256;
    property Region: string read GetRegion write SetRegion;
    property SecretKey: string read GetSecretKey write SetSecretKey;
    property ServiceName: string read GetServiceName write SetServiceName;
    property SignatureVersion: Integer read GetSignatureVersion write SetSignatureVersion;
    property EnableSecrets: Boolean read GetEnableSecrets write SetEnableSecrets;

    function  GenPresignedUrl(const httpVerb: string; useHttps: Boolean; const domain: string; const path: string; numSecondsValid: Integer; const awsService: string): string;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkAuthAws_Create  = function(): Pointer; cdecl;
  TCkAuthAws_Dispose = procedure(handle: Pointer); cdecl;
  TCkAuthAws_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkAuthAws_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkAuthAws_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkAuthAws_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkAuthAws_get_AccessKey = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_AccessKey = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_CanonicalizedResourceV2 = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_CanonicalizedResourceV2 = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_PrecomputedMd5 = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_PrecomputedMd5 = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_PrecomputedSha256 = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_PrecomputedSha256 = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_Region = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_Region = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_SecretKey = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_SecretKey = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_ServiceName = function(handle: Pointer): PAnsiChar; cdecl;
  TCkAuthAws_put_ServiceName = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkAuthAws_get_SignatureVersion = function(handle: Pointer): Integer; cdecl;
  TCkAuthAws_put_SignatureVersion = procedure(handle: Pointer; value: Integer); cdecl;
  TCkAuthAws_get_EnableSecrets = function(handle: Pointer): LongBool; cdecl;
  TCkAuthAws_put_EnableSecrets = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkAuthAws_GenPresignedUrl = function(handle: Pointer; httpVerb: PAnsiChar; useHttps: LongBool; domain: PAnsiChar; path: PAnsiChar; numSecondsValid: Integer; awsService: PAnsiChar): PAnsiChar; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkAuthAws_Create:  TCkAuthAws_Create  = nil;
  CkAuthAws_Dispose: TCkAuthAws_Dispose = nil;
  CkAuthAws_get_LastErrorHtml: TCkAuthAws_get_LastErrorHtml = nil;
  CkAuthAws_get_LastErrorText: TCkAuthAws_get_LastErrorText = nil;
  CkAuthAws_get_LastErrorXml: TCkAuthAws_get_LastErrorXml = nil;
  CkAuthAws_get_Version: TCkAuthAws_get_Version = nil;
  CkAuthAws_get_DebugLogFilePath: TCkAuthAws_get_DebugLogFilePath = nil;
  CkAuthAws_put_DebugLogFilePath: TCkAuthAws_put_DebugLogFilePath = nil;
  CkAuthAws_get_VerboseLogging: TCkAuthAws_get_VerboseLogging = nil;
  CkAuthAws_put_VerboseLogging: TCkAuthAws_put_VerboseLogging = nil;
  CkAuthAws_get_LastMethodSuccess: TCkAuthAws_get_LastMethodSuccess = nil;
  CkAuthAws_put_LastMethodSuccess: TCkAuthAws_put_LastMethodSuccess = nil;
  CkAuthAws_get_AccessKey: TCkAuthAws_get_AccessKey = nil;
  CkAuthAws_put_AccessKey: TCkAuthAws_put_AccessKey = nil;
  CkAuthAws_get_CanonicalizedResourceV2: TCkAuthAws_get_CanonicalizedResourceV2 = nil;
  CkAuthAws_put_CanonicalizedResourceV2: TCkAuthAws_put_CanonicalizedResourceV2 = nil;
  CkAuthAws_get_PrecomputedMd5: TCkAuthAws_get_PrecomputedMd5 = nil;
  CkAuthAws_put_PrecomputedMd5: TCkAuthAws_put_PrecomputedMd5 = nil;
  CkAuthAws_get_PrecomputedSha256: TCkAuthAws_get_PrecomputedSha256 = nil;
  CkAuthAws_put_PrecomputedSha256: TCkAuthAws_put_PrecomputedSha256 = nil;
  CkAuthAws_get_Region: TCkAuthAws_get_Region = nil;
  CkAuthAws_put_Region: TCkAuthAws_put_Region = nil;
  CkAuthAws_get_SecretKey: TCkAuthAws_get_SecretKey = nil;
  CkAuthAws_put_SecretKey: TCkAuthAws_put_SecretKey = nil;
  CkAuthAws_get_ServiceName: TCkAuthAws_get_ServiceName = nil;
  CkAuthAws_put_ServiceName: TCkAuthAws_put_ServiceName = nil;
  CkAuthAws_get_SignatureVersion: TCkAuthAws_get_SignatureVersion = nil;
  CkAuthAws_put_SignatureVersion: TCkAuthAws_put_SignatureVersion = nil;
  CkAuthAws_get_EnableSecrets: TCkAuthAws_get_EnableSecrets = nil;
  CkAuthAws_put_EnableSecrets: TCkAuthAws_put_EnableSecrets = nil;
  CkAuthAws_GenPresignedUrl: TCkAuthAws_GenPresignedUrl = nil;

constructor TAuthAws.Create;
begin
  inherited Create;
  FHandle := CkAuthAws_Create();
end;

destructor TAuthAws.Destroy;
begin
  if FHandle <> nil then
    CkAuthAws_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

function TAuthAws.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkAuthAws_get_LastErrorHtml(FHandle));
end;

function TAuthAws.GetLastErrorText: string;
begin
  Result := CkToStr(CkAuthAws_get_LastErrorText(FHandle));
end;

function TAuthAws.GetLastErrorXml: string;
begin
  Result := CkToStr(CkAuthAws_get_LastErrorXml(FHandle));
end;

function TAuthAws.GetVersion: string;
begin
  Result := CkToStr(CkAuthAws_get_Version(FHandle));
end;

function TAuthAws.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkAuthAws_get_DebugLogFilePath(FHandle));
end;

procedure TAuthAws.SetDebugLogFilePath(AValue: string);
begin
  CkAuthAws_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkAuthAws_get_VerboseLogging(FHandle));
end;

procedure TAuthAws.SetVerboseLogging(AValue: Boolean);
begin
  CkAuthAws_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TAuthAws.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkAuthAws_get_LastMethodSuccess(FHandle));
end;

procedure TAuthAws.SetLastMethodSuccess(AValue: Boolean);
begin
  CkAuthAws_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TAuthAws.GetAccessKey: string;
begin
  Result := CkToStr(CkAuthAws_get_AccessKey(FHandle));
end;

procedure TAuthAws.SetAccessKey(AValue: string);
begin
  CkAuthAws_put_AccessKey(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetCanonicalizedResourceV2: string;
begin
  Result := CkToStr(CkAuthAws_get_CanonicalizedResourceV2(FHandle));
end;

procedure TAuthAws.SetCanonicalizedResourceV2(AValue: string);
begin
  CkAuthAws_put_CanonicalizedResourceV2(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetPrecomputedMd5: string;
begin
  Result := CkToStr(CkAuthAws_get_PrecomputedMd5(FHandle));
end;

procedure TAuthAws.SetPrecomputedMd5(AValue: string);
begin
  CkAuthAws_put_PrecomputedMd5(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetPrecomputedSha256: string;
begin
  Result := CkToStr(CkAuthAws_get_PrecomputedSha256(FHandle));
end;

procedure TAuthAws.SetPrecomputedSha256(AValue: string);
begin
  CkAuthAws_put_PrecomputedSha256(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetRegion: string;
begin
  Result := CkToStr(CkAuthAws_get_Region(FHandle));
end;

procedure TAuthAws.SetRegion(AValue: string);
begin
  CkAuthAws_put_Region(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetSecretKey: string;
begin
  Result := CkToStr(CkAuthAws_get_SecretKey(FHandle));
end;

procedure TAuthAws.SetSecretKey(AValue: string);
begin
  CkAuthAws_put_SecretKey(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetServiceName: string;
begin
  Result := CkToStr(CkAuthAws_get_ServiceName(FHandle));
end;

procedure TAuthAws.SetServiceName(AValue: string);
begin
  CkAuthAws_put_ServiceName(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TAuthAws.GetSignatureVersion: Integer;
begin
  Result := CkAuthAws_get_SignatureVersion(FHandle);
end;

procedure TAuthAws.SetSignatureVersion(AValue: Integer);
begin
  CkAuthAws_put_SignatureVersion(FHandle, AValue);
end;

function TAuthAws.GetEnableSecrets: Boolean;
begin
  Result := Boolean(CkAuthAws_get_EnableSecrets(FHandle));
end;

procedure TAuthAws.SetEnableSecrets(AValue: Boolean);
begin
  CkAuthAws_put_EnableSecrets(FHandle, LongBool(AValue));
end;

function TAuthAws.GenPresignedUrl(const httpVerb: string; useHttps: Boolean; const domain: string; const path: string; numSecondsValid: Integer; const awsService: string): string;
begin
  Result := CkToStr(CkAuthAws_GenPresignedUrl(FHandle, PAnsiChar(StrToCk(httpVerb)), LongBool(useHttps), PAnsiChar(StrToCk(domain)), PAnsiChar(StrToCk(path)), numSecondsValid, PAnsiChar(StrToCk(awsService))));
end;

initialization
  Chilkat_GetProcedureAddress(CkAuthAws_Create,  'CkAuthAws_Create');
  Chilkat_GetProcedureAddress(CkAuthAws_Dispose, 'CkAuthAws_Dispose');
  Chilkat_GetProcedureAddress(CkAuthAws_get_LastErrorHtml, 'CkAuthAws_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkAuthAws_get_LastErrorText, 'CkAuthAws_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkAuthAws_get_LastErrorXml, 'CkAuthAws_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkAuthAws_get_Version, 'CkAuthAws_get_Version');
  Chilkat_GetProcedureAddress(CkAuthAws_get_DebugLogFilePath, 'CkAuthAws_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkAuthAws_put_DebugLogFilePath, 'CkAuthAws_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkAuthAws_get_VerboseLogging, 'CkAuthAws_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkAuthAws_put_VerboseLogging, 'CkAuthAws_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkAuthAws_get_LastMethodSuccess, 'CkAuthAws_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkAuthAws_put_LastMethodSuccess, 'CkAuthAws_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkAuthAws_get_AccessKey, 'CkAuthAws_get_AccessKey');
  Chilkat_GetProcedureAddress(CkAuthAws_put_AccessKey, 'CkAuthAws_put_AccessKey');
  Chilkat_GetProcedureAddress(CkAuthAws_get_CanonicalizedResourceV2, 'CkAuthAws_get_CanonicalizedResourceV2');
  Chilkat_GetProcedureAddress(CkAuthAws_put_CanonicalizedResourceV2, 'CkAuthAws_put_CanonicalizedResourceV2');
  Chilkat_GetProcedureAddress(CkAuthAws_get_PrecomputedMd5, 'CkAuthAws_get_PrecomputedMd5');
  Chilkat_GetProcedureAddress(CkAuthAws_put_PrecomputedMd5, 'CkAuthAws_put_PrecomputedMd5');
  Chilkat_GetProcedureAddress(CkAuthAws_get_PrecomputedSha256, 'CkAuthAws_get_PrecomputedSha256');
  Chilkat_GetProcedureAddress(CkAuthAws_put_PrecomputedSha256, 'CkAuthAws_put_PrecomputedSha256');
  Chilkat_GetProcedureAddress(CkAuthAws_get_Region, 'CkAuthAws_get_Region');
  Chilkat_GetProcedureAddress(CkAuthAws_put_Region, 'CkAuthAws_put_Region');
  Chilkat_GetProcedureAddress(CkAuthAws_get_SecretKey, 'CkAuthAws_get_SecretKey');
  Chilkat_GetProcedureAddress(CkAuthAws_put_SecretKey, 'CkAuthAws_put_SecretKey');
  Chilkat_GetProcedureAddress(CkAuthAws_get_ServiceName, 'CkAuthAws_get_ServiceName');
  Chilkat_GetProcedureAddress(CkAuthAws_put_ServiceName, 'CkAuthAws_put_ServiceName');
  Chilkat_GetProcedureAddress(CkAuthAws_get_SignatureVersion, 'CkAuthAws_get_SignatureVersion');
  Chilkat_GetProcedureAddress(CkAuthAws_put_SignatureVersion, 'CkAuthAws_put_SignatureVersion');
  Chilkat_GetProcedureAddress(CkAuthAws_get_EnableSecrets, 'CkAuthAws_get_EnableSecrets');
  Chilkat_GetProcedureAddress(CkAuthAws_put_EnableSecrets, 'CkAuthAws_put_EnableSecrets');
  Chilkat_GetProcedureAddress(CkAuthAws_GenPresignedUrl, 'CkAuthAws_GenPresignedUrl');

end.
