From 0c08a6debc6eedf03921a55198e11eae9ae08dcd Mon Sep 17 00:00:00 2001 From: axoniusgithub Date: Wed, 18 Dec 2024 15:44:26 +0000 Subject: [PATCH] Sync changes from private repo main branch --- .github/CODEOWNERS | 14 ++++++++++ .github/workflows/jira-description-action.yml | 22 +++++++++++++++ axonius_api_client/api/api_endpoints.py | 4 +-- .../api/json_api/enforcements.py | 27 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/jira-description-action.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..94c05e7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,14 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. + +# More details are here: https://help.github.com/articles/about-codeowners/ + +# The '*' pattern is global owners. + +# Order is important. The last matching pattern has the most precedence. +# The folders are ordered as follows: + +# In each subsection folders are ordered first by depth, then alphabetically. +# This should make it easy to add new rules without breaking existing ones. + +.github/ @axonius/devex-team diff --git a/.github/workflows/jira-description-action.yml b/.github/workflows/jira-description-action.yml new file mode 100644 index 0000000..5c7a13c --- /dev/null +++ b/.github/workflows/jira-description-action.yml @@ -0,0 +1,22 @@ +name: jira-description-action +on: + pull_request: + types: [opened, reopened, edited, synchronize] +# Set the minimum required permissions for the GITHUB_TOKEN +# This action only needs read access to pull requests for +# reading PR titles and checking PR context. These permissions +# are set to adhere to the principle of least privilege, ensuring +# the token cannot perform unintended actions. +permissions: + pull-requests: read +jobs: + add-jira-description: + runs-on: ubuntu-latest + steps: + - uses: Axonius/jira-description-action@v0.4.0 + name: jira-description-action + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + jira-token: ${{ secrets.JIRA_TOKEN }} + jira-base-url: https://axonius.atlassian.net + fail-when-jira-issue-not-found: true diff --git a/axonius_api_client/api/api_endpoints.py b/axonius_api_client/api/api_endpoints.py index 3646af8..43bcbbd 100644 --- a/axonius_api_client/api/api_endpoints.py +++ b/axonius_api_client/api/api_endpoints.py @@ -983,8 +983,8 @@ class Enforcements(ApiEndpointGroup): delete_set: ApiEndpoint = ApiEndpoint( method="delete", path="api/enforcements", - request_schema_cls=json_api.generic.DictValueSchema, - request_model_cls=json_api.generic.DictValue, + request_schema_cls=json_api.enforcements.DeleteEnforcementSchema, + request_model_cls=json_api.enforcements.DeleteEnforcementModel, response_schema_cls=json_api.generic.DeletedSchema, response_model_cls=json_api.generic.Deleted, ) diff --git a/axonius_api_client/api/json_api/enforcements.py b/axonius_api_client/api/json_api/enforcements.py index f55d930..2a623dc 100644 --- a/axonius_api_client/api/json_api/enforcements.py +++ b/axonius_api_client/api/json_api/enforcements.py @@ -1608,6 +1608,33 @@ def get_schema_cls() -> t.Any: return CreateEnforcementSchema +class DeleteEnforcementSchema(BaseSchemaJson): + """Pass.""" + value = marshmallow_jsonapi.fields.Dict() + + + class Meta: + """Pass.""" + + type_ = "enforcements_delete_schema" + + @staticmethod + def get_model_cls() -> t.Any: + """Pass.""" + return DeleteEnforcementModel + + +@dataclasses.dataclass +class DeleteEnforcementModel(BaseModel): + """Pass.""" + value: dict + + @staticmethod + def get_schema_cls() -> t.Any: + """Pass.""" + return DeleteEnforcementSchema + + @dataclasses.dataclass class ActionType(BaseModel): """Pass."""