protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListConnectionsRequest request;

            try
            {
                request = new ListConnectionsRequest
                {
                    CompartmentId  = CompartmentId,
                    OpcRequestId   = OpcRequestId,
                    DisplayName    = DisplayName,
                    Limit          = Limit,
                    Page           = Page,
                    SortBy         = SortBy,
                    SortOrder      = SortOrder,
                    LifecycleState = LifecycleState
                };
                IEnumerable <ListConnectionsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ConnectionCollection, 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);
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListConnectionsRequest request;

            try
            {
                request = new ListConnectionsRequest
                {
                    WorkspaceId  = WorkspaceId,
                    DataAssetKey = DataAssetKey,
                    Name         = Name,
                    Page         = Page,
                    Limit        = Limit,
                    Fields       = Fields,
                    Type         = Type,
                    SortBy       = SortBy,
                    SortOrder    = SortOrder,
                    OpcRequestId = OpcRequestId
                };
                IEnumerable <ListConnectionsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ConnectionSummaryCollection, true);
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Beispiel #3
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonCodeStarconnectionsConfig config = new AmazonCodeStarconnectionsConfig();

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

            ListConnectionsResponse resp = new ListConnectionsResponse();

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

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

                foreach (var obj in resp.Connections)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Lists the connections associated with your account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListConnections 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 ListConnections service method, as returned by CodeStarconnections.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/ListConnections">REST API Reference for ListConnections Operation</seealso>
        public virtual Task<ListConnectionsResponse> ListConnectionsAsync(ListConnectionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = ListConnectionsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListConnectionsResponseUnmarshaller.Instance;

            return InvokeAsync<ListConnectionsResponse>(request, options, cancellationToken);
        }
        internal virtual ListConnectionsResponse ListConnections(ListConnectionsRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = ListConnectionsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListConnectionsResponseUnmarshaller.Instance;

            return Invoke<ListConnectionsResponse>(request, options);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListConnections operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListConnections operation on AmazonCodeStarconnectionsClient.</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 EndListConnections
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/ListConnections">REST API Reference for ListConnections Operation</seealso>
        public virtual IAsyncResult BeginListConnections(ListConnectionsRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListConnectionsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListConnectionsResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
 /// <summary>Snippet for ListConnections</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListConnectionsRequestObject()
 {
     // Create client
     ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create();
     // Initialize request argument(s)
     ListConnectionsRequest request = new ListConnectionsRequest
     {
         ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
         MaxResults           = 0U,
         PageToken            = "",
     };
     // Make the request
     ListConnectionsResponse response = connectionServiceClient.ListConnections(request);
 }
        /// <summary>
        /// 获取事件连接器列表
        /// </summary>
        /// <param name="req"><see cref="ListConnectionsRequest"/></param>
        /// <returns><see cref="ListConnectionsResponse"/></returns>
        public ListConnectionsResponse ListConnectionsSync(ListConnectionsRequest req)
        {
            JsonResponseModel <ListConnectionsResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "ListConnections");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <ListConnectionsResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
Beispiel #9
0
        /// <summary>Snippet for ListConnections</summary>
        public async Task ListConnectionsRequestObjectAsync()
        {
            // Snippet: ListConnectionsAsync(ListConnectionsRequest, CallSettings)
            // Create client
            ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListConnectionsRequest request = new ListConnectionsRequest
            {
                ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            };
            // Make the request
            PagedAsyncEnumerable <ListConnectionsResponse, Connection> response = connectionServiceClient.ListConnectionsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Connection item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListConnectionsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Connection item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <Connection> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Connection item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
 /// <summary>
 /// Creates a new enumerable which will iterate over the ConnectionSummary objects
 /// contained in responses from the ListConnections operation. This enumerable will fetch more data from the server as needed.
 /// </summary>
 /// <param name="request">The request object containing the details to send</param>
 /// <param name="retryConfiguration">The configuration for retrying, may be null</param>
 /// <param name="cancellationToken">The cancellation token object</param>
 /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns>
 public IEnumerable <ConnectionSummary> ListConnectionsRecordEnumerator(ListConnectionsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
 {
     return(new Common.Utils.ResponseRecordEnumerable <ListConnectionsRequest, ListConnectionsResponse, ConnectionSummary>(
                response => response.OpcNextPage,
                input =>
     {
         if (!string.IsNullOrEmpty(input))
         {
             request.Page = input;
         }
         return request;
     },
                request => client.ListConnections(request, retryConfiguration, cancellationToken),
                response => response.ConnectionCollection.Items
                ));
 }
        /// <summary>Snippet for ListConnections</summary>
        public void ListConnectionsRequestObject()
        {
            // Snippet: ListConnections(ListConnectionsRequest, CallSettings)
            // Create client
            ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.Create();
            // Initialize request argument(s)
            ListConnectionsRequest request = new ListConnectionsRequest
            {
                ParentAsEndpointName = EndpointName.FromProjectEndpoint("[PROJECT]", "[ENDPOINT]"),
            };
            // Make the request
            PagedEnumerable <ListConnectionsResponse, Connection> response = connectionServiceClient.ListConnections(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Connection item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListConnectionsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Connection item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <Connection> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Connection item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Beispiel #12
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListConnectionsRequest request;

            try
            {
                request = new ListConnectionsRequest
                {
                    CatalogId           = CatalogId,
                    DataAssetKey        = DataAssetKey,
                    DisplayName         = DisplayName,
                    DisplayNameContains = DisplayNameContains,
                    LifecycleState      = LifecycleState,
                    TimeCreated         = TimeCreated,
                    TimeUpdated         = TimeUpdated,
                    CreatedById         = CreatedById,
                    UpdatedById         = UpdatedById,
                    ExternalKey         = ExternalKey,
                    TimeStatusUpdated   = TimeStatusUpdated,
                    IsDefault           = IsDefault,
                    Fields       = Fields,
                    SortBy       = SortBy,
                    SortOrder    = SortOrder,
                    Limit        = Limit,
                    Page         = Page,
                    OpcRequestId = OpcRequestId
                };
                IEnumerable <ListConnectionsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ConnectionCollection, 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);
            }
        }
        /// <summary>Snippet for ListConnectionsAsync</summary>
        public async Task ListConnectionsRequestObjectAsync()
        {
            // Snippet: ListConnectionsAsync(ListConnectionsRequest, CallSettings)
            // Additional: ListConnectionsAsync(ListConnectionsRequest, CancellationToken)
            // Create client
            ConnectionServiceClient connectionServiceClient = await ConnectionServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListConnectionsRequest request = new ListConnectionsRequest
            {
                ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
                MaxResults           = 0U,
                PageToken            = "",
            };
            // Make the request
            ListConnectionsResponse response = await connectionServiceClient.ListConnectionsAsync(request);

            // End snippet
        }
Beispiel #14
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListConnectionsRequest request;

            try
            {
                request = new ListConnectionsRequest
                {
                    CatalogId           = CatalogId,
                    DataAssetKey        = DataAssetKey,
                    DisplayName         = DisplayName,
                    DisplayNameContains = DisplayNameContains,
                    LifecycleState      = LifecycleState,
                    TimeCreated         = TimeCreated,
                    TimeUpdated         = TimeUpdated,
                    CreatedById         = CreatedById,
                    UpdatedById         = UpdatedById,
                    ExternalKey         = ExternalKey,
                    TimeStatusUpdated   = TimeStatusUpdated,
                    IsDefault           = IsDefault,
                    Fields       = Fields,
                    SortBy       = SortBy,
                    SortOrder    = SortOrder,
                    Limit        = Limit,
                    Page         = Page,
                    OpcRequestId = OpcRequestId
                };
                IEnumerable <ListConnectionsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ConnectionCollection, true);
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListConnectionsRequest request;

            try
            {
                request = new ListConnectionsRequest
                {
                    RegistryId          = RegistryId,
                    DataAssetKey        = DataAssetKey,
                    Name                = Name,
                    Page                = Page,
                    Limit               = Limit,
                    Fields              = Fields,
                    Type                = Type,
                    SortBy              = SortBy,
                    SortOrder           = SortOrder,
                    OpcRequestId        = OpcRequestId,
                    FavoritesQueryParam = FavoritesQueryParam
                };
                IEnumerable <ListConnectionsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ConnectionSummaryCollection, 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);
            }
        }