TelephonyCampaign Class

Agent-owned outbound call Campaign. Creation/replacement authorizes execution after successful preparation.

Constructor

TelephonyCampaign(*args: Any, **kwargs: Any)

Variables

Name Description
connection_name
str

Human-readable name of the provider connection in the current project. Required.

source

Typed caller address shared with generated CallJobs. The connection validates source support separately from recipient support. Required.

recipients

1-100 recipients, exclusive with recipient_dataset. The whole UTF-8 request is limited to 1 MiB. Omitted from reads; retain the submission for row correlation.

recipient_dataset

Same-project CSV/JSON/JSONL uri_file, exclusive with recipients. Omitted version pins latest per preparation. Limits: 1-1,000,000 rows, 256 MiB decoded/file, 1 MiB/row.

schedule

Dispatch schedule; omission equals ImmediateSchedule. Every mode waits for successful preparation, then follows its schedule and available capacity.

retry_policy

Per-recipient retries. Omit for one attempt; generated CallJobs return fixed_interval with max_attempts=1 and interval=0 seconds.

status

Business execution state. Each asynchronous action has its own retained operation monitor. Required. Known values are: "validating", "running", "cancelling", "completed", "failed", "cancelled", and "deleting".

error

Preparation/control failure, cleared on retry. Never includes secrets or raw recipient values.

name
str

Immutable name supplied as campaign_name in the PUT path, not the request body; echoed in responses. Unique within the project and Agent. Required.

created_at

Creation time. Required.

updated_at

Last observable progress update. Required.

etag
str

Conditional-action token, not a cache validator. Changes with control state, not progress. Required.

operation_id
str

Latest accepted action, for discovery only. Poll the initiating response's Operation-Id/Operation-Location instead. Required.

finished_at

Time of terminal completion for the current round; cleared when failed preparation is replaced.

locked_agent_version
str

Latest Agent version pinned once per preparation and shared by retries/calls. Omitted until resolved; replacement clears it. Unavailable pins fail without fallback.

progress

Available partial accounting even when the job fails or is cancelled. Required.

Methods

as_dict

Return a dict that can be turned into json using json.dump.

clear

Remove all items from the dictionary.

copy
get

Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: The value for key if key is in the dictionary, else default. :rtype: any

items
keys
pop

Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.

popitem

Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if the dictionary is empty.

setdefault

Return the value for key if key is in the dictionary; otherwise set the key to default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: The value for key if key is in the dictionary, else default. :rtype: any

update

Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs.

values

as_dict

Return a dict that can be turned into json using json.dump.

as_dict(*, exclude_readonly: bool = False) -> dict[str, Any]

Keyword-Only Parameters

Name Description
exclude_readonly

Whether to remove the readonly properties.

Default value: False

Returns

Type Description

A dict JSON compatible object

clear

Remove all items from the dictionary.

clear() -> None

copy

copy() -> Model

get

Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: The value for key if key is in the dictionary, else default. :rtype: any

get(key: str, default: Any = None) -> Any

Parameters

Name Description
key
Required
default
Default value: None

items

items() -> ItemsView[str, Any]

Returns

Type Description

a set-like object providing a view on the mapping's items

keys

keys() -> KeysView[str]

Returns

Type Description

a set-like object providing a view on the mapping's keys

pop

Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.

pop(key: str, default: ~typing.Any = <object object>) -> Any

Parameters

Name Description
key
Required
default

popitem

Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if the dictionary is empty.

popitem() -> tuple[str, Any]

setdefault

Return the value for key if key is in the dictionary; otherwise set the key to default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: The value for key if key is in the dictionary, else default. :rtype: any

setdefault(key: str, default: ~typing.Any = <object object>) -> Any

Parameters

Name Description
key
Required
default

update

Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs.

update(*args: Any, **kwargs: Any) -> None

values

values() -> ValuesView[Any]

Returns

Type Description

an object providing a view on the mapping's values

Attributes

connection_name

Human-readable name of the provider connection in the current project. Required.

connection_name: str

created_at

Creation time. Required.

created_at: datetime

error

Preparation/control failure, cleared on retry. Never includes secrets or raw recipient values.

error: _models.ApiError | None

etag

Conditional-action token, not a cache validator. Changes with control state, not progress. Required.

etag: str

finished_at

Time of terminal completion for the current round; cleared when failed preparation is replaced.

finished_at: datetime | None

locked_agent_version

Latest Agent version pinned once per preparation and shared by retries/calls. Omitted until resolved; replacement clears it. Unavailable pins fail without fallback.

locked_agent_version: str | None

name

Immutable name supplied as campaign_name in the PUT path, not the request body; echoed in responses. Unique within the project and Agent. Required.

name: str

operation_id

Latest accepted action, for discovery only. Poll the initiating response's Operation-Id/Operation-Location instead. Required.

operation_id: str

progress

Available partial accounting even when the job fails or is cancelled. Required.

progress: _models.TelephonyCampaignProgress

recipient_dataset

Same-project CSV/JSON/JSONL uri_file, exclusive with recipients. Omitted version pins latest per preparation. Limits: 1-1,000,000 rows, 256 MiB decoded/file, 1 MiB/row.

recipient_dataset: _models.TelephonyCampaignDatasetReference | None

recipients

1-100 recipients, exclusive with recipient_dataset. The whole UTF-8 request is limited to 1 MiB. Omitted from reads; retain the submission for row correlation.

recipients: list['_models.TelephonyRecipient'] | None

retry_policy

Per-recipient retries. Omit for one attempt; generated CallJobs return fixed_interval with max_attempts=1 and interval=0 seconds.

retry_policy: _models.TelephonyOutboundRetryPolicy | None

schedule

Dispatch schedule; omission equals ImmediateSchedule. Every mode waits for successful preparation, then follows its schedule and available capacity.

schedule: _models.TelephonyCampaignSchedule | None

source

Typed caller address shared with generated CallJobs. The connection validates source support separately from recipient support. Required.

source: _models.TelephonyAddress

status

Business execution state. Each asynchronous action has its own retained operation monitor. Required. Known values are: "validating", "running", "cancelling", "completed", "failed", "cancelled", and "deleting".

status: str | _models.TelephonyCampaignStatus

updated_at

Last observable progress update. Required.

updated_at: datetime