mirror of
https://github.com/brygphilomena/pyironscales.git
synced 2025-11-04 16:17:28 +00:00
lol. nevermind. I can't read. its incident/id/stats not company/id/stats
This commit is contained in:
parent
339b0fea2a
commit
b242ca0a2b
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "pyironscales"
|
name = "pyironscales"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Peter Annabel", email="peter.annabel@gmail.com" },
|
{ name="Peter Annabel", email="peter.annabel@gmail.com" },
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
from pyironscales.endpoints.base.base_endpoint import IronscalesEndpoint
|
from pyironscales.endpoints.base.base_endpoint import IronscalesEndpoint
|
||||||
from pyironscales.endpoints.ironscales.CompanyIdStatsRemediationStatusesEndpoint import CompanyIdStatsRemediationStatusesEndpoint
|
|
||||||
from pyironscales.interfaces import (
|
from pyironscales.interfaces import (
|
||||||
IGettable,
|
IGettable,
|
||||||
)
|
)
|
||||||
@ -17,7 +16,6 @@ class CompanyIdStatsEndpoint(
|
|||||||
def __init__(self, client, parent_endpoint=None) -> None:
|
def __init__(self, client, parent_endpoint=None) -> None:
|
||||||
IronscalesEndpoint.__init__(self, client, "stats/", parent_endpoint=parent_endpoint)
|
IronscalesEndpoint.__init__(self, client, "stats/", parent_endpoint=parent_endpoint)
|
||||||
IGettable.__init__(self, CompanyStatisticsAndLicense)
|
IGettable.__init__(self, CompanyStatisticsAndLicense)
|
||||||
self.remediation_statuses = self._register_child_endpoint(CompanyIdStatsRemediationStatusesEndpoint(client, parent_endpoint=self))
|
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@ -1,38 +0,0 @@
|
|||||||
from pyironscales.endpoints.base.base_endpoint import IronscalesEndpoint
|
|
||||||
|
|
||||||
from pyironscales.interfaces import (
|
|
||||||
IGettable,
|
|
||||||
)
|
|
||||||
from pyironscales.models.ironscales import CompanyStatsRemediationStatuses
|
|
||||||
from pyironscales.types import (
|
|
||||||
JSON,
|
|
||||||
IronscalesRequestParams,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class CompanyIdStatsRemediationStatusesEndpoint(
|
|
||||||
IronscalesEndpoint,
|
|
||||||
IGettable[CompanyStatsRemediationStatuses, IronscalesRequestParams],
|
|
||||||
):
|
|
||||||
def __init__(self, client, parent_endpoint=None) -> None:
|
|
||||||
IronscalesEndpoint.__init__(self, client, "remediation-statuses/", parent_endpoint=parent_endpoint)
|
|
||||||
IGettable.__init__(self, CompanyStatsRemediationStatuses)
|
|
||||||
|
|
||||||
def get(
|
|
||||||
self,
|
|
||||||
data: JSON | None = None,
|
|
||||||
params: IronscalesRequestParams | None = None,
|
|
||||||
) -> CompanyStatsRemediationStatuses:
|
|
||||||
"""
|
|
||||||
Performs a GET request against the /company/{id}/stats/remediation-statuses/ endpoint.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
data (dict[str, Any]): The data to send in the request body.
|
|
||||||
params (dict[str, int | str]): The parameters to send in the request query string.
|
|
||||||
Returns:
|
|
||||||
CompanyStatsRemediationStatuses: The parsed response data.
|
|
||||||
"""
|
|
||||||
return self._parse_one(
|
|
||||||
CompanyStatsRemediationStatuses,
|
|
||||||
super()._make_request("GET", data=data, params=params).json(),
|
|
||||||
)
|
|
||||||
@ -154,12 +154,6 @@ class CompanyStatisticsAndLicense(IronscalesModel):
|
|||||||
activeMailboxes: bool | None = Field(default=None, alias="activeMailboxes")
|
activeMailboxes: bool | None = Field(default=None, alias="activeMailboxes")
|
||||||
lastMailboxSyncDate: datetime | None = Field(default=None, alias="lastMailboxSyncDate")
|
lastMailboxSyncDate: datetime | None = Field(default=None, alias="lastMailboxSyncDate")
|
||||||
|
|
||||||
class CompanyStatsRemediationStatuses(IronscalesModel):
|
|
||||||
phishing: dict[str, int] | None = Field(default=None, alias="Phishing")
|
|
||||||
spam: dict[str, int] | None = Field(default=None, alias="Spam")
|
|
||||||
safe: dict[str, int] | None = Field(default=None, alias="Safe")
|
|
||||||
unclassified: dict[str, int] | None = Field(default=None, alias="Unclassified")
|
|
||||||
|
|
||||||
class EscalatedEmails(IronscalesModel):
|
class EscalatedEmails(IronscalesModel):
|
||||||
arrival_date: datetime | None = Field(default=None, alias="ArrivalDate")
|
arrival_date: datetime | None = Field(default=None, alias="ArrivalDate")
|
||||||
incident_id: int | None = Field(default=None, alias="IncidentId")
|
incident_id: int | None = Field(default=None, alias="IncidentId")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user