Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#569171 : Create commands for content tag - ai #52

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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