EntryQueryable

public protocol EntryQueryable : QueryProtocol

Undocumented

  • locale(_:) Extension method

    Instance method to fetch Entry for specific locale.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    @discardableResult
    public func locale(_ locale: String) -> Self

    Parameters

    locale

    The code for fetching entry for locale.

    Return Value

    A reference to the receiving object to enable chaining.

  • only(fields:) Extension method

    Specifies an array of only keys in BASE object that would be included in the response.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .only(["fieldUid"])
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    @discardableResult
    public func only(fields: [String]) -> Self

    Parameters

    fields

    Array of the only keys to be included in response.

    Return Value

    A reference to the receiving object to enable chaining.

  • except(fields:) Extension method

    Specifies an array of except keys in BASE object that would be included in the response.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .except(["fieldUid"])
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    @discardableResult
    public func except(fields: [String]) -> Self

    Parameters

    fields

    Array of the except keys to be included in response.

    Return Value

    A reference to the receiving object to enable chaining.

  • include(params:) Extension method

    Instance method for including count, Unpublished, ContentType schema, Global Fields schema, and Reference ContentType Uid in result.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    public func include(params: Query.Include) -> Self

    Parameters

    params

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

    Return Value

    A reference to the receiving object to enable chaining.

  • includeReference(with:) Extension method

    Instace method to include reference objects with given key in response.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    public func includeReference(with keys: [String]) -> Self

    Parameters

    keys

    Array of reference keys to include in response.

    Return Value

    A reference to the receiving object to enable chaining.

  • Specifies an array of only keys in reference object that would be included in the response.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    public func includeReferenceField(with key: String, only fields: [String]) -> Self

    Return Value

    A reference to the receiving object to enable chaining.

  • Specifies an array of except keys in reference object that would be included in the response.

    Example usage:

    let stack = Contentstack.stack(apiKey: apiKey,
                deliveryToken: deliveryToken,
                environment: environment)
    
    // To fetch Entry from specific contentType
    stack.contentType(uid: contentTypeUID).entry().query()
    .fetch { (result: Result<ContentstackResponse<EntryModel>, Error>, response: ResponseType) in
       switch result {
        case .success(let contentstackResponse):
            // Contentstack response with EntryModel array in items.
       case .failure(let error):
            //Error Message
       }
    }
    

    Declaration

    Swift

    public func includeReferenceField(with key: String, except fields: [String]) -> Self

    Return Value

    A reference to the receiving object to enable chaining.