Skip to content

Commit

Permalink
dataclass changed to namedtuple
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Brauer <[email protected]>
  • Loading branch information
danbrauer committed Nov 24, 2024
1 parent 4d14d74 commit 7be764f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cartography/intel/github/repos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import configparser
import logging
from dataclasses import dataclass
from collections import namedtuple
from string import Template
from typing import Any
from typing import Dict
Expand All @@ -20,16 +20,17 @@
logger = logging.getLogger(__name__)


@dataclass(frozen=False)
class UserAffiliationAndRepoPermission:
"""
Representation of a user's permission level and affiliation to a GitHub repo. See:
- Permission: https://docs.github.com/en/graphql/reference/enums#repositorypermission
- Affiliation: https://docs.github.com/en/graphql/reference/enums#collaboratoraffiliation
"""
user: Dict
permission: str # WRITE, MAINTAIN, ADMIN, etc
affiliation: str # OUTSIDE, DIRECT
# Representation of a user's permission level and affiliation to a GitHub repo. See:
# - Permission: https://docs.github.com/en/graphql/reference/enums#repositorypermission
# - Affiliation: https://docs.github.com/en/graphql/reference/enums#collaboratoraffiliation
UserAffiliationAndRepoPermission = namedtuple(
'UserAffiliationAndRepoPermission',
[
'user', # Dict
'permission', # 'WRITE', 'MAINTAIN', 'ADMIN', etc
'affiliation', # 'OUTSIDE', 'DIRECT'
],
)


GITHUB_ORG_REPOS_PAGINATED_GRAPHQL = """
Expand Down

0 comments on commit 7be764f

Please sign in to comment.