Exemple #1
0
 public Task Delete(DeletePhotoRequest request, CancellationToken cancellationToken = default)
 {
     return(_amazonS3Client.DeleteObjectAsync(new DeleteObjectRequest
     {
         BucketName = BucketName,
         Key = request.PhotoName
     }, cancellationToken));
 }
Exemple #2
0
        public async Task DeletePhoto(DeletePhotoRequest request, CancellationToken cancellationToken)
        {
            var ad = await _repository.FindById(request.Id, cancellationToken);

            if (ad == null)
            {
                throw new NoPhotoFoundException(request.Id);
            }

            await _repository.DeleteById(request.Id, cancellationToken);
        }
Exemple #3
0
        public IActionResult DeletePhoto(DeletePhotoRequest request)
        {
            var messageClientId = new MessageClientId(request.ClientId);
            var messageChainId  = new MessageChainId(Guid.NewGuid().ToString());
            var inputMessage    = new DeletePhotoInputMessage(messageClientId, messageChainId)
            {
                PhotoId = request.PhotoId
            };

            _queueManager.SendMessage(PhotoSettings.PhotoInputQueue, inputMessage);

            return(Ok());
        }
Exemple #4
0
        public void DeletePhoto_RequestObject()
        {
            // Snippet: DeletePhoto(DeletePhotoRequest,CallSettings)
            // Create client
            StreetViewPublishServiceClient streetViewPublishServiceClient = StreetViewPublishServiceClient.Create();
            // Initialize request argument(s)
            DeletePhotoRequest request = new DeletePhotoRequest
            {
                PhotoId = "",
            };

            // Make the request
            streetViewPublishServiceClient.DeletePhoto(request);
            // End snippet
        }
Exemple #5
0
        public async Task DeletePhotoAsync_RequestObject()
        {
            // Snippet: DeletePhotoAsync(DeletePhotoRequest,CallSettings)
            // Create client
            StreetViewPublishServiceClient streetViewPublishServiceClient = await StreetViewPublishServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeletePhotoRequest request = new DeletePhotoRequest
            {
                PhotoId = "",
            };
            // Make the request
            await streetViewPublishServiceClient.DeletePhotoAsync(request);

            // End snippet
        }