Skip to content

Commit

Permalink
create commands for content tag - ai
Browse files Browse the repository at this point in the history
  • Loading branch information
alacerdah committed Feb 20, 2024
1 parent c26ec84 commit 0c0768f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Extensions/ArtificialIntelligence/ContentTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const CONTENT_RESULT = 'application/vnd.iris.ai.content-result+json';

export const CONTENT_COMBINATION = 'application/vnd.iris.ai.content-combination+json';

export const CONTENT_TAG = 'application/vnd.iris.ai.tag+json';

export const ENTITY = 'application/vnd.iris.ai.entity+json';

export const INTENTION = 'application/vnd.iris.ai.intention+json';
Expand Down
4 changes: 4 additions & 0 deletions src/Extensions/ArtificialIntelligence/UriTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ export const CONTENT = '/content';
export const CONTENT_ID = '/content/{0}';

export const CONTENT_ANALYSIS = '/content/analysis';

export const CONTENT_TAGS = '/content-tags';

export const CONTENT_TAG_ID = '/content-tag/{0}';
34 changes: 34 additions & 0 deletions src/Extensions/ArtificialIntelligence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,40 @@ export default class ArtificialIntelligenceExtension extends ExtensionBase {
this._createDeleteCommand(UriTemplates.ENTITIES));
}

// Content Tag

getContentTag(id) {
return this._processCommand(
this._createGetCommand(this._buildUri(UriTemplates.CONTENT_TAG_ID, id)));
}

getContentTags(skip = 0, take = 100, ascending = false, name = '') {
return this._processCommand(
this._createGetCommand(
this._buildResourceQuery(UriTemplates.CONTENT_TAGS, {
$skip: skip,
$take: take,
$ascending: ascending,
name: name
})));
}

setContentTag(tag) {
return this._processCommand(
this._createSetCommand(UriTemplates.CONTENT_TAGS, ContentTypes.CONTENT_TAG, tag));
}

deleteContentTag(id) {
return this._processCommand(
this._createDeleteCommand(this._buildUri(UriTemplates.CONTENT_TAG_ID, id)));
}

deleteContentTags() {
return this._processCommand(
this._createDeleteCommand(UriTemplates.CONTENT_TAGS));
}


// Model

getModels(skip = 0, take = 100, ascending = false) {
Expand Down

0 comments on commit 0c0768f

Please sign in to comment.