Example #1
0
 internal PatchableHostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, string friendlyName, string description, string customRdpProperty, int?maxSessionLimit, PersonalDesktopAssignmentType?personalDesktopAssignmentType, LoadBalancerType?loadBalancerType, int?ring, bool?validationEnvironment, RegistrationInfoPatch registrationInfo, string vmTemplate, string ssoadfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, SsoSecretType?ssoSecretType, PreferredAppGroupType?preferredAppGroupType, bool?startVmOnConnect) : base(id, name, resourceType, systemData)
 {
     Tags                          = tags;
     FriendlyName                  = friendlyName;
     Description                   = description;
     CustomRdpProperty             = customRdpProperty;
     MaxSessionLimit               = maxSessionLimit;
     PersonalDesktopAssignmentType = personalDesktopAssignmentType;
     LoadBalancerType              = loadBalancerType;
     Ring                          = ring;
     ValidationEnvironment         = validationEnvironment;
     RegistrationInfo              = registrationInfo;
     VmTemplate                    = vmTemplate;
     SsoadfsAuthority              = ssoadfsAuthority;
     SsoClientId                   = ssoClientId;
     SsoClientSecretKeyVaultPath   = ssoClientSecretKeyVaultPath;
     SsoSecretType                 = ssoSecretType;
     PreferredAppGroupType         = preferredAppGroupType;
     StartVmOnConnect              = startVmOnConnect;
 }
Example #2
0
        internal static HostPoolUpdateOptions DeserializeHostPoolUpdateOptions(JsonElement element)
        {
            Optional <IDictionary <string, string> > tags = default;
            ResourceIdentifier id                = default;
            string             name              = default;
            ResourceType       type              = default;
            SystemData         systemData        = default;
            Optional <string>  friendlyName      = default;
            Optional <string>  description       = default;
            Optional <string>  customRdpProperty = default;
            Optional <int>     maxSessionLimit   = default;
            Optional <PersonalDesktopAssignmentType> personalDesktopAssignmentType = default;
            Optional <LoadBalancerType> loadBalancerType = default;
            Optional <int>  ring = default;
            Optional <bool> validationEnvironment                        = default;
            Optional <RegistrationInfoPatch> registrationInfo            = default;
            Optional <string>                vmTemplate                  = default;
            Optional <string>                ssoadfsAuthority            = default;
            Optional <string>                ssoClientId                 = default;
            Optional <string>                ssoClientSecretKeyVaultPath = default;
            Optional <SsoSecretType>         ssoSecretType               = default;
            Optional <PreferredAppGroupType> preferredAppGroupType       = default;
            Optional <bool> startVMOnConnect = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("friendlyName"))
                        {
                            friendlyName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("description"))
                        {
                            description = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("customRdpProperty"))
                        {
                            customRdpProperty = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("maxSessionLimit"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            maxSessionLimit = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("personalDesktopAssignmentType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            personalDesktopAssignmentType = new PersonalDesktopAssignmentType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("loadBalancerType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            loadBalancerType = new LoadBalancerType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("ring"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            ring = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("validationEnvironment"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            validationEnvironment = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("registrationInfo"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            registrationInfo = RegistrationInfoPatch.DeserializeRegistrationInfoPatch(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("vmTemplate"))
                        {
                            vmTemplate = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("ssoadfsAuthority"))
                        {
                            ssoadfsAuthority = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("ssoClientId"))
                        {
                            ssoClientId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("ssoClientSecretKeyVaultPath"))
                        {
                            ssoClientSecretKeyVaultPath = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("ssoSecretType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            ssoSecretType = new SsoSecretType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("preferredAppGroupType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            preferredAppGroupType = new PreferredAppGroupType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("startVMOnConnect"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            startVMOnConnect = property0.Value.GetBoolean();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new HostPoolUpdateOptions(id, name, type, systemData, Optional.ToDictionary(tags), friendlyName.Value, description.Value, customRdpProperty.Value, Optional.ToNullable(maxSessionLimit), Optional.ToNullable(personalDesktopAssignmentType), Optional.ToNullable(loadBalancerType), Optional.ToNullable(ring), Optional.ToNullable(validationEnvironment), registrationInfo.Value, vmTemplate.Value, ssoadfsAuthority.Value, ssoClientId.Value, ssoClientSecretKeyVaultPath.Value, Optional.ToNullable(ssoSecretType), Optional.ToNullable(preferredAppGroupType), Optional.ToNullable(startVMOnConnect)));
        }