This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from aflorithmic/org-resource
Organization resource
- Loading branch information
Showing
10 changed files
with
182 additions
and
133 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,49 @@ | ||
from apiaudio.helper_classes import UpdatableResource, ListableResource, DeletableResource | ||
from apiaudio.helper_classes import ( | ||
UpdatableResource, | ||
ListableResource, | ||
DeletableResource, | ||
) | ||
|
||
|
||
class LexiItem(UpdatableResource, ListableResource, DeletableResource): | ||
OBJECT_NAME = "diction/custom/item" | ||
resource_path = "/diction/custom/item" | ||
|
||
|
||
class CustomDict(ListableResource): | ||
OBJECT_NAME = "diction/custom" | ||
resource_path = "/diction/custom" | ||
|
||
|
||
class Lexi(ListableResource): | ||
OBJECT_NAME = "diction" | ||
resource_path = "/diction" | ||
|
||
custom_word_path = resource_path + "/custom/item" | ||
list_words = resource_path + "/custom" | ||
|
||
@classmethod | ||
def register_custom_word(cls, word, replacement, lang, specialization="default", contentType="basic"): | ||
def register_custom_word( | ||
cls, word, replacement, lang, specialization="default", contentType="basic" | ||
): | ||
return LexiItem.update( | ||
**{ | ||
"word" : word, | ||
"replacement" : replacement, | ||
"lang" : lang, | ||
"specialization" : specialization, | ||
"contentType" : contentType | ||
"word": word, | ||
"replacement": replacement, | ||
"lang": lang, | ||
"specialization": specialization, | ||
"contentType": contentType, | ||
} | ||
) | ||
|
||
@classmethod | ||
def list_custom_words(cls, **args): | ||
return LexiItem.list(**args) | ||
|
||
@classmethod | ||
def list_custom_dicts(cls, **args): | ||
return CustomDict.list(**args) | ||
|
||
@classmethod | ||
def delete_custom_word(cls, **args): | ||
return LexiItem.delete(**args) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from apiaudio.api_request import APIRequest | ||
|
||
|
||
class Organization(APIRequest): | ||
OBJECT_NAME = "organization" | ||
resource_path = "/org" | ||
child_orgs_path = "/org/child_orgs" | ||
secrets_path = "/secrets" | ||
|
||
@classmethod | ||
def get_secrets(cls): | ||
return cls._get_request(path_param=cls.secrets_path) | ||
|
||
@classmethod | ||
def get_org_data(cls): | ||
return cls._get_request() | ||
|
||
@classmethod | ||
def list_child_orgs(cls): | ||
return cls._get_request(path_param=cls.child_orgs_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters