singer_sdk.typing.PropertiesList

class singer_sdk.typing.PropertiesList[source]

Properties list. A convenience wrapper around the ObjectType class.

Examples

>>> schema = PropertiesList(
...     # username/password
...     Property("username", StringType, requires_properties=["password"]),
...     Property("password", StringType, secret=True),
...     # OAuth
...     Property(
...         "client_id",
...         StringType,
...         requires_properties=["client_secret", "refresh_token"],
...     ),
...     Property("client_secret", StringType, secret=True),
...     Property("refresh_token", StringType, secret=True),
... )
>>> print(schema.to_json(indent=2))
{
  "type": "object",
  "properties": {
    "username": {
      "type": [
        "string",
        "null"
      ]
    },
    "password": {
      "type": [
        "string",
        "null"
      ],
      "secret": true,
      "writeOnly": true
    },
    "client_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "client_secret": {
      "type": [
        "string",
        "null"
      ],
      "secret": true,
      "writeOnly": true
    },
    "refresh_token": {
      "type": [
        "string",
        "null"
      ],
      "secret": true,
      "writeOnly": true
    }
  },
  "dependentRequired": {
    "username": [
      "password"
    ],
    "client_id": [
      "client_secret",
      "refresh_token"
    ]
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
append(property)[source]

Append a property to the property list.

Parameters:

property (Property) – Property to add

Return type:

None

items()[source]

Get wrapped properties.

Returns:

List of (name, property) tuples.

Return type:

ItemsView[str, Property]

property type_dict: dict[source]

Get type dictionary.

Returns:

A dictionary describing the type.