private DeploymentServiceModel CreateDeploymentServiceModel(ValueServiceModel response)
        {
            var output = JsonConvert.DeserializeObject <DeploymentServiceModel>(response.Data);

            output.Id   = response.Key;
            output.ETag = response.ETag;
            if (output.Tags == null)
            {
                output.Tags = new List <string>();
            }

            return(output);
        }
        public async Task <ValueServiceModel> SaveDocumentAsync(string collectionId, string key, ValueServiceModel input, string collectionLink)
        {
            try
            {
                var response = await this.client.UpsertDocumentAsync(
                    collectionLink,
                    new KeyValueDocument(collectionId, key, input.Data),
                    IfMatch(input.ETag));

                return(new ValueServiceModel(response?.Resource));
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Update failed while saving the resource", ex);
            }
        }