// Code generated by Microsoft Kiota - DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package models
import (
    "math"
    "strings"
)
type WhatIfAnalysisReasons int

const (
    NOTSET_WHATIFANALYSISREASONS = 1
    NOTENOUGHINFORMATION_WHATIFANALYSISREASONS = 2
    INVALIDCONDITION_WHATIFANALYSISREASONS = 4
    USERS_WHATIFANALYSISREASONS = 8
    WORKLOADIDENTITIES_WHATIFANALYSISREASONS = 16
    APPLICATION_WHATIFANALYSISREASONS = 32
    USERACTIONS_WHATIFANALYSISREASONS = 64
    AUTHENTICATIONCONTEXT_WHATIFANALYSISREASONS = 128
    DEVICEPLATFORM_WHATIFANALYSISREASONS = 256
    DEVICES_WHATIFANALYSISREASONS = 512
    CLIENTAPPS_WHATIFANALYSISREASONS = 1024
    LOCATION_WHATIFANALYSISREASONS = 2048
    SIGNINRISK_WHATIFANALYSISREASONS = 4096
    EMPTYPOLICY_WHATIFANALYSISREASONS = 8192
    INVALIDPOLICY_WHATIFANALYSISREASONS = 16384
    POLICYNOTENABLED_WHATIFANALYSISREASONS = 32768
    USERRISK_WHATIFANALYSISREASONS = 65536
    TIME_WHATIFANALYSISREASONS = 131072
    INSIDERRISK_WHATIFANALYSISREASONS = 262144
    AUTHENTICATIONFLOW_WHATIFANALYSISREASONS = 524288
    UNKNOWNFUTUREVALUE_WHATIFANALYSISREASONS = 1048576
)

func (i WhatIfAnalysisReasons) String() string {
    var values []string
    options := []string{"notSet", "notEnoughInformation", "invalidCondition", "users", "workloadIdentities", "application", "userActions", "authenticationContext", "devicePlatform", "devices", "clientApps", "location", "signInRisk", "emptyPolicy", "invalidPolicy", "policyNotEnabled", "userRisk", "time", "insiderRisk", "authenticationFlow", "unknownFutureValue"}
    for p := 0; p < 21; p++ {
        mantis := WhatIfAnalysisReasons(int(math.Pow(2, float64(p))))
        if i&mantis == mantis {
            values = append(values, options[p])
        }
    }
    return strings.Join(values, ",")
}
func ParseWhatIfAnalysisReasons(v string) (any, error) {
    var result WhatIfAnalysisReasons
    values := strings.Split(v, ",")
    for _, str := range values {
        switch str {
            case "notSet":
                result |= NOTSET_WHATIFANALYSISREASONS
            case "notEnoughInformation":
                result |= NOTENOUGHINFORMATION_WHATIFANALYSISREASONS
            case "invalidCondition":
                result |= INVALIDCONDITION_WHATIFANALYSISREASONS
            case "users":
                result |= USERS_WHATIFANALYSISREASONS
            case "workloadIdentities":
                result |= WORKLOADIDENTITIES_WHATIFANALYSISREASONS
            case "application":
                result |= APPLICATION_WHATIFANALYSISREASONS
            case "userActions":
                result |= USERACTIONS_WHATIFANALYSISREASONS
            case "authenticationContext":
                result |= AUTHENTICATIONCONTEXT_WHATIFANALYSISREASONS
            case "devicePlatform":
                result |= DEVICEPLATFORM_WHATIFANALYSISREASONS
            case "devices":
                result |= DEVICES_WHATIFANALYSISREASONS
            case "clientApps":
                result |= CLIENTAPPS_WHATIFANALYSISREASONS
            case "location":
                result |= LOCATION_WHATIFANALYSISREASONS
            case "signInRisk":
                result |= SIGNINRISK_WHATIFANALYSISREASONS
            case "emptyPolicy":
                result |= EMPTYPOLICY_WHATIFANALYSISREASONS
            case "invalidPolicy":
                result |= INVALIDPOLICY_WHATIFANALYSISREASONS
            case "policyNotEnabled":
                result |= POLICYNOTENABLED_WHATIFANALYSISREASONS
            case "userRisk":
                result |= USERRISK_WHATIFANALYSISREASONS
            case "time":
                result |= TIME_WHATIFANALYSISREASONS
            case "insiderRisk":
                result |= INSIDERRISK_WHATIFANALYSISREASONS
            case "authenticationFlow":
                result |= AUTHENTICATIONFLOW_WHATIFANALYSISREASONS
            case "unknownFutureValue":
                result |= UNKNOWNFUTUREVALUE_WHATIFANALYSISREASONS
            default:
                return nil, nil
        }
    }
    return &result, nil
}
func SerializeWhatIfAnalysisReasons(values []WhatIfAnalysisReasons) []string {
    result := make([]string, len(values))
    for i, v := range values {
        result[i] = v.String()
    }
    return result
}
func (i WhatIfAnalysisReasons) isMultiValue() bool {
    return true
}
