Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
define common models for policy list builder endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sbasan committed Sep 4, 2023
1 parent 736d162 commit f97dc63
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions vmngclient/model/policy_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import datetime
from typing import List, Optional

from pydantic import BaseModel, Field


class InfoTag(BaseModel):
info_tag: Optional[str] = Field("", alias="infoTag")


class PolicyListId(BaseModel):
list_id: str = Field(alias="listId")


class PolicyListCreationPayload(BaseModel):
name: str
description: str
type: str
entries: List


class PolicyListEditPayload(PolicyListCreationPayload):
list_id: str = Field(alias="listId")


class PolicyList(PolicyListEditPayload, InfoTag):
last_updated: datetime.datetime = Field(alias="lastUpdated")
owner: str
read_only: bool = Field(alias="readOnly")
version: str
info_tag: str = Field(alias="infoTag")
reference_count: int = Field(alias="referenceCount")
references: List
is_activated_by_vsmart: bool = Field(alias="isActivatedByVsmart")


class PolicyListPreview(BaseModel):
preview: str

0 comments on commit f97dc63

Please sign in to comment.