def build_intent_for_api(intent_name, questions, answer):
    """Build structure of intent for dialogflow API.
    :param intent_name: str, name of intent
    :param questions: iterable, iterable of questions
    :param answer: str, answer to question
    :return: dict, intent for api
    """
    intent = {'display_name': intent_name,
              'messages': [{'text': {'text': [answer]}}],
              'training_phrases': []}

    for question in questions:
        phrase = {'parts': [{'text': question}]}
        intent['training_phrases'].append(phrase)

    return intent