Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
how a consumer would use the library or CLI tool (e.g. adding unit tests, updating documentation, etc) are not captured
here.

## Unreleased

### Fixed

- A bug where in some rare cases searching file events could cause the SDK to throw a validation error on the server's correct response.

## 2.2.2 - 2025-01-08

### Fixed
Expand Down
7 changes: 4 additions & 3 deletions src/_incydr_sdk/agents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime
from typing import List
from typing import Optional
from typing import Union

from pydantic import BaseModel
from pydantic import Field
Expand Down Expand Up @@ -63,7 +64,7 @@ class Agent(ResponseModel):
machine_id: Optional[str] = Field(alias="machineId")
serial_number: Optional[str] = Field(alias="serialNumber")
active: Optional[bool]
agent_type: Optional[AgentType] = Field(alias="agentType")
agent_type: Optional[Union[AgentType, str]] = Field(alias="agentType")
agent_health_issue_types: Optional[List[str]] = Field(alias="agentHealthIssueTypes")
app_version: Optional[str] = Field(alias="appVersion")
product_version: Optional[str] = Field(alias="productVersion")
Expand Down Expand Up @@ -98,10 +99,10 @@ class AgentUpdateRequest(BaseModel):

class QueryAgentsRequest(BaseModel):
active: Optional[bool]
agentType: Optional[AgentType]
agentType: Optional[Union[AgentType, str]]
agentHealthy: Optional[bool]
anyOfAgentHealthIssueTypes: Optional[List[str]]
srtKey: Optional[SortKeys]
srtKey: Optional[Union[SortKeys, str]]
srtDir: Optional[str]
pageSize: Optional[int]
page: Optional[int]
Expand Down
5 changes: 3 additions & 2 deletions src/_incydr_sdk/audit_log/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Dict
from typing import List
from typing import Optional
from typing import Union

from pydantic import BaseModel
from pydantic import Field
Expand Down Expand Up @@ -63,7 +64,7 @@ class QueryExportRequest(Model):
dateRange: Optional[DateRange]
eventTypes: Optional[List[str]]
resourceIds: Optional[List[str]]
userTypes: Optional[List[UserTypes]]
userTypes: Optional[List[Union[UserTypes, str]]]


class QueryAuditLogRequest(Model):
Expand All @@ -75,4 +76,4 @@ class QueryAuditLogRequest(Model):
page: int
pageSize: int
resourceIds: Optional[List[str]]
userTypes: Optional[List[UserTypes]]
userTypes: Optional[List[Union[UserTypes, str]]]
7 changes: 4 additions & 3 deletions src/_incydr_sdk/cases/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime
from typing import List
from typing import Optional
from typing import Union

from pydantic import BaseModel
from pydantic import Extra
Expand Down Expand Up @@ -48,7 +49,7 @@ class Case(ResponseModel, validate_assignment=True):
updated_at: Optional[datetime] = Field(allow_mutation=False, alias="updatedAt")
subject: Optional[str]
subject_username: Optional[str] = Field(alias="subjectUsername")
status: CaseStatus
status: Union[CaseStatus, str]
assignee: Optional[str]
assignee_username: Optional[str] = Field(
allow_mutation=False, alias="assigneeUsername"
Expand Down Expand Up @@ -152,7 +153,7 @@ class FileEvent(Model):
description="Lists indicators that the data may be exposed.",
example=["OutsideTrustedDomains", "IsPublic"],
)
file_availability: Optional[FileAvailability] = Field(
file_availability: Optional[Union[FileAvailability, str]] = Field(
None,
alias="fileAvailability",
description="The download availability status of the file associated with the event.",
Expand All @@ -170,7 +171,7 @@ class FileEvent(Model):
description="The file location on the user's device; a path forward or backslash should be included at the end of the filepath. Possibly null if the file event occurred on a cloud provider.",
example="/Users/casey/Documents/",
)
risk_indicators: Optional[List[RiskIndicator]] = Field(
risk_indicators: Optional[List[Union[RiskIndicator, str]]] = Field(
None,
alias="riskIndicators",
description="List of risk indicators identified for this event. If more than one risk indicator applies to this event, the sum of all indicators determines the total risk score.",
Expand Down
3 changes: 2 additions & 1 deletion src/_incydr_sdk/file_events/models/event.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import datetime
from typing import List
from typing import Optional
from typing import Union

from pydantic import Field

Expand Down Expand Up @@ -226,7 +227,7 @@ class Report(Model):
description="The display name of the report.",
example="Top Accounts Report",
)
type: Optional[ReportType] = Field(
type: Optional[Union[ReportType, str]] = Field(
description='Indicates if the report is "REPORT_TYPE_AD_HOC" or "REPORT_TYPE_SAVED".',
example="REPORT_TYPE_SAVED",
)
Expand Down
2 changes: 1 addition & 1 deletion src/_incydr_sdk/queries/file_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

class Filter(BaseModel):
term: str
operator: Operator
operator: Union[Operator, str]
value: Optional[Union[int, str]]

class Config:
Expand Down
13 changes: 7 additions & 6 deletions src/_incydr_sdk/trusted_activities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime
from typing import List
from typing import Optional
from typing import Union

from pydantic import Extra
from pydantic import Field
Expand All @@ -15,7 +16,7 @@


class ProviderObject(Model):
name: Optional[Name] = Field(
name: Optional[Union[Name, str]] = Field(
None,
description="The name of a provider for a specified activity action.\n ### Supported providers for trusted "
"activity type and actions\n\n - `DOMAIN`\n - `CLOUD_SHARE`\n - `BOX`\n - "
Expand All @@ -26,7 +27,7 @@ class ProviderObject(Model):


class ActivityAction(Model):
type: Optional[ActivityType] = Field(
type: Optional[Union[ActivityType, str]] = Field(
None,
description="The type of an activity action.\n### Supported trusted activity types for each activity action "
"type\n\n- `CLOUD_SHARE` \n - `DOMAIN`\n- `CLOUD_SYNC` \n - `DOMAIN`\n - `ACCOUNT_NAME`\n- "
Expand All @@ -40,7 +41,7 @@ class ActivityAction(Model):


class ActivityActionGroup(Model):
name: Optional[Name] = Field(
name: Optional[Union[Name, str]] = Field(
Name.DEFAULT,
description="The name of the activity action group. Currently, only `DEFAULT` activity action group is "
"supported.",
Expand Down Expand Up @@ -85,10 +86,10 @@ class TrustedActivity(ResponseModel, validate_assignment=True):
description: Optional[str] = Field(
None, description="A description of the trusted activity."
)
principal_type: Optional[PrincipalType] = Field(
principal_type: Optional[Union[PrincipalType, str]] = Field(
None, alias="principalType", allow_mutation=False
)
type: Optional[ActivityType] = Field(
type: Optional[Union[ActivityType, str]] = Field(
None, description="The type of the trusted activity.", alias="type"
)
update_time: Optional[datetime] = Field(
Expand Down Expand Up @@ -129,7 +130,7 @@ class UpdateTrustedActivity(Model, extra=Extra.ignore):
description="Whether the trusted activity represents a high value source",
alias="isHighValueSource",
)
type: Optional[ActivityType] = Field(
type: Optional[Union[ActivityType, str]] = Field(
None,
description="The type of the trusted activity.\n\nNote: The `ACCOUNT_NAME` trusted activity type requires "
"agent version 1.5.0 or later for Incydr \nProfessional, Enterprise, Gov F2, and Horizon product "
Expand Down
3 changes: 2 additions & 1 deletion src/_incydr_sdk/watchlists/models/requests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import List
from typing import Optional
from typing import Union

from pydantic import BaseModel
from pydantic import constr
Expand Down Expand Up @@ -50,7 +51,7 @@ class CreateWatchlistRequest(BaseModel):
description="The required title for a custom watchlist.",
example="My Custom List",
)
watchlistType: WatchlistType
watchlistType: Union[WatchlistType, str]

class Config:
use_enum_values = True
Expand Down
3 changes: 2 additions & 1 deletion src/_incydr_sdk/watchlists/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime
from typing import List
from typing import Optional
from typing import Union

from pydantic import Field

Expand Down Expand Up @@ -242,7 +243,7 @@ class Watchlist(ResponseModel):
description: Optional[str] = Field(
None, description="Description for a custom watchlist."
)
list_type: WatchlistType = Field(alias="listType")
list_type: Union[WatchlistType, str] = Field(alias="listType")
stats: Optional[WatchlistStats] = None
tenant_id: Optional[str] = Field(
None, description="A unique tenant ID.", alias="tenantId"
Expand Down