/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { collectionsAggregate } from "../funcs/collectionsAggregate.js"; import { collectionsCreate } from "../funcs/collectionsCreate.js"; import { collectionsDelete, DeleteAcceptEnum, } from "../funcs/collectionsDelete.js"; import { collectionsGet } from "../funcs/collectionsGet.js"; import { collectionsList } from "../funcs/collectionsList.js"; import { collectionsListEvents } from "../funcs/collectionsListEvents.js"; import { collectionsSearch } from "../funcs/collectionsSearch.js"; import { collectionsUpdate } from "../funcs/collectionsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export { DeleteAcceptEnum } from "../funcs/collectionsDelete.js"; export class Collections extends ClientSDK { /** * List collections * * @remarks * List all collections for an organization. Retrieved information includes collection ID, name, query, description, status, and asset count.

This endpoint does not cost credits to execute. */ async list( request: operations.V3CollectionsCrudListRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsList( this, request, options, )); } /** * Create a collection * * @remarks * Create a new collection.

This endpoint does not cost credits to execute. */ async create( request: operations.V3CollectionsCrudCreateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsCreate( this, request, options, )); } /** * Delete a collection * * @remarks * Delete a collection.

This endpoint does not cost credits to execute. */ async delete( request: operations.V3CollectionsCrudDeleteRequest, options?: RequestOptions & { acceptHeaderOverride?: DeleteAcceptEnum }, ): Promise { return unwrapAsync(collectionsDelete( this, request, options, )); } /** * Get a collection * * @remarks * Retrieve information about a collection. Retrieved information includes its name, query, description, status, and asset count.

This endpoint does not cost credits to execute. */ async get( request: operations.V3CollectionsCrudGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsGet( this, request, options, )); } /** * Update a collection * * @remarks * Update a collection's name, description, and/or query.

This endpoint does not cost credits to execute. */ async update( request: operations.V3CollectionsCrudUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsUpdate( this, request, options, )); } /** * Get a collection's events * * @remarks * Retrieve the event history for a collection. This includes the addition or removal of assets as well as collection status changes.

This endpoint does not cost credits to execute. */ async listEvents( request: operations.V3CollectionsListEventsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsListEvents( this, request, options, )); } /** * Aggregate results for a search query within a collection * * @remarks * Aggregate results for a Platform search query that targets a collection's assets. This functionality is equivalent to the [Report Builder](https://docs.censys.com/docs/platform-report-builder#/) in the Platform web UI. */ async aggregate( request: operations.V3CollectionsSearchAggregateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsAggregate( this, request, options, )); } /** * Run a search query within a collection * * @remarks * Run a search query across a collection's assets. Reference the [documentation on Censys Query Language](https://docs.censys.com/docs/censys-query-language#/) for information about query syntax. Host services that match your search criteria will be returned in a `matched_services` object. */ async search( request: operations.V3CollectionsSearchQueryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(collectionsSearch( this, request, options, )); } }