// cloud only
        public AutomationVariable(Variable cloudVariable)
            : base(cloudVariable.Name, null, cloudVariable.Properties.LastModifiedTime.LocalDateTime)
        {
            try
            {
                var jss = new JavaScriptSerializer();
                this.setValue(jss.DeserializeObject(cloudVariable.Properties.Value));
            }
            catch
            {
                this.setValue(null);
            }

            this.Encrypted = cloudVariable.Properties.IsEncrypted;
        }
 public void UpdateVariable(Variable variable)
 {
     AutomationClient.Variables.Patch(resourceGroup, automationAccount, new VariablePatchParameters
     {
         Name = variable.Name,
         Properties = new VariablePatchProperties
         {
             Value = variable.Properties.Value,
             Description = variable.Properties.Description
         }
     });
 }
 // both cloud and local
 public AutomationVariable(VariableJson localJson, Variable cloudVariable)
     : base(localJson, cloudVariable.Properties.LastModifiedTime.LocalDateTime)
 {
     this.Encrypted = cloudVariable.Properties.IsEncrypted;
     this.setValue(localJson.Value);            
 }