From 5bf663729d9f15b22c938091f61a168ab83f8aad Mon Sep 17 00:00:00 2001 From: Anthony Oliveri Date: Mon, 10 Dec 2018 14:46:38 -0600 Subject: [PATCH] feat(NaturalLanguageUnderstandingV1): Add new limit property to CategoriesOptions model --- .../Models/CategoriesOptions.swift | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Source/NaturalLanguageUnderstandingV1/Models/CategoriesOptions.swift b/Source/NaturalLanguageUnderstandingV1/Models/CategoriesOptions.swift index abff87e43..dc0f89c1a 100644 --- a/Source/NaturalLanguageUnderstandingV1/Models/CategoriesOptions.swift +++ b/Source/NaturalLanguageUnderstandingV1/Models/CategoriesOptions.swift @@ -21,5 +21,31 @@ import Foundation Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, Portuguese, Spanish. */ public struct CategoriesOptions: Codable, Equatable { - public init() { } + + /** + Maximum number of categories to return. + Maximum value: **10**. + */ + public var limit: Int? + + // Map each property name to the key that shall be used for encoding/decoding. + private enum CodingKeys: String, CodingKey { + case limit = "limit" + } + + /** + Initialize a `CategoriesOptions` with member variables. + + - parameter limit: Maximum number of categories to return. + Maximum value: **10**. + + - returns: An initialized `CategoriesOptions`. + */ + public init( + limit: Int? = nil + ) + { + self.limit = limit + } + }