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

VT-8411:Add a participant to a multiparty call using API #220

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [7.55.0](https://github.com/plivo/plivo-go/tree/v7.55.0) (2024-11-05)
**Feature - CreateRecordingTranscription and DeleteRecordingTranscription feature added**
- This API would help in creating transcription for recorded calls for which transcription is not available and delete API to delete.
- Support for the `transcription_url` and `transcript` parameter in MPC Add Participant.

## [7.54.0](https://github.com/plivo/plivo-go/tree/v7.54.0) (2024-10-30)
**Feature - GetRecordingTranscription feature to get transcription**
- Support for the `type` filter parameter, supported filters are transcription, raw and diarized
Expand Down
2 changes: 1 addition & 1 deletion baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"encoding/json"
"errors"
"fmt"
"io/ioutil"

Check failure on line 8 in baseclient.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"net/http"
"net/url"
"reflect"
Expand All @@ -13,7 +13,7 @@
"github.com/google/go-querystring/query"
)

const sdkVersion = "7.54.0"
const sdkVersion = "7.55.0"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
4 changes: 4 additions & 0 deletions fixtures/createRecordingTranscription.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"api_id": "c9db3f38-55e8-4d97-93b2-1ece5a342528",
"message": "transcription in progress"
}
2 changes: 2 additions & 0 deletions multipartycall.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ type MultiPartyCallAddParticipantParams struct {
CreateMpcWithSingleParticipant *bool `json:"create_mpc_with_single_participant,omitempty" url:"create_mpc_with_single_participant,omitempty"`
SendDigits string `json:"send_digits,omitempty" url:"send_digits,omitempty"`
SendOnPreanswer bool `json:"send_on_preanswer,omitempty" url:"send_on_preanswer,omitempty"`
TranscriptionUrl string `json:"transcription_url,omitempty" url:"transcription_url,omitempty"`
Transcript bool `json:"transcript,omitempty" url:"transcript,omitempty"`
}

type MultiPartyCallListParams struct {
Expand Down
24 changes: 24 additions & 0 deletions transcription.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ type GetRecordingTranscriptionRequest struct {
TranscriptionType string `json:"type"`
}

type RecordingTranscriptionRequest struct {
RecordingID string `json:"recording_id"`
}

type GetRecordingTranscriptionParams struct {
Type string `url:"type"`
}
Expand All @@ -23,6 +27,16 @@ type GetRecordingTranscriptionResponse struct {
Transcription interface{} `json:"transcription"`
}

func (service *TranscriptionService) CreateRecordingTranscription(request RecordingTranscriptionRequest) (response map[string]interface{}, err error) {
req, err := service.client.NewRequest("POST", nil, "Transcription/%s", request.RecordingID)
if err != nil {
return
}
response = make(map[string]interface{})
err = service.client.ExecuteRequest(req, response, isVoiceRequest())
return
}

func (service *TranscriptionService) GetRecordingTranscription(request GetRecordingTranscriptionRequest) (response *GetRecordingTranscriptionResponse, err error) {
params := GetRecordingTranscriptionParams{
Type: request.TranscriptionType,
Expand All @@ -35,3 +49,13 @@ func (service *TranscriptionService) GetRecordingTranscription(request GetRecord
err = service.client.ExecuteRequest(req, response, isVoiceRequest())
return
}

func (service *TranscriptionService) DeleteRecordingTranscription(request RecordingTranscriptionRequest) (response map[string]interface{}, err error) {
Abinaya-Shunmugavel marked this conversation as resolved.
Show resolved Hide resolved
req, err := service.client.NewRequest("DELETE", nil, "Transcription/%s", request.RecordingID)
Abinaya-Shunmugavel marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return
}
response = make(map[string]interface{})
err = service.client.ExecuteRequest(req, response, isVoiceRequest())
return
}
Loading