RIC-642 related changes: REST subscription, rnib enhancements, symptomdata, rest...
[ric-plt/xapp-frame-py.git] / ricxappframe / subsclient / api / common_api.py
1 # coding: utf-8
2
3 """
4     RIC subscription
5
6     This is the initial REST API for RIC subscription  # noqa: E501
7
8     OpenAPI spec version: 0.0.4
9     
10     Generated by: https://github.com/swagger-api/swagger-codegen.git
11 """
12
13
14 from __future__ import absolute_import
15
16 import re  # noqa: F401
17
18 # python 2 and python 3 compatibility library
19 import six
20
21 from ricxappframe.subsclient.api_client import ApiClient
22
23
24 class CommonApi(object):
25     """NOTE: This class is auto generated by the swagger code generator program.
26
27     Do not edit the class manually.
28     Ref: https://github.com/swagger-api/swagger-codegen
29     """
30
31     def __init__(self, api_client=None):
32         if api_client is None:
33             api_client = ApiClient()
34         self.api_client = api_client
35
36     def get_all_subscriptions(self, **kwargs):  # noqa: E501
37         """Returns list of subscriptions  # noqa: E501
38
39         This method makes a synchronous HTTP request by default. To make an
40         asynchronous HTTP request, please pass async_req=True
41         >>> thread = api.get_all_subscriptions(async_req=True)
42         >>> result = thread.get()
43
44         :param async_req bool
45         :return: SubscriptionList
46                  If the method is called asynchronously,
47                  returns the request thread.
48         """
49         kwargs['_return_http_data_only'] = True
50         if kwargs.get('async_req'):
51             return self.get_all_subscriptions_with_http_info(**kwargs)  # noqa: E501
52         else:
53             (data) = self.get_all_subscriptions_with_http_info(**kwargs)  # noqa: E501
54             return data
55
56     def get_all_subscriptions_with_http_info(self, **kwargs):  # noqa: E501
57         """Returns list of subscriptions  # noqa: E501
58
59         This method makes a synchronous HTTP request by default. To make an
60         asynchronous HTTP request, please pass async_req=True
61         >>> thread = api.get_all_subscriptions_with_http_info(async_req=True)
62         >>> result = thread.get()
63
64         :param async_req bool
65         :return: SubscriptionList
66                  If the method is called asynchronously,
67                  returns the request thread.
68         """
69
70         all_params = []  # noqa: E501
71         all_params.append('async_req')
72         all_params.append('_return_http_data_only')
73         all_params.append('_preload_content')
74         all_params.append('_request_timeout')
75
76         params = locals()
77         for key, val in six.iteritems(params['kwargs']):
78             if key not in all_params:
79                 raise TypeError(
80                     "Got an unexpected keyword argument '%s'"
81                     " to method get_all_subscriptions" % key
82                 )
83             params[key] = val
84         del params['kwargs']
85
86         collection_formats = {}
87
88         path_params = {}
89
90         query_params = []
91
92         header_params = {}
93
94         form_params = []
95         local_var_files = {}
96
97         body_params = None
98         # HTTP header `Accept`
99         header_params['Accept'] = self.api_client.select_header_accept(
100             ['application/json'])  # noqa: E501
101
102         # Authentication setting
103         auth_settings = []  # noqa: E501
104
105         return self.api_client.call_api(
106             '/subscriptions', 'GET',
107             path_params,
108             query_params,
109             header_params,
110             body=body_params,
111             post_params=form_params,
112             files=local_var_files,
113             response_type='SubscriptionList',  # noqa: E501
114             auth_settings=auth_settings,
115             async_req=params.get('async_req'),
116             _return_http_data_only=params.get('_return_http_data_only'),
117             _preload_content=params.get('_preload_content', True),
118             _request_timeout=params.get('_request_timeout'),
119             collection_formats=collection_formats)
120
121     def subscribe(self, **kwargs):  # noqa: E501
122         """Subscribe a list of X2AP event triggers to receive messages sent by RAN  # noqa: E501
123
124         This method makes a synchronous HTTP request by default. To make an
125         asynchronous HTTP request, please pass async_req=True
126         >>> thread = api.subscribe(async_req=True)
127         >>> result = thread.get()
128
129         :param async_req bool
130         :param SubscriptionParams subscription_params: Subscription parameters
131         :return: SubscriptionResponse
132                  If the method is called asynchronously,
133                  returns the request thread.
134         """
135         kwargs['_return_http_data_only'] = True
136         if kwargs.get('async_req'):
137             return self.subscribe_with_http_info(**kwargs)  # noqa: E501
138         else:
139             (data) = self.subscribe_with_http_info(**kwargs)  # noqa: E501
140             return data
141
142     def subscribe_with_http_info(self, **kwargs):  # noqa: E501
143         """Subscribe a list of X2AP event triggers to receive messages sent by RAN  # noqa: E501
144
145         This method makes a synchronous HTTP request by default. To make an
146         asynchronous HTTP request, please pass async_req=True
147         >>> thread = api.subscribe_with_http_info(async_req=True)
148         >>> result = thread.get()
149
150         :param async_req bool
151         :param SubscriptionParams subscription_params: Subscription parameters
152         :return: SubscriptionResponse
153                  If the method is called asynchronously,
154                  returns the request thread.
155         """
156
157         all_params = ['subscription_params']  # noqa: E501
158         all_params.append('async_req')
159         all_params.append('_return_http_data_only')
160         all_params.append('_preload_content')
161         all_params.append('_request_timeout')
162
163         params = locals()
164         for key, val in six.iteritems(params['kwargs']):
165             if key not in all_params:
166                 raise TypeError(
167                     "Got an unexpected keyword argument '%s'"
168                     " to method subscribe" % key
169                 )
170             params[key] = val
171         del params['kwargs']
172
173         collection_formats = {}
174
175         path_params = {}
176
177         query_params = []
178
179         header_params = {}
180
181         form_params = []
182         local_var_files = {}
183
184         body_params = None
185         if 'subscription_params' in params:
186             body_params = params['subscription_params']
187         # HTTP header `Accept`
188         header_params['Accept'] = self.api_client.select_header_accept(
189             ['application/json'])  # noqa: E501
190
191         # HTTP header `Content-Type`
192         header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
193             ['application/json'])  # noqa: E501
194
195         # Authentication setting
196         auth_settings = []  # noqa: E501
197
198         return self.api_client.call_api(
199             '/subscriptions', 'POST',
200             path_params,
201             query_params,
202             header_params,
203             body=body_params,
204             post_params=form_params,
205             files=local_var_files,
206             response_type='SubscriptionResponse',  # noqa: E501
207             auth_settings=auth_settings,
208             async_req=params.get('async_req'),
209             _return_http_data_only=params.get('_return_http_data_only'),
210             _preload_content=params.get('_preload_content', True),
211             _request_timeout=params.get('_request_timeout'),
212             collection_formats=collection_formats)
213
214     def unsubscribe(self, subscription_id, **kwargs):  # noqa: E501
215         """Unsubscribe X2AP events from Subscription Manager  # noqa: E501
216
217         This method makes a synchronous HTTP request by default. To make an
218         asynchronous HTTP request, please pass async_req=True
219         >>> thread = api.unsubscribe(subscription_id, async_req=True)
220         >>> result = thread.get()
221
222         :param async_req bool
223         :param str subscription_id: The subscriptionId received in the Subscription Response (required)
224         :return: None
225                  If the method is called asynchronously,
226                  returns the request thread.
227         """
228         kwargs['_return_http_data_only'] = True
229         if kwargs.get('async_req'):
230             return self.unsubscribe_with_http_info(subscription_id, **kwargs)  # noqa: E501
231         else:
232             (data) = self.unsubscribe_with_http_info(subscription_id, **kwargs)  # noqa: E501
233             return data
234
235     def unsubscribe_with_http_info(self, subscription_id, **kwargs):  # noqa: E501
236         """Unsubscribe X2AP events from Subscription Manager  # noqa: E501
237
238         This method makes a synchronous HTTP request by default. To make an
239         asynchronous HTTP request, please pass async_req=True
240         >>> thread = api.unsubscribe_with_http_info(subscription_id, async_req=True)
241         >>> result = thread.get()
242
243         :param async_req bool
244         :param str subscription_id: The subscriptionId received in the Subscription Response (required)
245         :return: None
246                  If the method is called asynchronously,
247                  returns the request thread.
248         """
249
250         all_params = ['subscription_id']  # noqa: E501
251         all_params.append('async_req')
252         all_params.append('_return_http_data_only')
253         all_params.append('_preload_content')
254         all_params.append('_request_timeout')
255
256         params = locals()
257         for key, val in six.iteritems(params['kwargs']):
258             if key not in all_params:
259                 raise TypeError(
260                     "Got an unexpected keyword argument '%s'"
261                     " to method unsubscribe" % key
262                 )
263             params[key] = val
264         del params['kwargs']
265         # verify the required parameter 'subscription_id' is set
266         if self.api_client.client_side_validation and ('subscription_id' not in params or
267                                                        params['subscription_id'] is None):  # noqa: E501
268             raise ValueError("Missing the required parameter `subscription_id` when calling `unsubscribe`")  # noqa: E501
269
270         collection_formats = {}
271
272         path_params = {}
273         if 'subscription_id' in params:
274             path_params['subscriptionId'] = params['subscription_id']  # noqa: E501
275
276         query_params = []
277
278         header_params = {}
279
280         form_params = []
281         local_var_files = {}
282
283         body_params = None
284         # HTTP header `Accept`
285         header_params['Accept'] = self.api_client.select_header_accept(
286             ['application/json'])  # noqa: E501
287
288         # HTTP header `Content-Type`
289         header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
290             ['application/json'])  # noqa: E501
291
292         # Authentication setting
293         auth_settings = []  # noqa: E501
294
295         return self.api_client.call_api(
296             '/subscriptions/{subscriptionId}', 'DELETE',
297             path_params,
298             query_params,
299             header_params,
300             body=body_params,
301             post_params=form_params,
302             files=local_var_files,
303             response_type=None,  # noqa: E501
304             auth_settings=auth_settings,
305             async_req=params.get('async_req'),
306             _return_http_data_only=params.get('_return_http_data_only'),
307             _preload_content=params.get('_preload_content', True),
308             _request_timeout=params.get('_request_timeout'),
309             collection_formats=collection_formats)