ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.198.1

This commit is contained in:
speakeasybot
2024-03-01 01:16:57 +00:00
parent e04f107a4d
commit 9340d908fe
27 changed files with 1562 additions and 90 deletions

View File

@@ -1,7 +1,9 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
import requests as requests_http
from .sdkconfiguration import SDKConfiguration
from plex_api import utils
from plex_api._hooks import HookContext
from plex_api.models import errors, operations
from typing import Optional
@@ -20,6 +22,7 @@ class Updater:
r"""Querying status of updates
Querying status of updates
"""
hook_ctx = HookContext(operation_id='getUpdateStatus', oauth2_scopes=[], security_source=self.sdk_configuration.security)
base_url = utils.template_url(*self.sdk_configuration.get_server_details())
url = base_url + '/updater/status'
@@ -32,7 +35,27 @@ class Updater:
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)
http_res = client.request('GET', url, headers=headers)
try:
req = self.sdk_configuration.get_hooks().before_request(
hook_ctx,
requests_http.Request('GET', url, headers=headers).prepare(),
)
http_res = client.send(req)
except Exception as e:
_, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
raise e
if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
if e:
raise e
else:
result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
if isinstance(result, Exception):
raise result
http_res = result
content_type = http_res.headers.get('Content-Type')
res = operations.GetUpdateStatusResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
@@ -61,6 +84,7 @@ class Updater:
r"""Checking for updates
Checking for updates
"""
hook_ctx = HookContext(operation_id='checkForUpdates', oauth2_scopes=[], security_source=self.sdk_configuration.security)
request = operations.CheckForUpdatesRequest(
download=download,
)
@@ -78,7 +102,27 @@ class Updater:
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)
http_res = client.request('PUT', url, params=query_params, headers=headers)
try:
req = self.sdk_configuration.get_hooks().before_request(
hook_ctx,
requests_http.Request('PUT', url, params=query_params, headers=headers).prepare(),
)
http_res = client.send(req)
except Exception as e:
_, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
raise e
if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
if e:
raise e
else:
result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
if isinstance(result, Exception):
raise result
http_res = result
content_type = http_res.headers.get('Content-Type')
res = operations.CheckForUpdatesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
@@ -103,6 +147,7 @@ class Updater:
r"""Apply Updates
Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
"""
hook_ctx = HookContext(operation_id='applyUpdates', oauth2_scopes=[], security_source=self.sdk_configuration.security)
request = operations.ApplyUpdatesRequest(
tonight=tonight,
skip=skip,
@@ -121,7 +166,27 @@ class Updater:
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)
http_res = client.request('PUT', url, params=query_params, headers=headers)
try:
req = self.sdk_configuration.get_hooks().before_request(
hook_ctx,
requests_http.Request('PUT', url, params=query_params, headers=headers).prepare(),
)
http_res = client.send(req)
except Exception as e:
_, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
raise e
if utils.match_status_codes(['400','401','4XX','500','5XX'], http_res.status_code):
http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
if e:
raise e
else:
result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
if isinstance(result, Exception):
raise result
http_res = result
content_type = http_res.headers.get('Content-Type')
res = operations.ApplyUpdatesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)