Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
environment: ci
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -39,7 +39,7 @@ jobs:
run: tox

- name: Install release dependencies
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.9'
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.10'
run: |
pip install bump-my-version build twine
sudo npm install -g semantic-release \
Expand All @@ -49,7 +49,7 @@ jobs:
@semantic-release/github

- name: Semantic Release and Publish
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.9'
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.10'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
Expand Down
12 changes: 6 additions & 6 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2025-12-09T17:38:40Z",
"generated_at": "2026-03-19T14:44:16Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -122,23 +122,23 @@
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
"is_secret": false,
"is_verified": false,
"line_number": 627,
"line_number": 628,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "0cc20f91828bed53ddb6294968b7f9abd631a3ba",
"is_secret": false,
"is_verified": false,
"line_number": 1743,
"line_number": 1744,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "3235b7f8d626cde63611d2e9ec43473f4e844c67",
"is_secret": false,
"is_verified": false,
"line_number": 3710,
"line_number": 3711,
"type": "Base64 High Entropy String",
"verified_result": null
}
Expand All @@ -148,15 +148,15 @@
"hashed_secret": "7eeef8638d6f283c8d76d7811ec6e5f198e16021",
"is_secret": false,
"is_verified": false,
"line_number": 7927,
"line_number": 7928,
"type": "Base64 High Entropy String",
"verified_result": null
},
{
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
"is_secret": false,
"is_verified": false,
"line_number": 10934,
"line_number": 10935,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,8 @@ integration_response = get_integration_response.get_result()

### Update Integration

> **⚠️ DEPRECATION WARNING**: The `hs-crypto` integration type is deprecated and will be removed in a future release. Please migrate to alternative encryption solutions.

For kms/hs-crypto

```py
Expand Down
42 changes: 33 additions & 9 deletions ibm_eventnotifications/event_notifications_v1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# (C) Copyright IBM Corp. 2025.
# (C) Copyright IBM Corp. 2026.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -2602,8 +2602,8 @@ def replace_integration(
:param str instance_id: Unique identifier for IBM Cloud Event Notifications
instance.
:param str id: Unique identifier for integration.
:param str type: Integration type. Allowed values are kms, hs-crypto and
collect_failed_events.
:param str type: Integration type. Allowed values are kms, hs-crypto
(deprecated) and collect_failed_events.
:param IntegrationMetadata metadata: Integration Metadata object.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
Expand Down Expand Up @@ -3360,9 +3360,9 @@ def get_notifications_status(
**kwargs,
) -> DetailedResponse:
"""
Get notification status.
Get status of webhook test notification.

Get notification status.
Status of webhook test notification.

:param str instance_id: Unique identifier for IBM Cloud Event Notifications
instance.
Expand Down Expand Up @@ -3575,21 +3575,29 @@ class BounceMetrics:

:attr List[BounceMetricItem] metrics: array of bounce metrics.
:attr int total_count: total number of bounce metrics.
:attr int offset: Current offset.
:attr int limit: limit to show bounce metrics.
"""

def __init__(
self,
metrics: List['BounceMetricItem'],
total_count: int,
offset: int,
limit: int,
) -> None:
"""
Initialize a BounceMetrics object.

:param List[BounceMetricItem] metrics: array of bounce metrics.
:param int total_count: total number of bounce metrics.
:param int offset: Current offset.
:param int limit: limit to show bounce metrics.
"""
self.metrics = metrics
self.total_count = total_count
self.offset = offset
self.limit = limit

@classmethod
def from_dict(cls, _dict: Dict) -> 'BounceMetrics':
Expand All @@ -3603,6 +3611,14 @@ def from_dict(cls, _dict: Dict) -> 'BounceMetrics':
args['total_count'] = _dict.get('total_count')
else:
raise ValueError('Required property \'total_count\' not present in BounceMetrics JSON')
if 'offset' in _dict:
args['offset'] = _dict.get('offset')
else:
raise ValueError('Required property \'offset\' not present in BounceMetrics JSON')
if 'limit' in _dict:
args['limit'] = _dict.get('limit')
else:
raise ValueError('Required property \'limit\' not present in BounceMetrics JSON')
return cls(**args)

@classmethod
Expand All @@ -3623,6 +3639,10 @@ def to_dict(self) -> Dict:
_dict['metrics'] = metrics_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
if hasattr(self, 'offset') and self.offset is not None:
_dict['offset'] = self.offset
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
return _dict

def _to_dict(self):
Expand Down Expand Up @@ -5585,7 +5605,8 @@ class IntegrationGetResponse:
Integration response object.

:attr str id: ID of the integration.
:attr str type: Integration type. Allowed values are kms and hs-crypto.
:attr str type: Integration type. Allowed values are kms and hs-crypto
(deprecated) and collect_failed_events.
:attr IntegrationMetadata metadata: Integration Metadata object.
:attr datetime created_at: Creation time of an integration.
:attr datetime updated_at: Last update time of an integration.
Expand All @@ -5603,7 +5624,8 @@ def __init__(
Initialize a IntegrationGetResponse object.

:param str id: ID of the integration.
:param str type: Integration type. Allowed values are kms and hs-crypto.
:param str type: Integration type. Allowed values are kms and hs-crypto
(deprecated) and collect_failed_events.
:param IntegrationMetadata metadata: Integration Metadata object.
:param datetime created_at: Creation time of an integration.
:param datetime updated_at: Last update time of an integration.
Expand Down Expand Up @@ -5817,7 +5839,8 @@ class IntegrationListItem:
all Integrations response object.

:attr str id: ID of the integration.
:attr str type: Integration type. Allowed values are kms and hs-crypto.
:attr str type: Integration type. Allowed values are kms, hs-crypto (deprecated)
and collect_failed_events.
:attr IntegrationMetadata metadata: Integration Metadata object.
:attr datetime created_at: Creation time of an integration.
:attr datetime updated_at: Update time of an integration.
Expand All @@ -5835,7 +5858,8 @@ def __init__(
Initialize a IntegrationListItem object.

:param str id: ID of the integration.
:param str type: Integration type. Allowed values are kms and hs-crypto.
:param str type: Integration type. Allowed values are kms, hs-crypto
(deprecated) and collect_failed_events.
:param IntegrationMetadata metadata: Integration Metadata object.
:param datetime created_at: Creation time of an integration.
:param datetime updated_at: Update time of an integration.
Expand Down
1 change: 1 addition & 0 deletions ibm_eventnotifications/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
"""
Version of ibm_eventnotifications
"""

__version__ = '0.22.0'
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pylint>=3.0.0,<4.0.0
pytest>=7.4.2,<8.0.0
pytest-cov>=4.1.0,<5.0.0
responses>=0.23.3,<1.0.0
black>=24.0.0,<25.0.0
black>=26.3.1
12 changes: 4 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@
# limitations under the License.

from setuptools import setup
from setuptools.command.test import test as TestCommand
import os
import sys
import pkg_resources

__version__ = '0.22.0'
PACKAGE_NAME = 'ibm_eventnotifications'
PACKAGE_DESC = 'Python server SDK for IBM Cloud Event Notifications service'

with open('requirements.txt') as f:
install_requires = [
str(req) for req in pkg_resources.parse_requirements(f)
]
install_requires = [line.strip() for line in f if line.strip() and not line.startswith('#')]

with open('requirements-dev.txt') as f:
tests_require = [str(req) for req in pkg_resources.parse_requirements(f)]
tests_require = [line.strip() for line in f if line.strip() and not line.startswith('#')]

if sys.argv[-1] == 'publish':
# test server
Expand Down Expand Up @@ -61,10 +58,9 @@
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
Expand Down
1 change: 1 addition & 0 deletions test/integration/test_event_notifications_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
Integration Tests for EventNotificationsV1
"""

import os
from datetime import timezone, timedelta

Expand Down
11 changes: 6 additions & 5 deletions test/unit/test_event_notifications_v1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# (C) Copyright IBM Corp. 2025.
# (C) Copyright IBM Corp. 2026.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,6 @@
import urllib
from ibm_eventnotifications.event_notifications_v1 import *


_service = EventNotificationsV1(authenticator=NoAuthAuthenticator())

_base_url = 'https://us-south.event-notifications.cloud.ibm.com/event-notifications'
Expand Down Expand Up @@ -278,7 +277,7 @@ def test_get_bounce_metrics_all_params(self):
"""
# Set up mock
url = preprocess_url('/v1/instances/testString/metrics/bounce')
mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0}'
mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0, "offset": 6, "limit": 5}'
responses.add(
responses.GET,
url,
Expand Down Expand Up @@ -352,7 +351,7 @@ def test_get_bounce_metrics_required_params(self):
"""
# Set up mock
url = preprocess_url('/v1/instances/testString/metrics/bounce')
mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0}'
mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0, "offset": 6, "limit": 5}'
responses.add(
responses.GET,
url,
Expand Down Expand Up @@ -402,7 +401,7 @@ def test_get_bounce_metrics_value_error(self):
"""
# Set up mock
url = preprocess_url('/v1/instances/testString/metrics/bounce')
mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0}'
mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0, "offset": 6, "limit": 5}'
responses.add(
responses.GET,
url,
Expand Down Expand Up @@ -7223,6 +7222,8 @@ def test_bounce_metrics_serialization(self):
bounce_metrics_model_json = {}
bounce_metrics_model_json['metrics'] = [bounce_metric_item_model]
bounce_metrics_model_json['total_count'] = 0
bounce_metrics_model_json['offset'] = 38
bounce_metrics_model_json['limit'] = 38

# Construct a model instance of BounceMetrics by calling from_dict on the json representation
bounce_metrics_model = BounceMetrics.from_dict(bounce_metrics_model_json)
Expand Down
12 changes: 2 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
[tox]
envlist = py38, py39, py310, py311
envlist = py310, py311, py312

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[testenv:py38]
basepython = python3.8
deps =
pylint<3.0.0
pytest
commands = pylint --rcfile=.pylintrc ibm_eventnotifications test/unit
3.12: py312

[testenv]
passenv = TOXENV CI GITHUB_*
Expand Down
Loading