Skip to content

Commit

Permalink
chore: generated code for commit 3879600. [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Dec 12, 2023
1 parent 3879600 commit 4ad25d3
Show file tree
Hide file tree
Showing 65 changed files with 2,523 additions and 5,920 deletions.
192 changes: 84 additions & 108 deletions clients/algoliasearch-client-python/algoliasearch/abtesting/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from re import match
from typing import Annotated, Any, Dict, List, Optional, Tuple, Union
from urllib.parse import quote

from pydantic import Field, StrictInt, StrictStr

Expand Down Expand Up @@ -104,27 +105,29 @@ async def add_ab_tests_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
if add_ab_tests_request is None:
raise ValueError(
"'add_ab_tests_request' is required when calling 'add_ab_tests'"
)

_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
_body: Optional[bytes] = None
_path = "/2/abtests"

if add_ab_tests_request is not None:
_body_params = add_ab_tests_request
_body = add_ab_tests_request

_param = self._transporter.param_serialize(
path="/2/abtests",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.POST,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -180,30 +183,27 @@ async def call_del_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if path is None:
raise ValueError("'path' is required when calling 'call_del'")

if path is not None:
_path_params["path"] = path
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/1{path}".replace("{path}", path)

if parameters is not None:
_query_params.append(("parameters", parameters))

_param = self._transporter.param_serialize(
path="/1{path}",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.DELETE,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -257,27 +257,24 @@ async def delete_ab_test_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if id is None:
raise ValueError("'id' is required when calling 'delete_ab_test'")

if id is not None:
_path_params["id"] = id
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/2/abtests/{id}".replace("{id}", quote(str(id)))

_param = self._transporter.param_serialize(
path="/2/abtests/{id}",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.DELETE,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -331,30 +328,27 @@ async def get_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if path is None:
raise ValueError("'path' is required when calling 'get'")

if path is not None:
_path_params["path"] = path
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/1{path}".replace("{path}", path)

if parameters is not None:
_query_params.append(("parameters", parameters))

_param = self._transporter.param_serialize(
path="/1{path}",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.GET,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -408,27 +402,24 @@ async def get_ab_test_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if id is None:
raise ValueError("'id' is required when calling 'get_ab_test'")

if id is not None:
_path_params["id"] = id
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/2/abtests/{id}".replace("{id}", quote(str(id)))

_param = self._transporter.param_serialize(
path="/2/abtests/{id}",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.GET,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -498,36 +489,30 @@ async def list_ab_tests_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
_body: Optional[bytes] = None
_path = "/2/abtests"

if offset is not None:
_query_params.append(("offset", offset))

if limit is not None:
_query_params.append(("limit", limit))

if index_prefix is not None:
_query_params.append(("indexPrefix", index_prefix))

if index_suffix is not None:
_query_params.append(("indexSuffix", index_suffix))

_param = self._transporter.param_serialize(
path="/2/abtests",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.GET,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -616,33 +601,30 @@ async def post_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if path is None:
raise ValueError("'path' is required when calling 'post'")

if path is not None:
_path_params["path"] = path
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/1{path}".replace("{path}", path)

if parameters is not None:
_query_params.append(("parameters", parameters))

if body is not None:
_body_params = body
_body = body

_param = self._transporter.param_serialize(
path="/1{path}",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.POST,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -721,33 +703,30 @@ async def put_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if path is None:
raise ValueError("'path' is required when calling 'put'")

if path is not None:
_path_params["path"] = path
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/1{path}".replace("{path}", path)

if parameters is not None:
_query_params.append(("parameters", parameters))

if body is not None:
_body_params = body
_body = body

_param = self._transporter.param_serialize(
path="/1{path}",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.PUT,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down Expand Up @@ -809,27 +788,24 @@ async def stop_ab_test_with_http_info(
:return: Returns the raw algoliasearch 'APIResponse' object.
"""

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_body_params: Optional[bytes] = None
if id is None:
raise ValueError("'id' is required when calling 'stop_ab_test'")

if id is not None:
_path_params["id"] = id
_query_params: List[Tuple[str, str]] = []
_body: Optional[bytes] = None
_path = "/2/abtests/{id}/stop".replace("{id}", quote(str(id)))

_param = self._transporter.param_serialize(
path="/2/abtests/{id}/stop",
path_params=_path_params,
query_params=_query_params,
body=_body_params,
body=_body,
request_options=request_options,
)

response = await self._transporter.request(
verb=Verb.POST,
path=_param[0],
data=_param[1],
request_options=_param[2],
use_read_transporter=True,
path=_path,
data=_param[0],
request_options=_param[1],
)

response.data = response.raw_data
Expand Down
Loading

0 comments on commit 4ad25d3

Please sign in to comment.