All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.bing.autosuggest.models.QueryContext Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.bing.autosuggest.models;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Defines the query context that Bing used for the request.
 */
public class QueryContext {
    /**
     * The query string as specified in the request.
     */
    @JsonProperty(value = "originalQuery", required = true)
    private String originalQuery;

    /**
     * The query string used by Bing to perform the query. Bing uses the
     * altered query string if the original query string contained spelling
     * mistakes. For example, if the query string is "saling downwind", the
     * altered query string will be "sailing downwind". This field is included
     * only if the original query string contains a spelling mistake.
     */
    @JsonProperty(value = "alteredQuery", access = JsonProperty.Access.WRITE_ONLY)
    private String alteredQuery;

    /**
     * The query string to use to force Bing to use the original string. For
     * example, if the query string is "saling downwind", the override query
     * string will be "+saling downwind". Remember to encode the query string
     * which results in "%2Bsaling+downwind". This field is included only if
     * the original query string contains a spelling mistake.
     */
    @JsonProperty(value = "alterationOverrideQuery", access = JsonProperty.Access.WRITE_ONLY)
    private String alterationOverrideQuery;

    /**
     * A Boolean value that indicates whether the specified query has adult
     * intent. The value is true if the query has adult intent; otherwise,
     * false.
     */
    @JsonProperty(value = "adultIntent", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean adultIntent;

    /**
     * A Boolean value that indicates whether Bing requires the user's location
     * to provide accurate results. If you specified the user's location by
     * using the X-MSEdge-ClientIP and X-Search-Location headers, you can
     * ignore this field. For location aware queries, such as "today's weather"
     * or "restaurants near me" that need the user's location to provide
     * accurate results, this field is set to true. For location aware queries
     * that include the location (for example, "Seattle weather"), this field
     * is set to false. This field is also set to false for queries that are
     * not location aware, such as "best sellers".
     */
    @JsonProperty(value = "askUserForLocation", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean askUserForLocation;

    /**
     * The isTransactional property.
     */
    @JsonProperty(value = "isTransactional", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isTransactional;

    /**
     * The _type property.
     */
    @JsonProperty(value = "_type")
    private String _type;

    /**
     * Get the query string as specified in the request.
     *
     * @return the originalQuery value
     */
    public String originalQuery() {
        return this.originalQuery;
    }

    /**
     * Set the query string as specified in the request.
     *
     * @param originalQuery the originalQuery value to set
     * @return the QueryContext object itself.
     */
    public QueryContext withOriginalQuery(String originalQuery) {
        this.originalQuery = originalQuery;
        return this;
    }

    /**
     * Get the query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is "saling downwind", the altered query string will be "sailing downwind". This field is included only if the original query string contains a spelling mistake.
     *
     * @return the alteredQuery value
     */
    public String alteredQuery() {
        return this.alteredQuery;
    }

    /**
     * Get the query string to use to force Bing to use the original string. For example, if the query string is "saling downwind", the override query string will be "+saling downwind". Remember to encode the query string which results in "%2Bsaling+downwind". This field is included only if the original query string contains a spelling mistake.
     *
     * @return the alterationOverrideQuery value
     */
    public String alterationOverrideQuery() {
        return this.alterationOverrideQuery;
    }

    /**
     * Get a Boolean value that indicates whether the specified query has adult intent. The value is true if the query has adult intent; otherwise, false.
     *
     * @return the adultIntent value
     */
    public Boolean adultIntent() {
        return this.adultIntent;
    }

    /**
     * Get a Boolean value that indicates whether Bing requires the user's location to provide accurate results. If you specified the user's location by using the X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this field. For location aware queries, such as "today's weather" or "restaurants near me" that need the user's location to provide accurate results, this field is set to true. For location aware queries that include the location (for example, "Seattle weather"), this field is set to false. This field is also set to false for queries that are not location aware, such as "best sellers".
     *
     * @return the askUserForLocation value
     */
    public Boolean askUserForLocation() {
        return this.askUserForLocation;
    }

    /**
     * Get the isTransactional value.
     *
     * @return the isTransactional value
     */
    public Boolean isTransactional() {
        return this.isTransactional;
    }

    /**
     * Get the _type value.
     *
     * @return the _type value
     */
    public String _type() {
        return this._type;
    }

    /**
     * Set the _type value.
     *
     * @param _type the _type value to set
     * @return the QueryContext object itself.
     */
    public QueryContext with_type(String _type) {
        this._type = _type;
        return this;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy