Exemplo n.º 1
0
        /// <summary>
        /// Update model information
        /// </summary>
        /// <param name="modelId">the id of the model</param>
        /// <param name="activeBuildId">the id of the build to be active (optional)</param>
        public void SetActiveBuild(string modelId, long activeBuildId)
        {
            var info = new UpdateActiveBuildInfo()
            {
                ActiveBuildId = activeBuildId
            };

            SetActiveBuild(modelId, info);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Set an active build for the model.
        /// </summary>
        /// <param name="modelId">Unique idenfier of the model</param>
        /// <param name="updateActiveBuildInfo"></param>
        public void SetActiveBuild(string modelId, UpdateActiveBuildInfo updateActiveBuildInfo)
        {
            string uri     = BaseUri + "/models/" + modelId;
            var    content = new ObjectContent <UpdateActiveBuildInfo>(updateActiveBuildInfo, new JsonMediaTypeFormatter());
            var    request = new HttpRequestMessage(new HttpMethod("PATCH"), uri)
            {
                Content = content
            };
            var response = _httpClient.SendAsync(request).Result;

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception("Error HTTP Status Code");
            }
        }