public virtual PSDataSource UpdatePSDataSource(UpdatePSDataSourceParameters parameters)
        {
            // Get the existing data source
            DataSource dataSource = OperationalInsightsManagementClient.DataSources.Get(parameters.ResourceGroupName, parameters.WorkspaceName, parameters.Name);

            if (parameters.Properties.Kind != dataSource.Kind)
            {
                throw new ArgumentException(Resources.DataSourceUpdateCannotModifyKind);
            }
            if (parameters.Name != dataSource.Name)
            {
                throw new ArgumentException(Resources.DataSourceUpdateCannotModifyName);
            }

            // Execute the update
            DataSource updatedDataSource = CreateOrUpdateDataSource(
                parameters.ResourceGroupName,
                parameters.WorkspaceName,
                dataSource.Name,
                parameters.Properties);

            return(new PSDataSource(updatedDataSource, parameters.ResourceGroupName, parameters.WorkspaceName));
        }
 public virtual PSDataSource UpdatePSDataSource(UpdatePSDataSourceParameters parameters)
 {
     // Get the existing data source
     DataSourceGetResponse response = OperationalInsightsManagementClient.DataSources.Get(parameters.ResourceGroupName, parameters.WorkspaceName, parameters.Name);
     DataSource dataSource = response.DataSource;
     
     if (parameters.Properties.Kind != dataSource.Kind)
     {
         throw new ArgumentException(Resources.DataSourceUpdateCannotModifyKind);
     }
     if (parameters.Name != dataSource.Name)
     {
         throw new ArgumentException(Resources.DataSourceUpdateCannotModifyName);
     }
     
     // Execute the update
     DataSource updatedDataSource = CreateOrUpdateDataSource(
         parameters.ResourceGroupName,
         parameters.WorkspaceName,
         dataSource.Name,
         parameters.Properties);
     
     return new PSDataSource(updatedDataSource, parameters.ResourceGroupName, parameters.WorkspaceName);
 }