<commit_before>// 
// Copyright (c) Microsoft and contributors.  All rights reserved.
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Warning: This code was generated by a tool.
// 
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using Microsoft.Azure.Management.Compute.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute.Automation
{
    [Cmdlet("New", "AzureRmSnapshotUpdateConfig", SupportsShouldProcess = true)]
    [OutputType(typeof(SnapshotUpdate))]
    public class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
    {
        [Parameter(
            Mandatory = false,
            Position = 0,
            ValueFromPipelineByPropertyName = true)]
        public StorageAccountTypes? AccountType { get; set; }

        [Parameter(
            Mandatory = false,
            Position = 1,
            ValueFromPipelineByPropertyName = true)]
        public OperatingSystemTypes? OsType { get; set; }

        [Parameter(
            Mandatory = false,
            Position = 2,
            ValueFromPipelineByPropertyName = true)]
        public int? DiskSizeGB { get; set; }

        [Parameter(
            Mandatory = false,
            Position = 3,
            ValueFromPipelineByPropertyName = true)]
        public Hashtable Tag { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  CreateOption cannot be changed during updating a snapshot." +
            "This parameter was added due to a bug." +
            "To set CreateOption of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public DiskCreateOption? CreateOption { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  StorageAccountId cannot be changed during updating a snapshot." +
            "This parameter was added due to a bug." +
            "To set StorageAccountId of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public string StorageAccountId { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  ImageReference cannot be changed during updating a snapshot." +
            "This parameter was added due to a bug." +
            "To set ImageReference of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public ImageDiskReference ImageReference { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  SourceUri cannot be changed during updating a snapshot." +
            "This parameter was added due to a bug." +
            "To set SourceUri of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public string SourceUri { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  SourceResourceId cannot be changed during updating a snapshot." +
            "This parameter was added due to a bug." +
            "To set SourceResourceId of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public string SourceResourceId { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public bool? EncryptionSettingsEnabled { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public KeyVaultAndSecretReference DiskEncryptionKey { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public KeyVaultAndKeyReference KeyEncryptionKey { get; set; }

        protected override void ProcessRecord()
        {
            if (ShouldProcess("SnapshotUpdate", "New"))
            {
                Run();
            }
        }

        private void Run()
        {
            // CreationData
            Microsoft.Azure.Management.Compute.Models.CreationData vCreationData = null;

            // EncryptionSettings
            Microsoft.Azure.Management.Compute.Models.EncryptionSettings vEncryptionSettings = null;

            if (this.CreateOption.HasValue)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.CreateOption = this.CreateOption.Value;
            }

            if (this.StorageAccountId != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.StorageAccountId = this.StorageAccountId;
            }

            if (this.ImageReference != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.ImageReference = this.ImageReference;
            }

            if (this.SourceUri != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.SourceUri = this.SourceUri;
            }

            if (this.SourceResourceId != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.SourceResourceId = this.SourceResourceId;
            }

            if (this.EncryptionSettingsEnabled != null)
            {
                if (vEncryptionSettings == null)
                {
                    vEncryptionSettings = new Microsoft.Azure.Management.Compute.Models.EncryptionSettings();
                }
                vEncryptionSettings.Enabled = this.EncryptionSettingsEnabled;
            }

            if (this.DiskEncryptionKey != null)
            {
                if (vEncryptionSettings == null)
                {
                    vEncryptionSettings = new Microsoft.Azure.Management.Compute.Models.EncryptionSettings();
                }
                vEncryptionSettings.DiskEncryptionKey = this.DiskEncryptionKey;
            }

            if (this.KeyEncryptionKey != null)
            {
                if (vEncryptionSettings == null)
                {
                    vEncryptionSettings = new Microsoft.Azure.Management.Compute.Models.EncryptionSettings();
                }
                vEncryptionSettings.KeyEncryptionKey = this.KeyEncryptionKey;
            }


            var vSnapshotUpdate = new SnapshotUpdate
            {
                AccountType = this.AccountType,
                OsType = this.OsType,
                DiskSizeGB = this.DiskSizeGB,
                Tags = (this.Tag == null) ? null : this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value),
                CreationData = vCreationData,
                EncryptionSettings = vEncryptionSettings,
            };

            WriteObject(vSnapshotUpdate);
        }
    }
}

<commit_msg>Update parameter obsolete messages for SnapshotUpdate<commit_after>// 
// Copyright (c) Microsoft and contributors.  All rights reserved.
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Warning: This code was generated by a tool.
// 
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using Microsoft.Azure.Management.Compute.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Compute.Automation
{
    [Cmdlet("New", "AzureRmSnapshotUpdateConfig", SupportsShouldProcess = true)]
    [OutputType(typeof(SnapshotUpdate))]
    public class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
    {
        [Parameter(
            Mandatory = false,
            Position = 0,
            ValueFromPipelineByPropertyName = true)]
        public StorageAccountTypes? AccountType { get; set; }

        [Parameter(
            Mandatory = false,
            Position = 1,
            ValueFromPipelineByPropertyName = true)]
        public OperatingSystemTypes? OsType { get; set; }

        [Parameter(
            Mandatory = false,
            Position = 2,
            ValueFromPipelineByPropertyName = true)]
        public int? DiskSizeGB { get; set; }

        [Parameter(
            Mandatory = false,
            Position = 3,
            ValueFromPipelineByPropertyName = true)]
        public Hashtable Tag { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  CreateOption cannot be changed during updating a snapshot." +
            "To set the CreateOption of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public DiskCreateOption? CreateOption { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  StorageAccountId cannot be changed during updating a snapshot." +
            "To set the StorageAccountId of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public string StorageAccountId { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  ImageReference cannot be changed during updating a snapshot." +
            "To set the ImageReference of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public ImageDiskReference ImageReference { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  SourceUri cannot be changed during updating a snapshot." +
            "To set the SourceUri of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public string SourceUri { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        [Obsolete("This parameter is obsolete.  SourceResourceId cannot be changed during updating a snapshot." +
            "To set the SourceResourceId of a snapshot, use New-AzureRmSnapshotConfig command.",
            false)]
        public string SourceResourceId { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public bool? EncryptionSettingsEnabled { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public KeyVaultAndSecretReference DiskEncryptionKey { get; set; }

        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true)]
        public KeyVaultAndKeyReference KeyEncryptionKey { get; set; }

        protected override void ProcessRecord()
        {
            if (ShouldProcess("SnapshotUpdate", "New"))
            {
                Run();
            }
        }

        private void Run()
        {
            // CreationData
            Microsoft.Azure.Management.Compute.Models.CreationData vCreationData = null;

            // EncryptionSettings
            Microsoft.Azure.Management.Compute.Models.EncryptionSettings vEncryptionSettings = null;

            if (this.CreateOption.HasValue)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.CreateOption = this.CreateOption.Value;
            }

            if (this.StorageAccountId != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.StorageAccountId = this.StorageAccountId;
            }

            if (this.ImageReference != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.ImageReference = this.ImageReference;
            }

            if (this.SourceUri != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.SourceUri = this.SourceUri;
            }

            if (this.SourceResourceId != null)
            {
                if (vCreationData == null)
                {
                    vCreationData = new Microsoft.Azure.Management.Compute.Models.CreationData();
                }
                vCreationData.SourceResourceId = this.SourceResourceId;
            }

            if (this.EncryptionSettingsEnabled != null)
            {
                if (vEncryptionSettings == null)
                {
                    vEncryptionSettings = new Microsoft.Azure.Management.Compute.Models.EncryptionSettings();
                }
                vEncryptionSettings.Enabled = this.EncryptionSettingsEnabled;
            }

            if (this.DiskEncryptionKey != null)
            {
                if (vEncryptionSettings == null)
                {
                    vEncryptionSettings = new Microsoft.Azure.Management.Compute.Models.EncryptionSettings();
                }
                vEncryptionSettings.DiskEncryptionKey = this.DiskEncryptionKey;
            }

            if (this.KeyEncryptionKey != null)
            {
                if (vEncryptionSettings == null)
                {
                    vEncryptionSettings = new Microsoft.Azure.Management.Compute.Models.EncryptionSettings();
                }
                vEncryptionSettings.KeyEncryptionKey = this.KeyEncryptionKey;
            }


            var vSnapshotUpdate = new SnapshotUpdate
            {
                AccountType = this.AccountType,
                OsType = this.OsType,
                DiskSizeGB = this.DiskSizeGB,
                Tags = (this.Tag == null) ? null : this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value),
                CreationData = vCreationData,
                EncryptionSettings = vEncryptionSettings,
            };

            WriteObject(vSnapshotUpdate);
        }
    }
}


{'fraction_non_alphanumeric': 0.07811838684321906, 'fraction_numerical': 0.0009674103633835178, 'mean_word_length': 1.8365631967072544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '23829', 'n_tokens_mistral': 3971, 'n_tokens_neox': 3838, 'n_words': 1064}