Skip to content

Commit

Permalink
Add support for Registration Tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Jan 13, 2025
1 parent c6af40e commit 28b79db
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6901,7 +6901,7 @@ def path(self, which=None):


class RegistrationCommand(Entity, EntityCreateMixin, EntityReadMixin):
"""A representation of a Role entity."""
"""A representation of a Registration Command entity."""

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


class RegistrationTokens(Entity, EntityCreateMixin, EntityReadMixin):
"""A representation of a Registration Token entity."""

def __init__(self, server_config=None, **kwargs):
self._fields = {
'organization': entity_fields.OneToOneField(Organization, required=True),
'location': entity_fields.OneToOneField(Location, required=True),
'search': entity_fields.StringField(default=''),
}

self._meta = {'api_path': '/api/registration_tokens'}
super().__init__(server_config=server_config, **kwargs)


class Report(Entity):
"""A representation of a Report entity."""

Expand Down Expand Up @@ -8790,6 +8804,11 @@ def update(self, fields=None):
self.update_json(fields)
return self.read()

def invalidate(self, fields=None):
"""Fetch a complete set of attributes for this entity."""
self.update_json(fields)
return self.read()


class VirtWhoConfig(
Entity,
Expand Down

0 comments on commit 28b79db

Please sign in to comment.