<reponame>Tshisuaka/api-snippets
# Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
taskqueue_sid = "WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

client = Client(account_sid, auth_token)

taskqueue = client.taskrouter.workspaces(workspace_sid) \
    .task_queues(taskqueue_sid) \
    .update(target_workers='languages HAS "english"')

print(taskqueue.target_workers)

# alternatively
taskqueue = client.taskrouter.workspaces(workspace_sid) \
    .task_queues(taskqueue_sid).fetch()

taskqueue = taskqueue.update(target_workers='languages HAS "english"')

print(taskqueue.target_workers)

# Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
taskqueue_sid = "WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

client = Client(account_sid, auth_token)

taskqueue = client.taskrouter.workspaces(workspace_sid) \
    .task_queues(taskqueue_sid) \
    .update(target_workers='languages HAS "english"')

print(taskqueue.target_workers)

# alternatively
taskqueue = client.taskrouter.workspaces(workspace_sid) \
    .task_queues(taskqueue_sid).fetch()

taskqueue = taskqueue.update(target_workers='languages HAS "english"')

print(taskqueue.target_workers)
# Download the Python helper library from twilio.com/docs/python/install # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure # alternatively