Esempio n. 1
0
        public async Task <LiveStreamResponseModel> CreateLiveStreamAsync(LiveStreamRequestModel liveStreamModel)
        {
            if (liveStreamModel == null)
            {
                throw new ArgumentNullException(nameof(liveStreamModel), "LiveStream Object cannot be null");
            }

            var liveStreamCreate = new LiveStreamCreateModel
            {
                LiveStream = liveStreamModel
            };

            var result = await CreateActionAsync <LiveStreamCreateModel, LiveStreamReadModel>("", liveStreamCreate).ConfigureAwait(false);

            return(result?.LiveStream ?? null);
        }
Esempio n. 2
0
        public async Task <LiveStreamResponseModel> UpdateLiveStreamAsync(string liveStreamID, LiveStreamRequestModel liveStreamModel)
        {
            if (liveStreamModel == null)
            {
                throw new ArgumentNullException(nameof(liveStreamModel), "LiveStream Object cannot be null");
            }
            if (string.IsNullOrWhiteSpace(liveStreamID))
            {
                throw new ArgumentNullException(nameof(liveStreamID), "The ID of the live stream is needed to update the stream");
            }

            var liveStreamCreate = new LiveStreamCreateModel
            {
                LiveStream = liveStreamModel
            };
            var result = await PatchActionAsync <LiveStreamCreateModel, LiveStreamReadModel>($"/{liveStreamID}", liveStreamCreate).ConfigureAwait(false);

            return(result?.LiveStream ?? null);
        }