Skip to content

Commit bea6465

Browse files
correction of problems in event_management module.
1 parent 797cf72 commit bea6465

File tree

6 files changed

+147
-116
lines changed

6 files changed

+147
-116
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.8.4] - 2025-02-17
10+
11+
### Fix
12+
- fix in create_webhook_destination, update_webhook_destination, get_webhook_destination functions. In versions 2.3.7.6 and 2.3.7.9.
13+
14+
915
## [2.8.3] - 2025-01-23
1016

1117
### Fix

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The following table shows the supported versions.
160160
* - 2.3.7.6
161161
- 2.7.7
162162
* - 2.3.7.9
163-
- 2.8.3
163+
- 2.8.4
164164

165165

166166

dnacentersdk/api/v2_3_7_6/event_management.py

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,7 @@ def create_webhook_destination_v1(self,
30123012
url=None,
30133013
webhookId=None,
30143014
payload=None,
3015+
customHeaders=None,
30153016
active_validation=True,
30163017
**request_parameters):
30173018
"""Create Webhook Destination .
@@ -3025,7 +3026,7 @@ def create_webhook_destination_v1(self,
30253026
trustCert(boolean): Event Management's Trust Cert.
30263027
url(string): Event Management's Url.
30273028
webhookId(string): Event Management's Required only for update webhook configuration .
3028-
headers(dict): Dictionary of HTTP Headers to send with the Request
3029+
customHeaders(dict): Dictionary of HTTP Headers to send with the Request
30293030
.
30303031
payload(dict): A JSON serializable Python object to send in the
30313032
body of the Request.
@@ -3045,14 +3046,14 @@ def create_webhook_destination_v1(self,
30453046
Documentation Link:
30463047
https://developer.cisco.com/docs/dna-center/#!create-webhook-destination
30473048
"""
3048-
check_type(headers, dict)
3049+
check_type(customHeaders, dict)
30493050
check_type(payload, dict)
3050-
if headers is not None:
3051-
if 'Content-Type' in headers:
3052-
check_type(headers.get('Content-Type'),
3051+
if customHeaders is not None:
3052+
if 'Content-Type' in customHeaders:
3053+
check_type(customHeaders.get('Content-Type'),
30533054
str, may_be_none=False)
3054-
if 'X-Auth-Token' in headers:
3055-
check_type(headers.get('X-Auth-Token'),
3055+
if 'X-Auth-Token' in customHeaders:
3056+
check_type(customHeaders.get('X-Auth-Token'),
30563057
str, may_be_none=False)
30573058

30583059
_params = {
@@ -3088,8 +3089,8 @@ def create_webhook_destination_v1(self,
30883089

30893090
with_custom_headers = False
30903091
_headers = self._session.headers or {}
3091-
if headers:
3092-
_headers.update(dict_of_str(headers))
3092+
if customHeaders:
3093+
_headers.update(dict_of_str(customHeaders))
30933094
with_custom_headers = True
30943095

30953096
e_url = ('/dna/intent/api/v1/event/webhook')
@@ -3114,6 +3115,7 @@ def update_webhook_destination_v1(self,
31143115
url=None,
31153116
webhookId=None,
31163117
payload=None,
3118+
customHeaders=None,
31173119
active_validation=True,
31183120
**request_parameters):
31193121
"""Update Webhook Destination .
@@ -3127,7 +3129,7 @@ def update_webhook_destination_v1(self,
31273129
trustCert(boolean): Event Management's Trust Cert.
31283130
url(string): Event Management's Url.
31293131
webhookId(string): Event Management's Required only for update webhook configuration .
3130-
headers(dict): Dictionary of HTTP Headers to send with the Request
3132+
customHeaders(dict): Dictionary of HTTP Headers to send with the Request
31313133
.
31323134
payload(dict): A JSON serializable Python object to send in the
31333135
body of the Request.
@@ -3147,11 +3149,11 @@ def update_webhook_destination_v1(self,
31473149
Documentation Link:
31483150
https://developer.cisco.com/docs/dna-center/#!update-webhook-destination
31493151
"""
3150-
check_type(headers, dict)
3152+
check_type(customHeaders, dict)
31513153
check_type(payload, dict)
3152-
if headers is not None:
3153-
if 'X-Auth-Token' in headers:
3154-
check_type(headers.get('X-Auth-Token'),
3154+
if customHeaders is not None:
3155+
if 'X-Auth-Token' in customHeaders:
3156+
check_type(customHeaders.get('X-Auth-Token'),
31553157
str, may_be_none=False)
31563158

31573159
_params = {
@@ -3187,8 +3189,8 @@ def update_webhook_destination_v1(self,
31873189

31883190
with_custom_headers = False
31893191
_headers = self._session.headers or {}
3190-
if headers:
3191-
_headers.update(dict_of_str(headers))
3192+
if customHeaders:
3193+
_headers.update(dict_of_str(customHeaders))
31923194
with_custom_headers = True
31933195

31943196
e_url = ('/dna/intent/api/v1/event/webhook')
@@ -3209,7 +3211,7 @@ def get_webhook_destination_v1(self,
32093211
order=None,
32103212
sort_by=None,
32113213
webhook_ids=None,
3212-
headers=None,
3214+
customHeaders=None,
32133215
**request_parameters):
32143216
"""Get Webhook Destination .
32153217
@@ -3221,7 +3223,7 @@ def get_webhook_destination_v1(self,
32213223
default value 10 .
32223224
sort_by(str): sortBy query parameter. SortBy field name .
32233225
order(str): order query parameter.
3224-
headers(dict): Dictionary of HTTP Headers to send with the Request
3226+
customHeaders(dict): Dictionary of HTTP Headers to send with the Request
32253227
.
32263228
**request_parameters: Additional request parameters (provides
32273229
support for parameters that may be added in the future).
@@ -3237,15 +3239,15 @@ def get_webhook_destination_v1(self,
32373239
Documentation Link:
32383240
https://developer.cisco.com/docs/dna-center/#!get-webhook-destination
32393241
"""
3240-
check_type(headers, dict)
3242+
check_type(customHeaders, dict)
32413243
check_type(webhook_ids, str)
32423244
check_type(offset, int)
32433245
check_type(limit, int)
32443246
check_type(sort_by, str)
32453247
check_type(order, str)
3246-
if headers is not None:
3247-
if 'X-Auth-Token' in headers:
3248-
check_type(headers.get('X-Auth-Token'),
3248+
if customHeaders is not None:
3249+
if 'X-Auth-Token' in customHeaders:
3250+
check_type(customHeaders.get('X-Auth-Token'),
32493251
str, may_be_none=False)
32503252

32513253
_params = {
@@ -3268,8 +3270,8 @@ def get_webhook_destination_v1(self,
32683270

32693271
with_custom_headers = False
32703272
_headers = self._session.headers or {}
3271-
if headers:
3272-
_headers.update(dict_of_str(headers))
3273+
if customHeaders:
3274+
_headers.update(dict_of_str(customHeaders))
32733275
with_custom_headers = True
32743276

32753277
e_url = ('/dna/intent/api/v1/event/webhook')
@@ -4156,6 +4158,7 @@ def create_webhook_destination(self,
41564158
url=None,
41574159
webhookId=None,
41584160
payload=None,
4161+
customHeaders=None,
41594162
active_validation=True,
41604163
**request_parameters):
41614164
""" This function is an alias of create_webhook_destination_v1 .
@@ -4168,7 +4171,7 @@ def create_webhook_destination(self,
41684171
trustCert(boolean): Event Management's Trust Cert.
41694172
url(string): Event Management's Url.
41704173
webhookId(string): Event Management's Required only for update webhook configuration .
4171-
headers(dict): Dictionary of HTTP Headers to send with the Request
4174+
customHeaders(dict): Dictionary of HTTP Headers to send with the Request
41724175
.
41734176
payload(): A JSON serializable Python object to send in the
41744177
body of the Request.
@@ -4190,6 +4193,7 @@ def create_webhook_destination(self,
41904193
url=url,
41914194
webhookId=webhookId,
41924195
payload=payload,
4196+
customHeaders=customHeaders,
41934197
active_validation=active_validation,
41944198
**request_parameters
41954199
)
@@ -4508,6 +4512,7 @@ def update_webhook_destination(self,
45084512
url=None,
45094513
webhookId=None,
45104514
payload=None,
4515+
customHeaders=None,
45114516
active_validation=True,
45124517
**request_parameters):
45134518
""" This function is an alias of update_webhook_destination_v1 .
@@ -4520,7 +4525,7 @@ def update_webhook_destination(self,
45204525
trustCert(boolean): Event Management's Trust Cert.
45214526
url(string): Event Management's Url.
45224527
webhookId(string): Event Management's Required only for update webhook configuration .
4523-
headers(dict): Dictionary of HTTP Headers to send with the Request
4528+
customHeaders(dict): Dictionary of HTTP Headers to send with the Request
45244529
.
45254530
payload(): A JSON serializable Python object to send in the
45264531
body of the Request.
@@ -4542,6 +4547,7 @@ def update_webhook_destination(self,
45424547
url=url,
45434548
webhookId=webhookId,
45444549
payload=payload,
4550+
customHeaders = customHeaders,
45454551
active_validation=active_validation,
45464552
**request_parameters
45474553
)
@@ -5646,7 +5652,7 @@ def get_webhook_destination(self,
56465652
order=None,
56475653
sort_by=None,
56485654
webhook_ids=None,
5649-
headers=None,
5655+
customHeaders=None,
56505656
**request_parameters):
56515657
""" This function is an alias of get_webhook_destination_v1 .
56525658
Args:
@@ -5657,7 +5663,7 @@ def get_webhook_destination(self,
56575663
default value 10 .
56585664
sort_by(basestring): sortBy query parameter. SortBy field name .
56595665
order(basestring): order query parameter.
5660-
headers(dict): Dictionary of HTTP Headers to send with the Request
5666+
customHeaders(dict): Dictionary of HTTP Headers to send with the Request
56615667
.
56625668
**request_parameters: Additional request parameters (provides
56635669
support for parameters that may be added in the future).
@@ -5671,7 +5677,7 @@ def get_webhook_destination(self,
56715677
order=order,
56725678
sort_by=sort_by,
56735679
webhook_ids=webhook_ids,
5674-
headers=headers,
5680+
customHeaders=customHeaders,
56755681
**request_parameters
56765682
)
56775683

0 commit comments

Comments
 (0)