Skip to content

Commit

Permalink
feat: add video recording and composition settings
Browse files Browse the repository at this point in the history
  • Loading branch information
RJPearson94 committed Jul 25, 2021
1 parent 0280d0a commit ef5861e
Show file tree
Hide file tree
Showing 15 changed files with 901 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ FEATURES
- Add `UseInboundWebhookOnNumber` response field to service create, fetch and update response structs
- Add `UseInboundWebhookOnNumber` input field to service create and update input structs

### Video

- **New Resource:** Composition Settings
- **New Resource:** Recording Settings

## v0.17.0 (2021-05-08)

FIXES
Expand Down
304 changes: 304 additions & 0 deletions definitions/service/video/v1/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,116 @@
}
}
]
},
{
"name": "Recording Settings",
"packageName": "recording_settings",
"function": {
"parameters": {}
},
"documentation": {
"description": "Client for managing the default recording settings",
"twilioDocsLink": "https://www.twilio.com/docs/video/api/encrypted-recordings"
},
"operations": [
{
"name": "Fetch",
"http": {
"uri": "/RecordingSettings/Default",
"method": "Get"
},
"documentation": {
"description": "retrieves the default recording settings",
"twilioDocsLink": "https://www.twilio.com/docs/video/api/encrypted-recordings#http-get"
},
"response": {
"name": "FetchRecordingSettingsResponse",
"structure": "RecordingSettingsResponse",
"documentation": {
"description": "defines the response fields for the retrieved recording settings"
}
}
},
{
"name": "Update",
"http": {
"uri": "/RecordingSettings/Default",
"method": "Post"
},
"documentation": {
"description": "modifies default recording settings",
"twilioDocsLink": "https://www.twilio.com/docs/video/api/encrypted-recordings#http-post"
},
"input": {
"structure": "UpdateRecordingSettingsInput",
"documentation": {
"description": "defines input fields for updating recording settings"
}
},
"response": {
"name": "UpdateRecordingSettingsResponse",
"structure": "RecordingSettingsResponse",
"documentation": {
"description": "defines the response fields for the updated recording settings"
}
}
}
]
},
{
"name": "Composition Settings",
"packageName": "composition_settings",
"function": {
"parameters": {}
},
"documentation": {
"description": "Client for managing the default composition settings",
"twilioDocsLink": "https://www.twilio.com/docs/video/api/encrypted-compositions"
},
"operations": [
{
"name": "Fetch",
"http": {
"uri": "/CompositionSettings/Default",
"method": "Get"
},
"documentation": {
"description": "retrieves the default composition settings",
"twilioDocsLink": "https://www.twilio.com/docs/video/api/encrypted-compositions#http-get"
},
"response": {
"name": "FetchCompositionSettingsResponse",
"structure": "CompositionSettingsResponse",
"documentation": {
"description": "defines the response fields for the retrieved composition settings"
}
}
},
{
"name": "Update",
"http": {
"uri": "/CompositionSettings/Default",
"method": "Post"
},
"documentation": {
"description": "modifies default composition settings",
"twilioDocsLink": "https://www.twilio.com/docs/video/api/encrypted-compositions#http-post"
},
"input": {
"structure": "UpdateCompositionSettingsInput",
"documentation": {
"description": "defines input fields for updating composition settings"
}
},
"response": {
"name": "UpdateCompositionSettingsResponse",
"structure": "CompositionSettingsResponse",
"documentation": {
"description": "defines the response fields for the updated composition settings"
}
}
}
]
}
],
"structures": {
Expand Down Expand Up @@ -2556,6 +2666,200 @@
}
]
},
"UpdateRecordingSettingsInput": {
"type": "URLEncoded",
"properties": [
{
"name": "FriendlyName",
"type": "string",
"value": "FriendlyName",
"required": true,
"validation": {
"ignore": true
}
},
{
"name": "AWSCredentialSid",
"type": "string",
"value": "AwsCredentialsSid",
"required": false
},
{
"name": "EncryptionKeySid",
"type": "string",
"value": "EncryptionKeySid",
"required": false
},
{
"name": "AWSS3URL",
"type": "string",
"value": "AwsS3Url",
"required": false
},
{
"name": "AWSStorageEnabled",
"type": "bool",
"value": "AwsStorageEnabled",
"required": false
},
{
"name": "EncryptionEnabled",
"type": "bool",
"value": "EncryptionEnabled",
"required": false
}
]
},
"RecordingSettingsResponse": {
"type": "JSON",
"properties": [
{
"name": "AccountSid",
"type": "string",
"value": "account_sid",
"required": true
},
{
"name": "FriendlyName",
"type": "string",
"value": "friendly_name",
"required": true
},
{
"name": "AWSCredentialSid",
"type": "string",
"value": "aws_credentials_sid",
"required": false
},
{
"name": "EncryptionKeySid",
"type": "string",
"value": "encryption_key_sid",
"required": false
},
{
"name": "AWSS3URL",
"type": "string",
"value": "aws_s3_url",
"required": false
},
{
"name": "AWSStorageEnabled",
"type": "bool",
"value": "aws_storage_enabled",
"required": false
},
{
"name": "EncryptionEnabled",
"type": "bool",
"value": "encryption_enabled",
"required": false
},
{
"name": "URL",
"type": "string",
"value": "url",
"required": true
}
]
},
"UpdateCompositionSettingsInput": {
"type": "URLEncoded",
"properties": [
{
"name": "FriendlyName",
"type": "string",
"value": "FriendlyName",
"required": true,
"validation": {
"ignore": true
}
},
{
"name": "AWSCredentialSid",
"type": "string",
"value": "AwsCredentialsSid",
"required": false
},
{
"name": "EncryptionKeySid",
"type": "string",
"value": "EncryptionKeySid",
"required": false
},
{
"name": "AWSS3URL",
"type": "string",
"value": "AwsS3Url",
"required": false
},
{
"name": "AWSStorageEnabled",
"type": "bool",
"value": "AwsStorageEnabled",
"required": false
},
{
"name": "EncryptionEnabled",
"type": "bool",
"value": "EncryptionEnabled",
"required": false
}
]
},
"CompositionSettingsResponse": {
"type": "JSON",
"properties": [
{
"name": "AccountSid",
"type": "string",
"value": "account_sid",
"required": true
},
{
"name": "FriendlyName",
"type": "string",
"value": "friendly_name",
"required": true
},
{
"name": "AWSCredentialSid",
"type": "string",
"value": "aws_credentials_sid",
"required": false
},
{
"name": "EncryptionKeySid",
"type": "string",
"value": "encryption_key_sid",
"required": false
},
{
"name": "AWSS3URL",
"type": "string",
"value": "aws_s3_url",
"required": false
},
{
"name": "AWSStorageEnabled",
"type": "bool",
"value": "aws_storage_enabled",
"required": false
},
{
"name": "EncryptionEnabled",
"type": "bool",
"value": "encryption_enabled",
"required": false
},
{
"name": "URL",
"type": "string",
"value": "url",
"required": true
}
]
},
"MetaResponse": {
"type": "JSON",
"properties": [
Expand Down
35 changes: 34 additions & 1 deletion service/video/tests/acceptance/video_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/RJPearson94/twilio-sdk-go"
"github.com/RJPearson94/twilio-sdk-go/service/video/v1/composition_hook"
"github.com/RJPearson94/twilio-sdk-go/service/video/v1/composition_hooks"
"github.com/RJPearson94/twilio-sdk-go/service/video/v1/composition_settings"
"github.com/RJPearson94/twilio-sdk-go/service/video/v1/recording_settings"
"github.com/RJPearson94/twilio-sdk-go/service/video/v1/room"
"github.com/RJPearson94/twilio-sdk-go/service/video/v1/rooms"
"github.com/RJPearson94/twilio-sdk-go/session/credentials"
Expand Down Expand Up @@ -62,7 +64,6 @@ var _ = Describe("Video Acceptance Tests", func() {
})
Expect(updateErr).To(BeNil())
Expect(updateResp).ToNot(BeNil())

})
})

Expand Down Expand Up @@ -113,6 +114,38 @@ var _ = Describe("Video Acceptance Tests", func() {
})
})

Describe("Given the video recording settings clients", func() {
It("Then the recording settings is created, fetched and updated", func() {
recordingSettingsClient := videoSession.RecordingSettings()

fetchResp, fetchErr := recordingSettingsClient.Fetch()
Expect(fetchErr).To(BeNil())
Expect(fetchResp).ToNot(BeNil())

updateResp, updateErr := recordingSettingsClient.Update(&recording_settings.UpdateRecordingSettingsInput{
FriendlyName: "Basic Recording Setting",
})
Expect(updateErr).To(BeNil())
Expect(updateResp).ToNot(BeNil())
})
})

Describe("Given the video composition settings clients", func() {
It("Then the composition settings is created, fetched and updated", func() {
compositionSettingsClient := videoSession.CompositionSettings()

fetchResp, fetchErr := compositionSettingsClient.Fetch()
Expect(fetchErr).To(BeNil())
Expect(fetchResp).ToNot(BeNil())

updateResp, updateErr := compositionSettingsClient.Update(&composition_settings.UpdateCompositionSettingsInput{
FriendlyName: "Basic Composition Setting",
})
Expect(updateErr).To(BeNil())
Expect(updateResp).ToNot(BeNil())
})
})

// TODO Add Recording tests
// TODO Add Room Recording tests
// TODO Add Composition tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"friendly_name": "Enterprise Composition Settings",
"aws_credentials_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"encryption_key_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1",
"aws_s3_url": "https://test-bucket.s3.amazonaws.com/composition/",
"aws_storage_enabled": true,
"encryption_enabled": false,
"url": "https://video.twilio.com/v1/CompositionSettings/Default"
}
Loading

0 comments on commit ef5861e

Please sign in to comment.