twilio / twilio-python

A Python module for communicating with the Twilio API and generating TwiML.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add update and remove operations to client.studio.v2.flows.update

allavytalize opened this issue · comments

Issue Summary

This is a feature request.
Twilio studio api already supports update and remove operations. Why not add them on the twilio-python client just like create?
https://www.twilio.com/docs/studio/rest-api/v2/flow#update-a-flow-resource
https://www.twilio.com/docs/studio/rest-api/v2/flow#delete-a-flow-resource

Steps to Reproduce

  1. Try to use update or remove operation on v2.flows resource.

Code Snippet

from twilio.rest import Client
client = Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
client.studio.v2.flows.update(...)

Exception/Log

AttributeError: 'FlowList' object has no attribute 'update'

Technical details:

  • twilio-python version: 9.0.4
  • python version: 3.11.6

Hi @allavytalize! The fetch, update and delete functions are available for a specific Flow resource only. Thus if you want to update a particular Flow resource, you are required to provide its sid like FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
While in case of create you are creating a new Flow resource, in case of list you are listing all the resources. Thus no particular Flow resource sid is required.
I think this helps!