snowflake.core.notification_integration.NotificationIntegrationCollection¶

class snowflake.core.notification_integration.NotificationIntegrationCollection(root: Root)¶

Bases: NotificationIntegrationCollectionBase

Represents the collection operations on the Snowflake Notification Integration resource.

With this collection, you can create, update, and iterate through notification integrations that you have access to in the current context.

Examples

Creating a notification integrations instance:

>>> # This example assumes that mySecret already exists
>>> notification_integrations = root.notification_integrations
>>> new_ni = NotificationIntegration(
...     name="my_notification_integration",
...     enabled=True,
...     notification_hook=NotificationWebhook(
...         webhook_url="https://events.pagerduty.com/v2/enqueue",
...         webhook_secret=WebhookSecret(
...             name="mySecret".upper(), database_name=database, schema_name=schema
...         ),
...         webhook_body_template='{"key": "SNOWFLAKE_WEBHOOK_SECRET", "msg": "SNOWFLAKE_WEBHOOK_MESSAGE"}',
...         webhook_headers={"content-type": "application/json", "user-content": "chrome"},
...     ),
... )
>>> notification_integrations.create(new_ni)
Copy

Attributes

root¶

The Root object this collection belongs to.

Methods

create(notification_integration: NotificationIntegration, mode: CreateMode | str | None = None) → NotificationIntegrationResource¶

Create a notification integration.

Parameters:
  • notification_integration (NotificationIntegration) – (required)

  • mode (Union[CreateMode, str]) – Parameter allowing support for different modes of resource creation. Possible values include: - errorIfExists: Throws an error if you try to create a resource that already exists. - orReplace: Automatically replaces the existing resource with the current one. - ifNotExists: Creates a new resource when an alter is requested for a non-existent resource.

create_async(notification_integration: NotificationIntegration, mode: CreateMode | str | None = None) → PollingOperation[NotificationIntegrationResource]¶

An asynchronous version of create().

Refer to PollingOperation for more information on asynchronous execution and the return type.

items() → ItemsView[str, T]¶
iter(*, like: str | None = None) → Iterator[NotificationIntegration]¶

List notification integrations.

Parameters:

like (str) – Parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.

iter_async(*, like: str | None = None) → PollingOperation[Iterator[NotificationIntegration]]¶

An asynchronous version of iter().

Refer to PollingOperation for more information on asynchronous execution and the return type.

keys() → KeysView[str]¶
update_reference(old_name: str, new_name: str, resource: T) → None¶

Update the collection with a new item.

values() → ValuesView[T]¶