public override void CreateModelTypeForOptionalClientProperties(CodeModelTS cm)
        {
            List <string> predefinedOptionalProperties = new List <string>()
            {
                "requestOptions", "filters", "noRetryPolicy", "apiVersion",
                "acceptLanguage", "longRunningOperationRetryTimeout",
                "generateClientRequestId", "rpRegistrationRetryTimeout"
            };
            var optionalProperitesOnClient = cm.Properties.Where(
                p => (!p.IsRequired || p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)) &&
                !p.IsConstant && !predefinedOptionalProperties.Contains(p.Name));

            if (optionalProperitesOnClient.Count() > 0)
            {
                string modelTypeName = cm.Name + "Options";
                var    modelType     = new CompositeTypeTS(modelTypeName);
                modelType.BaseModelType = New <CompositeType>(new { Name = "AzureServiceClientOptions", SerializedName = "AzureServiceClientOptions" });
                // We could end up having a property that is required but has a default value based on the above condition. If so then make it optional.
                optionalProperitesOnClient.Where(p => p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)).ForEach(prop => prop.IsRequired = false);
                modelType.AddRange(optionalProperitesOnClient);
                var modelTypeFound = cm.ModelTypes.FirstOrDefault(m => m.Name.EqualsIgnoreCase(modelTypeName));
                if (modelTypeFound != null)
                {
                    cm.Remove(modelTypeFound);
                }
                cm.Add(modelType);
                cm.OptionalParameterTypeForClientConstructor = "Models." + modelTypeName;
            }
        }
        public virtual void CreateModelTypeForOptionalClientProperties(CodeModelTS cm)
        {
            List <string> predefinedOptionalProperties = new List <string>()
            {
                "requestOptions", "filters", "noRetryPolicy"
            };
            var optionalProperitesOnClient = cm.Properties.Where(
                p => (!p.IsRequired || p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)) &&
                !p.IsConstant && !predefinedOptionalProperties.Contains(p.Name));

            if (optionalProperitesOnClient.Count() > 0)
            {
                string modelTypeName = cm.Name + "Options";
                var    modelType     = new CompositeTypeTS(modelTypeName);
                modelType.BaseModelType = New <CompositeType>(new { Name = "ServiceClientOptions", SerializedName = "ServiceClientOptions" });
                // We could end up having a property that is required but has a default value based on the above condition. If so then make it optional.
                optionalProperitesOnClient.Where(p => p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)).ForEach(prop => prop.IsRequired = false);
                modelType.AddRange(optionalProperitesOnClient);
                cm.Add(modelType);
                cm.OptionalParameterTypeForClientConstructor = "Models." + modelTypeName;
            }
        }