Beispiel #1
0
        private static void ListSamlProviders()
        {
            if (String.IsNullOrEmpty(Token))
            {
                stsClient = new AmazonIdentityManagementServiceClient(AccessKeyId, SecretKey, iamconfig);
            }
            else
            {
                stsClient = new AmazonIdentityManagementServiceClient(AccessKeyId, SecretKey, Token, iamconfig);
            }

            ListSAMLProvidersRequest req = new ListSAMLProvidersRequest();

            try
            {
                ListSAMLProvidersResponse response = stsClient.ListSAMLProviders(req);
                foreach (SAMLProviderListEntry entry in response.SAMLProviderList)
                {
                    Console.WriteLine("ARN: {0}, Valid Until: {1}, Create Date: {2}", entry.Arn, entry.ValidUntil, entry.CreateDate);
                }
                Console.WriteLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error occured while creating user. " + ex.ToString());
            }
        }
        /// <summary>
        /// 查询SAML身份提供商列表
        /// </summary>
        /// <param name="req">参考<see cref="ListSAMLProvidersRequest"/></param>
        /// <returns>参考<see cref="ListSAMLProvidersResponse"/>实例</returns>
        public async Task <ListSAMLProvidersResponse> ListSAMLProviders(ListSAMLProvidersRequest req)
        {
            JsonResponseModel <ListSAMLProvidersResponse> rsp = null;

            try
            {
                var strResp = await this.InternalRequest(req, "ListSAMLProviders");

                rsp = JsonConvert.DeserializeObject <JsonResponseModel <ListSAMLProvidersResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonIdentityManagementServiceConfig config = new AmazonIdentityManagementServiceConfig();

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

            ListSAMLProvidersResponse resp = new ListSAMLProvidersResponse();
            ListSAMLProvidersRequest  req  = new ListSAMLProvidersRequest
            {
            };

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

            foreach (var obj in resp.SAMLProviderList)
            {
                AddObject(obj);
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListSAMLProviders operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders 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<ListSAMLProvidersResponse> ListSAMLProvidersAsync(ListSAMLProvidersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ListSAMLProvidersRequestMarshaller();
            var unmarshaller = ListSAMLProvidersResponseUnmarshaller.Instance;

            return InvokeAsync<ListSAMLProvidersRequest,ListSAMLProvidersResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal ListSAMLProvidersResponse ListSAMLProviders(ListSAMLProvidersRequest request)
        {
            var marshaller = new ListSAMLProvidersRequestMarshaller();
            var unmarshaller = ListSAMLProvidersResponseUnmarshaller.Instance;

            return Invoke<ListSAMLProvidersRequest,ListSAMLProvidersResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListSAMLProviders operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders operation on AmazonIdentityManagementServiceClient.</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 EndListSAMLProviders
        ///         operation.</returns>
        public IAsyncResult BeginListSAMLProviders(ListSAMLProvidersRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ListSAMLProvidersRequestMarshaller();
            var unmarshaller = ListSAMLProvidersResponseUnmarshaller.Instance;

            return BeginInvoke<ListSAMLProvidersRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 public Task <ListSAMLProvidersResponse> ListSAMLProvidersAsync(ListSAMLProvidersRequest request,
                                                                CancellationToken cancellationToken = new CancellationToken())
 {
     throw new System.NotImplementedException();
 }
 /// <summary>
 /// Initiates the asynchronous execution of the ListSAMLProviders operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders operation on AmazonIdentityManagementServiceClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">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>
 public void ListSAMLProvidersAsync(ListSAMLProvidersRequest request, AmazonServiceCallback<ListSAMLProvidersRequest, ListSAMLProvidersResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new ListSAMLProvidersRequestMarshaller();
     var unmarshaller = ListSAMLProvidersResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<ListSAMLProvidersRequest,ListSAMLProvidersResponse> responseObject 
                     = new AmazonServiceResult<ListSAMLProvidersRequest,ListSAMLProvidersResponse>((ListSAMLProvidersRequest)req, (ListSAMLProvidersResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<ListSAMLProvidersRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the ListSAMLProviders operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.ListSAMLProviders"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders 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 async Task<ListSAMLProvidersResponse> ListSAMLProvidersAsync(ListSAMLProvidersRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ListSAMLProvidersRequestMarshaller();
            var unmarshaller = ListSAMLProvidersResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, ListSAMLProvidersRequest, ListSAMLProvidersResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
        /// <summary>
        /// <para>Lists the SAML providers in the account.</para> <para><b>NOTE:</b>This operation requires Signature Version 4.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <returns>The response from the ListSAMLProviders service method, as returned by AmazonIdentityManagementService.</returns>
		public ListSAMLProvidersResponse ListSAMLProviders(ListSAMLProvidersRequest request)
        {
            var task = ListSAMLProvidersAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
Beispiel #11
0
        /// <summary>
        /// <para>Lists the SAML providers in the account.</para> <para><b>NOTE:</b>This operation requires Signature Version 4.</para>
        /// </summary>
        /// 
        /// <param name="listSAMLProvidersRequest">Container for the necessary parameters to execute the ListSAMLProviders service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <returns>The response from the ListSAMLProviders service method, as returned by AmazonIdentityManagementService.</returns>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<ListSAMLProvidersResponse> ListSAMLProvidersAsync(ListSAMLProvidersRequest listSAMLProvidersRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ListSAMLProvidersRequestMarshaller();
            var unmarshaller = ListSAMLProvidersResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, ListSAMLProvidersRequest, ListSAMLProvidersResponse>(listSAMLProvidersRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Beispiel #12
0
		internal ListSAMLProvidersResponse ListSAMLProviders(ListSAMLProvidersRequest request)
        {
            var task = ListSAMLProvidersAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        IAsyncResult invokeListSAMLProviders(ListSAMLProvidersRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new ListSAMLProvidersRequestMarshaller();
            var unmarshaller = ListSAMLProvidersResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the ListSAMLProviders operation.
 /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/>
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders operation on AmazonIdentityManagementServiceClient.</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 EndListSAMLProviders
 ///         operation.</returns>
 public IAsyncResult BeginListSAMLProviders(ListSAMLProvidersRequest request, AsyncCallback callback, object state)
 {
     return invokeListSAMLProviders(request, callback, state, false);
 }
 /// <summary>
 /// Lists the SAML providers in the account.
 /// 
 ///         <note>This operation requires <a href="http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Signature
 /// Version            4</a>.</note>
 /// </summary>
 /// <param name="request">Container for the necessary parameters to execute the ListSAMLProviders service method.</param>
 /// 
 /// <returns>The response from the ListSAMLProviders service method, as returned by IdentityManagementService.</returns>
 public ListSAMLProvidersResponse ListSAMLProviders(ListSAMLProvidersRequest request)
 {
     IAsyncResult asyncResult = invokeListSAMLProviders(request, null, null, true);
     return EndListSAMLProviders(asyncResult);
 }
Beispiel #16
0
 IAsyncResult invokeListSAMLProviders(ListSAMLProvidersRequest listSAMLProvidersRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new ListSAMLProvidersRequestMarshaller().Marshall(listSAMLProvidersRequest);
     var unmarshaller = ListSAMLProvidersResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }