# `Twilio.Taskrouter.V1.Workspace.WorkerService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/taskrouter/v1/workspace/worker_service.ex#L2)

Service for Worker API operations.

Operations: `list`, `create`, `fetch`, `update`, `delete`

# `create`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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](https://www.twilio.com/docs/taskrouter/api/activity) 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`

```elixir
@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`

```elixir
@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`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
| `ActivityName` | string | The `activity_name` of the Worker resources to read. |
| `ActivitySid` | string | The `activity_sid` of the Worker resources to read. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Available` | string | Whether 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. |
| `FriendlyName` | string | The `friendly_name` of the Worker resources to read. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `TargetWorkersExpression` | string | Filter 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` |
| `TaskQueueName` | string | The `friendly_name` of the TaskQueue that the Workers to read are eligible for. |
| `TaskQueueSid` | string | The SID of the TaskQueue that the Workers to read are eligible for. |
| `Ordering` | string | Sorting parameter for Workers |

# `stream`

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

Stream:  (lazy auto-pagination).

# `update`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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](https://www.twilio.com/docs/taskrouter/api/activity) 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](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
