/// <summary>
        /// Updates the channel with the information supplied. Only limited information can be updated
        /// via this API. See the ChannelUpdateableModel for the fields that are updateable.
        /// </summary>
        /// <param name="channel">The channel to update</param>
        /// <returns>The updated channel</returns>
        public async Task <ChannelModel> UpdateChannel(ChannelModel channel)
        {
            Validator.ValidateVariable(channel, "channel");

            // Need to strip out all of the non-updateable fields in order for the API to not return a 403 error
            ChannelUpdateableModel updateableChannel = JSONSerializerHelper.Clone <ChannelUpdateableModel>(channel);

            return(await this.PatchAsync <ChannelModel>("channels/" + channel.id, this.CreateContentFromObject(updateableChannel)));
        }
Exemple #2
0
        public override void DuplicateAction(ActionContainerControl actionContainer)
        {
            List <ActionBase> actions = new List <ActionBase>()
            {
                actionContainer.GetAction()
            };

            actions = JSONSerializerHelper.Clone <List <ActionBase> >(actions);
            this.AddActionControlContainer(new ActionContainerControl(this.window, this, actions.First()));
        }
        /// <summary>
        /// Updates the specified MixPlay game version.
        /// </summary>
        /// <param name="version">The MixPlay game version to update</param>
        /// <returns>The updated MixPlay game version</returns>
        public async Task <MixPlayGameVersionModel> UpdateMixPlayGameVersion(MixPlayGameVersionModel version)
        {
            Validator.ValidateVariable(version, "version");

            // Need to strip out all of the non-updateable fields in order for the API to not return a 403 error
            MixPlayGameVersionUpdateableModel updateableVersion = JSONSerializerHelper.Clone <MixPlayGameVersionUpdateableModel>(version);

            updateableVersion.controls = version.controls;

            return(await this.PutAsync <MixPlayGameVersionModel>("interactive/versions/" + version.id, this.CreateContentFromObject(updateableVersion)));
        }
Exemple #4
0
        private MethodPacket BuildUpdateScenesPacket(IEnumerable <MixPlayConnectedSceneModel> scenes)
        {
            Validator.ValidateList(scenes, "scenes");
            MixPlayConnectedSceneCollectionModel collection = new MixPlayConnectedSceneCollectionModel();

            foreach (MixPlayConnectedSceneModel scene in scenes)
            {
                // Need to strip out all of the non-updateable fields in order for the API to not return a 403 error
                collection.scenes.Add(JSONSerializerHelper.Clone <MixPlayConnectedSceneModel>(scene));
            }
            return(new MethodParamsPacket("updateScenes", JObject.FromObject(collection)));
        }
 /// <summary>
 /// Gets a copy of the current OAuth token.
 /// </summary>
 /// <returns>The OAuth token copy</returns>
 public OAuthTokenModel GetOAuthTokenCopy()
 {
     return(JSONSerializerHelper.Clone <OAuthTokenModel>(this.token));
 }