Skip to content

Patch Models

albert.core.shared.models.patch

PatchOperation

Attributes:

Name Type Description
ADD
UPDATE
DELETE

ADD

ADD = 'add'

UPDATE

UPDATE = 'update'

DELETE

DELETE = 'delete'

PatchDatum

Show JSON schema:
{
  "properties": {
    "operation": {
      "title": "Operation",
      "type": "string"
    },
    "attribute": {
      "title": "Attribute",
      "type": "string"
    },
    "newValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Newvalue"
    },
    "oldValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Oldvalue"
    }
  },
  "required": [
    "operation",
    "attribute"
  ],
  "title": "PatchDatum",
  "type": "object"
}

Fields:

operation

operation: str

attribute

attribute: str

new_value

new_value: Any | None = None

old_value

old_value: Any | None = None

model_dump

model_dump(**kwargs) -> dict[str, Any]
Source code in src/albert/core/shared/models/patch.py
def model_dump(self, **kwargs) -> dict[str, Any]:
    # Default to exclude_unset=True to remove old/new value when not explicitly set
    kwargs.setdefault("exclude_unset", True)
    return super().model_dump(**kwargs)

DTPatchDatum

Show JSON schema:
{
  "properties": {
    "operation": {
      "title": "Operation",
      "type": "string"
    },
    "attribute": {
      "title": "Attribute",
      "type": "string"
    },
    "newValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Newvalue"
    },
    "oldValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Oldvalue"
    },
    "colId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Colid"
    }
  },
  "required": [
    "operation",
    "attribute"
  ],
  "title": "DTPatchDatum",
  "type": "object"
}

Fields:

colId

colId: str | None = None

PatchPayload

Show JSON schema:
{
  "$defs": {
    "PatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PatchDatum",
      "type": "object"
    }
  },
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/PatchDatum"
      },
      "title": "Data",
      "type": "array"
    }
  },
  "required": [
    "data"
  ],
  "title": "PatchPayload",
  "type": "object"
}

Fields:

data

model_dump

model_dump(**kwargs) -> dict[str, Any]
Source code in src/albert/core/shared/models/patch.py
def model_dump(self, **kwargs) -> dict[str, Any]:
    # Default to exclude_unset=True to remove old/new value when not explicitly set
    kwargs.setdefault("exclude_unset", True)
    return super().model_dump(**kwargs)

PGPatchDatum

Show JSON schema:
{
  "properties": {
    "operation": {
      "title": "Operation",
      "type": "string"
    },
    "attribute": {
      "title": "Attribute",
      "type": "string"
    },
    "newValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Newvalue"
    },
    "oldValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Oldvalue"
    },
    "rowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Rowid"
    }
  },
  "required": [
    "operation",
    "attribute"
  ],
  "title": "PGPatchDatum",
  "type": "object"
}

Fields:

rowId

rowId: str | None = None

GeneralPatchDatum

Show JSON schema:
{
  "$defs": {
    "DTPatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        },
        "colId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Colid"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "DTPatchDatum",
      "type": "object"
    },
    "PGPatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        },
        "rowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rowid"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PGPatchDatum",
      "type": "object"
    },
    "PatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PatchDatum",
      "type": "object"
    }
  },
  "properties": {
    "operation": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Operation"
    },
    "attribute": {
      "title": "Attribute",
      "type": "string"
    },
    "newValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Newvalue"
    },
    "oldValue": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Oldvalue"
    },
    "rowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Rowid"
    },
    "colId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Colid"
    },
    "actions": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/PGPatchDatum"
              },
              {
                "$ref": "#/$defs/DTPatchDatum"
              },
              {
                "$ref": "#/$defs/PatchDatum"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Actions"
    }
  },
  "required": [
    "attribute"
  ],
  "title": "GeneralPatchDatum",
  "type": "object"
}

Fields:

colId

colId: str | None = None

actions

actions: (
    list[PGPatchDatum | DTPatchDatum | PatchDatum] | None
) = None

operation

operation: str | None = None

GeneralPatchPayload

Show JSON schema:
{
  "$defs": {
    "DTPatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        },
        "colId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Colid"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "DTPatchDatum",
      "type": "object"
    },
    "GeneralPatchDatum": {
      "properties": {
        "operation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Operation"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        },
        "rowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rowid"
        },
        "colId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Colid"
        },
        "actions": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/PGPatchDatum"
                  },
                  {
                    "$ref": "#/$defs/DTPatchDatum"
                  },
                  {
                    "$ref": "#/$defs/PatchDatum"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Actions"
        }
      },
      "required": [
        "attribute"
      ],
      "title": "GeneralPatchDatum",
      "type": "object"
    },
    "PGPatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        },
        "rowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rowid"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PGPatchDatum",
      "type": "object"
    },
    "PatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PatchDatum",
      "type": "object"
    }
  },
  "properties": {
    "data": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/PGPatchDatum"
          },
          {
            "$ref": "#/$defs/DTPatchDatum"
          },
          {
            "$ref": "#/$defs/GeneralPatchDatum"
          },
          {
            "$ref": "#/$defs/PatchDatum"
          }
        ]
      },
      "title": "Data",
      "type": "array"
    }
  },
  "title": "GeneralPatchPayload",
  "type": "object"
}

Fields:

PGPatchPayload

A payload for a PATCH request to update a parameter group.

Show JSON schema:
{
  "$defs": {
    "PGPatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        },
        "rowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rowid"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PGPatchDatum",
      "type": "object"
    },
    "PatchDatum": {
      "properties": {
        "operation": {
          "title": "Operation",
          "type": "string"
        },
        "attribute": {
          "title": "Attribute",
          "type": "string"
        },
        "newValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Newvalue"
        },
        "oldValue": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Oldvalue"
        }
      },
      "required": [
        "operation",
        "attribute"
      ],
      "title": "PatchDatum",
      "type": "object"
    }
  },
  "description": "A payload for a PATCH request to update a parameter group.",
  "properties": {
    "data": {
      "description": "The data to be updated in the parameter group.",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/PGPatchDatum"
          },
          {
            "$ref": "#/$defs/PatchDatum"
          }
        ]
      },
      "title": "Data",
      "type": "array"
    }
  },
  "title": "PGPatchPayload",
  "type": "object"
}

Fields:

data

The data to be updated in the parameter group.