internal CloudServiceExtensionProperties(string publisher, string type, string typeHandlerVersion, bool?autoUpgradeMinorVersion, string settings, string protectedSettings, CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault, string forceUpdateTag, string provisioningState, IList <string> rolesAppliedTo)
 {
     Publisher                     = publisher;
     Type                          = type;
     TypeHandlerVersion            = typeHandlerVersion;
     AutoUpgradeMinorVersion       = autoUpgradeMinorVersion;
     Settings                      = settings;
     ProtectedSettings             = protectedSettings;
     ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault;
     ForceUpdateTag                = forceUpdateTag;
     ProvisioningState             = provisioningState;
     RolesAppliedTo                = rolesAppliedTo;
 }
        internal static CloudServiceExtensionProperties DeserializeCloudServiceExtensionProperties(JsonElement element)
        {
            Optional <string> publisher               = default;
            Optional <string> type                    = default;
            Optional <string> typeHandlerVersion      = default;
            Optional <bool>   autoUpgradeMinorVersion = default;
            Optional <string> settings                = default;
            Optional <string> protectedSettings       = default;
            Optional <CloudServiceVaultAndSecretReference> protectedSettingsFromKeyVault = default;
            Optional <string>          forceUpdateTag    = default;
            Optional <string>          provisioningState = default;
            Optional <IList <string> > rolesAppliedTo    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("publisher"))
                {
                    publisher = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("typeHandlerVersion"))
                {
                    typeHandlerVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("autoUpgradeMinorVersion"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    autoUpgradeMinorVersion = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("settings"))
                {
                    settings = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("protectedSettings"))
                {
                    protectedSettings = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("protectedSettingsFromKeyVault"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    protectedSettingsFromKeyVault = CloudServiceVaultAndSecretReference.DeserializeCloudServiceVaultAndSecretReference(property.Value);
                    continue;
                }
                if (property.NameEquals("forceUpdateTag"))
                {
                    forceUpdateTag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    provisioningState = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("rolesAppliedTo"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    rolesAppliedTo = array;
                    continue;
                }
            }
            return(new CloudServiceExtensionProperties(publisher.Value, type.Value, typeHandlerVersion.Value, Optional.ToNullable(autoUpgradeMinorVersion), settings.Value, protectedSettings.Value, protectedSettingsFromKeyVault.Value, forceUpdateTag.Value, provisioningState.Value, Optional.ToList(rolesAppliedTo)));
        }