Exemple #1
0
        /// <summary>
        /// Provides the list of entities of a given type.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListEntities 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 ListEntities service method, as returned by MarketplaceCatalog.</returns>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.AccessDeniedException">
        /// Access is denied.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.InternalServiceException">
        /// There was an internal service exception.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.ResourceNotFoundException">
        /// The specified resource wasn't found.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.ThrottlingException">
        /// Too many requests.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.ValidationException">
        /// An error occurred during validation.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListEntities">REST API Reference for ListEntities Operation</seealso>
        public virtual Task <ListEntitiesResponse> ListEntitiesAsync(ListEntitiesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListEntitiesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListEntitiesResponseUnmarshaller.Instance;

            return(InvokeAsync <ListEntitiesResponse>(request, options, cancellationToken));
        }
Exemple #2
0
        /// <summary>
        /// Provides the list of entities of a given type.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListEntities service method.</param>
        ///
        /// <returns>The response from the ListEntities service method, as returned by MarketplaceCatalog.</returns>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.AccessDeniedException">
        /// Access is denied.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.InternalServiceException">
        /// There was an internal service exception.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.ResourceNotFoundException">
        /// The specified resource wasn't found.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.ThrottlingException">
        /// Too many requests.
        /// </exception>
        /// <exception cref="Amazon.MarketplaceCatalog.Model.ValidationException">
        /// An error occurred during validation.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListEntities">REST API Reference for ListEntities Operation</seealso>
        public virtual ListEntitiesResponse ListEntities(ListEntitiesRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListEntitiesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListEntitiesResponseUnmarshaller.Instance;

            return(Invoke <ListEntitiesResponse>(request, options));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListEntities operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListEntities operation on AmazonMarketplaceCatalogClient.</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 EndListEntities
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListEntities">REST API Reference for ListEntities Operation</seealso>
        public virtual IAsyncResult BeginListEntities(ListEntitiesRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListEntitiesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListEntitiesResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
Exemple #4
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListEntitiesRequest request;

            try
            {
                request = new ListEntitiesRequest
                {
                    CatalogId    = CatalogId,
                    DataAssetKey = DataAssetKey,
                    DisplayName  = DisplayName,
                    BusinessName = BusinessName,
                    DisplayOrBusinessNameContains = DisplayOrBusinessNameContains,
                    TypeKey             = TypeKey,
                    DisplayNameContains = DisplayNameContains,
                    LifecycleState      = LifecycleState,
                    TimeCreated         = TimeCreated,
                    TimeUpdated         = TimeUpdated,
                    CreatedById         = CreatedById,
                    UpdatedById         = UpdatedById,
                    ExternalKey         = ExternalKey,
                    PatternKey          = PatternKey,
                    TimeExternal        = TimeExternal,
                    TimeStatusUpdated   = TimeStatusUpdated,
                    IsLogical           = IsLogical,
                    IsPartition         = IsPartition,
                    FolderKey           = FolderKey,
                    Path          = Path,
                    HarvestStatus = HarvestStatus,
                    LastJobKey    = LastJobKey,
                    Fields        = Fields,
                    SortBy        = SortBy,
                    SortOrder     = SortOrder,
                    Limit         = Limit,
                    Page          = Page,
                    OpcRequestId  = OpcRequestId
                };
                IEnumerable <ListEntitiesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.EntityCollection, 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 ListEntitiesAsync</summary>
        public async Task ListEntitiesRequestObjectAsync()
        {
            // Snippet: ListEntitiesAsync(ListEntitiesRequest, CallSettings)
            // Create client
            MetadataServiceClient metadataServiceClient = await MetadataServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListEntitiesRequest request = new ListEntitiesRequest
            {
                ParentAsZoneName = ZoneName.FromProjectLocationLakeZone("[PROJECT]", "[LOCATION]", "[LAKE]", "[ZONE]"),
                View             = ListEntitiesRequest.Types.EntityView.Unspecified,
                Filter           = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListEntitiesResponse, Entity> response = metadataServiceClient.ListEntitiesAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Entity 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((ListEntitiesResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Entity 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 <Entity> 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 (Entity 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
        }
Exemple #6
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListEntitiesRequest request;

            try
            {
                request = new ListEntitiesRequest
                {
                    CatalogId           = CatalogId,
                    DataAssetKey        = DataAssetKey,
                    DisplayName         = DisplayName,
                    DisplayNameContains = DisplayNameContains,
                    LifecycleState      = LifecycleState,
                    TimeCreated         = TimeCreated,
                    TimeUpdated         = TimeUpdated,
                    CreatedById         = CreatedById,
                    UpdatedById         = UpdatedById,
                    ExternalKey         = ExternalKey,
                    TimeExternal        = TimeExternal,
                    TimeStatusUpdated   = TimeStatusUpdated,
                    IsLogical           = IsLogical,
                    IsPartition         = IsPartition,
                    FolderKey           = FolderKey,
                    Path          = Path,
                    HarvestStatus = HarvestStatus,
                    LastJobKey    = LastJobKey,
                    Fields        = Fields,
                    SortBy        = SortBy,
                    SortOrder     = SortOrder,
                    Limit         = Limit,
                    Page          = Page,
                    OpcRequestId  = OpcRequestId
                };
                IEnumerable <ListEntitiesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.EntityCollection, true);
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }