Skip to content

Commit 2d6d3d7

Browse files
generated api for federation service
1 parent 23bf1a3 commit 2d6d3d7

284 files changed

Lines changed: 57820 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api_client_generation/local/federation/federation_api.yaml

Lines changed: 7326 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
# coding: utf-8
2+
3+
"""
4+
SFS MS Admin API
5+
6+
see https://symphony-1.gitbook.io/federation/
7+
8+
The version of the OpenAPI document: 0.0.1
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
import warnings
15+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16+
from typing import Any, Dict, List, Optional, Tuple, Union
17+
from typing_extensions import Annotated
18+
19+
from pydantic import Field
20+
from typing_extensions import Annotated
21+
from symphony.bdk.gen.federation_model.companies_search_response import CompaniesSearchResponse
22+
23+
from symphony.bdk.gen.api_client import ApiClient, RequestSerialized
24+
from symphony.bdk.gen.api_response import ApiResponse
25+
from symphony.bdk.gen.rest import RESTResponseType
26+
27+
28+
class CompaniesApi:
29+
"""NOTE: This class is auto generated by OpenAPI Generator
30+
Ref: https://openapi-generator.tech
31+
32+
Do not edit the class manually.
33+
"""
34+
35+
def __init__(self, api_client=None) -> None:
36+
if api_client is None:
37+
api_client = ApiClient.get_default()
38+
self.api_client = api_client
39+
40+
41+
@validate_call
42+
async def search_companies(
43+
self,
44+
query: Annotated[str, Field(min_length=3, strict=True, description="Start of the company's name to match")],
45+
_request_timeout: Union[
46+
None,
47+
Annotated[StrictFloat, Field(gt=0)],
48+
Tuple[
49+
Annotated[StrictFloat, Field(gt=0)],
50+
Annotated[StrictFloat, Field(gt=0)]
51+
]
52+
] = None,
53+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
54+
_content_type: Optional[StrictStr] = None,
55+
_headers: Optional[Dict[StrictStr, Any]] = None,
56+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
57+
) -> CompaniesSearchResponse:
58+
"""Search for companies
59+
60+
Search for companies by name.<br /> <b>Note:</b> The WeChat or WhatsApp or SMS or SMS Direct or LINE onboarding applications do not enforce consistency for company names.
61+
62+
:param query: Start of the company's name to match (required)
63+
:type query: str
64+
:param _request_timeout: timeout setting for this request. If one
65+
number provided, it will be total request
66+
timeout. It can also be a pair (tuple) of
67+
(connection, read) timeouts.
68+
:type _request_timeout: int, tuple(int, int), optional
69+
:param _request_auth: set to override the auth_settings for an a single
70+
request; this effectively ignores the
71+
authentication in the spec for a single request.
72+
:type _request_auth: dict, optional
73+
:param _content_type: force content-type for the request.
74+
:type _content_type: str, Optional
75+
:param _headers: set to override the headers for a single
76+
request; this effectively ignores the headers
77+
in the spec for a single request.
78+
:type _headers: dict, optional
79+
:param _host_index: set to override the host_index for a single
80+
request; this effectively ignores the host_index
81+
in the spec for a single request.
82+
:type _host_index: int, optional
83+
:return: Returns the result object.
84+
""" # noqa: E501
85+
86+
_param = self._search_companies_serialize(
87+
query=query,
88+
_request_auth=_request_auth,
89+
_content_type=_content_type,
90+
_headers=_headers,
91+
_host_index=_host_index
92+
)
93+
94+
_response_types_map: Dict[str, Optional[str]] = {
95+
'200': "CompaniesSearchResponse",
96+
'401': "Unauthorized",
97+
'403': "Forbidden",
98+
}
99+
response_data = await self.api_client.call_api(
100+
*_param,
101+
_request_timeout=_request_timeout
102+
)
103+
await response_data.read()
104+
return self.api_client.response_deserialize(
105+
response_data=response_data,
106+
response_types_map=_response_types_map,
107+
).data
108+
109+
110+
@validate_call
111+
async def search_companies_with_http_info(
112+
self,
113+
query: Annotated[str, Field(min_length=3, strict=True, description="Start of the company's name to match")],
114+
_request_timeout: Union[
115+
None,
116+
Annotated[StrictFloat, Field(gt=0)],
117+
Tuple[
118+
Annotated[StrictFloat, Field(gt=0)],
119+
Annotated[StrictFloat, Field(gt=0)]
120+
]
121+
] = None,
122+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
123+
_content_type: Optional[StrictStr] = None,
124+
_headers: Optional[Dict[StrictStr, Any]] = None,
125+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
126+
) -> ApiResponse[CompaniesSearchResponse]:
127+
"""Search for companies
128+
129+
Search for companies by name.<br /> <b>Note:</b> The WeChat or WhatsApp or SMS or SMS Direct or LINE onboarding applications do not enforce consistency for company names.
130+
131+
:param query: Start of the company's name to match (required)
132+
:type query: str
133+
:param _request_timeout: timeout setting for this request. If one
134+
number provided, it will be total request
135+
timeout. It can also be a pair (tuple) of
136+
(connection, read) timeouts.
137+
:type _request_timeout: int, tuple(int, int), optional
138+
:param _request_auth: set to override the auth_settings for an a single
139+
request; this effectively ignores the
140+
authentication in the spec for a single request.
141+
:type _request_auth: dict, optional
142+
:param _content_type: force content-type for the request.
143+
:type _content_type: str, Optional
144+
:param _headers: set to override the headers for a single
145+
request; this effectively ignores the headers
146+
in the spec for a single request.
147+
:type _headers: dict, optional
148+
:param _host_index: set to override the host_index for a single
149+
request; this effectively ignores the host_index
150+
in the spec for a single request.
151+
:type _host_index: int, optional
152+
:return: Returns the result object.
153+
""" # noqa: E501
154+
155+
_param = self._search_companies_serialize(
156+
query=query,
157+
_request_auth=_request_auth,
158+
_content_type=_content_type,
159+
_headers=_headers,
160+
_host_index=_host_index
161+
)
162+
163+
_response_types_map: Dict[str, Optional[str]] = {
164+
'200': "CompaniesSearchResponse",
165+
'401': "Unauthorized",
166+
'403': "Forbidden",
167+
}
168+
response_data = await self.api_client.call_api(
169+
*_param,
170+
_request_timeout=_request_timeout
171+
)
172+
await response_data.read()
173+
return self.api_client.response_deserialize(
174+
response_data=response_data,
175+
response_types_map=_response_types_map,
176+
)
177+
178+
179+
@validate_call
180+
async def search_companies_without_preload_content(
181+
self,
182+
query: Annotated[str, Field(min_length=3, strict=True, description="Start of the company's name to match")],
183+
_request_timeout: Union[
184+
None,
185+
Annotated[StrictFloat, Field(gt=0)],
186+
Tuple[
187+
Annotated[StrictFloat, Field(gt=0)],
188+
Annotated[StrictFloat, Field(gt=0)]
189+
]
190+
] = None,
191+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
192+
_content_type: Optional[StrictStr] = None,
193+
_headers: Optional[Dict[StrictStr, Any]] = None,
194+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
195+
) -> RESTResponseType:
196+
"""Search for companies
197+
198+
Search for companies by name.<br /> <b>Note:</b> The WeChat or WhatsApp or SMS or SMS Direct or LINE onboarding applications do not enforce consistency for company names.
199+
200+
:param query: Start of the company's name to match (required)
201+
:type query: str
202+
:param _request_timeout: timeout setting for this request. If one
203+
number provided, it will be total request
204+
timeout. It can also be a pair (tuple) of
205+
(connection, read) timeouts.
206+
:type _request_timeout: int, tuple(int, int), optional
207+
:param _request_auth: set to override the auth_settings for an a single
208+
request; this effectively ignores the
209+
authentication in the spec for a single request.
210+
:type _request_auth: dict, optional
211+
:param _content_type: force content-type for the request.
212+
:type _content_type: str, Optional
213+
:param _headers: set to override the headers for a single
214+
request; this effectively ignores the headers
215+
in the spec for a single request.
216+
:type _headers: dict, optional
217+
:param _host_index: set to override the host_index for a single
218+
request; this effectively ignores the host_index
219+
in the spec for a single request.
220+
:type _host_index: int, optional
221+
:return: Returns the result object.
222+
""" # noqa: E501
223+
224+
_param = self._search_companies_serialize(
225+
query=query,
226+
_request_auth=_request_auth,
227+
_content_type=_content_type,
228+
_headers=_headers,
229+
_host_index=_host_index
230+
)
231+
232+
_response_types_map: Dict[str, Optional[str]] = {
233+
'200': "CompaniesSearchResponse",
234+
'401': "Unauthorized",
235+
'403': "Forbidden",
236+
}
237+
response_data = await self.api_client.call_api(
238+
*_param,
239+
_request_timeout=_request_timeout
240+
)
241+
return response_data.response
242+
243+
244+
def _search_companies_serialize(
245+
self,
246+
query,
247+
_request_auth,
248+
_content_type,
249+
_headers,
250+
_host_index,
251+
) -> RequestSerialized:
252+
253+
_host = None
254+
255+
_collection_formats: Dict[str, str] = {
256+
}
257+
258+
_path_params: Dict[str, str] = {}
259+
_query_params: List[Tuple[str, str]] = []
260+
_header_params: Dict[str, Optional[str]] = _headers or {}
261+
_form_params: List[Tuple[str, str]] = []
262+
_files: Dict[
263+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
264+
] = {}
265+
_body_params: Optional[bytes] = None
266+
267+
# process the path parameters
268+
# process the query parameters
269+
if query is not None:
270+
271+
_query_params.append(('query', query))
272+
273+
# process the header parameters
274+
# process the form parameters
275+
# process the body parameter
276+
277+
278+
# set the HTTP header `Accept`
279+
if 'Accept' not in _header_params:
280+
_header_params['Accept'] = self.api_client.select_header_accept(
281+
[
282+
'application/json'
283+
]
284+
)
285+
286+
287+
# authentication setting
288+
_auth_settings: List[str] = [
289+
'sfsAuthentication'
290+
]
291+
292+
return self.api_client.param_serialize(
293+
method='GET',
294+
resource_path='/api/v1/customer/companies/search',
295+
path_params=_path_params,
296+
query_params=_query_params,
297+
header_params=_header_params,
298+
body=_body_params,
299+
post_params=_form_params,
300+
files=_files,
301+
auth_settings=_auth_settings,
302+
collection_formats=_collection_formats,
303+
_host=_host,
304+
_request_auth=_request_auth
305+
)
306+
307+

0 commit comments

Comments
 (0)