/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.0-rc1
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

/**
 * PolicyBinding Serializer
 * @export
 * @interface PatchedDeviceUserBindingRequest
 */
export interface PatchedDeviceUserBindingRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedDeviceUserBindingRequest
     */
    policy?: string | null;
    /**
     *
     * @type {string}
     * @memberof PatchedDeviceUserBindingRequest
     */
    group?: string | null;
    /**
     *
     * @type {number}
     * @memberof PatchedDeviceUserBindingRequest
     */
    user?: number | null;
    /**
     *
     * @type {string}
     * @memberof PatchedDeviceUserBindingRequest
     */
    target?: string;
    /**
     * Negates the outcome of the policy. Messages are unaffected.
     * @type {boolean}
     * @memberof PatchedDeviceUserBindingRequest
     */
    negate?: boolean;
    /**
     *
     * @type {boolean}
     * @memberof PatchedDeviceUserBindingRequest
     */
    enabled?: boolean;
    /**
     *
     * @type {number}
     * @memberof PatchedDeviceUserBindingRequest
     */
    order?: number;
    /**
     * Timeout after which Policy execution is terminated.
     * @type {number}
     * @memberof PatchedDeviceUserBindingRequest
     */
    timeout?: number;
    /**
     * Result if the Policy execution fails.
     * @type {boolean}
     * @memberof PatchedDeviceUserBindingRequest
     */
    failureResult?: boolean;
    /**
     *
     * @type {boolean}
     * @memberof PatchedDeviceUserBindingRequest
     */
    isPrimary?: boolean;
}

/**
 * Check if a given object implements the PatchedDeviceUserBindingRequest interface.
 */
export function instanceOfPatchedDeviceUserBindingRequest(
    value: object,
): value is PatchedDeviceUserBindingRequest {
    return true;
}

export function PatchedDeviceUserBindingRequestFromJSON(
    json: any,
): PatchedDeviceUserBindingRequest {
    return PatchedDeviceUserBindingRequestFromJSONTyped(json, false);
}

export function PatchedDeviceUserBindingRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedDeviceUserBindingRequest {
    if (json == null) {
        return json;
    }
    return {
        policy: json["policy"] == null ? undefined : json["policy"],
        group: json["group"] == null ? undefined : json["group"],
        user: json["user"] == null ? undefined : json["user"],
        target: json["target"] == null ? undefined : json["target"],
        negate: json["negate"] == null ? undefined : json["negate"],
        enabled: json["enabled"] == null ? undefined : json["enabled"],
        order: json["order"] == null ? undefined : json["order"],
        timeout: json["timeout"] == null ? undefined : json["timeout"],
        failureResult: json["failure_result"] == null ? undefined : json["failure_result"],
        isPrimary: json["is_primary"] == null ? undefined : json["is_primary"],
    };
}

export function PatchedDeviceUserBindingRequestToJSON(json: any): PatchedDeviceUserBindingRequest {
    return PatchedDeviceUserBindingRequestToJSONTyped(json, false);
}

export function PatchedDeviceUserBindingRequestToJSONTyped(
    value?: PatchedDeviceUserBindingRequest | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        policy: value["policy"],
        group: value["group"],
        user: value["user"],
        target: value["target"],
        negate: value["negate"],
        enabled: value["enabled"],
        order: value["order"],
        timeout: value["timeout"],
        failure_result: value["failureResult"],
        is_primary: value["isPrimary"],
    };
}
