Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Partition<T, TCtor>

Type parameters

  • T: { id: string }

  • TCtor: ModelConstructor<T>

Hierarchy

  • Partition

Index

Properties

Accessors

Methods

Properties

Readonly container

container: Container

Readonly ctor

ctor: TCtor

Accessors

query

  • get query(): Query<T, TCtor>
  • Runs a query in the partition.

    Returns Query<T, TCtor>

Methods

delete

  • delete(id: string, options?: RequestOptions): Promise<ItemResponse<T>>
  • Deletes a model by ID.

    Parameters

    • id: string
    • Optional options: RequestOptions

    Returns Promise<ItemResponse<T>>

find

  • find(id: string, options?: RequestOptions): Promise<InstanceType<TCtor>>
  • Looks up a model by ID.

    Parameters

    • id: string
    • Optional options: RequestOptions

    Returns Promise<InstanceType<TCtor>>

findWithDetails

  • findWithDetails(id: string, options?: RequestOptions): Promise<IResourceResponse<InstanceType<TCtor>>>
  • Looks up a model by ID, including the original resource metadata.

    Parameters

    • id: string
    • Optional options: RequestOptions

    Returns Promise<IResourceResponse<InstanceType<TCtor>>>

maybeFind

  • maybeFind(id: string, options?: RequestOptions): Promise<undefined | InstanceType<TCtor>>
  • Looks up a model by ID, returning undefined if it didn't exist.

    Parameters

    • id: string
    • Optional options: RequestOptions

    Returns Promise<undefined | InstanceType<TCtor>>

Generated using TypeDoc