Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Twilio Video Api #20

Closed
wants to merge 1 commit into from

Conversation

t-tomalak
Copy link

This PR implements Twilio Video Api #1 : https://www.twilio.com/docs/api/video/rest

It incluedes implementation for two services

@kevinburke
Copy link
Owner

Hey, this is great! Can you run make authors to add yourself to AUTHORS.txt, and then amend the commit?

Thanks!

@t-tomalak
Copy link
Author

Hey, done it.

t.Parallel()
client, server := getServer(videoRecordingResponse)
defer server.Close()
recording, err := client.Video.VideoRecordings.Get(context.Background(), "RT63868a235fc1cf3987e6a2b67346273f")
Copy link
Owner

@kevinburke kevinburke Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From an API perspective there's a little stutter here where we write Video twice. Would it be better as client.Video.Recordings.Get()?

(Or that would overlap with the existing Recordings struct, huh. Ugh.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that but I wasn't sure what to make with it. Also I find that when using Client it's easy to make null pointer dereference.
To solve that I think in this place in Client declaration I should remove Rooms and VideoRecordings and make some VideoClient struct with Client and this two services

type VideoClient struct {
	*Client
	Rooms *RoomService
	Recordings *VideoRecordingService
}

Also I think it would be good for other services too, what you think?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for a separate pull request?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I should leave this VideoClient as it is now, or you mean to move into seperate pull request changing all other Clients and here change only VideoClient?

// When you make a request to this URL, Twilio will generate a temporary URL for accessing
// this binary data, and issue an HTTP 302 redirect response to your request. The Recording
// will be returned in the format as described in the metadata.
func (vr *VideoRecordingService) Media(ctx context.Context, sid string) (*VideoMedia, error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have the API resemble this one for Messages Media? https://github.com/kevinburke/twilio-go/blob/master/media.go#L59

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that but are you sure we need that to download this media? Because when i was looking at this Messages Media it was looking like some complicated stuff (https://www.twilio.com/docs/api/messaging/media#media-list-resource) but in VideoRecordings they returning proper link to download it

{
    "location": "https://com.twilio.dev-us1.video.recording.s3.amazonaws.com/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

@kevinburke
Copy link
Owner

Merged as 8f07b10, thanks!

@kevinburke kevinburke closed this Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants