jpbullalayao / jpbullalayao/sendbird-python

Refactor Message methods to be nested resources under Channels

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

We'd like to implement the following functionalities for Messages:

List messages in a channel
Send messages in a channel
View messages in a channel
Update messages in a channel
Delete messages in a channel
View message count in a channel

Right now, these are implemented with the following methods in api_resources/channel.py:

channel.list_messages()
channel.send_text_message()
channel.view_message()
channel.update_text_message()
channel.delete_message()
channel.view_message_count()

While these work, I'd like to refactor the above method calls to use the following convention in the form of nested resources:

channel.messages.list()
channel.messages.send()
channel.messages.retrieve()
message.update()
message.delete()
channel.messages.count()

See Stripe nested resources implementation for reference: https://github.com/stripe/stripe-python/blob/master/stripe/api_resources/abstract/nested_resource_class_methods.py

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in api_resources/channel.py and compare the existing message methods with Stripe's nested_resource_class_methods.py reference. Refactor the six listed operations to the channel.messages and message method conventions while preserving their current behavior, then verify that each requested nested call is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.