ContentTypeQuery

public final class ContentTypeQuery : BaseQuery

To fetch all or find ContentType use ContentTypeQuery.

  • Undocumented

    Declaration

    Swift

    public typealias ResourceType = ContentTypeModel
  • Stack instance for Entry to be fetched

    Declaration

    Swift

    public var stack: Stack
  • URI Parameters

    Declaration

    Swift

    public var parameters: [String : Any]
  • Query Parameters

    Declaration

    Swift

    public var queryParameter: [String : Any]
  • Declaration

    Swift

    public var cachePolicy: CachePolicy
  • Use this method to do a search on ContentType which enables searching for entries based on value’s for members of referenced entries.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    stack.asset().query().where(queryableCodingKey: .title, .equals("ContentType Title"))
    .find { (result: Result<ContentstackResponse<ContentType>, Error>, response: ResponseType) in
        switch result {
        case .success(let contentstackResponse):
            // Contentstack response with ContentType array in items.
        case .failure(let error):
            //Error Message
        }
    }
    

    Declaration

    Swift

    public func `where`(queryableCodingKey: ContentTypeModel.QueryableCodingKey, _
        operation: Query.Operation) -> ContentTypeQuery

    Parameters

    queryableCodingKey

    The member of your QueryableCodingKey that you are performing your select operation against.

    operation

    The query operation used in the query.

    Return Value

    A ContentTypeQuery to enable chaining.

  • Include URI paramertes to fetch ContentType with Global Fields and Count.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    stack.asset().query().include(params: [.all])
    .find { (result: Result<ContentstackResponse<ContentTypeModel>, Error>, response: ResponseType) in
        switch result {
        case .success(let contentstackResponse):
            // Contentstack response with ContentTypeModel array in items.
        case .failure(let error):
            //Error Message
        }
    }
    

    Declaration

    Swift

    public func include(params: Include) -> Self

    Parameters

    params

    The member of your ContentTypeQuery.Include that you want to include in response

    Return Value

    A AssetQuery to enable chaining.

  • The ContentTypeQuery.Include is parameter for including count, Global Fields schema in result.

    See more

    Declaration

    Swift

    public struct Include : OptionSet