Twilio.Taskrouter.V1.Workspace.WorkerService (twilio_elixir v0.1.1)

Copy Markdown View Source

Service for Worker API operations.

Operations: list, create, fetch, update, delete

Summary

Functions

Operation: CreateWorker | Tags: TaskrouterV1Worker

Operation: DeleteWorker | Tags: TaskrouterV1Worker

Operation: FetchWorker | Tags: TaskrouterV1Worker

Operation: ListWorker | Tags: TaskrouterV1Worker

Operation: UpdateWorker | Tags: TaskrouterV1Worker

Functions

create(client, workspace_sid, params \\ %{}, opts \\ [])

@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Taskrouter.V1.Workspace.Worker.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Operation: CreateWorker | Tags: TaskrouterV1Worker

Required Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| FriendlyName | string | A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. |

Optional Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| ActivitySid | string | The SID of a valid Activity that will describe the new Worker's initial state. See Activities for more information. If not provided, the new Worker's initial state is the default_activity_sid configured on the Workspace. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Attributes | string | A valid JSON string that describes the new Worker. For example: { "email": "Bob@example.com", "phone": "+5095551234" }. This data is passed to the assignment_callback_url when TaskRouter assigns a Task to the Worker. Defaults to {}. |

delete(client, workspace_sid, sid, opts \\ [])

@spec delete(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}

Operation: DeleteWorker | Tags: TaskrouterV1Worker

fetch(client, workspace_sid, sid, opts \\ [])

@spec fetch(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Taskrouter.V1.Workspace.Worker.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Operation: FetchWorker | Tags: TaskrouterV1Worker

list(client, workspace_sid, params \\ %{}, opts \\ [])

@spec list(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Operation: ListWorker | Tags: TaskrouterV1Worker

Query Parameters

ParameterTypeDescription
ActivityNamestringThe activity_name of the Worker resources to read.
ActivitySidstringThe activity_sid of the Worker resources to read.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

AvailablestringWhether to return only Worker resources that are available or unavailable. Can be true, 1, or yes to return Worker resources that are available, and false, or any value returns the Worker resources that are not available.
FriendlyNamestringThe friendly_name of the Worker resources to read.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

TargetWorkersExpressionstringFilter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: sid, friendly_name, activity_sid, or activity_name
TaskQueueNamestringThe friendly_name of the TaskQueue that the Workers to read are eligible for.
TaskQueueSidstringThe SID of the TaskQueue that the Workers to read are eligible for.
OrderingstringSorting parameter for Workers

stream(client, workspace_sid, params \\ %{}, opts \\ [])

@spec stream(Twilio.Client.t(), String.t(), map(), keyword()) :: Enumerable.t()

Stream: (lazy auto-pagination).

update(client, workspace_sid, sid, params \\ %{}, opts \\ [])

@spec update(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Taskrouter.V1.Workspace.Worker.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Operation: UpdateWorker | Tags: TaskrouterV1Worker

Optional Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| ActivitySid | string | The SID of a valid Activity that will describe the Worker's initial state. See Activities for more information. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Attributes | string | The JSON string that describes the Worker. For example: { "email": "Bob@example.com", "phone": "+5095551234" }. This data is passed to the assignment_callback_url when TaskRouter assigns a Task to the Worker. Defaults to {}. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| FriendlyName | string | A descriptive string that you create to describe the Worker. It can be up to 64 characters long. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| RejectPendingReservations | boolean | Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new Activity resource has its availability property set to False. |