ApifyClient.API.RequestQueues (apify_client v1.0.0)

Copy Markdown View Source

Provides API endpoints related to api/request queues

Summary

Functions

Create request queue

Delete request queue

Get request queue

Get list of request queues

Update request queue

Functions

create(opts \\ [])

@spec create(opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.RequestQueueResource.t()}
  | {:error, ApifyClient.Error.t()}

Create request queue

Creates a request queue and returns its object. Keep in mind that requests stored under unnamed queue follows data retention period.

It creates a queue of given name if the parameter name is used. If a queue with the given name already exists then the endpoint returns its object.

Options

  • name: Custom unique name to easily identify the queue in the future.

delete(queue_id, opts \\ [])

@spec delete(queue_id :: String.t(), opts :: keyword()) ::
  :ok | {:error, ApifyClient.Error.t()}

Delete request queue

Deletes given queue.

get(queue_id, opts \\ [])

@spec get(queue_id :: String.t(), opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.RequestQueueResource.t()}
  | {:error, ApifyClient.Error.t()}

Get request queue

Returns queue object for given queue ID.

list(opts \\ [])

@spec list(opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.ListOfRequestQueues.t()}
  | {:error, ApifyClient.Error.t()}

Get list of request queues

Lists all of a user's request queues. The response is a JSON array of objects, where each object contains basic information about one queue.

By default, the objects are sorted by the createdAt field in ascending order, therefore you can use pagination to incrementally fetch all queues while new ones are still being created. To sort them in descending order, use desc=1 parameter. The endpoint supports pagination using limit and offset parameters and it will not return more than 1000 array elements.

Options

  • offset: Number of items that should be skipped at the start. The default value is 0.

  • limit: Maximum number of items to return. The default value as well as the maximum is 1000.

  • desc: If true or 1 then the objects are sorted by the createdAt field in descending order. By default, they are sorted in ascending order.

  • unnamed: If true or 1 then all the storages are returned. By default, only named storages are returned.

  • ownership: Filter by ownership. If this parameter is omitted, all accessible request queues are returned.

    • ownedByMe: Return only request queues owned by the user.
    • sharedWithMe: Return only request queues shared with the user by other users.

update(queue_id, body, opts \\ [])

@spec update(queue_id :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.RequestQueueResource.t()}
  | {:error, ApifyClient.Error.t()}

Update request queue

Updates a request queue's name and general resource access level using a value specified by a JSON object passed in the PUT payload.

The response is the updated request queue object, as returned by the Get request queue API endpoint.

Request Body

Content Types: application/json