Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ArticleInstanceRatingsClient

Index

Constructors

constructor

Properties

Protected apiClient

apiClient: ApiClient

Protected articleInstanceRatingsRoute

articleInstanceRatingsRoute: ArticleInstanceRatingsRoute

Accessors

routeDefinition

  • Provides direct access to articleRatingsRoute.

    method
    example

    articleInstanceRatingsClient.routeDefinition.get(id);

    Returns ArticleInstanceRatingsRoute

Methods

create

  • Returns a promise that is resolved once the create article rating action has been performed; this action creates a new rating for an article.

    method
    example

    articleInstanceRatingsClient.create({ articleId : '', rating : 5, userId : '' }) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • data: IRating

      An article rating object that needs to be inserted into the system.

    Returns PromiseLike<IHttpResponse<IRating>>

    A promise that is resolved once the create article rating action has been performed.

find

  • Returns a promise that is resolved once the find action has been performed. Success response returns a list of article rating resources matching the given criteria.

    method
    example

    articleInstanceRatingsClient.find({ pageNumber : 1, pageSize : 10, orderBy : '', orderDirection : '', search : '' }) .then(function (collection) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • articleId: string

      Article slug or id which uniquely identifies article whose rating resources need to be retrieved.

    • Optional options: IOptions

      Query resource options object.

    Returns PromiseLike<IHttpResponse<IQueryModel<IRating>>>

    A promise that is resolved once the find action has been performed.

findByUser

  • Returns a promise that is resolved once the findByUser action has been performed. Success response returns a list of article rating resources filtered by username.

    method
    example

    articleInstanceRatingsClient.find('', { pageNumber : 1, pageSize : 10, orderBy : '', orderDirection : '' }) .then(function (collection) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • articleId: string

      Article slug or id which uniquely identifies article whose rating resources need to be retrieved.

    • username: string

      Username which uniquely identifies a user which has created an article rating.

    • Optional options: IOptions

      Query resource options object.

    Returns PromiseLike<IHttpResponse<IQueryModel<IRating>>>

    A promise that is resolved once the findByUser action has been performed.

get

  • Returns a promise that is resolved once the get action has been performed. Success response returns the specified article rating resource.

    method
    example

    articleInstanceRatingsClient.get('') .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • articleId: string

      Article slug or id which uniquely identifies article whose rating resources need to be retrieved.

    • id: string

      Article slug or id which uniquely identifies article resource that needs to be retrieved.

    • Optional options: IGetRequestOptions

      Options object that contains embed data.

    Returns PromiseLike<IHttpResponse<IRating>>

    A promise that is resolved once the get action has been performed.

remove

  • Returns a promise that is resolved once the remove article rating action has been performed. If the action is successfully completed, the article rating resource will be permanently removed from the system. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply articleRatingsRoute route template. Here is an example of how a route can be obtained from HAL enabled objects:

    let params = modelMapper.removeParams(articleRating);
    let uri = params['model'].links('delete').href;
    
    method
    example

    // articleRating is a resource previously fetched using get action. articleInstanceRatingsClient.remove(articleRating) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • data: IRating

      Rating resource resource that needs to be deleted.

    Returns PromiseLike<IHttpResponse<void>>

    a promise that is resolved once the remove article rating action has been performed.

removeAll

  • Returns a promise that is resolved once the removeAll article rating action has been performed. If the action is successfully completed, the article rating resources will be permanently removed from the system for a specified article resource. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply articleInstanceRouteClient route template. Here is an example of how a route can be obtained from HAL enabled objects:

    let params = modelMapper.removeParams(article);
    let uri = params['model'].links('delete-ratings-by-article').href;
    
    method
    example

    // article is a resource previously fetched using get action. articleInstanceRatingsClient.removeAll(article) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • data: IArticle

      Article object whose ratings needs to be deleted.

    Returns PromiseLike<IHttpResponse<void>>

    A promise that is resolved once the removeAll article rating action has been performed.

update

  • Returns a promise that is resolved once the update article rating action has been performed; this action updates an article rating. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply articleRatingsRoute route template. Here is an example of how a route can be obtained from HAL enabled objects:

    let params = modelMapper.removeParams(articleRating);
    let uri = params['model'].links('put').href;
    
    method
    example

    // articleRating is a resource previously fetched using get action. articleRating.rating = 4; articleInstanceRatingsClient.update(articleRating) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here });

    Parameters

    • data: IRating

      An article object used to update specified article resource.

    Returns PromiseLike<IHttpResponse<void>>

    A promise that is resolved once the update article rating action has been performed.

Generated using TypeDoc