Skip to content

Plugin Action Response Dto

immichpy.client.generated.models.plugin_action_response_dto.PluginActionResponseDto pydantic-model

Bases: BaseModel

PluginActionResponseDto

Show JSON schema:
{
  "$defs": {
    "PluginContextType": {
      "description": "Context type",
      "enum": [
        "asset",
        "album",
        "person"
      ],
      "title": "PluginContextType",
      "type": "string"
    }
  },
  "description": "PluginActionResponseDto",
  "properties": {
    "description": {
      "description": "Action description",
      "title": "Description",
      "type": "string"
    },
    "id": {
      "description": "Action ID",
      "title": "Id",
      "type": "string"
    },
    "methodName": {
      "description": "Method name",
      "title": "Methodname",
      "type": "string"
    },
    "pluginId": {
      "description": "Plugin ID",
      "title": "Pluginid",
      "type": "string"
    },
    "schema": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Action schema",
      "title": "Schema"
    },
    "supportedContexts": {
      "description": "Supported contexts",
      "items": {
        "$ref": "#/$defs/PluginContextType"
      },
      "title": "Supportedcontexts",
      "type": "array"
    },
    "title": {
      "description": "Action title",
      "title": "Title",
      "type": "string"
    }
  },
  "required": [
    "description",
    "id",
    "methodName",
    "pluginId",
    "schema",
    "supportedContexts",
    "title"
  ],
  "title": "PluginActionResponseDto",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

description pydantic-field

description: StrictStr

Action description

id pydantic-field

id: StrictStr

Action ID

method_name pydantic-field

method_name: StrictStr

Method name

plugin_id pydantic-field

plugin_id: StrictStr

Plugin ID

supported_contexts pydantic-field

supported_contexts: List[PluginContextType]

Supported contexts

title pydantic-field

title: StrictStr

Action title

var_schema pydantic-field

var_schema: Optional[Dict[str, Any]]

Action schema

from_dict classmethod

from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of PluginActionResponseDto from a dict

Source code in immichpy/client/generated/models/plugin_action_response_dto.py
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of PluginActionResponseDto from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate(
        {
            "description": obj.get("description"),
            "id": obj.get("id"),
            "methodName": obj.get("methodName"),
            "pluginId": obj.get("pluginId"),
            "schema": obj.get("schema"),
            "supportedContexts": obj.get("supportedContexts"),
            "title": obj.get("title"),
        }
    )
    return _obj

from_json classmethod

from_json(json_str: str) -> Optional[Self]

Create an instance of PluginActionResponseDto from a JSON string

Source code in immichpy/client/generated/models/plugin_action_response_dto.py
67
68
69
70
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of PluginActionResponseDto from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict

to_dict() -> Dict[str, Any]

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in immichpy/client/generated/models/plugin_action_response_dto.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # set to None if var_schema (nullable) is None
    # and model_fields_set contains the field
    if self.var_schema is None and "var_schema" in self.model_fields_set:
        _dict["schema"] = None

    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/plugin_action_response_dto.py
62
63
64
65
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str

to_str() -> str

Returns the string representation of the model using alias

Source code in immichpy/client/generated/models/plugin_action_response_dto.py
58
59
60
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))