// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.ai.personalizer.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.BinaryData;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Request a set of actions to be ranked by the Personalizer service. */
@Fluent
public final class PersonalizerRankOptions {
    /*
     * Features of the context used for Personalizer as a
     * dictionary of dictionaries. This is determined by your application, and
     * typically includes features about the current user, their
     * device, profile information, aggregated data about time and date, etc.
     * Features should not include personally identifiable information (PII),
     * unique UserIDs, or precise timestamps.
     */
    @JsonProperty(value = "contextFeatures")
    private List<BinaryData> contextFeatures;

    /*
     * The set of actions the Personalizer service can pick from.
     * The set should not contain more than 50 actions.
     * The order of the actions does not affect the rank result but the order
     * should match the sequence your application would have used to display
     * them.
     * The first item in the array will be used as Baseline item in Offline
     * Evaluations.
     */
    @JsonProperty(value = "actions", required = true)
    private List<PersonalizerRankableAction> actions;

    /*
     * The set of action ids to exclude from ranking.
     * Personalizer will consider the first non-excluded item in the array as
     * the Baseline action when performing Offline Evaluations.
     */
    @JsonProperty(value = "excludedActions")
    private List<String> excludedActions;

    /*
     * Optionally pass an eventId that uniquely identifies this Rank event.
     * If null, the service generates a unique eventId. The eventId will be
     * used for
     * associating this request with its reward, as well as seeding the
     * pseudo-random
     * generator when making a Personalizer call.
     */
    @JsonProperty(value = "eventId")
    private String eventId;

    /*
     * Send false if it is certain the rewardActionId in rank results will be
     * shown to the user, therefore
     * Personalizer will expect a Reward call, otherwise it will assign the
     * default
     * Reward to the event. Send true if it is possible the user will not see
     * the action specified in the rank results,
     * (e.g. because the page is rendering later, or the Rank results may be
     * overridden by code further downstream).
     * You must call the Activate Event API if the event output is shown to
     * users, otherwise Rewards will be ignored.
     */
    @JsonProperty(value = "deferActivation")
    private Boolean deferActivation;

    /**
     * Get the contextFeatures property: Features of the context used for Personalizer as a dictionary of dictionaries.
     * This is determined by your application, and typically includes features about the current user, their device,
     * profile information, aggregated data about time and date, etc. Features should not include personally
     * identifiable information (PII), unique UserIDs, or precise timestamps.
     *
     * @return the contextFeatures value.
     */
    public List<BinaryData> getContextFeatures() {
        return this.contextFeatures;
    }

    /**
     * Set the contextFeatures property: Features of the context used for Personalizer as a dictionary of dictionaries.
     * This is determined by your application, and typically includes features about the current user, their device,
     * profile information, aggregated data about time and date, etc. Features should not include personally
     * identifiable information (PII), unique UserIDs, or precise timestamps.
     *
     * @param contextFeatures the contextFeatures value to set.
     * @return the PersonalizerRankOptions object itself.
     */
    public PersonalizerRankOptions setContextFeatures(List<BinaryData> contextFeatures) {
        this.contextFeatures = contextFeatures;
        return this;
    }

    /**
     * Get the actions property: The set of actions the Personalizer service can pick from. The set should not contain
     * more than 50 actions. The order of the actions does not affect the rank result but the order should match the
     * sequence your application would have used to display them. The first item in the array will be used as Baseline
     * item in Offline Evaluations.
     *
     * @return the actions value.
     */
    public List<PersonalizerRankableAction> getActions() {
        return this.actions;
    }

    /**
     * Set the actions property: The set of actions the Personalizer service can pick from. The set should not contain
     * more than 50 actions. The order of the actions does not affect the rank result but the order should match the
     * sequence your application would have used to display them. The first item in the array will be used as Baseline
     * item in Offline Evaluations.
     *
     * @param actions the actions value to set.
     * @return the PersonalizerRankOptions object itself.
     */
    public PersonalizerRankOptions setActions(List<PersonalizerRankableAction> actions) {
        this.actions = actions;
        return this;
    }

    /**
     * Get the excludedActions property: The set of action ids to exclude from ranking. Personalizer will consider the
     * first non-excluded item in the array as the Baseline action when performing Offline Evaluations.
     *
     * @return the excludedActions value.
     */
    public List<String> getExcludedActions() {
        return this.excludedActions;
    }

    /**
     * Set the excludedActions property: The set of action ids to exclude from ranking. Personalizer will consider the
     * first non-excluded item in the array as the Baseline action when performing Offline Evaluations.
     *
     * @param excludedActions the excludedActions value to set.
     * @return the PersonalizerRankOptions object itself.
     */
    public PersonalizerRankOptions setExcludedActions(List<String> excludedActions) {
        this.excludedActions = excludedActions;
        return this;
    }

    /**
     * Get the eventId property: Optionally pass an eventId that uniquely identifies this Rank event. If null, the
     * service generates a unique eventId. The eventId will be used for associating this request with its reward, as
     * well as seeding the pseudo-random generator when making a Personalizer call.
     *
     * @return the eventId value.
     */
    public String getEventId() {
        return this.eventId;
    }

    /**
     * Set the eventId property: Optionally pass an eventId that uniquely identifies this Rank event. If null, the
     * service generates a unique eventId. The eventId will be used for associating this request with its reward, as
     * well as seeding the pseudo-random generator when making a Personalizer call.
     *
     * @param eventId the eventId value to set.
     * @return the PersonalizerRankOptions object itself.
     */
    public PersonalizerRankOptions setEventId(String eventId) {
        this.eventId = eventId;
        return this;
    }

    /**
     * Get the deferActivation property: Send false if it is certain the rewardActionId in rank results will be shown to
     * the user, therefore Personalizer will expect a Reward call, otherwise it will assign the default Reward to the
     * event. Send true if it is possible the user will not see the action specified in the rank results, (e.g. because
     * the page is rendering later, or the Rank results may be overridden by code further downstream). You must call the
     * Activate Event API if the event output is shown to users, otherwise Rewards will be ignored.
     *
     * @return the deferActivation value.
     */
    public Boolean isDeferActivation() {
        return this.deferActivation;
    }

    /**
     * Set the deferActivation property: Send false if it is certain the rewardActionId in rank results will be shown to
     * the user, therefore Personalizer will expect a Reward call, otherwise it will assign the default Reward to the
     * event. Send true if it is possible the user will not see the action specified in the rank results, (e.g. because
     * the page is rendering later, or the Rank results may be overridden by code further downstream). You must call the
     * Activate Event API if the event output is shown to users, otherwise Rewards will be ignored.
     *
     * @param deferActivation the deferActivation value to set.
     * @return the PersonalizerRankOptions object itself.
     */
    public PersonalizerRankOptions setDeferActivation(Boolean deferActivation) {
        this.deferActivation = deferActivation;
        return this;
    }
}
