tock / ai.tock.bot.connector.ga / gaFlexibleMessageForCarousel

# gaFlexibleMessageForCarousel

`fun I18nTranslator.gaFlexibleMessageForCarousel(items: List<GACarouselItem>, suggestions: List<CharSequence> = emptyList(), oneItemTitle: CharSequence? = null, oneItemSubtitle: CharSequence? = null, oneItemDescription: CharSequence? = null, oneItemSuggestions: List<CharSequence> = emptyList()): GAResponseConnectorMessage` (source)

Add a basic card if only one element in the items list, in order to avoid the limitation of 2 items.

### Parameters

`items` - the carousel items

`suggestions` - the suggestions

`oneItemTitle` - if not null and if there is only one item, use this as title. If null GACarouselItem.title is used as title

`oneItemSubtitle` - if not null and if there is only one item, use this as subtitle. If null and the image is not null, GACarouselItem.description is used as subtitle

`oneItemDescription` - if not null and if there is only one item, use this as description. If null and the image is null, GACarouselItem.description is used as description

`oneItemSuggestions` - the additional suggestion if there is only one item

`fun I18nTranslator.gaFlexibleMessageForCarousel(items: List<GACarouselItem>, suggestions: List<CharSequence> = emptyList(), oneItemSuggestions: List<CharSequence> = emptyList(), oneItemBasicCardProvider: (GACarouselItem) -> GABasicCard = { basicCard( it.title.raw, if (it.image != null) it.description?.raw else null, if (it.image == null) it.description?.raw else null, it.image ) }): GAResponseConnectorMessage` (source)

Add a basic card if only one element in the items list, in order to avoid the limitation of 2 items.

### Parameters

`items` - the carousel items

`suggestions` - the suggestions

`oneItemSuggestions` - the additional suggestion if there is only one item

`oneItemBasicCardProvider` - provides the basic card if only one item