The AWS4Delphi is a Delphi SDK to integrate with AWS services with delphi quickly and simply.
The available services are:
- Amazon SNS: Simple Notification Service
- Amazon SQS: Simple Queue Service
- Amazon S3: Simple Storage Service
For install in your project using boss:
$ boss install github.com/gabrielbaltazar/AWS4Delphi
Prerequisites: GBClient - This is a SDK to work with rest requests
The available functions are:
- CreateBucket
- CreateObject
- DeleteBucket
- DeleteObject
- DownloadObject
- ExistBucket
- ExistObject
- GetObjectProperties
- ListBuckets
- ListObjects
You need to use AWS4D.S3.Facade.Interfaces
uses
AWS4D.S3.Facade.Interfaces;
- SET Credentials
var
FS3: IAWS4DS3Facade;
begin
FS3 := NewS3Facade;
FS3.AccessKey('')
.SecretKey('')
.Region('us-east-1');
end;
- CREATE Object
FS3.CreateObject
.Request
.BucketName('bucketName')
.ObjectName('objectName')
.FileName('FileName') // or .FileStream(Stream)
.&End
.Send;
- DOWNLOAD Object
FS3.DownloadObject
.Request
.BucketName(edtListObjectsBucketName.Text)
.ObjectName(edtListObjectObjectName.Text)
.&End
.Send
.SaveToFile('test.txt');
The available functions are:
- AddPermission
- CheckIfPhoneNumberIsOptedOut
- ConfirmSubscription
- CreateSMSSandboxPhoneNumber
- CreateTopic
- DeleteTopic
- DeleteSMSSandboxPhoneNumber
- GetSMSSandboxAccountStatus
- GetSubscriptionAttributes
- GetTopicAttributes
- ListSMSSandboxPhoneNumbers
- ListSubscriptions
- ListTopics
- OptInPhoneNumber
- Publish
- RemovePersmission
- SetEndpointAttributes
- SetPlatformApplicationAttributes
- SetSubscriptionsAttributes
- SetTopicAttributes
- Subscribe
- Unsubscribe
- VerifySMSSandboxPhoneNumber
You need to use AWS4D.SNS.Facade.Interfaces
uses AWS4D.SNS.Facade.Interfaces;
- SET Credentials
var
FSNS: IAWS4DSNSFacade;
begin
FSNS := NewSNSFacade;
FSNS
.AccessKey('')
.SecretKey('')
.Region('us-east-1');
end;
- Create Topic
FSNS.CreateTopic
.Request
.Name('topicName')
.&End
.Send;
showMessage(FSNS.CreateTopic.Response.TopicArn)
The available functions are:
- CreateQueue
- DeleteMessage
- DeleteMessageBatch
- DeleteQueue
- GetQueueAttributes
- GetQueueUrl
- ListQueues
- ListQueueTags
- PurgeQueue
- ReceiveMessage
- SendMessage
- TagQueue
- UnTagQueue
You need to use AWS4D.SQS.Facade.Interfaces
uses
AWS4D.SQS.Facade.Interfaces;
- SET Credentials
var
FSQS: IAWS4DSQSFacade;
begin
FSQS := NewSQSFacade;
FSQS.AccessKey('')
.SecretKey('')
.Region('us-east-1');
end;
- SEND Message
FSQS.SendMessage
.Request
.QueueUrl('urlSqsQueue')
.MessageBody('Message Content')
.&End
.Send;
- RECEIVE Message
FSQS.ReceiveMessage
.Request
.MaxNumberOfMessages(3)
.QueueUrl('urlSqsQueue')
.&End
.Send;
while FSQS.ReceiveMessage.Response.Messages.HasNext do
ShowMessage(FSQS.ReceiveMessage.Response.Messages.Current.Body);