Skip to content

Commit 6e19100

Browse files
committed
Add support for Registration Tokens
1 parent c6af40e commit 6e19100

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

nailgun/entities.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6901,7 +6901,7 @@ def path(self, which=None):
69016901

69026902

69036903
class RegistrationCommand(Entity, EntityCreateMixin, EntityReadMixin):
6904-
"""A representation of a Role entity."""
6904+
"""A representation of a Registration Command entity."""
69056905

69066906
def __init__(self, server_config=None, **kwargs):
69076907
self._fields = {
@@ -6953,6 +6953,20 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
69536953
return attrs['registration_command']
69546954

69556955

6956+
class RegistrationTokens(Entity, EntityCreateMixin, EntityReadMixin):
6957+
"""A representation of a Registration Token entity."""
6958+
6959+
def __init__(self, server_config=None, **kwargs):
6960+
self._fields = {
6961+
'organization': entity_fields.OneToOneField(Organization, required=True),
6962+
'location': entity_fields.OneToOneField(Location, required=True),
6963+
'search': entity_fields.StringField(default=''),
6964+
}
6965+
6966+
self._meta = {'api_path': '/api/registration_tokens'}
6967+
super().__init__(server_config=server_config, **kwargs)
6968+
6969+
69566970
class Report(Entity):
69576971
"""A representation of a Report entity."""
69586972

0 commit comments

Comments
 (0)