Skip to content

Commit

Permalink
Added new recording params and filter (#172)
Browse files Browse the repository at this point in the history
* Added params

* Updated UTs

* changed version

* changes

* response json fix

* fixed filter names

* removed add_time from recording filters

* fixed limit and offset params for recording struct
  • Loading branch information
anindya-plivo authored May 31, 2023
1 parent 43b29ca commit f65de7f
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 33 deletions.
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.29.0](https://github.com/plivo/plivo-java/tree/v7.29.0) (2023-05-29)
**Feature - Recording API changes**
- Added `monthly_recording_storage_amount`, `recording_storage_rate`, `rounded_recording_duration`, and `recording_storage_duration` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)
- Added `recording_storage_duration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)

## [7.28.0](https://github.com/plivo/plivo-go/tree/v7.28.0) (2023-05-04)
**Feature - Added New Param 'renewalDate' in Get Number and List Numbers APIs**
- Add New Param `renewalDate` to the response of the [list all numbers API], [list single number API]
Expand Down
2 changes: 1 addition & 1 deletion baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/google/go-querystring/query"
)

const sdkVersion = "7.28.0"
const sdkVersion = "7.29.0"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
6 changes: 5 additions & 1 deletion fixtures/recordingGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"recording_start_ms": "1407235163907.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/",
"monthly_recording_storage_amount": 0.0008,
"rounded_recording_duration": 120,
"recording_storage_duration": 209,
"recording_storage_rate": 0.0004
}
18 changes: 15 additions & 3 deletions fixtures/recordingListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"recording_start_ms": "1407235163907.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/",
"monthly_recording_storage_amount": 0.0008,
"rounded_recording_duration": 120,
"recording_storage_duration": 209,
"recording_storage_rate": 0.0004
},
{
"add_time": "2014-08-05 16:05:21.993853+05:30",
Expand All @@ -32,7 +36,11 @@
"recording_start_ms": "1407234829553.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/",
"monthly_recording_storage_amount": 0.0008,
"rounded_recording_duration": 120,
"recording_storage_duration": 209,
"recording_storage_rate": 0.0004
},
{
"add_time": "2014-08-05 15:51:56.582492+05:30",
Expand All @@ -45,7 +53,11 @@
"recording_start_ms": "1407234081443.00000",
"recording_type": "conference",
"recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3",
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/"
"resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/",
"monthly_recording_storage_amount": 0.0008,
"rounded_recording_duration": 120,
"recording_storage_duration": 209,
"recording_storage_rate": 0.0004
}
]
}
64 changes: 36 additions & 28 deletions recordings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,46 @@ type RecordingService struct {
}

type Recording struct {
AddTime string `json:"add_time,omitempty" url:"add_time,omitempty"`
CallUUID string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
RecordingID string `json:"recording_id,omitempty" url:"recording_id,omitempty"`
RecordingType string `json:"recording_type,omitempty" url:"recording_type,omitempty"`
RecordingFormat string `json:"recording_format,omitempty" url:"recording_format,omitempty"`
ConferenceName string `json:"conference_name,omitempty" url:"conference_name,omitempty"`
RecordingURL string `json:"recording_url,omitempty" url:"recording_url,omitempty"`
ResourceURI string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
RecordingStartMS string `json:"recording_start_ms,omitempty" url:"recording_start_ms,omitempty"`
RecordingEndMS string `json:"recording_end_ms,omitempty" url:"recording_end_ms,omitempty"`
RecordingDurationMS string `json:"recording_duration_ms,omitempty" url:"recording_duration_ms,omitempty"`
FromNumber string `json:"from_number,omitempty" url:"from_number,omitempty"`
ToNumber string `json:"to_number,omitempty" url:"to_number,omitempty"`
AddTime string `json:"add_time,omitempty" url:"add_time,omitempty"`
CallUUID string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
MonthlyRecordingStorageAmount float64 `json:"monthly_recording_storage_amount,omitempty" url:"monthly_recording_storage_amount,omitempty"`
RecordingStorageDuration int64 `json:"recording_storage_duration,omitempty" url:"recording_storage_duration,omitempty"`
RecordingStorageRate float64 `json:"recording_storage_rate,omitempty" url:"recording_storage_rate,omitempty"`
RecordingID string `json:"recording_id,omitempty" url:"recording_id,omitempty"`
RecordingType string `json:"recording_type,omitempty" url:"recording_type,omitempty"`
RecordingFormat string `json:"recording_format,omitempty" url:"recording_format,omitempty"`
ConferenceName string `json:"conference_name,omitempty" url:"conference_name,omitempty"`
RecordingURL string `json:"recording_url,omitempty" url:"recording_url,omitempty"`
ResourceURI string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
RecordingStartMS string `json:"recording_start_ms,omitempty" url:"recording_start_ms,omitempty"`
RecordingEndMS string `json:"recording_end_ms,omitempty" url:"recording_end_ms,omitempty"`
RecordingDurationMS string `json:"recording_duration_ms,omitempty" url:"recording_duration_ms,omitempty"`
RoundedRecordingDuration int64 `json:"rounded_recording_duration,omitempty" url:"rounded_recording_duration,omitempty"`
FromNumber string `json:"from_number,omitempty" url:"from_number,omitempty"`
ToNumber string `json:"to_number,omitempty" url:"to_number,omitempty"`
}

type RecordingListParams struct {
// Query parameters.
Subaccount string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
CallUUID string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
AddTimeEquals string `json:"add_time,omitempty" url:"add_time,omitempty"`
AddTimeLessThan string `json:"add_time__lt,omitempty" url:"add_time__lt,omitempty"`
AddTimeGreaterThan string `json:"add_time__gt,omitempty" url:"add_time__gt,omitempty"`
AddTimeLessOrEqual string `json:"add_time__lte,omitempty" url:"add_time__lte,omitempty"`
AddTimeGreaterOrEqual string `json:"add_time__gte,omitempty" url:"add_time__gte,omitempty"`
Limit int64 `json:"limit:omitempty" url:"limit:omitempty"`
Offset int64 `json:"offset:omitempty" url:"offset:omitempty"`
FromNumber string `json:"from_number,omitempty" url:"from_number,omitempty"`
ToNumber string `json:"to_number,omitempty" url:"to_number,omitempty"`
ConferenceName string `json:"conference_name,omitempty" url:"conference_name,omitempty"`
MpcName string `json:"mpc_name,omitempty" url:"mpc_name,omitempty"`
ConferenceUuid string `json:"conference_uuid,omitempty" url:"conference_uuid,omitempty"`
MpcUuid string `json:"mpc_uuid,omitempty" url:"mpc_uuid,omitempty"`
Subaccount string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
CallUUID string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
AddTimeLessThan string `json:"add_time__lt,omitempty" url:"add_time__lt,omitempty"`
AddTimeGreaterThan string `json:"add_time__gt,omitempty" url:"add_time__gt,omitempty"`
AddTimeLessOrEqual string `json:"add_time__lte,omitempty" url:"add_time__lte,omitempty"`
AddTimeGreaterOrEqual string `json:"add_time__gte,omitempty" url:"add_time__gte,omitempty"`
Limit int64 `json:"limit,omitempty" url:"limit,omitempty"`
Offset int64 `json:"offset,omitempty" url:"offset,omitempty"`
FromNumber string `json:"from_number,omitempty" url:"from_number,omitempty"`
ToNumber string `json:"to_number,omitempty" url:"to_number,omitempty"`
ConferenceName string `json:"conference_name,omitempty" url:"conference_name,omitempty"`
MpcName string `json:"mpc_name,omitempty" url:"mpc_name,omitempty"`
ConferenceUuid string `json:"conference_uuid,omitempty" url:"conference_uuid,omitempty"`
MpcUuid string `json:"mpc_uuid,omitempty" url:"mpc_uuid,omitempty"`
RecordingStorageDurationEquals int64 `json:"recording_storage_duration,omitempty" url:"recording_storage_duration,omitempty"`
RecordingStorageDurationLessThan int64 `json:"recording_storage_duration__lt,omitempty" url:"recording_storage_duration__lt,omitempty"`
RecordingStorageDurationGreaterThan int64 `json:"recording_storage_duration__gt,omitempty" url:"recording_storage_duration__gt,omitempty"`
RecordingStorageDurationLessOrEqual int64 `json:"recording_storage_duration__lte,omitempty" url:"recording_storage_duration__lte,omitempty"`
RecordingStorageDurationGreaterOrEqual int64 `json:"recording_storage_duration__gte,omitempty" url:"recording_storage_duration__gte,omitempty"`
}

type RecordingListResponse struct {
Expand Down

0 comments on commit f65de7f

Please sign in to comment.