Skip to content

Commit 060b1f7

Browse files
Mayank SharmaMayank Sharma
authored andcommitted
tests
1 parent 13fbb50 commit 060b1f7

37 files changed

+834
-246
lines changed

.swagger-codegen-ignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.swagger-codegen/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

Pipfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
certifi = ">=14.05.14"
8+
six = ">=1.10"
9+
python-dateutil = ">=2.5.3"
10+
urllib3 = ">=1.15.1"
11+
12+
[dev-packages]
13+
14+
[requires]
15+
python_version = "3.8"

Pipfile.lock

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
5454
from __future__ import print_function
5555
import time
5656
import swagger_client
57-
from swagger_client.rest import ApiException
57+
from swagger_client.rest import RavenException
5858
from pprint import pprint
5959

6060
# Configure API key authorization: ApiKeyAuth
@@ -73,7 +73,7 @@ try:
7373
# sends the event in bulk to all the clients specified
7474
api_response = api_instance.send_bulk_event(app_id, event, idempotency_key=idempotency_key)
7575
pprint(api_response)
76-
except ApiException as e:
76+
except RavenException as e:
7777
print("Exception when calling EventApi->send_bulk_event: %s\n" % e)
7878

7979
```
@@ -112,14 +112,6 @@ All URIs are relative to *https://api.ravenapp.dev*
112112
- [WebhookOverride](docs/WebhookOverride.md)
113113
- [WhatsappOverride](docs/WhatsappOverride.md)
114114

115-
## Documentation For Authorization
116-
117-
## ApiKeyAuth
118-
119-
- **Type**: API key
120-
- **API key parameter name**: Authorization
121-
- **Location**: HTTP header
122-
123115
## Author
124116

125117

docs/EventApi.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
All URIs are relative to *https://api.ravenapp.dev*
44

5-
Method | HTTP request | Description
6-
------------- | ------------- | -------------
7-
[**send_bulk_event**](EventApi.md#send_bulk_event) | **POST** /v1/apps/{app_id}/events/bulk_send | sends the event in bulk to all the clients specified
8-
[**send_event**](EventApi.md#send_event) | **POST** /v1/apps/{app_id}/events/send | sends the event to the client specified
9-
5+
| Method | HTTP request | Description |
6+
| -------------------------------------------------- | ------------------------------------------- | ---------------------------------------------------- |
7+
| [**send_bulk_event**](EventApi.md#send_bulk_event) | **POST** /v1/apps/{app_id}/events/bulk_send | sends the event in bulk to all the clients specified |
8+
| [**send_event**](EventApi.md#send_event) | **POST** /v1/apps/{app_id}/events/send | sends the event to the client specified |
109

1110
# **send_bulk_event**
11+
1212
> SuccessResponse send_bulk_event(app_id, event, idempotency_key=idempotency_key)
1313
1414
sends the event in bulk to all the clients specified
1515

1616
This API will send the event in bulk to the clients specified
1717

1818
### Example
19+
1920
```python
2021
from __future__ import print_function
2122
import time
2223
import swagger_client
23-
from swagger_client.rest import ApiException
24+
from swagger_client.rest import RavenException
2425
from pprint import pprint
2526

2627
# Configure API key authorization: ApiKeyAuth
@@ -39,17 +40,17 @@ try:
3940
# sends the event in bulk to all the clients specified
4041
api_response = api_instance.send_bulk_event(app_id, event, idempotency_key=idempotency_key)
4142
pprint(api_response)
42-
except ApiException as e:
43+
except RavenException as e:
4344
print("Exception when calling EventApi->send_bulk_event: %s\n" % e)
4445
```
4546

4647
### Parameters
4748

48-
Name | Type | Description | Notes
49-
------------- | ------------- | ------------- | -------------
50-
**app_id** | **str**| app id of raven app |
51-
**event** | [**SendEventBulk**](SendEventBulk.md)| the body for the event that has to be triggered |
52-
**idempotency_key** | **str**| idempotency key of api | [optional]
49+
| Name | Type | Description | Notes |
50+
| ------------------- | ------------------------------------- | ----------------------------------------------- | ---------- |
51+
| **app_id** | **str** | app id of raven app |
52+
| **event** | [**SendEventBulk**](SendEventBulk.md) | the body for the event that has to be triggered |
53+
| **idempotency_key** | **str** | idempotency key of api | [optional] |
5354

5455
### Return type
5556

@@ -61,24 +62,26 @@ Name | Type | Description | Notes
6162

6263
### HTTP request headers
6364

64-
- **Content-Type**: application/json
65-
- **Accept**: application/json
65+
- **Content-Type**: application/json
66+
- **Accept**: application/json
6667

6768
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
6869

6970
# **send_event**
71+
7072
> Response send_event(app_id, event, idempotency_key=idempotency_key)
7173
7274
sends the event to the client specified
7375

7476
This API will send the event to the client specified
7577

7678
### Example
79+
7780
```python
7881
from __future__ import print_function
7982
import time
8083
import swagger_client
81-
from swagger_client.rest import ApiException
84+
from swagger_client.rest import RavenException
8285
from pprint import pprint
8386

8487
# Configure API key authorization: ApiKeyAuth
@@ -97,17 +100,17 @@ try:
97100
# sends the event to the client specified
98101
api_response = api_instance.send_event(app_id, event, idempotency_key=idempotency_key)
99102
pprint(api_response)
100-
except ApiException as e:
103+
except RavenException as e:
101104
print("Exception when calling EventApi->send_event: %s\n" % e)
102105
```
103106

104107
### Parameters
105108

106-
Name | Type | Description | Notes
107-
------------- | ------------- | ------------- | -------------
108-
**app_id** | **str**| app id of raven app |
109-
**event** | [**SendEvent**](SendEvent.md)| the body for the event that has to be triggered |
110-
**idempotency_key** | **str**| idempotency key of api | [optional]
109+
| Name | Type | Description | Notes |
110+
| ------------------- | ----------------------------- | ----------------------------------------------- | ---------- |
111+
| **app_id** | **str** | app id of raven app |
112+
| **event** | [**SendEvent**](SendEvent.md) | the body for the event that has to be triggered |
113+
| **idempotency_key** | **str** | idempotency key of api | [optional] |
111114

112115
### Return type
113116

@@ -119,8 +122,7 @@ Name | Type | Description | Notes
119122

120123
### HTTP request headers
121124

122-
- **Content-Type**: application/json
123-
- **Accept**: application/json
125+
- **Content-Type**: application/json
126+
- **Accept**: application/json
124127

125128
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
126-

raven/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
# coding: utf-8
21

3-
# flake8: noqa
4-
5-
"""
6-
Raven API
7-
8-
This is OpenAPI defintion for the APIs of Raven. You can find out more about Raven at [https://ravenapp.dev/](https://ravenapp.dev/). # noqa: E501
9-
10-
OpenAPI spec version: 1.0.0
11-
12-
Generated by: https://github.com/swagger-api/swagger-codegen.git
13-
"""
14-
15-
16-
from __future__ import absolute_import
172

183
# import apis into sdk package
194
from raven.api import RavenClient

raven/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# flake8: noqa
44

55
# import apis into api package
6-
from raven.api.raven_client import RavenClient
6+
from raven.api.raven_client import RavenClient

raven/api/raven_client.py

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
from __future__ import absolute_import
22

3-
import re
3+
import re
44

55
import six
6-
76
from raven.api_client import ApiClient
7+
from raven.configuration import Configuration
88

99

1010
class RavenClient(object):
1111

12-
def __init__(self, api_client=None):
13-
if api_client is None:
14-
api_client = ApiClient()
15-
self.api_client = api_client
12+
def __init__(self, api_key=None):
13+
if api_key is None:
14+
api_key = ""
15+
config = Configuration()
16+
config.api_key['Authorization'] = api_key
17+
config.api_key_prefix['Authorization'] = 'AuthKey'
18+
self.api_client = ApiClient(config)
1619

1720
def send_bulk(self, app_id, event, **kwargs):
1821
kwargs['_return_http_data_only'] = True
@@ -23,23 +26,7 @@ def send_bulk(self, app_id, event, **kwargs):
2326
return data
2427

2528
def send_bulk_with_http_info(self, app_id, event, **kwargs):
26-
"""sends the event in bulk to all the clients specified
27-
28-
This API will send the event in bulk to the clients specified
29-
This method makes a synchronous HTTP request by default. To make an
30-
asynchronous HTTP request, please pass async_req=True
31-
>>> thread = api.send_bulk_with_http_info(app_id, event, async_req=True)
32-
>>> result = thread.get()
33-
34-
:param async_req bool
35-
:param str app_id: app id of raven app (required)
36-
:param SendEventBulk event: the body for the event that has to be triggered (required)
37-
:param str idempotency_key: idempotency key of api
38-
:return: SuccessResponse
39-
If the method is called asynchronously,
40-
returns the request thread.
41-
"""
42-
29+
4330
all_params = ['app_id', 'event', 'idempotency_key']
4431
all_params.append('async_req')
4532
all_params.append('_return_http_data_only')
@@ -101,7 +88,7 @@ def send_bulk_with_http_info(self, app_id, event, **kwargs):
10188
body=body_params,
10289
post_params=form_params,
10390
files=local_var_files,
104-
response_type='SuccessResponse',
91+
response_type='Response',
10592
auth_settings=auth_settings,
10693
async_req=params.get('async_req'),
10794
_return_http_data_only=params.get('_return_http_data_only'),
@@ -119,22 +106,6 @@ def send(self, app_id, event, **kwargs):
119106
return data
120107

121108
def send_with_http_info(self, app_id, event, **kwargs):
122-
"""sends the event to the client specified
123-
124-
This API will send the event to the client specified
125-
This method makes a synchronous HTTP request by default. To make an
126-
asynchronous HTTP request, please pass async_req=True
127-
>>> thread = api.send_with_http_info(app_id, event, async_req=True)
128-
>>> result = thread.get()
129-
130-
:param async_req bool
131-
:param str app_id: app id of raven app (required)
132-
:param SendEvent event: the body for the event that has to be triggered (required)
133-
:param str idempotency_key: idempotency key of api
134-
:return: Response
135-
If the method is called asynchronously,
136-
returns the request thread.
137-
"""
138109

139110
all_params = ['app_id', 'event', 'idempotency_key']
140111
all_params.append('async_req')

0 commit comments

Comments
 (0)