Пример #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonACMPCAConfig config = new AmazonACMPCAConfig();

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

            ListCertificateAuthoritiesResponse resp = new ListCertificateAuthoritiesResponse();

            do
            {
                ListCertificateAuthoritiesRequest req = new ListCertificateAuthoritiesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.CertificateAuthorities)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Пример #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListCertificateAuthoritiesRequest request;

            try
            {
                request = new ListCertificateAuthoritiesRequest
                {
                    OpcRequestId   = OpcRequestId,
                    CompartmentId  = CompartmentId,
                    LifecycleState = LifecycleState,
                    Name           = Name,
                    IssuerCertificateAuthorityId = IssuerCertificateAuthorityId,
                    CertificateAuthorityId       = CertificateAuthorityId,
                    SortBy    = SortBy,
                    SortOrder = SortOrder,
                    Limit     = Limit,
                    Page      = Page
                };
                IEnumerable <ListCertificateAuthoritiesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.CertificateAuthorityCollection, true);
                }
                if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null)
                {
                    WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources.");
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
        internal virtual ListCertificateAuthoritiesResponse ListCertificateAuthorities(ListCertificateAuthoritiesRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListCertificateAuthoritiesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListCertificateAuthoritiesResponseUnmarshaller.Instance;

            return(Invoke <ListCertificateAuthoritiesResponse>(request, options));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListCertificateAuthorities operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListCertificateAuthorities 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/ListCertificateAuthorities">REST API Reference for ListCertificateAuthorities Operation</seealso>
        public virtual Task <ListCertificateAuthoritiesResponse> ListCertificateAuthoritiesAsync(ListCertificateAuthoritiesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListCertificateAuthoritiesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListCertificateAuthoritiesResponseUnmarshaller.Instance;

            return(InvokeAsync <ListCertificateAuthoritiesResponse>(request, options, cancellationToken));
        }
Пример #5
0
        internal virtual ListCertificateAuthoritiesResponse ListCertificateAuthorities(ListCertificateAuthoritiesRequest request)
        {
            var marshaller   = ListCertificateAuthoritiesRequestMarshaller.Instance;
            var unmarshaller = ListCertificateAuthoritiesResponseUnmarshaller.Instance;

            return(Invoke <ListCertificateAuthoritiesRequest, ListCertificateAuthoritiesResponse>(request, marshaller, unmarshaller));
        }