Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 88 additions & 88 deletions google/genai/_interactions/resources/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,44 +160,6 @@ def create(
cast_to=Webhook,
)

def retrieve(
self,
id: str,
*,
api_version: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Webhook:
"""
Gets a specific Webhook.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Webhook,
)

def update(
self,
id: str,
Expand Down Expand Up @@ -384,6 +346,44 @@ def delete(
cast_to=WebhookDeleteResponse,
)

def get(
self,
id: str,
*,
api_version: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Webhook:
"""
Gets a specific Webhook.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Webhook,
)

def ping(
self,
id: str,
Expand Down Expand Up @@ -586,44 +586,6 @@ async def create(
cast_to=Webhook,
)

async def retrieve(
self,
id: str,
*,
api_version: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Webhook:
"""
Gets a specific Webhook.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Webhook,
)

async def update(
self,
id: str,
Expand Down Expand Up @@ -812,6 +774,44 @@ async def delete(
cast_to=WebhookDeleteResponse,
)

async def get(
self,
id: str,
*,
api_version: str | None = None,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Webhook:
"""
Gets a specific Webhook.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
path_template("/{api_version}/webhooks/{id}", api_version=api_version, id=id),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=Webhook,
)

async def ping(
self,
id: str,
Expand Down Expand Up @@ -908,9 +908,6 @@ def __init__(self, webhooks: WebhooksResource) -> None:
self.create = to_raw_response_wrapper(
webhooks.create,
)
self.retrieve = to_raw_response_wrapper(
webhooks.retrieve,
)
self.update = to_raw_response_wrapper(
webhooks.update,
)
Expand All @@ -920,6 +917,9 @@ def __init__(self, webhooks: WebhooksResource) -> None:
self.delete = to_raw_response_wrapper(
webhooks.delete,
)
self.get = to_raw_response_wrapper(
webhooks.get,
)
self.ping = to_raw_response_wrapper(
webhooks.ping,
)
Expand All @@ -935,9 +935,6 @@ def __init__(self, webhooks: AsyncWebhooksResource) -> None:
self.create = async_to_raw_response_wrapper(
webhooks.create,
)
self.retrieve = async_to_raw_response_wrapper(
webhooks.retrieve,
)
self.update = async_to_raw_response_wrapper(
webhooks.update,
)
Expand All @@ -947,6 +944,9 @@ def __init__(self, webhooks: AsyncWebhooksResource) -> None:
self.delete = async_to_raw_response_wrapper(
webhooks.delete,
)
self.get = async_to_raw_response_wrapper(
webhooks.get,
)
self.ping = async_to_raw_response_wrapper(
webhooks.ping,
)
Expand All @@ -962,9 +962,6 @@ def __init__(self, webhooks: WebhooksResource) -> None:
self.create = to_streamed_response_wrapper(
webhooks.create,
)
self.retrieve = to_streamed_response_wrapper(
webhooks.retrieve,
)
self.update = to_streamed_response_wrapper(
webhooks.update,
)
Expand All @@ -974,6 +971,9 @@ def __init__(self, webhooks: WebhooksResource) -> None:
self.delete = to_streamed_response_wrapper(
webhooks.delete,
)
self.get = to_streamed_response_wrapper(
webhooks.get,
)
self.ping = to_streamed_response_wrapper(
webhooks.ping,
)
Expand All @@ -989,9 +989,6 @@ def __init__(self, webhooks: AsyncWebhooksResource) -> None:
self.create = async_to_streamed_response_wrapper(
webhooks.create,
)
self.retrieve = async_to_streamed_response_wrapper(
webhooks.retrieve,
)
self.update = async_to_streamed_response_wrapper(
webhooks.update,
)
Expand All @@ -1001,6 +998,9 @@ def __init__(self, webhooks: AsyncWebhooksResource) -> None:
self.delete = async_to_streamed_response_wrapper(
webhooks.delete,
)
self.get = async_to_streamed_response_wrapper(
webhooks.get,
)
self.ping = async_to_streamed_response_wrapper(
webhooks.ping,
)
Expand Down
Loading