コード例 #1
0
        IAsyncResult invokeListIdentities(ListIdentitiesRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller   = new ListIdentitiesRequestMarshaller();
            var unmarshaller = ListIdentitiesResponseUnmarshaller.Instance;

            return(Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer));
        }
コード例 #2
0
        /// <summary>
        /// <para>Returns a list containing all of the identities (email addresses and domains) for a specific AWS Account, regardless of verification
        /// status.</para> <para>This action is throttled at one request per second.</para>
        /// </summary>
        ///
        /// <param name="listIdentitiesRequest">Container for the necessary parameters to execute the ListIdentities service method on
        /// AmazonSimpleEmailService.</param>
        ///
        /// <returns>The response from the ListIdentities service method, as returned by AmazonSimpleEmailService.</returns>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <ListIdentitiesResponse> ListIdentitiesAsync(ListIdentitiesRequest listIdentitiesRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListIdentitiesRequestMarshaller();
            var unmarshaller = ListIdentitiesResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, ListIdentitiesRequest, ListIdentitiesResponse>(listIdentitiesRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
コード例 #3
0
        internal ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request)
        {
            ListIdentitiesRequestMarshaller    marshaller = new ListIdentitiesRequestMarshaller();
            ListIdentitiesResponseUnmarshaller instance   = ListIdentitiesResponseUnmarshaller.Instance;

            return(Invoke <ListIdentitiesRequest, ListIdentitiesResponse>(request, marshaller, instance));
        }
コード例 #4
0
        /// <summary>
        /// Lists the identities in a pool.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListIdentities service method.</param>
        ///
        /// <returns>The response from the ListIdentities service method, as returned by CognitoIdentity.</returns>
        /// <exception cref="InternalErrorException">
        /// Thrown when the service encounters an error during processing the request.
        /// </exception>
        /// <exception cref="InvalidParameterException">
        /// Thrown for missing or bad input parameter(s).
        /// </exception>
        /// <exception cref="NotAuthorizedException">
        /// Thrown when a user is not authorized to access the requested resource.
        /// </exception>
        /// <exception cref="ResourceNotFoundException">
        /// Thrown when the requested resource (for example, a dataset or record) does not exist.
        /// </exception>
        /// <exception cref="TooManyRequestsException">
        /// Thrown when a request is throttled.
        /// </exception>
        public ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request)
        {
            var marshaller   = new ListIdentitiesRequestMarshaller();
            var unmarshaller = ListIdentitiesResponseUnmarshaller.Instance;

            return(Invoke <ListIdentitiesRequest, ListIdentitiesResponse>(request, marshaller, unmarshaller));
        }
コード例 #5
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSimpleEmailServiceConfig config = new AmazonSimpleEmailServiceConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonSimpleEmailServiceClient client = new AmazonSimpleEmailServiceClient(creds, config);

            ListIdentitiesResponse resp = new ListIdentitiesResponse();

            do
            {
                ListIdentitiesRequest req = new ListIdentitiesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxItems = maxItems
                };

                resp = client.ListIdentities(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Identities)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
コード例 #6
0
ファイル: SESMain.cs プロジェクト: cusanelly/Library
        public async Task <ListIdentitiesResponse> ListEmails()
        {
            var request = new ListIdentitiesRequest {
                IdentityType = IdentityType.EmailAddress
            };

            return(await _Client.ListIdentitiesAsync(request));
        }
コード例 #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListIdentities operation.
        /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListIdentities 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 <ListIdentitiesResponse> ListIdentitiesAsync(ListIdentitiesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListIdentitiesRequestMarshaller();
            var unmarshaller = ListIdentitiesResponseUnmarshaller.Instance;

            return(InvokeAsync <ListIdentitiesRequest, ListIdentitiesResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
コード例 #8
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListIdentities operation.
        /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListIdentities operation on AmazonCognitoIdentityClient.</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 EndListIdentities
        ///         operation.</returns>
        public IAsyncResult BeginListIdentities(ListIdentitiesRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new ListIdentitiesRequestMarshaller();
            var unmarshaller = ListIdentitiesResponseUnmarshaller.Instance;

            return(BeginInvoke <ListIdentitiesRequest>(request, marshaller, unmarshaller,
                                                       callback, state));
        }
コード例 #9
0
ファイル: SESModel.cs プロジェクト: cusanelly/Library
        public async Task AddEmail(string email)
        {
            VerifyEmailIdentityRequest request = new VerifyEmailIdentityRequest {
                EmailAddress = email
            };
            ListIdentitiesRequest req = new ListIdentitiesRequest {
                IdentityType = IdentityType.EmailAddress
            };
            var res = await _Client.ListIdentitiesAsync(req);

            await _Client.VerifyEmailIdentityAsync(request);
        }
コード例 #10
0
        internal ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request)
        {
            var task = ListIdentitiesAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
コード例 #11
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListIdentities operation.
        /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListIdentities operation.</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>void</returns>
        public void ListIdentitiesAsync(ListIdentitiesRequest request, AmazonServiceCallback callback, object state)
        {
            if (!AmazonInitializer.IsInitialized)
            {
                throw new Exception("AWSPrefab is not added to the scene");
            }

            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate
            {
                var marshaller   = new ListIdentitiesRequestMarshaller();
                var unmarshaller = ListIdentitiesResponseUnmarshaller.Instance;
                Invoke(request, callback, state, marshaller, unmarshaller, signer);
            }));
            return;
        }
コード例 #12
0
        public void ListIdentitiesAsync(ListIdentitiesRequest request, AmazonServiceCallback <ListIdentitiesRequest, ListIdentitiesResponse> callback, AsyncOptions options = null)
        {
            options = ((options == null) ? new AsyncOptions() : options);
            ListIdentitiesRequestMarshaller    marshaller = new ListIdentitiesRequestMarshaller();
            ListIdentitiesResponseUnmarshaller instance   = ListIdentitiesResponseUnmarshaller.Instance;
            Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;

            if (callback != null)
            {
                callbackHelper = delegate(AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao)
                {
                    AmazonServiceResult <ListIdentitiesRequest, ListIdentitiesResponse> responseObject = new AmazonServiceResult <ListIdentitiesRequest, ListIdentitiesResponse>((ListIdentitiesRequest)req, (ListIdentitiesResponse)res, ex, ao.State);
                    callback(responseObject);
                };
            }
            BeginInvoke(request, marshaller, instance, options, callbackHelper);
        }
コード例 #13
0
        private IEnumerable <IdentityDescription> GetAllIdentitiesHelper(string poolId)
        {
            AutoResetEvent ars = new AutoResetEvent(false);
            Exception      responseException = new Exception();

            var request = new ListIdentitiesRequest
            {
                MaxResults     = MaxResults,
                IdentityPoolId = poolId
            };
            string nextToken = null;

            do
            {
                List <IdentityDescription> identities = null;
                Client.ListIdentitiesAsync(request, (response) =>
                {
                    responseException = response.Exception;
                    if (response.Exception == null)
                    {
                        identities = response.Response.Identities;
                        nextToken  = response.Response.NextToken;
                    }
                    ars.Set();
                }, new AsyncOptions {
                    ExecuteCallbackOnMainThread = false
                });
                ars.WaitOne();
                Utils.AssertExceptionIsNull(responseException);
                foreach (var ident in identities)
                {
                    Utils.AssertFalse(ident == null);
                    Utils.AssertStringIsNotNullOrEmpty(ident.IdentityId);
                    Utils.AssertFalse(ident.Logins == null);
                    yield return(ident);
                }
                request.NextToken = nextToken;
            } while (!string.IsNullOrEmpty(nextToken));
        }
コード例 #14
0
        private static IEnumerable <IdentityDescription> GetAllIdentitiesHelper(string poolId)
        {
            var request = new ListIdentitiesRequest
            {
                MaxResults     = MaxResults,
                IdentityPoolId = poolId
            };
            ListIdentitiesResponse result;

            do
            {
                result = Client.ListIdentities(request);
                foreach (var ident in result.Identities)
                {
                    Assert.IsNotNull(ident);
                    Assert.IsFalse(string.IsNullOrEmpty(ident.IdentityId));
                    Assert.IsNotNull(ident.Logins);
                    yield return(ident);
                }
                request.NextToken = result.NextToken;
            } while (!string.IsNullOrEmpty(result.NextToken));
        }
コード例 #15
0
        /// <summary>
        /// Lists the identities in a pool.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListIdentities service method.</param>
        ///
        /// <returns>The response from the ListIdentities service method, as returned by CognitoIdentity.</returns>
        /// <exception cref="InternalErrorException">
        /// Thrown when the service encounters an error during processing the request.
        /// </exception>
        /// <exception cref="InvalidParameterException">
        /// Thrown for missing or bad input parameter(s).
        /// </exception>
        /// <exception cref="NotAuthorizedException">
        /// Thrown when a user is not authorized to access the requested resource.
        /// </exception>
        /// <exception cref="ResourceNotFoundException">
        /// Thrown when the requested resource (for example, a dataset or record) does not exist.
        /// </exception>
        /// <exception cref="TooManyRequestsException">
        /// Thrown when a request is throttled.
        /// </exception>
        public ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request)
        {
            IAsyncResult asyncResult = invokeListIdentities(request, null, null, true);

            return(EndListIdentities(asyncResult));
        }
コード例 #16
0
 /// <summary>
 /// Initiates the asynchronous execution of the ListIdentities operation.
 /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/>
 /// </summary>
 ///
 /// <param name="request">Container for the necessary parameters to execute the ListIdentities operation on AmazonCognitoIdentityClient.</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 EndListIdentities
 ///         operation.</returns>
 public IAsyncResult BeginListIdentities(ListIdentitiesRequest request, AsyncCallback callback, object state)
 {
     return(invokeListIdentities(request, callback, state, false));
 }
コード例 #17
0
 /// <summary>
 /// Get the service identities, one page at a time.
 /// </summary>
 /// <returns> ListIdentitiesResponse object</returns>
 /// <param name="request"> ListIdentitiesRequest object</param>
 /// <param name='jsonRpcCallId'>
 /// The json rpc call identifier. This is a string generated by the client, which can be used to correlate the response to the request. Max length is 256 characters. A JSON-RPC id must be generated on a per call invocation basis. The Rogerthat platform uses the id of the call to store the call result for a certain amount of time so that if something fails during the communication, the same call (having the same JSON-RPC id) can be resent to the Rogerthat service, allowing to fetch the result, without actually executing the call again. This avoids annoying problems such as duplicate delivery of messages.
 /// 
 /// You should use a different JSON-RPC id for every call you make.
 /// 
 /// In case of an intermittent failure such as a network connectivity problem, you can retry the same call using the same JSON-RPC id, without running the risk of duplicate execution of your call (e.g. duplicate message delivery).
 /// </param>
 public ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request, string jsonRpcCallId)
 {
     ListIdentitiesResponse result = new ListIdentitiesResponse();
     WireRequest(0, jsonRpcCallId, "system.list_identities", (writer) =>
         {
             request.Write(writer, false);
         }, (reader) =>
         {
             result.Read(reader);
         }
     );
     return result;
 }
コード例 #18
0
 /// <summary>
 /// Get the service identities, one page at a time.
 /// </summary>
 /// <returns> ListIdentitiesResponse object</returns>
 /// <param name="request"> ListIdentitiesRequest object</param>
 public ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request)
 {
     return ListIdentities(request, Guid.NewGuid().ToString());
 }