// cloud only
 public AutomationCredential(Credential cloudCredential)
     : base(cloudCredential.Name, null, cloudCredential.Properties.LastModifiedTime.LocalDateTime)
 {
     this.setUsername(cloudCredential.Properties.UserName);
     this.setPassword(null);
 }
 // both cloud and local
 public AutomationCredential(CredentialJson localJson, Credential cloudCredential)
     : base(localJson, cloudCredential.Properties.LastModifiedTime.LocalDateTime)
 {
     this.setUsername(localJson.Username);
     this.setPassword(localJson.Password);
 }
 public void UpdateCredential(Credential credential, string password = null)
 {
     AutomationClient.PsCredentials.Patch(resourceGroup, automationAccount, new CredentialPatchParameters
     {
         Name = credential.Name,
         Properties = new CredentialPatchProperties
         {
             UserName = credential.Properties.UserName,
             Password = password,
             Description = credential.Properties.Description
         }
     });
 }