Skip to content

Commit

Permalink
chore: update openapi client
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 committed Dec 14, 2023
1 parent 3bafbf4 commit b44a10c
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 205 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, str]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, str]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(str, response.json())
return response_200
Expand All @@ -54,9 +52,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, str]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, str]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, Status]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, Status]]:
if response.status_code == HTTPStatus.OK:
response_200 = Status.from_dict(response.json())

Expand All @@ -50,9 +48,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, Status]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, Status]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/billing/payment_methods/{payment_method_id}".format(
client.base_url, payment_method_id=payment_method_id
)
url = "{}/billing/payment_methods/{payment_method_id}".format(client.base_url, payment_method_id=payment_method_id)

headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
Expand All @@ -31,9 +29,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, bool]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, response.json())
return response_200
Expand All @@ -47,9 +43,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, bool]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, str]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, str]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(str, response.json())
return response_200
Expand All @@ -44,9 +42,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, str]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, str]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, float]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, float]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(float, response.json())
return response_200
Expand All @@ -57,9 +55,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, float]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, float]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, float]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, float]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(float, response.json())
return response_200
Expand All @@ -63,9 +61,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, float]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, float]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ def _get_kwargs(

def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[
Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
]:
) -> Optional[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
if response.status_code == HTTPStatus.OK:
response_200 = HandleStripeWebhookResponseHandleStripeWebhook.from_dict(
response.json()
)
response_200 = HandleStripeWebhookResponseHandleStripeWebhook.from_dict(response.json())

return response_200
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
Expand All @@ -58,9 +54,7 @@ def _parse_response(

def _build_response(
*, client: Client, response: httpx.Response
) -> Response[
Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
]:
) -> Response[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -73,9 +67,7 @@ def sync_detailed(
*,
client: Client,
stripe_signature: Union[Unset, str] = UNSET,
) -> Response[
Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
]:
) -> Response[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
"""Handle Stripe Webhook
Args:
Expand Down Expand Up @@ -106,9 +98,7 @@ def sync(
*,
client: Client,
stripe_signature: Union[Unset, str] = UNSET,
) -> Optional[
Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
]:
) -> Optional[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
"""Handle Stripe Webhook
Args:
Expand All @@ -132,9 +122,7 @@ async def asyncio_detailed(
*,
client: Client,
stripe_signature: Union[Unset, str] = UNSET,
) -> Response[
Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
]:
) -> Response[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
"""Handle Stripe Webhook
Args:
Expand Down Expand Up @@ -163,9 +151,7 @@ async def asyncio(
*,
client: Client,
stripe_signature: Union[Unset, str] = UNSET,
) -> Optional[
Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]
]:
) -> Optional[Union[HTTPValidationError, HandleStripeWebhookResponseHandleStripeWebhook]]:
"""Handle Stripe Webhook
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, Invoice]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, Invoice]]:
if response.status_code == HTTPStatus.OK:
response_200 = Invoice.from_dict(response.json())

Expand All @@ -46,9 +44,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, Invoice]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, Invoice]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[Any, HTTPValidationError]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(Any, response.json())
return response_200
Expand All @@ -54,9 +52,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[Any, HTTPValidationError]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ def _get_kwargs(
client: Client,
json_body: HashCheck,
) -> Dict[str, Any]:
url = "{}/files/dir/check_hash/{target_path}".format(
client.base_url, target_path=target_path
)
url = "{}/files/dir/check_hash/{target_path}".format(client.base_url, target_path=target_path)

headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
Expand All @@ -36,9 +34,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, bool]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, response.json())
return response_200
Expand All @@ -52,9 +48,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, bool]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, bool]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, response.json())
return response_200
Expand All @@ -45,9 +43,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, bool]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[Any, HTTPValidationError]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(Any, response.json())
return response_200
Expand All @@ -45,9 +43,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[Any, HTTPValidationError]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[FileSpec, HTTPValidationError]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[FileSpec, HTTPValidationError]]:
if response.status_code == HTTPStatus.OK:
response_200 = FileSpec.from_dict(response.json())

Expand All @@ -54,9 +52,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[FileSpec, HTTPValidationError]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[FileSpec, HTTPValidationError]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def _get_kwargs(
}


def _parse_response(
*, client: Client, response: httpx.Response
) -> Optional[Union[HTTPValidationError, bool]]:
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[HTTPValidationError, bool]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(bool, response.json())
return response_200
Expand All @@ -50,9 +48,7 @@ def _parse_response(
return None


def _build_response(
*, client: Client, response: httpx.Response
) -> Response[Union[HTTPValidationError, bool]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[HTTPValidationError, bool]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand Down
Loading

0 comments on commit b44a10c

Please sign in to comment.