How to use the stashy.branch_permissions.Restriction.request_data function in stashy

To help you get started, we’ve selected a few stashy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cosmin / stashy / stashy / branch_permissions.py View on Github external
def create(self, match, users=None, groups=None, keys=None,
               restriction_type=RestrictionType.READ_ONLY,
               matcher_type=Matcher.PATTERN):
        """
        Restrict a branch, or set of branches defined by a pattern,
        to a set of users, groups, and access keys.
        Note: access keys need to be specified by their numerical id. labels are
        not accepted.
        """
        data = Restriction.request_data(match, users, groups, keys,
                                        restriction_type, matcher_type)

        return self._client.post(self.url(""), data=data)