Esempio n. 1
0
        internal DeleteEndpointResponse DeleteEndpoint(DeleteEndpointRequest request)
        {
            var marshaller   = new DeleteEndpointRequestMarshaller();
            var unmarshaller = DeleteEndpointResponseUnmarshaller.Instance;

            return(Invoke <DeleteEndpointRequest, DeleteEndpointResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 2
0
        private async Task DeleteEndpointAsync(string endpointArnToDelete)
        {
            DeleteEndpointRequest deReq = new DeleteEndpointRequest();

            deReq.EndpointArn = endpointArnToDelete;
            await snsClient.DeleteEndpointAsync(deReq);
        }
        /// <summary>Snippet for DeleteEndpointAsync</summary>
        public async Task DeleteEndpointRequestObjectAsync()
        {
            // Snippet: DeleteEndpointAsync(DeleteEndpointRequest, CallSettings)
            // Additional: DeleteEndpointAsync(DeleteEndpointRequest, CancellationToken)
            // Create client
            IDSClient iDSClient = await IDSClient.CreateAsync();

            // Initialize request argument(s)
            DeleteEndpointRequest request = new DeleteEndpointRequest
            {
                EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                RequestId    = "",
            };
            // Make the request
            Operation <Empty, OperationMetadata> response = await iDSClient.DeleteEndpointAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, OperationMetadata> retrievedResponse = await iDSClient.PollOnceDeleteEndpointAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        public async Task <UnRegisterUserSuccessfulResult> UnRegisterUserAsync(string userId)
        {
            UnRegisterUserSuccessfulResult result      = new UnRegisterUserSuccessfulResult();
            List <DynamoSubscriber>        subscribers = await subscribersTableOperator.GetAllSubcribersOfUserAsync(userId);

            if (subscribers.Count == 0)
            {
                result.NotRegistered = true;
                return(result);
            }
            if (tagOperator.IsTaggingAvailable())
            {
                var tagSubscibers = subscribers.Select(s => new Subscriber {
                    UserId = s.UserId, Token = s.NotificationToken
                }).ToList();
                await tagOperator.RemoveSubscribers(tagSubscibers);
            }
            foreach (var subscriber in subscribers)
            {
                DeleteEndpointRequest deReq = new DeleteEndpointRequest();
                deReq.EndpointArn = subscriber.EndpointARN;
                await snsClient.DeleteEndpointAsync(deReq);

                await subscribersTableOperator.RemoveSubscriberAsync(subscriber);
            }

            return(result);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteEndpoint operation.
        /// <seealso cref="Amazon.SimpleNotificationService.IAmazonSimpleNotificationService"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteEndpoint operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <DeleteEndpointResponse> DeleteEndpointAsync(DeleteEndpointRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DeleteEndpointRequestMarshaller();
            var unmarshaller = DeleteEndpointResponseUnmarshaller.Instance;

            return(Invoke <IRequest, DeleteEndpointRequest, DeleteEndpointResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
Esempio n. 6
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!ConfirmDelete("OCIDataconnectivityEndpoint", "Remove"))
            {
                return;
            }

            DeleteEndpointRequest request;

            try
            {
                request = new DeleteEndpointRequest
                {
                    EndpointId       = EndpointId,
                    RegistryId       = RegistryId,
                    IsForceOperation = IsForceOperation,
                    IfMatch          = IfMatch,
                    OpcRequestId     = OpcRequestId
                };

                response = client.DeleteEndpoint(request).GetAwaiter().GetResult();
                WriteOutput(response, CreateWorkRequestObject(response.OpcWorkRequestId));
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
        /// <summary>
        /// S3 on Outposts access points simplify managing data access at scale for shared datasets
        /// in Amazon S3 on Outposts. S3 on Outposts uses endpoints to connect to Outposts buckets
        /// so that you can perform actions within your virtual private cloud (VPC).
        ///
        ///
        /// <para>
        /// This action deletes an endpoint.
        /// </para>
        ///
        /// <para>
        /// Related actions include:
        /// </para>
        ///  <ul> <li>
        /// <para>
        ///  <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
        ///
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html">ListEndpoints</a>
        ///
        /// </para>
        ///  </li> </ul>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteEndpoint service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the DeleteEndpoint service method, as returned by S3Outposts.</returns>
        /// <exception cref="Amazon.S3Outposts.Model.AccessDeniedException">
        /// Access was denied for this action.
        /// </exception>
        /// <exception cref="Amazon.S3Outposts.Model.InternalServerException">
        /// There was an exception with the internal server.
        /// </exception>
        /// <exception cref="Amazon.S3Outposts.Model.ResourceNotFoundException">
        /// The requested resource was not found.
        /// </exception>
        /// <exception cref="Amazon.S3Outposts.Model.ValidationException">
        /// There was an exception validating this data.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3outposts-2017-07-25/DeleteEndpoint">REST API Reference for DeleteEndpoint Operation</seealso>
        public virtual Task <DeleteEndpointResponse> DeleteEndpointAsync(DeleteEndpointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteEndpointRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteEndpointResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteEndpointResponse>(request, options, cancellationToken));
        }
        /// <summary>
        /// S3 on Outposts access points simplify managing data access at scale for shared datasets
        /// in Amazon S3 on Outposts. S3 on Outposts uses endpoints to connect to Outposts buckets
        /// so that you can perform actions within your virtual private cloud (VPC).
        ///
        ///
        /// <para>
        /// This action deletes an endpoint.
        /// </para>
        ///
        /// <para>
        /// Related actions include:
        /// </para>
        ///  <ul> <li>
        /// <para>
        ///  <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
        ///
        /// </para>
        ///  </li> <li>
        /// <para>
        ///  <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html">ListEndpoints</a>
        ///
        /// </para>
        ///  </li> </ul>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteEndpoint service method.</param>
        ///
        /// <returns>The response from the DeleteEndpoint service method, as returned by S3Outposts.</returns>
        /// <exception cref="Amazon.S3Outposts.Model.AccessDeniedException">
        /// Access was denied for this action.
        /// </exception>
        /// <exception cref="Amazon.S3Outposts.Model.InternalServerException">
        /// There was an exception with the internal server.
        /// </exception>
        /// <exception cref="Amazon.S3Outposts.Model.ResourceNotFoundException">
        /// The requested resource was not found.
        /// </exception>
        /// <exception cref="Amazon.S3Outposts.Model.ValidationException">
        /// There was an exception validating this data.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3outposts-2017-07-25/DeleteEndpoint">REST API Reference for DeleteEndpoint Operation</seealso>
        public virtual DeleteEndpointResponse DeleteEndpoint(DeleteEndpointRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteEndpointRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteEndpointResponseUnmarshaller.Instance;

            return(Invoke <DeleteEndpointResponse>(request, options));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteEndpoint operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteEndpoint operation on AmazonS3OutpostsClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteEndpoint
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3outposts-2017-07-25/DeleteEndpoint">REST API Reference for DeleteEndpoint Operation</seealso>
        public virtual IAsyncResult BeginDeleteEndpoint(DeleteEndpointRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteEndpointRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteEndpointResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
        internal DeleteEndpointResponse DeleteEndpoint(DeleteEndpointRequest request)
        {
            var task = DeleteEndpointAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Atualiza o registro de endpoint de notificação no SNS
        /// </summary>
        /// <param name="device"></param>
        /// <returns></returns>
        public static bool RemoveNotificationEndpoint(DeviceEntity device)
        {
            DeleteEndpointRequest request = new DeleteEndpointRequest()
            {
                EndpointArn = device.BrokerEndpoint
            };

            var result = AWSFactory.SNSClient.DeleteEndpoint(request);

            if (result.HttpStatusCode == System.Net.HttpStatusCode.OK)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 12
0
        public static void SNSMobilePushAPIsDeletePlatformEndpoint()
        {
            #region SNSMobilePushAPIsDeletePlatformEndpoint
            var snsClient = new AmazonSimpleNotificationServiceClient();

            var request = new DeleteEndpointRequest
            {
                EndpointArn = "arn:aws:sns:us-east-1:80398EXAMPLE:" +
                              "endpoint/GCM/TimeCardProcessingApplication/" +
                              "d84b5f0d-7136-3bbe-9b42-4e001EXAMPLE"
            };

            snsClient.DeleteEndpoint(request);
            #endregion
        }
Esempio n. 13
0
        public static bool RemoveDevice(string DeviceARN)
        {
            try
            {
                using (var client = CreateClient())
                {
                    var request = new DeleteEndpointRequest()
                    {
                        EndpointArn = DeviceARN
                    };

                    var resp = client.DeleteEndpoint(request);
                    return(resp.HttpStatusCode == System.Net.HttpStatusCode.OK);
                }
            }
            catch (Exception ex)
            {
                Entities.Log.Error("SNS.RemoveDeviceEndpoint", ex);
                return(false);
            }
        }
        public async Task <UnRegisterSubscriberSuccessfulResult> UnRegisterSubscriberAsync(DynamoSubscriber subscriber, List <IDynamoTagEntry> tags)
        {
            UnRegisterSubscriberSuccessfulResult result = new UnRegisterSubscriberSuccessfulResult();

            if (subscriber != null)
            {
                if (tagOperator.IsTaggingAvailable())
                {
                    await tagOperator.RemoveTagSubscribers(tags);
                }
                DeleteEndpointRequest deReq = new DeleteEndpointRequest();
                deReq.EndpointArn = subscriber.EndpointARN;
                await snsClient.DeleteEndpointAsync(deReq);

                await subscribersTableOperator.RemoveSubscriberAsync(subscriber);
            }
            else
            {
                result.NotRegistered = true;
                return(result);
            }

            return(result);
        }
Esempio n. 15
0
 public DeleteEndpointResponse DeleteEndpoint(DeleteEndpointRequest request)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 16
0
 public Task <DeleteEndpointResponse> DeleteEndpointAsync(DeleteEndpointRequest request, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
Esempio n. 17
0
 public void DeleteEndpointAsync(DeleteEndpointRequest request, AmazonServiceCallback <DeleteEndpointRequest, DeleteEndpointResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 18
0
 public Task <DeleteEndpointResponse> DeleteEndpointAsync(DeleteEndpointRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new System.NotImplementedException();
 }
Esempio n. 19
0
        /// <summary>
        /// This is the main function for sending notification
        /// </summary>
        public void sendNotification()
        {
            foreach (Client client in clients)
            {
                int clientID = client.getClientID();

                #region AWS connection - This code block is same for every push message type - This is the basic block.

                _client = new AmazonSimpleNotificationServiceClient("XXXXXXX", "XXXXXXXXXX", Amazon.RegionEndpoint.EUCentral1);
                string    token       = client.getPushToken();
                Platfroms mobilOsType = client.getMobileType() == 0 ? Platfroms.IOS_PATFORM : Platfroms.ANDROID_PLATFORM;

                try
                {
                    string applicationArn = "";

                    try
                    {
                        applicationArn = applications[(int)mobilOsType].getArn();
                    }
                    catch
                    {
                        continue;
                    }

                    string endPointArn = createEndPointArn(token, applicationArn);

                    if (string.IsNullOrEmpty(endPointArn))
                    {
                        continue;
                    }
                    else
                    {
                        PublishRequest publishRequest          = new PublishRequest();
                        Dictionary <string, string> messageMap = new Dictionary <string, string>();
                        messageMap.Add("default", "default message");
                        string platform = mobilOsType == 0 ? "APNS_SANDBOX" : "GCM";

                        // This application developed for IOS and Android
                        if (mobilOsType != Platfroms.IOS_PATFORM && mobilOsType != Platfroms.ANDROID_PLATFORM)
                        {
                            continue;
                        }

                        int    clientsID = client.getClientID();
                        Guid   pushesID  = client.getPushID();
                        string message   = mobilOsType == 0 ? getAPNSMessage(notification, title, pushesID, clientsID) : getGCMMessage(notification, title, pushesID, clientsID);
                        messageMap.Add(platform, message);

                        publishRequest.TargetArn        = endPointArn;
                        publishRequest.MessageStructure = "json";

                        string messageJSON = "";

                        try
                        {
                            messageJSON = JsonConvert.SerializeObject(messageMap);
                        }
                        catch
                        {
                            continue;
                        }

                        try
                        {
                            publishRequest.Message = messageJSON;
                            _client.Publish(publishRequest);
                        }
                        catch
                        {
                            continue;
                        }

                        try
                        {
                            // for deleting endPointArn
                            DeleteEndpointRequest _request = new DeleteEndpointRequest();
                            _request.EndpointArn = endPointArn;
                            _client.DeleteEndpoint(_request);
                        }
                        catch
                        {
                            continue;
                        }
                    }
                }
                catch
                {
                    continue;
                }

                #endregion
            }
        }