/* 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.
 */

/**
 * PolicyBindingSerializer which does not require target as target is set implicitly
 * @export
 * @interface TransactionPolicyBindingRequest
 */
export interface TransactionPolicyBindingRequest {
    /**
     *
     * @type {string}
     * @memberof TransactionPolicyBindingRequest
     */
    policy?: string | null;
    /**
     *
     * @type {string}
     * @memberof TransactionPolicyBindingRequest
     */
    group?: string | null;
    /**
     *
     * @type {number}
     * @memberof TransactionPolicyBindingRequest
     */
    user?: number | null;
    /**
     * Negates the outcome of the policy. Messages are unaffected.
     * @type {boolean}
     * @memberof TransactionPolicyBindingRequest
     */
    negate?: boolean;
    /**
     *
     * @type {boolean}
     * @memberof TransactionPolicyBindingRequest
     */
    enabled?: boolean;
    /**
     *
     * @type {number}
     * @memberof TransactionPolicyBindingRequest
     */
    order: number;
    /**
     * Timeout after which Policy execution is terminated.
     * @type {number}
     * @memberof TransactionPolicyBindingRequest
     */
    timeout?: number;
    /**
     * Result if the Policy execution fails.
     * @type {boolean}
     * @memberof TransactionPolicyBindingRequest
     */
    failureResult?: boolean;
}

/**
 * Check if a given object implements the TransactionPolicyBindingRequest interface.
 */
export function instanceOfTransactionPolicyBindingRequest(
    value: object,
): value is TransactionPolicyBindingRequest {
    if (!("order" in value) || value["order"] === undefined) return false;
    return true;
}

export function TransactionPolicyBindingRequestFromJSON(
    json: any,
): TransactionPolicyBindingRequest {
    return TransactionPolicyBindingRequestFromJSONTyped(json, false);
}

export function TransactionPolicyBindingRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): TransactionPolicyBindingRequest {
    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"],
        negate: json["negate"] == null ? undefined : json["negate"],
        enabled: json["enabled"] == null ? undefined : json["enabled"],
        order: json["order"],
        timeout: json["timeout"] == null ? undefined : json["timeout"],
        failureResult: json["failure_result"] == null ? undefined : json["failure_result"],
    };
}

export function TransactionPolicyBindingRequestToJSON(json: any): TransactionPolicyBindingRequest {
    return TransactionPolicyBindingRequestToJSONTyped(json, false);
}

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

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