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

travel.izi.api.service.MtgObjectService Maven / Gradle / Ivy

/*
 * Copyright (C) 2014 IZITEQ B.V.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package travel.izi.api.service;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import travel.izi.api.model.entity.CompactMtgObject;
import travel.izi.api.model.entity.FullMtgObject;
import travel.izi.api.model.entity.ProductIdResponse;
import travel.izi.api.model.enumeration.MtgObjectType;
import travel.izi.api.service.constant.ContentSectionModifier;

import java.util.List;

/**
 * Endpoints for MTG Object.
 */
@SuppressWarnings("unused")
public interface MtgObjectService {

    /**
     * Retrieve a full MtgObject by UUID param.
     *
     * @param uuid           UUID of MtgObject.
     * @param languages      Array of preferable content languages.
     * @param includes       Array of {@link ContentSectionModifier} (by default: {@link
     *                       ContentSectionModifier#CHILDREN}).
     * @param except         The same array of {@link ContentSectionModifier} as above for
     *                       excluding.
     * @param audio_duration Defines if the total audio duration shall be added to returned
     *                       MTGObject(s).
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     *                       Field 'audio_duration’ will be added to root of compact form and to
     *                       content section of full form.
     *                       The value of 'audio_duration’ is integer and keeps total duration in
     *                       seconds of the object and children.
     * @param children_count Defines if the field `children_count` shall be added to full form of
     *                       MTGObject in content section.
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     * @return Only one MtgObject is returned. The language of content is a first available
     * language from requested languages. If no available language or MtgObject with requested
     * UUID doesn't exist, 404 error code is returned.
     */
    @GET("/mtgobjects/{uuid}")
    Call> mtgObject(
            @Path("uuid") String uuid,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("audio_duration") Boolean audio_duration,
            @Query("children_count_in_full_form") Boolean children_count
    );

    /**
     * Retrieve list of compact MtgObjects by set of UUIDs param.
     *
     * @param uuids          Set of MtgObject UUIDs separated by commas.
     * @param languages      Array of preferable content languages.
     * @param includes       Array of {@link ContentSectionModifier} (by default: {@link
     *                       ContentSectionModifier#CHILDREN}).
     * @param except         The same array of {@link ContentSectionModifier} as above for
     *                       excluding.
     * @param audio_duration Defines if the total audio duration shall be added to returned
     *                       MTGObject(s).
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     *                       Field 'audio_duration’ will be added to root of compact form and to
     *                       content section of full form.
     *                       The value of 'audio_duration’ is integer and keeps total duration in
     *                       seconds of the object and children.
     * @return List of MtgObjects. The language of content is a first available
     * language from requested languages. If no available language or MtgObject with requested
     * UUIDs doesn't exist, 404 error code is returned.
     * @see #fullMtgObjects(String, String[], String[], String[], Boolean, Boolean)
     */
    @GET("/mtgobjects/batch/{uuids}?form=compact")
    Call> compactMtgObjects(
            @Path("uuids") String uuids,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("audio_duration") Boolean audio_duration
    );

    /**
     * Retrieve list of full MtgObjects by set of UUIDs param.
     *
     * @see #compactMtgObjects(String, String[], String[], String[], Boolean)
     */
    @GET("/mtgobjects/batch/{uuids}?form=full")
    Call> fullMtgObjects(
            @Path("uuids") String uuids,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("audio_duration") Boolean audio_duration,
            @Query("children_count_in_full_form") Boolean children_count
    );

    /**
     * Retrieve parents of MtgObject in compact form.
     *
     * @param uuid           UUID of MtgObject.
     * @param languages      Array of preferable content languages.
     * @param includes       Array of {@link ContentSectionModifier}.
     * @param except         The same array of {@link ContentSectionModifier} as above for
     *                       excluding.
     * @param limit          Number of results to return, value in interval [1, 100]
     *                       (20 by default).
     * @param offset         Get the results starting at a given offset (0 by default).
     * @param audio_duration Defines if the total audio duration shall be added to returned
     *                       MTGObject(s).
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     *                       Field 'audio_duration’ will be added to root of compact form and to
     *                       content section of full form.
     *                       The value of 'audio_duration’ is integer and keeps total duration in
     *                       seconds of the object and children.
     * @return If MtgObject with requested UUID doesn't exist, 404 error code is returned.
     * @see #fullParents(String, String[], String[], String[], Long, Long, Boolean, Boolean)
     */
    @GET("/mtgobjects/{uuid}/parents?form=compact")
    Call> compactParents(
            @Path("uuid") String uuid,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("limit") Long limit,
            @Query("offset") Long offset,
            @Query("audio_duration") Boolean audio_duration
    );

    /**
     * Retrieve parents of MtgObject in full form.
     *
     * @see #compactParents(String, String[], String[], String[], Long, Long, Boolean)
     */
    @GET("/mtgobjects/{uuid}/parents?form=full")
    Call> fullParents(
            @Path("uuid") String uuid,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("limit") Long limit,
            @Query("offset") Long offset,
            @Query("audio_duration") Boolean audio_duration,
            @Query("children_count_in_full_form") Boolean children_count
    );

    /**
     * Retrieve children of MtgObject in compact form.
     *
     * @param uuid           UUID of MtgObject.
     * @param languages      Array of preferable content languages.
     * @param includes       Array of {@link ContentSectionModifier}.
     * @param except         The same array of {@link ContentSectionModifier} as above for
     *                       excluding.
     * @param limit          Number of results to return, up to 100 (50 by default)
     * @param offset         Get the results starting at a given offset (0 by default).
     * @param types          Array of requested types of children, i.e. for Museum children could be
     *                       {@link MtgObjectType#Exhibit} or {@link MtgObjectType#Collection},
     *                       while for Tour children could be {@link
     *                       MtgObjectType#TouristAttraction} or {@link
     *                       MtgObjectType#StoryNavigation}.
     * @param show_hidden    If it set to true, then hidden tourist_attraction will be returned.
     * @param audio_duration Defines if the total audio duration shall be added to returned
     *                       MTGObject(s).
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     *                       Field 'audio_duration’ will be added to root of compact form and to
     *                       content section of full form.
     *                       The value of 'audio_duration’ is integer and keeps total duration in
     *                       seconds of the object and children.
     * @return If MtgObject with requested UUID doesn't exist, 404 error code is returned.
     * @see #fullChildren(String, String[], String[], String[], Long, Long, String[], Boolean,
     * Boolean, Boolean)
     */
    @GET("/mtgobjects/{uuid}/children?form=compact")
    Call> compactChildren(
            @Path("uuid") String uuid,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("limit") Long limit,
            @Query("offset") Long offset,
            @Query("type") String[] types,
            @Query("show_hidden") Boolean show_hidden,
            @Query("audio_duration") Boolean audio_duration
    );

    /**
     * Retrieve children of MtgObject in full form.
     *
     * @see #compactChildren(String, String[], String[], String[], Long, Long, String[],
     * Boolean, Boolean)
     */
    @GET("/mtgobjects/{uuid}/children?form=full")
    Call> fullChildren(
            @Path("uuid") String uuid,
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("limit") Long limit,
            @Query("offset") Long offset,
            @Query("type") String[] types,
            @Query("show_hidden") Boolean show_hidden,
            @Query("audio_duration") Boolean audio_duration,
            @Query("children_count_in_full_form") Boolean children_count
    );

    /**
     * Retrieve number of children of a MTGObject.
     *
     * @param uuid      UUID of MtgObject.
     * @param languages Array of preferable content languages.
     * @param types     Array of requested types of children, i.e. for Museum children could be
     *                  {@link MtgObjectType#Exhibit} or {@link MtgObjectType#Collection}, while
     *                  for Tour children could be {@link MtgObjectType#TouristAttraction} or
     *                  {@link MtgObjectType#StoryNavigation}.
     * @return Amount of children of MTGObject with requested UUID as integer.
     */
    @GET("/mtgobjects/{uuid}/children/count")
    Call childrenNumber(
            @Path("uuid") String uuid,
            @Query("languages") String[] languages,
            @Query("type") String[] types
    );

    /**
     * Retrieve a full museum object using its external IP address. IP address is detected by
     * server if it is not set
     * directly via the parameter 'ip'.
     *
     * @param languages      Array of preferable content languages.
     * @param includes       Array of {@link ContentSectionModifier} (by default: {@link
     *                       ContentSectionModifier#CHILDREN}).
     * @param except         The same array of {@link ContentSectionModifier} as above for
     *                       excluding.
     * @param ip             External API value. Used to set external IP directly.
     * @param audio_duration Defines if the total audio duration shall be added to returned
     *                       MTGObject(s).
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     *                       Field 'audio_duration’ will be added to root of compact form and to
     *                       content section of full form.
     *                       The value of 'audio_duration’ is integer and keeps total duration in
     *                       seconds of the object and children.
     * @param children_count Defines if the field `children_count` shall be added to full form of
     *                       MTGObject in content section.
     *                       Values: `true` or `false`. Default value: `false`. Makes sense for
     *                       MTGObjects museum, tour or collection.
     * @return Only one MtgObject is returned. The language of content is a first available
     * language from requested languages. If no available language or MtgObject with requested ip
     * doesn't exist, 404 error code is returned.
     */
    @GET("/mtgobjects/ip?form=full")
    Call> museumByIp(
            @Query("languages") String[] languages,
            @Query("includes") String[] includes,
            @Query("except") String[] except,
            @Query("ip") String ip,
            @Query("audio_duration") Boolean audio_duration,
            @Query("children_count_in_full_form") Boolean children_count
    );

    /**
     * Retrieve product ID of MtgObject.
     *
     * @param uuid UUID of MtgObject.
     * @return If MtgObject with requested UUID doesn't exist, 404 error code is returned.
     */
    @GET("/mtgobjects/{uuid}/product_id")
    Call productId(
            @Path("uuid") String uuid
    );

    /**
     * Search for museums and/or tours by product IDs.
     *
     * @param languages  Array of preferable languages.
     * @param productIds Array of product IDs.
     * @param includes   Array of {@link ContentSectionModifier}.
     * @param except     The same array of {@link ContentSectionModifier} as above for excluding.
     * @return If MtgObject with requested product IDs doesn't exist, 404 error code is returned.
     * @see #searchFullByProductIds(String[], String[], String[], String[])
     */
    @GET("/mtgobjects/search/paid?form=compact")
    Call> searchCompactByProductIds(
            @Query("languages") String[] languages,
            @Query("product_ids") String[] productIds,
            @Query("includes") String[] includes,
            @Query("except") String[] except
    );

    /**
     * Search for museums and/or tours by product IDs.
     *
     * @see #searchCompactByProductIds(String[], String[], String[], String[])
     */
    @GET("/mtgobjects/search/paid?form=full")
    Call> searchFullByProductIds(
            @Query("languages") String[] languages,
            @Query("product_ids") String[] productIds,
            @Query("includes") String[] includes,
            @Query("except") String[] except
    );

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy