Skip to content

prefect_hightouch.api_client.models.sync_run

SyncRun

Bases: BaseModel

Attributes:

Name Type Description
completion_ratio float

The completion ratio of sync run, showing the progress of a sync run

created_at datetime

The timestamp when sync run was created. In most cases this will be equivalent to startedAt, but it may be earlier if the sync was triggered while a run was already in progress, and the new run didn't start for a while.

failed_rows SyncRunFailedRows

The number of rows that we attempted to sync, but were rejected by the destination.

This does not include rows that weren't attempted due to the sync being cancelled.

finished_at datetime

The timestamp when the sync run finished

id str

The sync run's id

planned_rows SyncRunPlannedRows

The number of planned rows that this sync run was supposed to execute.

Note that the counts for successfulRows and failedRows may not add up to plannedRows if the sync was cancelled.

query_size float

The number of rows in the query.

started_at datetime

The timestamp when the sync run started

status SyncRunStatus

The status of sync runs

successful_rows SyncRunSuccessfulRows

The number of rows that were successfully processed by the destination.

error Union[Unset, str]

Error message if the sync run didn't finish successfully

Source code in prefect_hightouch/api_client/models/sync_run.py
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
class SyncRun(BaseModel):
    """
    Attributes:
        completion_ratio (float): The completion ratio of sync run, showing the progress of a sync run
        created_at (datetime.datetime): The timestamp when sync run was created. In most cases this will be
            equivalent to `startedAt`, but it may be earlier if the sync was triggered
            while a run was already in progress, and the new run didn't start for
            a while.
        failed_rows (SyncRunFailedRows): The number of rows that we attempted to sync, but were rejected by the
            destination.

            This does not include rows that weren't attempted due to the sync being
            cancelled.
        finished_at (datetime.datetime): The timestamp when the sync run finished
        id (str): The sync run's id
        planned_rows (SyncRunPlannedRows): The number of planned rows that this sync run was supposed to execute.

            Note that the counts for `successfulRows` and `failedRows` may not add up
            to `plannedRows` if the sync was cancelled.
        query_size (float): The number of rows in the query.
        started_at (datetime.datetime): The timestamp when the sync run started
        status (SyncRunStatus): The status of sync runs
        successful_rows (SyncRunSuccessfulRows): The number of rows that were successfully processed by the destination.
        error (Union[Unset, str]): Error message if the sync run didn't finish successfully
    """

    completion_ratio: float = None
    created_at: datetime.datetime = None
    failed_rows: SyncRunFailedRows = None
    finished_at: datetime.datetime = None
    id: str = None
    planned_rows: SyncRunPlannedRows = None
    query_size: float = None
    started_at: datetime.datetime = None
    status: SyncRunStatus = None
    successful_rows: SyncRunSuccessfulRows = None
    error: Union[Unset, str] = UNSET
    additional_properties: Dict[str, Any] = Field(default_factory=dict)

    def to_dict(self) -> Dict[str, Any]:
        completion_ratio = self.completion_ratio
        created_at = self.created_at.isoformat()

        failed_rows = self.failed_rows.to_dict()

        finished_at = self.finished_at.isoformat()

        id = self.id
        planned_rows = self.planned_rows.to_dict()

        query_size = self.query_size
        started_at = self.started_at.isoformat()

        status = self.status.value

        successful_rows = self.successful_rows.to_dict()

        error = self.error

        field_dict: Dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update(
            {
                "completionRatio": completion_ratio,
                "createdAt": created_at,
                "failedRows": failed_rows,
                "finishedAt": finished_at,
                "id": id,
                "plannedRows": planned_rows,
                "querySize": query_size,
                "startedAt": started_at,
                "status": status,
                "successfulRows": successful_rows,
            }
        )
        if error is not UNSET:
            field_dict["error"] = error

        return field_dict

    @classmethod
    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
        if src_dict is None or src_dict is UNSET:
            return {}
        d = {k: v if v is not None else UNSET for k, v in src_dict.items()}
        completion_ratio = d.pop("completionRatio")

        created_at = isoparse(d.pop("createdAt"))

        failed_rows = SyncRunFailedRows.from_dict(d.pop("failedRows"))

        finished_at = isoparse(d.pop("finishedAt"))

        id = d.pop("id")

        planned_rows = SyncRunPlannedRows.from_dict(d.pop("plannedRows"))

        query_size = d.pop("querySize")

        started_at = isoparse(d.pop("startedAt"))

        status = SyncRunStatus(d.pop("status"))

        successful_rows = SyncRunSuccessfulRows.from_dict(d.pop("successfulRows"))

        error = d.pop("error", UNSET)

        sync_run = cls(
            completion_ratio=completion_ratio,
            created_at=created_at,
            failed_rows=failed_rows,
            finished_at=finished_at,
            id=id,
            planned_rows=planned_rows,
            query_size=query_size,
            started_at=started_at,
            status=status,
            successful_rows=successful_rows,
            error=error,
        )

        sync_run.additional_properties = d
        return sync_run

    @property
    def additional_keys(self) -> List[str]:
        return list(self.additional_properties.keys())

    def __getitem__(self, key: str) -> Any:
        return self.additional_properties.get(key)

    def __setitem__(self, key: str, value: Any) -> None:
        self.additional_properties[key] = value

    def __delitem__(self, key: str) -> None:
        del self.additional_properties[key]

    def __contains__(self, key: str) -> bool:
        return key in self.additional_properties

additional_keys: List[str] property

additional_properties: Dict[str, Any] = Field(default_factory=dict) class-attribute instance-attribute

completion_ratio: float = None class-attribute instance-attribute

created_at: datetime.datetime = None class-attribute instance-attribute

error: Union[Unset, str] = UNSET class-attribute instance-attribute

failed_rows: SyncRunFailedRows = None class-attribute instance-attribute

finished_at: datetime.datetime = None class-attribute instance-attribute

id: str = None class-attribute instance-attribute

planned_rows: SyncRunPlannedRows = None class-attribute instance-attribute

query_size: float = None class-attribute instance-attribute

started_at: datetime.datetime = None class-attribute instance-attribute

status: SyncRunStatus = None class-attribute instance-attribute

successful_rows: SyncRunSuccessfulRows = None class-attribute instance-attribute

from_dict classmethod

Source code in prefect_hightouch/api_client/models/sync_run.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    if src_dict is None or src_dict is UNSET:
        return {}
    d = {k: v if v is not None else UNSET for k, v in src_dict.items()}
    completion_ratio = d.pop("completionRatio")

    created_at = isoparse(d.pop("createdAt"))

    failed_rows = SyncRunFailedRows.from_dict(d.pop("failedRows"))

    finished_at = isoparse(d.pop("finishedAt"))

    id = d.pop("id")

    planned_rows = SyncRunPlannedRows.from_dict(d.pop("plannedRows"))

    query_size = d.pop("querySize")

    started_at = isoparse(d.pop("startedAt"))

    status = SyncRunStatus(d.pop("status"))

    successful_rows = SyncRunSuccessfulRows.from_dict(d.pop("successfulRows"))

    error = d.pop("error", UNSET)

    sync_run = cls(
        completion_ratio=completion_ratio,
        created_at=created_at,
        failed_rows=failed_rows,
        finished_at=finished_at,
        id=id,
        planned_rows=planned_rows,
        query_size=query_size,
        started_at=started_at,
        status=status,
        successful_rows=successful_rows,
        error=error,
    )

    sync_run.additional_properties = d
    return sync_run

to_dict

Source code in prefect_hightouch/api_client/models/sync_run.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def to_dict(self) -> Dict[str, Any]:
    completion_ratio = self.completion_ratio
    created_at = self.created_at.isoformat()

    failed_rows = self.failed_rows.to_dict()

    finished_at = self.finished_at.isoformat()

    id = self.id
    planned_rows = self.planned_rows.to_dict()

    query_size = self.query_size
    started_at = self.started_at.isoformat()

    status = self.status.value

    successful_rows = self.successful_rows.to_dict()

    error = self.error

    field_dict: Dict[str, Any] = {}
    field_dict.update(self.additional_properties)
    field_dict.update(
        {
            "completionRatio": completion_ratio,
            "createdAt": created_at,
            "failedRows": failed_rows,
            "finishedAt": finished_at,
            "id": id,
            "plannedRows": planned_rows,
            "querySize": query_size,
            "startedAt": started_at,
            "status": status,
            "successfulRows": successful_rows,
        }
    )
    if error is not UNSET:
        field_dict["error"] = error

    return field_dict