Package com.collibra.dgc.core.api.component.instance

# Interface RelationApi

public interface RelationApi
Contains all api operations for handling relations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Relation`
  `addRelation(AddRelationRequest addRelationRequest)`
  Adds a new relation according to the parameters present in the request.
  `List<Relation>`
  `addRelations(List<AddRelationRequest> addRelationRequests)`
  Adds new relations according to the list of parameters present in the requests.
  `Relation`
  `changeRelation(ChangeRelationRequest changeRelationRequest)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Use `removeRelation(UUID)` with `addRelation(AddRelationRequest)` instead.
  `List<Relation>`
  `changeRelations(List<ChangeRelationRequest> changeRelationRequests)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Use `removeRelations(List)` with `addRelations(List)` instead.
  `boolean`
  `exists(UUID relationId)`
  Returns true if a relation with given ID exists.
  `CursorPagedResponse<Relation>`
  `findRelations(FindRelationsRequest findRelationsRequest)`
  Finds the relations according to the given request object.
  `CursorPagedResponse<Relation>`
  `findRelationsWithoutViewRightCheck(FindRelationsRequest findRelationsRequest)`
  Finds the relations according to the given request object and without checking user view right permissions.
  `Relation`
  `getRelation(UUID relationId)`
  Returns the relation identified by given ID.
  `void`
  `removeRelation(UUID relationId)`
  Removes the relation identified by given ID.
  `void`
  `removeRelations(List<UUID> relationIds)`
  Removes the relations with the given relation IDs.

- ## Method Details

  - ### addRelation

    Relation addRelation(AddRelationRequest addRelationRequest)
    Adds a new relation according to the parameters present in the request.
    Parameters:
      `addRelationRequest` - the parameters that will determine the new relation
    Returns:
      the newly created relation

  - ### addRelations

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<Relation> addRelations(List<AddRelationRequest> addRelationRequests)
    Adds new relations according to the list of parameters present in the requests.
    Parameters:
      `addRelationRequests` - the list of parameters that will determine the new relations
    Returns:
      the newly created relations

  - ### changeRelation

    @Deprecated(forRemoval=true) Relation changeRelation(ChangeRelationRequest changeRelationRequest)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use `removeRelation(UUID)` with `addRelation(AddRelationRequest)` instead.
    Changes a relation according to the parameters present in the request.
    Parameters:
      `changeRelationRequest` - the parameters to change the relation.
    Returns:
      the changed relation

  - ### changeRelations

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) @Deprecated(forRemoval=true) List<Relation> changeRelations(List<ChangeRelationRequest> changeRelationRequests)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use `removeRelations(List)` with `addRelations(List)` instead.
    Changes multiple relations according to the parameters presents in the list of the requests.
    Parameters:
      `changeRelationRequests` - the list of parameters to change the relations
    Returns:
      the changed relations

  - ### getRelation

    Relation getRelation(UUID relationId)
    Returns the relation identified by given ID.
    Parameters:
      `relationId` - the ID of the relation
    Returns:
      the found relation

  - ### findRelations

    @SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) CursorPagedResponse<Relation> findRelations(FindRelationsRequest findRelationsRequest)
    Finds the relations according to the given request object.
    Parameters:
      `findRelationsRequest` - the request object
    Returns:
      A PagedResponse of Relations

  - ### findRelationsWithoutViewRightCheck

    @SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) CursorPagedResponse<Relation> findRelationsWithoutViewRightCheck(FindRelationsRequest findRelationsRequest)
    Finds the relations according to the given request object and without checking user view right permissions.
    Parameters:
      `findRelationsRequest` - the request object
    Returns:
      A PagedResponse of Relations

  - ### exists

    boolean exists(UUID relationId)
    Returns true if a relation with given ID exists.
    Parameters:
      `relationId` - the ID of the issue
    Returns:
      true if a relation with given ID exists, `false` otherwise

  - ### removeRelation

    void removeRelation(UUID relationId)
    Removes the relation identified by given ID.
    Parameters:
      `relationId` - the ID of the relation to remove

  - ### removeRelations

    void removeRelations(List<UUID> relationIds)
    Removes the relations with the given relation IDs.
    Parameters:
      `relationIds` - the list of IDs of the relations to remove